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

Issue 2492833003: Create and use BlinkInterfaceProvider WeakPtrs on the same thread (Closed)

Created:
4 years, 1 month ago by Peter Beverloo
Modified:
4 years, 1 month ago
Reviewers:
CC:
chromium-reviews
Target Ref:
refs/pending/branch-heads/2883
Project:
chromium
Visibility:
Public.

Description

Create 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 Review-Url: https://codereview.chromium.org/2476543003 Cr-Commit-Position: refs/heads/master@{#430663} (cherry picked from commit c6f247ed04bc2e28157968a9f7e8f195012ae614)

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -3 lines) Patch
M content/renderer/mojo/blink_interface_provider_impl.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/mojo/blink_interface_provider_impl.cc View 2 chunks +4 lines, -3 lines 0 comments Download

Messages

Total messages: 1 (0 generated)
Peter Beverloo
4 years, 1 month ago (2016-11-10 23:00:36 UTC) #1
Message was sent while issue was closed.
Committed patchset #1 (id:1) to pending queue manually as
ef2701435a566dc72d270a8d3ae7d8e2e558ecd8.

Powered by Google App Engine
This is Rietveld 408576698