Chromium Code Reviews
DescriptionCreate and use BlinkInterfaceProvider WeakPtrs on the same thread
A race condition seems to be occurring where the reference to
WeakReference::Flag in WeakReferenceOwner is in process of being destroyed
while a new reference is being added. This happens when a document having
Web Workers is being destroyed (due to a reload) while, on the thread
specific to a worker, an API is used that binds to a Mojo Interface
Provider.
Creating the weak pointers on arbitrary threads, even though they
consistently get dereferenced on the main thread, seems to be unsafe
in this situation.
Instead, create a single WeakPtr<> on the main thread during construction,
a copy of which can be made on the worker threads. This will increase the
reference count of the WeakReference::Flag, which is a thread-safe ref
counted object.
BUG=649645
Committed: https://crrev.com/c6f247ed04bc2e28157968a9f7e8f195012ae614
Cr-Commit-Position: refs/heads/master@{#430663}
Patch Set 1 #
Messages
Total messages: 15 (7 generated)
|
||||||||||||||||||||||||||||