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

Issue 568793002: PPAPI: Fix GetBrowserInterface race conditions (Closed)

Created:
6 years, 3 months ago by dmichael (off chromium)
Modified:
6 years, 3 months ago
Reviewers:
teravest, piman
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

PPAPI: Fix GetBrowserInterface race conditions - Previously, we had an unguarded bool flag for whether an interface lookup had been logged to UMA. Now each InterfaceInfo has a lock+flag. Should be near-zero contention. - Previously, PpapiGlobals::GetBrowserSender did lazy creation with no synchronization. Now we create it at process startup and clear it at process shutdown, so there should be no race while the plugin is running. BUG=413513, 414150 Committed: https://crrev.com/d1b2c8f719b0ab471a476bf53911a3657bb4c06a Cr-Commit-Position: refs/heads/master@{#294715} Committed: https://crrev.com/fee3a512a9456e0398ea8369496ac1c365fb3574 Cr-Commit-Position: refs/heads/master@{#295551}

Patch Set 1 #

Patch Set 2 : lockless approach #

Total comments: 6

Patch Set 3 : use lock-per-interface #

Patch Set 4 : make InterfaceInfo a class #

Patch Set 5 : fix misspelling #

Total comments: 2

Patch Set 6 : minimize critical section #

Patch Set 7 : Don't dereference NULL at plugin shutdown. #

Patch Set 8 : Review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -46 lines) Patch
M content/ppapi_plugin/ppapi_thread.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M ppapi/nacl_irt/plugin_main.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ppapi/proxy/interface_list.h View 1 2 3 2 chunks +25 lines, -14 lines 0 comments Download
M ppapi/proxy/interface_list.cc View 1 2 3 4 5 6 7 4 chunks +27 lines, -11 lines 0 comments Download
M ppapi/proxy/plugin_dispatcher.cc View 1 1 chunk +2 lines, -7 lines 0 comments Download
M ppapi/proxy/plugin_globals.h View 1 2 3 4 5 6 7 1 chunk +6 lines, -4 lines 0 comments Download
M ppapi/proxy/plugin_globals.cc View 1 2 3 4 5 6 7 2 chunks +20 lines, -5 lines 0 comments Download
M ppapi/proxy/ppapi_proxy_test.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 24 (6 generated)
dmichael (off chromium)
WDYT? https://codereview.chromium.org/568793002/diff/20001/ppapi/proxy/interface_list.cc File ppapi/proxy/interface_list.cc (right): https://codereview.chromium.org/568793002/diff/20001/ppapi/proxy/interface_list.cc#newcode355 ppapi/proxy/interface_list.cc:355: new PpapiHostMsg_LogInterfaceUsage(HashInterfaceName(name))); note that previously, even with the ...
6 years, 3 months ago (2014-09-12 18:12:08 UTC) #2
teravest
https://codereview.chromium.org/568793002/diff/20001/ppapi/proxy/interface_list.h File ppapi/proxy/interface_list.h (right): https://codereview.chromium.org/568793002/diff/20001/ppapi/proxy/interface_list.h#newcode72 ppapi/proxy/interface_list.h:72: base::AtomicSequenceNumber interface_request_count_; Since we don't really need a sequence ...
6 years, 3 months ago (2014-09-12 19:08:28 UTC) #3
dmichael (off chromium)
https://codereview.chromium.org/568793002/diff/20001/ppapi/proxy/interface_list.h File ppapi/proxy/interface_list.h (right): https://codereview.chromium.org/568793002/diff/20001/ppapi/proxy/interface_list.h#newcode72 ppapi/proxy/interface_list.h:72: base::AtomicSequenceNumber interface_request_count_; done with a lock-per-interface. Contention should be ...
6 years, 3 months ago (2014-09-12 20:44:00 UTC) #4
teravest
lgtm It would be good to put a description of how you fixed the race ...
6 years, 3 months ago (2014-09-12 21:00:17 UTC) #5
dmichael (off chromium)
https://codereview.chromium.org/568793002/diff/80001/ppapi/proxy/interface_list.cc File ppapi/proxy/interface_list.cc (right): https://codereview.chromium.org/568793002/diff/80001/ppapi/proxy/interface_list.cc#newcode370 ppapi/proxy/interface_list.cc:370: if (!sent_to_uma_) { On 2014/09/12 21:00:17, teravest wrote: > ...
6 years, 3 months ago (2014-09-12 22:21:19 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/568793002/100001
6 years, 3 months ago (2014-09-12 22:22:47 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/15181) chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/10753)
6 years, 3 months ago (2014-09-12 22:35:06 UTC) #10
dmichael (off chromium)
piman for owners of content/ppapi_plugin. Trivial name change.
6 years, 3 months ago (2014-09-12 22:38:12 UTC) #12
piman
lgtm
6 years, 3 months ago (2014-09-12 23:48:14 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/568793002/100001
6 years, 3 months ago (2014-09-13 00:18:25 UTC) #15
commit-bot: I haz the power
Committed patchset #6 (id:100001) as 8261a0a3324670b9cfa790ac122ffd1422ca0431
6 years, 3 months ago (2014-09-13 01:09:33 UTC) #16
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/d1b2c8f719b0ab471a476bf53911a3657bb4c06a Cr-Commit-Position: refs/heads/master@{#294715}
6 years, 3 months ago (2014-09-13 01:17:42 UTC) #17
raymes
A revert of this CL (patchset #6 id:100001) has been created in https://codereview.chromium.org/566243004/ by raymes@chromium.org. ...
6 years, 3 months ago (2014-09-15 03:45:07 UTC) #18
dmichael (off chromium)
At shutdown, ppapi_thread.cc resets plugin_proxy_delegate_, which was leading to a NULL pointer dereference within SetPluginProxyDelegate. ...
6 years, 3 months ago (2014-09-15 16:34:31 UTC) #19
teravest
On 2014/09/15 16:34:31, dmichael wrote: > At shutdown, ppapi_thread.cc resets plugin_proxy_delegate_, which was leading to ...
6 years, 3 months ago (2014-09-15 21:58:26 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/568793002/140001
6 years, 3 months ago (2014-09-18 16:47:54 UTC) #22
commit-bot: I haz the power
Committed patchset #8 (id:140001) as 60609f3328b69091e3b405391dd188568dcf00c5
6 years, 3 months ago (2014-09-18 21:33:23 UTC) #23
commit-bot: I haz the power
6 years, 3 months ago (2014-09-18 21:35:43 UTC) #24
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/fee3a512a9456e0398ea8369496ac1c365fb3574
Cr-Commit-Position: refs/heads/master@{#295551}

Powered by Google App Engine
This is Rietveld 408576698