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

Issue 2159133002: Shutdown StoragePartition before ProfileIOData is being shut down (Closed)

Created:
4 years, 5 months ago by kinuko
Modified:
4 years, 4 months ago
CC:
anandc+watch-blimp_chromium.org, blink-worker-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, dtrainor+watch-blimp_chromium.org, horo+watch_chromium.org, jessicag+watch-blimp_chromium.org, jochen+watch_chromium.org, jsbell+serviceworker_chromium.org, khushalsagar+watch-blimp_chromium.org, kinuko+serviceworker, kinuko+watch, kmarshall+watch-blimp_chromium.org, lethalantidote+watch-blimp_chromium.org, maniscalco+watch-blimp_chromium.org, marcinjb+watch-blimp_chromium.org, Mike West, mlamouri+watch-content_chromium.org, nhiroki, nyquist+watch-blimp_chromium.org, Peter Beverloo, serviceworker-reviews, shaktisahu+watch-blimp_chromium.org, sriramsr+watch-blimp_chromium.org, tzik, wjmaclean
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Shutdown StoragePartition before ProfileIOData is being shut down - Expose a new ShutdownStoragePartitions method on BrowserContext - Calls the new method in the subclasses of BrowserContext before actual destruction / shutdown starts Content modules that are hung on StoragePartition often try to dereference ResourceContext (which is owned by ProfileIOData in chromium cases) even after ResourceContext is destroyed, so it could easily lead to U-A-F. This happens because StoragePartitions are destroyed in BrowserContext's dtor, while ProfileIOData and any other objects that are managed/owned by BrowserContext's subclasses are usually destroyed earlier than that (i.e. their destructors run before the base class's one). This change tries to add a new explicit method, BrowserContext::ShutdownStoragePartitions, and let embedders call it before the embedders are going to destroy/shutdown their own objects (which include ResourceContext), so that content modules can safely assume they can dereference those objects while its StoragePartition's still there. BUG=529896 Committed: https://crrev.com/f6ed359c6f34261f93f3ac5431c7f7526d500262 Cr-Commit-Position: refs/heads/master@{#407781}

Patch Set 1 #

Patch Set 2 : dcheck #

Patch Set 3 : more fix #

Total comments: 5

Patch Set 4 : Don't call profile method in ~Handle #

Patch Set 5 : crash fix #

Patch Set 6 : fix #

Total comments: 5

Patch Set 7 : addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -53 lines) Patch
M blimp/engine/common/blimp_browser_context.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc View 1 2 3 4 5 6 6 chunks +14 lines, -15 lines 0 comments Download
M chrome/browser/profiles/off_the_record_profile_impl.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/profiles/off_the_record_profile_io_data.h View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl_io_data.h View 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/test/base/testing_profile.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M chromecast/browser/cast_browser_context.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/browser_context.cc View 1 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_context_wrapper.h View 4 chunks +1 line, -10 lines 0 comments Download
M content/browser/service_worker/service_worker_context_wrapper.cc View 3 chunks +1 line, -22 lines 0 comments Download
M content/browser/storage_partition_impl.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/storage_partition_impl_map.cc View 1 chunk +1 line, -2 lines 0 comments Download
M content/public/browser/browser_context.h View 1 chunk +7 lines, -0 lines 0 comments Download
M content/public/test/test_browser_context.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/shell/browser/shell_browser_context.cc View 1 chunk +1 line, -0 lines 0 comments Download
M headless/lib/browser/headless_browser_context_impl.cc View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 89 (65 generated)
kinuko
Matt- can you take a look when you have time? What do you think?
4 years, 5 months ago (2016-07-19 14:23:14 UTC) #14
mmenke
https://codereview.chromium.org/2159133002/diff/60001/chrome/browser/profiles/profile_impl_io_data.cc File chrome/browser/profiles/profile_impl_io_data.cc (right): https://codereview.chromium.org/2159133002/diff/60001/chrome/browser/profiles/profile_impl_io_data.cc#newcode119 chrome/browser/profiles/profile_impl_io_data.cc:119: profile_->ShutdownStoragePartitions(); This doesn't seem like a good place for ...
4 years, 5 months ago (2016-07-19 17:55:20 UTC) #22
kinuko
Thanks, updated. PTAL https://codereview.chromium.org/2159133002/diff/60001/chrome/browser/profiles/profile_impl_io_data.cc File chrome/browser/profiles/profile_impl_io_data.cc (right): https://codereview.chromium.org/2159133002/diff/60001/chrome/browser/profiles/profile_impl_io_data.cc#newcode119 chrome/browser/profiles/profile_impl_io_data.cc:119: profile_->ShutdownStoragePartitions(); On 2016/07/19 17:55:20, mmenke wrote: ...
4 years, 5 months ago (2016-07-21 03:06:25 UTC) #56
mmenke
LGTM! https://codereview.chromium.org/2159133002/diff/60001/content/browser/browser_context.cc File content/browser/browser_context.cc (right): https://codereview.chromium.org/2159133002/diff/60001/content/browser/browser_context.cc#newcode500 content/browser/browser_context.cc:500: RemoveUserData(kStoragePartitionMapKeyName); On 2016/07/21 03:06:25, kinuko wrote: > On ...
4 years, 5 months ago (2016-07-21 15:27:21 UTC) #57
michaeln
Does this change ensure that URLRequestContexts outlive StoragePartitions?
4 years, 5 months ago (2016-07-21 20:08:09 UTC) #58
kinuko
On 2016/07/21 20:08:09, michaeln wrote: > Does this change ensure that URLRequestContexts outlive StoragePartitions? Yes ...
4 years, 5 months ago (2016-07-21 23:23:48 UTC) #59
kinuko
Thanks! https://codereview.chromium.org/2159133002/diff/220001/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc File chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc (right): https://codereview.chromium.org/2159133002/diff/220001/chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc#newcode53 chrome/browser/browsing_data/browsing_data_appcache_helper_unittest.cc:53: content::TestBrowserThreadBundle thread_bundle_; On 2016/07/21 15:27:20, mmenke wrote: > ...
4 years, 5 months ago (2016-07-22 04:16:21 UTC) #61
kinuko
Adding more owners... mkwst@chromium.org: Please review changes in chrome/browser/browsing_data dtrainor@chromium.org: Please review changes in blimp/ ...
4 years, 5 months ago (2016-07-22 04:35:54 UTC) #64
falken
service worker lgtm. awesome!
4 years, 5 months ago (2016-07-22 04:38:15 UTC) #66
kinuko
On 2016/07/22 04:35:54, kinuko wrote: > mkwst@chromium.org: Please review changes in chrome/browser/browsing_data Looks like ooo, ...
4 years, 5 months ago (2016-07-22 04:38:20 UTC) #67
alex clarke (OOO till 29th)
headless/ LGTM
4 years, 5 months ago (2016-07-22 09:36:47 UTC) #70
Paweł Hajdan Jr.
chrome/test LGTM
4 years, 5 months ago (2016-07-22 13:17:30 UTC) #71
halliwell
On 2016/07/22 13:17:30, Paweł Hajdan Jr. wrote: > chrome/test LGTM chromecast/ lgtm
4 years, 5 months ago (2016-07-22 13:22:42 UTC) #72
David Trainor- moved to gerrit
blimp/ lgtm thanks!
4 years, 5 months ago (2016-07-22 16:14:17 UTC) #73
jam
Can the motivation be spelled out (both for me to understand it, and for future ...
4 years, 5 months ago (2016-07-22 16:26:22 UTC) #74
mmenke
On 2016/07/22 16:26:22, jam wrote: > Can the motivation be spelled out (both for me ...
4 years, 5 months ago (2016-07-22 17:59:43 UTC) #75
jam
On 2016/07/22 17:59:43, mmenke wrote: > On 2016/07/22 16:26:22, jam wrote: > > Can the ...
4 years, 5 months ago (2016-07-22 21:12:00 UTC) #76
mmenke
On 2016/07/22 21:12:00, jam wrote: > On 2016/07/22 17:59:43, mmenke wrote: > > On 2016/07/22 ...
4 years, 5 months ago (2016-07-22 21:18:50 UTC) #77
kinuko
On 2016/07/22 21:18:50, mmenke wrote: > On 2016/07/22 21:12:00, jam wrote: > > On 2016/07/22 ...
4 years, 5 months ago (2016-07-25 15:05:56 UTC) #80
jam
On 2016/07/25 15:05:56, kinuko wrote: > On 2016/07/22 21:18:50, mmenke wrote: > > On 2016/07/22 ...
4 years, 5 months ago (2016-07-25 19:17:34 UTC) #81
michaeln
lgtm 2 !
4 years, 5 months ago (2016-07-25 22:42:37 UTC) #82
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/2159133002/240001
4 years, 4 months ago (2016-07-26 11:56:20 UTC) #85
commit-bot: I haz the power
Committed patchset #7 (id:240001)
4 years, 4 months ago (2016-07-26 13:27:46 UTC) #87
commit-bot: I haz the power
4 years, 4 months ago (2016-07-26 13:29:10 UTC) #89
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/f6ed359c6f34261f93f3ac5431c7f7526d500262
Cr-Commit-Position: refs/heads/master@{#407781}

Powered by Google App Engine
This is Rietveld 408576698