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

Issue 2245333005: Fix data races in MojoShellConnectionImpl (Closed)

Created:
4 years, 4 months ago by Ken Rockot(use gerrit already)
Modified:
4 years, 4 months ago
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, chromium-reviews, creis+watch_chromium.org, darin (slow to review), darin-cc_chromium.org, jam, nasko+codewatch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix data races in MojoShellConnectionImpl Corrects some data being improperly guarded by locks. connection_filters_ must always be accessed under lock. This change will lead to deadlock if any filter tries to add or remove filters during OnConnect, but 1) nobody is doing that yet and 2) it is currently unsafe to do this already. With guaranteed deadlock at least it's now impossible to do by accident. Refines the thread checking in ConnectionFilterImpl to allow for destruction on any thread if OnConnect has never been called. This guards against ConnectionFilterImpls being added after shutdown is initiated. This state may not be reachable in practice since we shouldn't bring up new RPHIs during shutdown, but it seems reasonable to express more accurate constraints here and the change is trivial. Finally, this also allows the IOThreadContext's internal MessageLoopObserver (nee "Obs"?) to be cleaned up when the IOThreadContext is shut down, rather than leaving all of them around until shutdown. This is worthwhile since incognito BrowserContexts may be created and destroyed arbitrarily many times in a normal browser session, accumulating many such observers which would otherwise live indefinitely. BUG=638581 R=ben@chromium.org Committed: https://crrev.com/2432550219bea14d12a8445ae92617e2b8d6acc0 Cr-Commit-Position: refs/heads/master@{#412690}

Patch Set 1 #

Patch Set 2 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -14 lines) Patch
M content/browser/renderer_host/render_process_host_impl.cc View 3 chunks +15 lines, -2 lines 0 comments Download
M content/common/mojo/mojo_shell_connection_impl.cc View 1 5 chunks +58 lines, -12 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 15 (10 generated)
Ken Rockot(use gerrit already)
4 years, 4 months ago (2016-08-17 20:45:49 UTC) #3
Ben Goodger (Google)
lgtm
4 years, 4 months ago (2016-08-17 20:50:57 UTC) #4
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/2245333005/20001
4 years, 4 months ago (2016-08-17 22:48:47 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 4 months ago (2016-08-17 23:29:24 UTC) #13
commit-bot: I haz the power
4 years, 4 months ago (2016-08-17 23:40:08 UTC) #15
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/2432550219bea14d12a8445ae92617e2b8d6acc0
Cr-Commit-Position: refs/heads/master@{#412690}

Powered by Google App Engine
This is Rietveld 408576698