Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(368)

Issue 2661053002: [Presentation API] Fix race condition in which state change is lost. (Closed)

Created:
3 years, 10 months ago by imcheng
Modified:
3 years, 10 months ago
Reviewers:
CC:
chromium-reviews
Target Ref:
refs/pending/branch-heads/2987
Project:
chromium
Visibility:
Public.

Description

[Presentation API] Fix race condition in which state change is lost. Currently there is a race condition between the PresentationConnection being returned to PresentationDispatcher on a successful start() or reconnect(), and PresentationDispatcher being notified by the browser that the state change has become connected. Although PresentationServiceImpl issues the state change strictly after executing the callback returning the PresentationConnection, it appears that they are using distinct independent message pipes, which do not guarantee order of arrival between these two messages. If the state change message arrives first, then it will be lost due to the connection not yet registered with Blink at that point in time. The fix here is to change state to connected in Blink, after the PresentationConnection is registered. This fix needs to be merged back to 57. Additional test assertions will be in a followup patch. BUG=684664 Review-Url: https://codereview.chromium.org/2653683006 Cr-Commit-Position: refs/heads/master@{#446465} (cherry picked from commit 1ebdd16432860b90eaaeaba7042c2e9761b17ef7) Review-Url: https://codereview.chromium.org/2661053002 . Cr-Commit-Position: refs/branch-heads/2987@{#198} Cr-Branched-From: ad51088c0e8776e8dcd963dbe752c4035ba6dab6-refs/heads/master@{#444943} Committed: https://chromium.googlesource.com/chromium/src/+/cdf4402738b87ca888eb12baa02d1b78bd396b4a

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -18 lines) Patch
M content/browser/presentation/presentation_service_impl.h View 2 chunks +3 lines, -4 lines 0 comments Download
M content/browser/presentation/presentation_service_impl.cc View 4 chunks +6 lines, -7 lines 0 comments Download
M content/browser/presentation/presentation_service_impl_unittest.cc View 3 chunks +3 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
imcheng
3 years, 10 months ago (2017-01-30 22:17:17 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
cdf4402738b87ca888eb12baa02d1b78bd396b4a.

Powered by Google App Engine
This is Rietveld 408576698