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

Issue 19492014: PPAPI: Purposely leak ProxyLock, fix shutdown race (Closed)

Created:
7 years, 5 months ago by dmichael (off chromium)
Modified:
7 years, 3 months ago
Reviewers:
teravest, bbudge, yzshen1
CC:
chromium-reviews
Visibility:
Public.

Description

PPAPI: Purposely leak ProxyLock, fix shutdown race This CL: - Makes callbacks returned by RunWhileLocked acquire the lock when they are destroyed if they are not run. This eliminates some potential race conditions. - Because MessageLoops can be destroyed after the PpapiGlobals (and thus the ProxyLock), this means we need to make the ProxyLock live longer. So we leak it so that it lives all the way through shutdown. This issue depends on: https://codereview.chromium.org/19492014/ BUG= R=yzshen@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=222829 Reverted: https://src.chromium.org/viewvc/chrome?view=rev&revision=222840 (static initializer + content_unittests failure) Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=223738

Patch Set 1 #

Patch Set 2 : Review comments #

Total comments: 1

Patch Set 3 : Make the destructor lock [sometimes] #

Total comments: 1

Patch Set 4 : purposely leak ProxyLock. Make unit tests work. #

Patch Set 5 : Fix release build, hopefully fix TrackedCallback tests #

Patch Set 6 : Clean up for review #

Patch Set 7 : test cleanup #

Total comments: 8

Patch Set 8 : bbudge's comments #

Patch Set 9 : Merge #

Patch Set 10 : Merge again #

Patch Set 11 : Merge yet again #

Patch Set 12 : Merge #

Patch Set 13 : Merge #

Patch Set 14 : merge #

Patch Set 15 : Merge, hopefully fix v8_var_converter_unittest.cc #

Patch Set 16 : Remove static initializer #

Unified diffs Side-by-side diffs Delta from patch set Stats (+183 lines, -59 lines) Patch
M content/renderer/pepper/host_globals.h View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -2 lines 0 comments Download
M content/renderer/pepper/host_globals.cc View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -12 lines 0 comments Download
M content/renderer/pepper/pepper_file_chooser_host_unittest.cc View 1 2 3 4 5 6 7 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M content/renderer/pepper/pepper_url_request_unittest.cc View 1 2 3 4 5 6 7 8 9 11 12 2 chunks +2 lines, -0 lines 0 comments Download
M content/renderer/pepper/v8_var_converter_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/proxy/plugin_globals.h View 1 2 3 4 5 3 chunks +0 lines, -4 lines 0 comments Download
M ppapi/proxy/plugin_globals.cc View 1 2 3 4 5 1 chunk +0 lines, -4 lines 0 comments Download
M ppapi/proxy/ppapi_proxy_test.cc View 1 2 3 4 5 6 2 chunks +7 lines, -0 lines 0 comments Download
M ppapi/proxy/raw_var_data_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/shared_impl/ppapi_globals.h View 1 2 3 2 chunks +0 lines, -3 lines 0 comments Download
M ppapi/shared_impl/proxy_lock.h View 1 2 3 4 5 6 7 8 chunks +76 lines, -5 lines 0 comments Download
M ppapi/shared_impl/proxy_lock.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +41 lines, -3 lines 0 comments Download
M ppapi/shared_impl/resource_tracker_unittest.cc View 1 2 3 4 5 4 chunks +4 lines, -0 lines 0 comments Download
M ppapi/shared_impl/test_globals.h View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M ppapi/shared_impl/test_globals.cc View 1 2 3 1 chunk +0 lines, -4 lines 0 comments Download
M ppapi/shared_impl/tracked_callback.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M ppapi/shared_impl/tracked_callback_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +35 lines, -7 lines 0 comments Download
M ppapi/shared_impl/var_tracker_unittest.cc View 1 2 3 4 5 6 6 chunks +6 lines, -0 lines 0 comments Download
M ppapi/shared_impl/var_value_conversions_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M ppapi/thunk/enter.h View 1 2 3 2 chunks +2 lines, -5 lines 0 comments Download
M ppapi/thunk/enter.cc View 1 2 3 1 chunk +0 lines, -8 lines 0 comments Download

Messages

