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

Issue 10600009: Support partitioning of storage contexts based on render_id. (Closed)

Created:
8 years, 6 months ago by awong
Modified:
8 years, 4 months ago
CC:
chromium-reviews, mihaip-chromium-reviews_chromium.org, jochen+watch-content_chromium.org, jam, joi+watch-content_chromium.org, Aaron Boodman, darin-cc_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Support partitioning of storage contexts based on render_id. This modifies BrowserContext to support having multiple storage partitions based on the child process id. The embedder is given a function that allows it to map a child process id into different storage buckets. R=creis,nasko,jam TBR=marja BUG=85121 TEST=add an isolated app that covers a path like http://www.example.com/isolated/. On that page, add an entry to local storage. Access another page on www.example.com that is not isolated. Check that it cannot see the previously set entry. Repeat test in the reverse direction. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=146443

Patch Set 1 : Fix comments #

Total comments: 46

Patch Set 2 : address comments. #

Patch Set 3 : errr...this version actually compiles. #

Patch Set 4 : fix unittest #

Patch Set 5 : fix bad access of BrowserContext::GetFileSystemContext() from FILE thread. #

Patch Set 6 : Merge in unittest fix from jam@ #

Total comments: 2

Patch Set 7 : rebased on jam@'s chromeos fixes. #

Total comments: 6

Patch Set 8 : #

Patch Set 9 : Forgot a funciton. #

Total comments: 5

Patch Set 10 : address John's comments. #

Patch Set 11 : #

