)]}'
{
  "commit": "831ae4ef65ece1724d731c4b06802721c6f161d4",
  "tree": "6c51c4475c016ca661e54b4f2c1d89769a8fbb4b",
  "parents": [
    "3872873889383f15deee8a8f9f5e86a116a409ce"
  ],
  "author": {
    "name": "Henrik Boström",
    "email": "hbos@webrtc.org",
    "time": "Wed Jul 29 10:04:00 2020"
  },
  "committer": {
    "name": "Commit Bot",
    "email": "commit-bot@chromium.org",
    "time": "Wed Jul 29 11:27:43 2020"
  },
  "message": "Reland \"[Perfect Negotiation] Implement non-racy version of SetLocalDescription.\"\n\nThis is a reland of d4089cae47334a4228b69d6bb23f2e49ebb7496e\nwith the following fix:\n\nInvoke MaybeStartGathering as the last step of DoSetLocalDescription.\nThis ensures that candidates and onicegatheringstatechange does not\nhappen before SLD is resolved. This is important for passing\nexternal/wpt/webrtc/RTCPeerConnection-iceGatheringState.html.\n\nOriginal change\u0027s description:\n\u003e [Perfect Negotiation] Implement non-racy version of SetLocalDescription.\n\u003e\n\u003e BACKGROUND\n\u003e\n\u003e When SLD is invoked with SetSessionDescriptionObserver, the observer is\n\u003e called by posting a message back to the execution thread, delaying the\n\u003e call. This delay is \"artificial\" - it\u0027s not necessary; the operation is\n\u003e already complete. It\u0027s a post from the signaling thread to the signaling\n\u003e thread. The rationale for the post was to avoid the observer making\n\u003e recursive calls back into the PeerConnection. The problem with this is\n\u003e that by the time the observer is called, the PeerConnection could\n\u003e already have executed other operations and modified its states.\n\u003e\n\u003e This causes the referenced bug: one can have a race where SLD is\n\u003e resolved \"too late\" (after a pending SRD is executed) and the signaling\n\u003e state observed when SLD resolves doesn\u0027t make sense.\n\u003e\n\u003e When implementing Unified Plan, we fixed similar issues for SRD by\n\u003e adding a version that takes SetRemoteDescriptionObserverInterface as\n\u003e argument instead of SetSessionDescriptionObserver. The new version did\n\u003e not have the delay. The old version had to be kept around not to break\n\u003e downstream projects that had dependencies both on he delay and on\n\u003e allowing the PC to be destroyed midst-operation without informing its\n\u003e observers.\n\u003e\n\u003e THIS CL\n\u003e\n\u003e This does the old SRD fix for SLD as well: A new observer interface is\n\u003e added, SetLocalDescriptionObserverInterface, and\n\u003e PeerConnection::SetLocalDescription() is overloaded. If you call it with\n\u003e the old observer, you get the delay, but if you call it with the new\n\u003e observer, you don\u0027t get a delay.\n\u003e\n\u003e - SetLocalDescriptionObserverInterface is added.\n\u003e - SetLocalDescription is overloaded.\n\u003e - The adapter for SetSessionDescriptionObserver that causes the delay\n\u003e   previously only used for SRD is updated to handle both SLD and SRD.\n\u003e - FakeSetLocalDescriptionObserver is added and\n\u003e   MockSetRemoteDescriptionObserver is renamed \"Fake...\".\n\u003e\n\u003e Bug: chromium:1071733\n\u003e Change-Id: I920368e648bede481058ac22f5b8794752a220b3\n\u003e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179100\n\u003e Commit-Queue: Henrik Boström \u003chbos@webrtc.org\u003e\n\u003e Reviewed-by: Harald Alvestrand \u003chta@webrtc.org\u003e\n\u003e Cr-Commit-Position: refs/heads/master@{#31798}\n\nTBR\u003dhta@webrtc.org\n\nBug: chromium:1071733\nChange-Id: Ic6e8d96afa1c19604762f373716c08dbfa9d178c\nReviewed-on: https://webrtc-review.googlesource.com/c/src/+/180481\nCommit-Queue: Henrik Boström \u003chbos@webrtc.org\u003e\nReviewed-by: Henrik Boström \u003chbos@webrtc.org\u003e\nCr-Commit-Position: refs/heads/master@{#31804}\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7e7bd1a06d3aeeabc18f97a427eed9633fcabfcb",
      "old_mode": 33188,
      "old_path": "api/BUILD.gn",
      "new_id": "728cc4fbb33a19132b535d6b21c9f6b1f83a8660",
      "new_mode": 33188,
      "new_path": "api/BUILD.gn"
    },
    {
      "type": "modify",
      "old_id": "220b30b3cf8bb3204211c47e82081d79faab522b",
      "old_mode": 33188,
      "old_path": "api/DEPS",
      "new_id": "4fc132bdc0082e87942961255eee2b5ea82490ac",
      "new_mode": 33188,
      "new_path": "api/DEPS"
    },
    {
      "type": "modify",
      "old_id": "fd4d2df6a749292358e0d0495f2337938f563c75",
      "old_mode": 33188,
      "old_path": "api/peer_connection_interface.h",
      "new_id": "52d0d8789a04868b8ed4d933517df8b0fd8c1918",
      "new_mode": 33188,
      "new_path": "api/peer_connection_interface.h"
    },
    {
      "type": "modify",
      "old_id": "23887e53daec8ead09f3d189664a6001d8c801d8",
      "old_mode": 33188,
      "old_path": "api/peer_connection_proxy.h",
      "new_id": "aa72d7cb101545c30c2382ced2d120150d456aa6",
      "new_mode": 33188,
      "new_path": "api/peer_connection_proxy.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "90d000cd817e03731776d0621f051d14ba00dcaa",
      "new_mode": 33188,
      "new_path": "api/set_local_description_observer_interface.h"
    },
    {
      "type": "modify",
      "old_id": "1e738a933dd6d9fcffcade6cce19289a997adee9",
      "old_mode": 33188,
      "old_path": "pc/peer_connection.cc",
      "new_id": "982e42a2d60ef6faf4cdeacbd025934a79e56aa5",
      "new_mode": 33188,
      "new_path": "pc/peer_connection.cc"
    },
    {
      "type": "modify",
      "old_id": "2591c4b75f85487762cf25b51b214401f2224cba",
      "old_mode": 33188,
      "old_path": "pc/peer_connection.h",
      "new_id": "1cb575244ff60c0bc6392335d4281c04be239ca0",
      "new_mode": 33188,
      "new_path": "pc/peer_connection.h"
    },
    {
      "type": "modify",
      "old_id": "30b11ceaa761dcb014c1f9dc1595eba37e235554",
      "old_mode": 33188,
      "old_path": "pc/peer_connection_signaling_unittest.cc",
      "new_id": "72cbffbbc58817f71cb00f861940bb02384676ff",
      "new_mode": 33188,
      "new_path": "pc/peer_connection_signaling_unittest.cc"
    },
    {
      "type": "modify",
      "old_id": "7c0b3391d0932f325972310cdfc8c663558f589c",
      "old_mode": 33188,
      "old_path": "pc/peer_connection_wrapper.cc",
      "new_id": "328f5795e2c9ee7ec3c153f83d89cf76fa5daf4b",
      "new_mode": 33188,
      "new_path": "pc/peer_connection_wrapper.cc"
    },
    {
      "type": "modify",
      "old_id": "2017735dc702800badfa5b278a0964bbaa4859f7",
      "old_mode": 33188,
      "old_path": "pc/test/mock_peer_connection_observers.h",
      "new_id": "0a835713a92c5ca1ae1c90696341a550b8d76ad2",
      "new_mode": 33188,
      "new_path": "pc/test/mock_peer_connection_observers.h"
    }
  ]
}