Total messages: 42 (0 generated)
dmichael (off chromium)
bbudge: Primary, and let me know if this works with your patch (though no need ...
7 years, 5 months ago (2013-07-19 22:45:17 UTC) #1
bbudge
On 2013/07/19 22:45:17, dmichael wrote: > bbudge: Primary, and let me know if this works ...
7 years, 5 months ago (2013-07-19 23:13:02 UTC) #2
teravest
I feel like I'm misreading this; it looks like public CallWhileLocked() is removed as part ...
7 years, 5 months ago (2013-07-19 23:20:12 UTC) #3
bbudge
This works for me. I need a 3 argument version so it would be good ...
7 years, 5 months ago (2013-07-19 23:52:07 UTC) #4
dmichael (off chromium)
On 2013/07/19 23:20:12, teravest wrote: > I feel like I'm misreading this; it looks like ...
7 years, 5 months ago (2013-07-20 02:13:07 UTC) #5
bbudge
One other thing Yuzhu pointed out to me about my old solution: what happens if ...
7 years, 5 months ago (2013-07-20 04:03:09 UTC) #6
bbudge
https://codereview.chromium.org/19492014/diff/11001/ppapi/shared_impl/proxy_lock.h File ppapi/shared_impl/proxy_lock.h (right): https://codereview.chromium.org/19492014/diff/11001/ppapi/shared_impl/proxy_lock.h#newcode141 ppapi/shared_impl/proxy_lock.h:141: struct RunWhleLockedHelper<void ()> { sp. RunWhileLockedHelper
7 years, 5 months ago (2013-07-20 14:01:24 UTC) #7
bbudge
On 2013/07/20 04:03:09, bbudge1 wrote: > One other thing Yuzhu pointed out to me about ...
7 years, 5 months ago (2013-07-20 18:40:35 UTC) #8
dmichael (off chromium)
On 2013/07/20 18:40:35, bbudge1 wrote: > On 2013/07/20 04:03:09, bbudge1 wrote: > > One other ...
7 years, 5 months ago (2013-07-22 16:50:40 UTC) #9
bbudge
On 2013/07/22 16:50:40, dmichael wrote: > On 2013/07/20 18:40:35, bbudge1 wrote: > > On 2013/07/20 ...
7 years, 5 months ago (2013-07-22 16:57:09 UTC) #10
yzshen1
On 2013/07/22 16:57:09, bbudge1 wrote: > On 2013/07/22 16:50:40, dmichael wrote: > > On 2013/07/20 ...
7 years, 5 months ago (2013-07-22 18:46:37 UTC) #11
teravest
On Mon, Jul 22, 2013 at 12:46 PM, <yzshen@chromium.org> wrote: > On 2013/07/22 16:57:09, bbudge1 ...
7 years, 5 months ago (2013-07-22 18:54:36 UTC) #12
dmichael (off chromium)
Sorry, I was overly optimistic when I said I'd upload "shortly" :-). I have something ...
7 years, 5 months ago (2013-07-22 20:04:53 UTC) #13
teravest
https://codereview.chromium.org/19492014/diff/24001/ppapi/shared_impl/proxy_lock.h File ppapi/shared_impl/proxy_lock.h (right): https://codereview.chromium.org/19492014/diff/24001/ppapi/shared_impl/proxy_lock.h#newcode178 ppapi/shared_impl/proxy_lock.h:178: // only ever have 1 owner). You should mention ...
7 years, 5 months ago (2013-07-22 20:36:00 UTC) #14
yzshen1
> > Does it make sense to support "recursive lock" (allow acquiring the lock > ...
7 years, 5 months ago (2013-07-22 21:37:57 UTC) #15
dmichael (off chromium)
Okay, so this CL is currently failing 1 unit test, because the PpapiGlobals (and therefore ...
7 years, 5 months ago (2013-07-23 16:23:00 UTC) #16
dmichael (off chromium)
On 2013/07/23 16:23:00, dmichael wrote: > Okay, so this CL is currently failing 1 unit ...
7 years, 5 months ago (2013-07-23 16:23:20 UTC) #17
dmichael (off chromium)
On Tue, Jul 23, 2013 at 10:23 AM, <dmichael@chromium.org> wrote: > On 2013/07/23 16:23:00, dmichael ...
7 years, 5 months ago (2013-07-23 16:41:30 UTC) #18
teravest
Sounds good to me. I double checked that there's nothing surprising in Lock::~Lock(). On Tue, ...
7 years, 5 months ago (2013-07-23 16:43:53 UTC) #19
bbudge
On 2013/07/23 16:23:20, dmichael wrote: > On 2013/07/23 16:23:00, dmichael wrote: > > Okay, so ...
7 years, 5 months ago (2013-07-23 16:58:51 UTC) #20
yzshen1
On 2013/07/23 16:58:51, bbudge1 wrote: > On 2013/07/23 16:23:20, dmichael wrote: > > On 2013/07/23 ...
7 years, 5 months ago (2013-07-23 17:34:02 UTC) #21
dmichael (off chromium)
I decided to split out the destructor locking in to a separate CL: https://codereview.chromium.org/19678028/ Because ...
7 years, 5 months ago (2013-07-24 16:29:43 UTC) #22
dmichael (off chromium)
On 2013/07/24 16:29:43, dmichael wrote: > I decided to split out the destructor locking in ...
7 years, 5 months ago (2013-07-24 16:30:43 UTC) #23
dmichael (off chromium)
I think this CL is now ready. It required more messiness than I hoped for ...
7 years, 5 months ago (2013-07-26 20:17:16 UTC) #24
bbudge
https://codereview.chromium.org/19492014/diff/73001/content/renderer/pepper/pepper_file_chooser_host_unittest.cc File content/renderer/pepper/pepper_file_chooser_host_unittest.cc (right): https://codereview.chromium.org/19492014/diff/73001/content/renderer/pepper/pepper_file_chooser_host_unittest.cc#newcode18 content/renderer/pepper/pepper_file_chooser_host_unittest.cc:18: #include "ppapi/proxy/proxy_lock.h" s/proxy/shared_impl https://codereview.chromium.org/19492014/diff/73001/ppapi/shared_impl/proxy_lock.h File ppapi/shared_impl/proxy_lock.h (right): https://codereview.chromium.org/19492014/diff/73001/ppapi/shared_impl/proxy_lock.h#newcode35 ppapi/shared_impl/proxy_lock.h:35: ...
7 years, 4 months ago (2013-07-29 21:02:18 UTC) #25
yzshen1
LGTM Thanks!
7 years, 4 months ago (2013-07-29 21:18:58 UTC) #26
dmichael (off chromium)
https://codereview.chromium.org/19492014/diff/73001/content/renderer/pepper/pepper_file_chooser_host_unittest.cc File content/renderer/pepper/pepper_file_chooser_host_unittest.cc (right): https://codereview.chromium.org/19492014/diff/73001/content/renderer/pepper/pepper_file_chooser_host_unittest.cc#newcode18 content/renderer/pepper/pepper_file_chooser_host_unittest.cc:18: #include "ppapi/proxy/proxy_lock.h" On 2013/07/29 21:02:18, bbudge1 wrote: > s/proxy/shared_impl ...
7 years, 4 months ago (2013-07-29 21:24:03 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/19492014/119001
7 years, 4 months ago (2013-08-09 20:07:09 UTC) #28
commit-bot: I haz the power
Failed to apply patch for content/renderer/pepper/host_globals.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 4 months ago (2013-08-09 20:07:24 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/19492014/131001
7 years, 4 months ago (2013-08-09 20:25:11 UTC) #30
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 4 months ago (2013-08-09 20:34:28 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/19492014/149001
7 years, 4 months ago (2013-08-09 21:11:22 UTC) #32
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=186095
7 years, 4 months ago (2013-08-10 04:06:10 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/19492014/164001
7 years, 3 months ago (2013-08-29 16:15:28 UTC) #34
commit-bot: I haz the power
Failed to apply patch for content/renderer/pepper/pepper_file_chooser_host_unittest.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 3 months ago (2013-08-29 16:15:46 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/19492014/183001
7 years, 3 months ago (2013-09-11 16:27:06 UTC) #36
commit-bot: I haz the power
Retried try job too often on win7_aura for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=77852
7 years, 3 months ago (2013-09-12 02:26:39 UTC) #37
dmichael (off chromium)
Committed patchset #14 manually as r222829 (presubmit successful).
7 years, 3 months ago (2013-09-12 19:09:08 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/19492014/218001
7 years, 3 months ago (2013-09-16 20:31:06 UTC) #39
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=198059
7 years, 3 months ago (2013-09-17 00:29:15 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dmichael@chromium.org/19492014/218001
7 years, 3 months ago (2013-09-17 19:37:35 UTC) #41
commit-bot: I haz the power
7 years, 3 months ago (2013-09-17 23:30:02 UTC) #42
Message was sent while issue was closed.
Change committed as 223738

Powered by Google App Engine
This is Rietveld 408576698