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

Issue 11362268: Implement the ability to obliterate a storage partition from disk. (Closed)

Created:
8 years, 1 month ago by awong
Modified:
8 years, 1 month ago
CC:
chromium-reviews, joi+watch-content_chromium.org, Aaron Boodman, darin-cc_chromium.org, jam, chromium-apps-reviews_chromium.org
Visibility:
Public.

Description

Implement the ability to obliterate a storage partition from disk. On the uninstall of an extension with isolated storage, we want to delete all the data for the extension from disk as soon as possible. Because we cannot know when when various objects with state on disk (eg., FileSystemContext) have all be deleted, we do a best-effort delete for any directory that we know isn't being used. The way this gets projected into the content modulue is that each extension defines one partition_domain. If an extension has a <webview> tag, it will also have multiple StoragePartitions, each with a different partition_name. If it doesn't have a <webview> tag, the partition_name is considered empty which yields the default partition. The default partition, and all webview partitions are peers inside the partition_domain's root directory. This CL introduces a function that allows us to delete partiton domain. Special care is taken to not accidentally instantiate a StoragePartition for the domain if none current exists. This is necessary to allow us to actually delete the whole partition domain directory. BUG=85127

Patch Set 1 #

Patch Set 2 : fix comments #

Patch Set 3 : remove stale function #

Patch Set 4 : Correctly delete all data. #

Total comments: 18

Patch Set 5 : Work around race on extension uninstall #

Total comments: 22

Patch Set 6 : Fix creis comments #

Patch Set 7 : onditionals are hard, let's go shopping #

Total comments: 2

Patch Set 8 : source control is hard, let's go shopping! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+337 lines, -81 lines) Patch
M chrome/browser/chrome_content_browser_client.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 2 chunks +40 lines, -19 lines 0 comments Download
M chrome/browser/extensions/data_deleter.cc View 1 2 3 4 1 chunk +6 lines, -6 lines 0 comments Download
M content/browser/browser_context.cc View 1 2 3 4 5 5 chunks +22 lines, -7 lines 0 comments Download
M content/browser/storage_partition_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/storage_partition_impl.cc View 1 2 3 4 5 4 chunks +85 lines, -35 lines 0 comments Download
M content/browser/storage_partition_impl_map.h View 1 2 3 4 5 2 chunks +6 lines, -1 line 0 comments Download
M content/browser/storage_partition_impl_map.cc View 1 2 3 4 5 7 chunks +155 lines, -8 lines 0 comments Download
M content/public/browser/browser_context.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/public/browser/content_browser_client.h View 1 2 3 4 5 1 chunk +13 lines, -5 lines 0 comments Download
M content/public/browser/content_browser_client.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/public/browser/storage_partition.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
awong
Nasko, Charlie, could one of you do the primary review? (not sure who is more ...
8 years, 1 month ago (2012-11-15 03:13:34 UTC) #1
nasko
Mostly nits and clarifications. https://codereview.chromium.org/11362268/diff/5001/content/browser/storage_partition_impl.cc File content/browser/storage_partition_impl.cc (right): https://codereview.chromium.org/11362268/diff/5001/content/browser/storage_partition_impl.cc#newcode79 content/browser/storage_partition_impl.cc:79: // Clear out appcache. If ...
8 years, 1 month ago (2012-11-15 17:48:10 UTC) #2
Charlie Reis
Yeah, I guess we have to keep certain directories around if they're still in use. ...
8 years, 1 month ago (2012-11-15 18:28:21 UTC) #3
awong
PTAL. It got more complicated. :-/ https://codereview.chromium.org/11362268/diff/5001/chrome/browser/extensions/data_deleter.cc File chrome/browser/extensions/data_deleter.cc (right): https://codereview.chromium.org/11362268/diff/5001/chrome/browser/extensions/data_deleter.cc#newcode27 chrome/browser/extensions/data_deleter.cc:27: // TODO(ajwong): If ...
8 years, 1 month ago (2012-11-16 00:36:03 UTC) #4
Charlie Reis
Hate to demand this, but this would really benefit from a test, given how many ...
8 years, 1 month ago (2012-11-16 01:45:10 UTC) #5
awong
Totally agreed with the test. But not making it due to deadline. Can you file ...
8 years, 1 month ago (2012-11-16 02:56:10 UTC) #6
awong
FYI, testing consisted of: Setup: 1) Loading platform app 2) Creating webview tags with multiple ...
8 years, 1 month ago (2012-11-16 02:58:13 UTC) #7
awong
hmm...try servers failing. Need to diagnose. :(
8 years, 1 month ago (2012-11-16 07:09:36 UTC) #8
awong
On 2012/11/16 07:09:36, awong wrote: > hmm...try servers failing. Need to diagnose. :( Found a ...
8 years, 1 month ago (2012-11-16 15:28:09 UTC) #9
Charlie Reis
One question, then I think we're ready to go. (Also, most recent try jobs failed ...
8 years, 1 month ago (2012-11-16 16:14:59 UTC) #10
awong
I'll fix the compile failures. My last try job accidentally picked up garbage on my ...
8 years, 1 month ago (2012-11-16 16:28:56 UTC) #11
Charlie Reis
Great. LGTM. On 2012/11/16 16:28:56, awong wrote: > I'll fix the compile failures. My last ...
8 years, 1 month ago (2012-11-16 16:32:36 UTC) #12
awong
Matt, can you do owners check for chrome/browser/extensions, and assuming all looks good, hit the ...
8 years, 1 month ago (2012-11-16 16:37:30 UTC) #13
Matt Perry
lgtm
8 years, 1 month ago (2012-11-16 19:58:11 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ajwong@chromium.org/11362268/11004
8 years, 1 month ago (2012-11-16 19:58:22 UTC) #15
commit-bot: I haz the power
Presubmit check for 11362268-11004 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 1 month ago (2012-11-16 19:58:27 UTC) #16
Charlie Reis
On 2012/11/16 19:58:27, I haz the power (commit-bot) wrote: > Presubmit check for 11362268-11004 failed ...
8 years, 1 month ago (2012-11-16 20:01:43 UTC) #17
Charlie Reis
8 years, 1 month ago (2012-11-16 20:11:52 UTC) #18
On 2012/11/16 20:01:43, creis wrote:
> On 2012/11/16 19:58:27, I haz the power (commit-bot) wrote:
> > Presubmit check for 11362268-11004 failed and returned exit status 1.
> > 
> > 
> > Running presubmit commit checks ...
> > 
> > ** Presubmit Warnings **
> > Your #include order seems to be broken. Send mail to
> > mailto:marja@chromium.org if this is not the case.
> >       content/browser/storage_partition_impl.cc:10 \
> >       content/browser/storage_partition_impl.cc:19
> > 
> > Presubmit checks took 1.8s to calculate.
> 
> Drat.  I guess I'll try to upload a fixed version of this patch in a separate
> review.

Moved review to https://codereview.chromium.org/11280030/, since Albert isn't
around to fix the include order.

Powered by Google App Engine
This is Rietveld 408576698