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

Issue 2686803002: Make nested classes of DevToolsDeviceDiscovery RefCountedThreadSafe (Closed)

Created:
3 years, 10 months ago by tzik
Modified:
3 years, 10 months ago
Reviewers:
pfeldman
CC:
chromium-reviews, devtools-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make nested classes of DevToolsDeviceDiscovery RefCountedThreadSafe DevToolsDeviceDiscovery binds a RemoteBrowser into a callback, and passes it to AndroidDeviceManager::Device to fetch the device info, where RemoteBrowser has non-thread-safe ref count. AndroidDeviceManager::Device do some work on another thread and call the callback on the original thread. However, there may be a reference to the callback left on the target thread, and if the last reference to the callback is released on the target thread, a reference to the bound RemoteBrowser instance is also released on the target thread. That causes a data race on the ref count of RemoteBrowser. This CL makes RemoteBrowser and related classes be RefCountedThreadSafe, so that the ref count manipulation doesn't cause the race. Review-Url: https://codereview.chromium.org/2686803002 Cr-Commit-Position: refs/heads/master@{#449184} Committed: https://chromium.googlesource.com/chromium/src/+/3fbaee1204d803fba5c0f28e7502f57879546c62

Patch Set 1 #

Patch Set 2 : fix #

Patch Set 3 : s/RefCounted/RefCountedThreadSafe/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -6 lines) Patch
M chrome/browser/devtools/device/devtools_device_discovery.h View 1 2 6 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 32 (23 generated)
tzik
PTAL
3 years, 10 months ago (2017-02-08 16:03:54 UTC) #13
pfeldman
Could you point to where semantics has changed? All I see is std::move instead of ...
3 years, 10 months ago (2017-02-08 18:03:16 UTC) #14
pfeldman
Ok, caseq@ explained it to me. It might be safer to make RemoteBrowser thread safe ...
3 years, 10 months ago (2017-02-08 18:07:55 UTC) #15
tzik
On 2017/02/08 18:07:55, pfeldman wrote: > Ok, caseq@ explained it to me. It might be ...
3 years, 10 months ago (2017-02-09 00:20:18 UTC) #19
tzik
On 2017/02/08 18:07:55, pfeldman wrote: > Ok, caseq@ explained it to me. It might be ...
3 years, 10 months ago (2017-02-09 00:23:50 UTC) #21
pfeldman
lgtm, thanks!
3 years, 10 months ago (2017-02-09 01:02:57 UTC) #24
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/2686803002/40001
3 years, 10 months ago (2017-02-09 01:42:36 UTC) #26
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/2686803002/40001
3 years, 10 months ago (2017-02-09 01:43:52 UTC) #29
commit-bot: I haz the power
3 years, 10 months ago (2017-02-09 01:48:56 UTC) #32
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/3fbaee1204d803fba5c0f28e7502...

Powered by Google App Engine
This is Rietveld 408576698