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

Issue 2207683002: Use a raw pointer instead of Singleton for PnaclHost and leak it. (Closed)

Created:
4 years, 4 months ago by gab
Modified:
4 years, 4 months ago
Reviewers:
Mark Seaborn
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@b6_sequenced_worker_pool_redirection
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use a raw pointer instead of Singleton for PnaclHost and leak it. This CL was brought up by issue 631547 which highlights that PnaclHost is sometimes deleted off-thread (on the main thread at static unitilization instead of the IO thread it's bound to) with live WeakPtrs. Issue 631547 results in random flakes for all browser_tests exercising this code one way or another, it should be fixed by this. The WeakPtrs served no purpose as the task running system is long gone by the time static destruction kicks in and no task would thus ever have been cancelled through them. It already leaked its state on static destruction from AtExitManager. It could instead have used base::LeakySingletonTraits but it really doesn't need to even be a Singleton per being intended for single-threaded usage. So this CL: - Replaces WeakPtrs usage with Unretained(this). - Adds missing thread_checker_ calls now that they will no longer be implicitly provided by GetWeakPtr() calls. - Replaces Singleton with a leaked static raw pointer. - Replace callback_forward.h include by callback.h (typedefs need it and were getting it transitively through singleton.h->at_exit.h). - The attempted un-initialization through DeInitIfSafe() remains the same. BUG=631547 Committed: https://crrev.com/459e9aa8dd4682aaaf5b8bcbb0fd030632b2d787 Cr-Commit-Position: refs/heads/master@{#409365}

Patch Set 1 #

Patch Set 2 : annotate leak #

Patch Set 3 : fix include and tests #

Patch Set 4 : git cl format #

Total comments: 2

Patch Set 5 : typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -95 lines) Patch
M components/nacl/browser/pnacl_host.h View 1 2 3 4 5 chunks +22 lines, -16 lines 0 comments Download
M components/nacl/browser/pnacl_host.cc View 1 2 3 17 chunks +51 lines, -76 lines 0 comments Download
M components/nacl/browser/pnacl_host_unittest.cc View 1 2 3 chunks +2 lines, -3 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 25 (19 generated)
gab
@mseaborn: PTAL, this addresses waterfall flakes caused by PNaclHost.
4 years, 4 months ago (2016-08-02 21:02:08 UTC) #12
Mark Seaborn
> @mseaborn: PTAL, this addresses waterfall flakes caused by PNaclHost. Can you mention in the ...
4 years, 4 months ago (2016-08-02 21:47:32 UTC) #15
gab
On 2016/08/02 21:47:32, Mark Seaborn wrote: > > @mseaborn: PTAL, this addresses waterfall flakes caused ...
4 years, 4 months ago (2016-08-02 21:57:42 UTC) #18
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/2207683002/80001
4 years, 4 months ago (2016-08-02 21:58:47 UTC) #21
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 4 months ago (2016-08-02 22:53:03 UTC) #23
commit-bot: I haz the power
4 years, 4 months ago (2016-08-02 22:55:20 UTC) #25
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/459e9aa8dd4682aaaf5b8bcbb0fd030632b2d787
Cr-Commit-Position: refs/heads/master@{#409365}

Powered by Google App Engine
This is Rietveld 408576698