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

Issue 2653683006: [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:
mark a. foltz, zhaobin
CC:
blink-reviews, chromium-reviews, darin-cc_chromium.org, haraken, jam
Target Ref:
refs/pending/heads/master
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} Committed: https://chromium.googlesource.com/chromium/src/+/1ebdd16432860b90eaaeaba7042c2e9761b17ef7

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: 19 (11 generated)
imcheng
Mark, Bin: PTAL
3 years, 10 months ago (2017-01-24 22:35:38 UTC) #4
zhaobin
lgtm. In M57 connection state change event is fired asychronously; while in M56 it is ...
3 years, 10 months ago (2017-01-24 23:06:47 UTC) #7
mark a. foltz
lgtm
3 years, 10 months ago (2017-01-26 19:22:33 UTC) #11
mark a. foltz
I'm assuming the controller delegate passes the state change onto the MRPM. Yes, the component ...
3 years, 10 months ago (2017-01-26 19:24:54 UTC) #12
imcheng
On 2017/01/26 19:24:54, mark a. foltz wrote: > I'm assuming the controller delegate passes the ...
3 years, 10 months ago (2017-01-26 20:17:08 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2653683006/1
3 years, 10 months ago (2017-01-26 20:18:14 UTC) #15
imcheng
To expand slightly on this: On 2017/01/26 20:17:08, imcheng wrote: > On 2017/01/26 19:24:54, mark ...
3 years, 10 months ago (2017-01-26 20:22:41 UTC) #16
commit-bot: I haz the power
3 years, 10 months ago (2017-01-26 22:03:53 UTC) #19
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/1ebdd16432860b90eaaeaba7042c...

Powered by Google App Engine
This is Rietveld 408576698