Patch Set 12 : rebased #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+614 lines, -167 lines) Patch
M chrome/browser/browsing_data_local_storage_helper.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/browsing_data_remover.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/browsing_data_remover_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chrome_content_browser_client.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +19 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_data_deleter.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/isolated_app_browsertest.cc View 1 6 chunks +79 lines, -2 lines 0 comments Download
M chrome/browser/sessions/session_restore.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/browser_context.cc View 1 2 3 4 5 6 7 8 9 6 chunks +110 lines, -129 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 1 chunk +2 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
A content/browser/storage_partition.h View 1 2 3 4 5 6 7 8 9 1 chunk +77 lines, -0 lines 0 comments Download
A content/browser/storage_partition.cc View 1 2 3 4 5 6 7 8 9 1 chunk +104 lines, -0 lines 0 comments Download
A content/browser/storage_partition_map.h View 1 2 3 4 5 6 7 8 9 1 chunk +49 lines, -0 lines 0 comments Download
A content/browser/storage_partition_map.cc View 1 2 3 4 5 6 7 8 9 1 chunk +94 lines, -0 lines 2 comments Download
M content/browser/web_contents/navigation_controller_impl.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/worker_host/worker_process_host.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M content/common/child_process_host_impl.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M content/common/child_process_host_impl.cc View 2 chunks +9 lines, -1 line 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 13 chunks +27 lines, -23 lines 0 comments Download
M content/public/browser/browser_context.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
M content/public/browser/content_browser_client.h View 1 2 3 4 5 6 7 1 chunk +14 lines, -1 line 0 comments Download
M content/public/browser/content_browser_client.cc View 1 2 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
awong
This is finally ready for a first pass review. Note that the IsolateAppTest is still ...
8 years, 5 months ago (2012-06-29 22:07:36 UTC) #1
nasko
Overall LGTM with some notes. http://codereview.chromium.org/10600009/diff/8001/content/browser/browser_context.cc File content/browser/browser_context.cc (right): http://codereview.chromium.org/10600009/diff/8001/content/browser/browser_context.cc#newcode271 content/browser/browser_context.cc:271: void DOMStorageContextForEach( nit: In ...
8 years, 5 months ago (2012-06-29 23:08:56 UTC) #2
Charlie Reis
Great. Looks promising, and I like the test. Please change the TEST= line to something ...
8 years, 5 months ago (2012-07-02 23:21:23 UTC) #3
awong
ready for another pass. https://chromiumcodereview.appspot.com/10600009/diff/8001/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): https://chromiumcodereview.appspot.com/10600009/diff/8001/chrome/browser/chrome_content_browser_client.cc#newcode409 chrome/browser/chrome_content_browser_client.cc:409: int child_process_id) { On 2012/07/02 ...
8 years, 5 months ago (2012-07-09 20:37:42 UTC) #4
awong
Yay! Looks like the try runs are going green! Review ready!
8 years, 5 months ago (2012-07-10 19:47:37 UTC) #5
Charlie Reis
LGTM http://codereview.chromium.org/10600009/diff/8001/chrome/browser/chrome_content_browser_client.cc File chrome/browser/chrome_content_browser_client.cc (right): http://codereview.chromium.org/10600009/diff/8001/chrome/browser/chrome_content_browser_client.cc#newcode409 chrome/browser/chrome_content_browser_client.cc:409: int child_process_id) { On 2012/07/09 20:37:43, awong wrote: ...
8 years, 5 months ago (2012-07-10 21:37:47 UTC) #6
awong
On 2012/07/10 21:37:47, creis wrote: > LGTM > > http://codereview.chromium.org/10600009/diff/8001/chrome/browser/chrome_content_browser_client.cc > File chrome/browser/chrome_content_browser_client.cc (right): > ...
8 years, 5 months ago (2012-07-10 23:13:01 UTC) #7
awong
john, mind doing an owners review for this?
8 years, 5 months ago (2012-07-10 23:14:04 UTC) #8
jam
lgtm I'd much rather prefer that StoragePartition is landed in a separate file. smaller files ...
8 years, 5 months ago (2012-07-11 02:09:25 UTC) #9
awong
StoragePartition and StoragePartitionMap moved into their own files. As to your question about GetDefaultDOMStorageContext, yes, ...
8 years, 5 months ago (2012-07-11 21:17:16 UTC) #10
awong
Seems like it's passing most of try servers. I'm thinking mac bot is flake...at least ...
8 years, 5 months ago (2012-07-11 22:59:25 UTC) #11
jam
slgtm with nits https://chromiumcodereview.appspot.com/10600009/diff/6011/content/browser/storage_partition.h File content/browser/storage_partition.h (right): https://chromiumcodereview.appspot.com/10600009/diff/6011/content/browser/storage_partition.h#newcode37 content/browser/storage_partition.h:37: class StoragePartition { nit: new code ...
8 years, 5 months ago (2012-07-11 23:36:31 UTC) #12
awong
https://chromiumcodereview.appspot.com/10600009/diff/6011/content/browser/storage_partition_map.h File content/browser/storage_partition_map.h (right): https://chromiumcodereview.appspot.com/10600009/diff/6011/content/browser/storage_partition_map.h#newcode22 content/browser/storage_partition_map.h:22: class StoragePartitionMap : public base::SupportsUserData::Data { On 2012/07/11 23:36:31, ...
8 years, 5 months ago (2012-07-12 20:28:40 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ajwong@chromium.org/10600009/11011
8 years, 5 months ago (2012-07-12 21:23:35 UTC) #14
commit-bot: I haz the power
Presubmit check for 10600009-11011 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 5 months ago (2012-07-12 21:23:42 UTC) #15
michaeln
https://chromiumcodereview.appspot.com/10600009/diff/11011/content/browser/storage_partition_map.cc File content/browser/storage_partition_map.cc (right): https://chromiumcodereview.appspot.com/10600009/diff/11011/content/browser/storage_partition_map.cc#newcode88 content/browser/storage_partition_map.cc:88: browser_context_->GetResourceContext(), Passing in browser_context_->GetResourceContext() doesn't look completely correct for ...
8 years, 4 months ago (2012-08-10 00:42:11 UTC) #16
awong
8 years, 4 months ago (2012-08-10 13:59:36 UTC) #17
https://chromiumcodereview.appspot.com/10600009/diff/11011/content/browser/st...
File content/browser/storage_partition_map.cc (right):

https://chromiumcodereview.appspot.com/10600009/diff/11011/content/browser/st...
content/browser/storage_partition_map.cc:88:
browser_context_->GetResourceContext(),
On 2012/08/10 00:42:11, michaeln wrote:
> Passing in browser_context_->GetResourceContext() doesn't look completely
> correct for the isolated app case.

Yes...nothing that uses GetResourceContext() has been fixed for isolated apps.
At the time of this CL, it was just too large of a chunk to bite off at once,
but maybe now it's time to start looking at it.

> * The URLRequestContext of this ResourceContext will be used when populating
> appcaches under this service, it will be using the 'default' cookies and http
> cache when doing so... that's not incorrect.

If I'm understanding correctly, can this be solved by passing in the appropriate
URLRequestContext instead of the whole ResourceContext?
 
> * The ResourceContext is also used as inputs to the
> ContentBrowserClient::AllowAppCache() method. The chrome level impl of that
> interface uses the ResourceContext to navigate to the content settings
> structures associated with the user profile... which does seem correct
(assuming
> isolated apps dont have different settings).

Interesting.  ResourceContext is a hard chunk to bite off since it is
conceptually the IO thread projection of BrowserContext.  However, when I looked
at ResourceContext, I recall thinking that, excluding URLRequestContext, all the
storage related state was only used by 1-2 spots in the Workers implementation. 
I was hoping that instead of introducing something like a StoragePartition
concept onto the IO thread, that we would be able to look at the uses of
URLRequestContext, AppCache, etc., individually on the IO thread and make them
not use ResourceContext.

Is this doable in the AppcCache case?

Powered by Google App Engine
This is Rietveld 408576698