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

Issue 42113: Ensure that a listener's OnChannelConnected is called before OnMessageReceive... (Closed)

Created:
11 years, 9 months ago by jam
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Ensure that a listener's OnChannelConnected is called before OnMessageReceived. A race condition existed since the listener thread could dispatch messages in two ways: a task being posted to it, or because the dispatch messages event is set. The latter is needed to avoid deadlock when multiple SyncChannels are used on the same listener thread. If the latter method was used to dispatch a message, it might occur before the task that calls OnChannelConnected gets run. The fix is to call OnChannelConnected manually if we notice a message is being dispatched before it's called. Note: I couldn't think of a way to test this since it depends on a race condition in the listener message looop (whether the task or objectwatcher gets run first). Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=11522

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -22 lines) Patch
M chrome/common/ipc_channel_proxy.h View 1 3 chunks +6 lines, -3 lines 0 comments Download
M chrome/common/ipc_channel_proxy.cc View 4 chunks +13 lines, -4 lines 0 comments Download
M chrome/common/ipc_sync_channel.cc View 1 2 chunks +1 line, -15 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
jam
11 years, 9 months ago (2009-03-12 04:53:20 UTC) #1
darin (slow to review)
11 years, 9 months ago (2009-03-12 06:44:10 UTC) #2
LGTM

can you think of a way that we might change ChannelProxy to make that kind of
test possible?

Powered by Google App Engine
This is Rietveld 408576698