DescriptionFix 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 : . #
Dependent Patchsets: Messages
Total messages: 15 (10 generated)
|