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

Issue 7480041: Adding session-only localStorage. (Closed)

Created:
9 years, 5 months ago by marja
Modified:
9 years, 4 months ago
CC:
chromium-reviews, Avi (use Gerrit), Paweł Hajdan Jr., jam, joi+watch-content_chromium.org, darin-cc_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Adding session-only LocalStorage. Data can now be stored in the permanent LocalStorage or in the session-only LocalStorage, depending on the content settings for the origin. Draft -- missing the usage of first party origin when checking the "enforce session only" setting BUG=NONE TEST=DOMStorageBrowserTest.ChangingSettings, DOMStorageBrowserTest.SessionOnly

Patch Set 1 #

Patch Set 2 : Reading the content settings in IO thread (like they should be) and making the webkit thread wait. #

Patch Set 3 : Un-blocking the WebKit thread, delayed answering to the DOMStorageHostMsg_StorageAreaId. #

Total comments: 8

Patch Set 4 : Misc test fixes, revolving around [Mock]ResourceContext. #

Total comments: 2

Patch Set 5 : Code review comments: Using a Callback instead of adding DOMStorageArea::Delegate. #

Patch Set 6 : Simplifying the interoperation of the IO and WEBKIT threads. #

Patch Set 7 : Adding tests. #

Total comments: 10

Patch Set 8 : Small modifications (code review comments). #

Patch Set 9 : Oops. Fixing unit_tests which didn't build after the previous change. #

Total comments: 6

Patch Set 10 : Streamlining: Moving ResourceContext& from DOMStorageContext to DOMMessageFilter. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+347 lines, -27 lines) Patch
M chrome/browser/chrome_content_browser_client.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 1 chunk +13 lines, -0 lines 0 comments Download
M content/browser/content_browser_client.h View 1 2 3 4 5 6 7 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/in_process_webkit/dom_storage_browsertest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +166 lines, -0 lines 0 comments Download
M content/browser/in_process_webkit/dom_storage_message_filter.h View 1 2 3 4 5 6 7 8 9 5 chunks +20 lines, -2 lines 0 comments Download
M content/browser/in_process_webkit/dom_storage_message_filter.cc View 1 2 3 4 5 6 7 8 9 4 chunks +47 lines, -8 lines 0 comments Download
M content/browser/in_process_webkit/dom_storage_namespace.h View 1 2 3 4 5 6 7 3 chunks +20 lines, -1 line 0 comments Download
M content/browser/in_process_webkit/dom_storage_namespace.cc View 1 2 3 4 5 6 7 8 9 2 chunks +52 lines, -11 lines 0 comments Download
M content/browser/mock_content_browser_client.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/mock_content_browser_client.cc View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/mock_resource_context.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/browser/renderer_host/browser_render_process_host.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/resource_context.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/browser/resource_context.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
michaeln
Oh boy... you're really going down this path of per-host session-only storage model. I think ...
9 years, 5 months ago (2011-07-27 18:53:22 UTC) #1
jochen (gone - plz use gerrit)
http://codereview.chromium.org/7480041/diff/4001/content/browser/in_process_webkit/dom_storage_context.cc File content/browser/in_process_webkit/dom_storage_context.cc (right): http://codereview.chromium.org/7480041/diff/4001/content/browser/in_process_webkit/dom_storage_context.cc#newcode284 content/browser/in_process_webkit/dom_storage_context.cc:284: return resource_context_; you can inline such small getters http://codereview.chromium.org/7480041/diff/4001/content/browser/in_process_webkit/dom_storage_namespace.cc ...
9 years, 4 months ago (2011-07-29 08:01:05 UTC) #2
michaeln
http://codereview.chromium.org/7480041/diff/4001/content/browser/in_process_webkit/dom_storage_message_filter.cc File content/browser/in_process_webkit/dom_storage_message_filter.cc (right): http://codereview.chromium.org/7480041/diff/4001/content/browser/in_process_webkit/dom_storage_message_filter.cc#newcode117 content/browser/in_process_webkit/dom_storage_message_filter.cc:117: void DOMStorageMessageFilter::OverrideThreadForMessage( This additional thread context switching (from IO ...
9 years, 4 months ago (2011-07-30 16:49:24 UTC) #3
marja
Marking some of the smaller changes done. http://codereview.chromium.org/7480041/diff/4001/content/browser/in_process_webkit/dom_storage_context.cc File content/browser/in_process_webkit/dom_storage_context.cc (right): http://codereview.chromium.org/7480041/diff/4001/content/browser/in_process_webkit/dom_storage_context.cc#newcode284 content/browser/in_process_webkit/dom_storage_context.cc:284: return resource_context_; ...
9 years, 4 months ago (2011-08-01 08:36:32 UTC) #4
marja
More changes "Done". http://codereview.chromium.org/7480041/diff/4001/content/browser/in_process_webkit/dom_storage_message_filter.cc File content/browser/in_process_webkit/dom_storage_message_filter.cc (right): http://codereview.chromium.org/7480041/diff/4001/content/browser/in_process_webkit/dom_storage_message_filter.cc#newcode117 content/browser/in_process_webkit/dom_storage_message_filter.cc:117: void DOMStorageMessageFilter::OverrideThreadForMessage( On 2011/07/30 16:49:24, michaeln ...
9 years, 4 months ago (2011-08-01 09:41:27 UTC) #5
michaeln
http://codereview.chromium.org/7480041/diff/9001/content/browser/mock_resource_context.cc File content/browser/mock_resource_context.cc (left): http://codereview.chromium.org/7480041/diff/9001/content/browser/mock_resource_context.cc#oldcode21 content/browser/mock_resource_context.cc:21: set_request_context(test_request_context_); why does the setter not work anymore? http://codereview.chromium.org/7480041/diff/16001/content/browser/content_browser_client.h ...
9 years, 4 months ago (2011-08-02 19:47:41 UTC) #6
marja
http://codereview.chromium.org/7480041/diff/9001/content/browser/mock_resource_context.cc File content/browser/mock_resource_context.cc (left): http://codereview.chromium.org/7480041/diff/9001/content/browser/mock_resource_context.cc#oldcode21 content/browser/mock_resource_context.cc:21: set_request_context(test_request_context_); On 2011/08/02 19:47:41, michaeln wrote: > why does ...
9 years, 4 months ago (2011-08-03 07:09:51 UTC) #7
marja
Thanks for the comments! http://codereview.chromium.org/7480041/diff/16001/content/browser/content_browser_client.h File content/browser/content_browser_client.h (right): http://codereview.chromium.org/7480041/diff/16001/content/browser/content_browser_client.h#newcode151 content/browser/content_browser_client.h:151: virtual bool AllowPermanentStorage( On 2011/08/02 ...
9 years, 4 months ago (2011-08-03 09:14:15 UTC) #8
michaeln
The code looks pretty good, but really i do wonder about the semantics involved wrt ...
9 years, 4 months ago (2011-08-04 20:21:51 UTC) #9
marja
9 years, 4 months ago (2011-08-05 13:15:53 UTC) #10
Thanks for the comments, the ResourceContext& change indeed streamlined the cl.
Marking small changes as "Done".

{mirandac,sky}: Afaics, this cl no longer touches the parts which would've
needed your reviews for the OWNERS check, so I'll remove you from the reviewer
list. sky, you're an OWNER of content/browser (but so is darin), so feel free to
add yourself back if you have time to review this.

http://codereview.chromium.org/7480041/diff/25001/content/browser/in_process_...
File content/browser/in_process_webkit/dom_storage_context.h (right):

http://codereview.chromium.org/7480041/diff/25001/content/browser/in_process_...
content/browser/in_process_webkit/dom_storage_context.h:112: const
content::ResourceContext& GetResourceContext() const {
On 2011/08/04 20:21:51, michaeln wrote:
> would prefer unix hacker style for this simple getter...
>    resource_context()
> ... but see comment elsewhere about maybe not needing this data member in this
> class

Done. Or rather, "Gone".

http://codereview.chromium.org/7480041/diff/25001/content/browser/in_process_...
File content/browser/in_process_webkit/dom_storage_message_filter.cc (right):

http://codereview.chromium.org/7480041/diff/25001/content/browser/in_process_...
content/browser/in_process_webkit/dom_storage_message_filter.cc:125:
Context()->GetResourceContext());
On 2011/08/04 20:21:51, michaeln wrote:
> I think this is the only place you actually need access to the ResourceContext
> instance. if that's right, instead of adding the new data member to
> DOMStorageContext consider adding it to the DOMStorageMessageFilter class.
> 
> The reasons being:
> 
> * Thread safety. The ResourceContext class can only be used on the IO thread
but
> the DOMStorage stuff is almost exclusively used on the WEBKIT thread. Having
> that data member there is a little landmine'ish.
> 
> * I think you could shrink the CL a little, less plumbing of that value around
> in ctors.

Done.

http://codereview.chromium.org/7480041/diff/25001/content/browser/in_process_...
File content/browser/in_process_webkit/dom_storage_namespace.cc (right):

http://codereview.chromium.org/7480041/diff/25001/content/browser/in_process_...
content/browser/in_process_webkit/dom_storage_namespace.cc:143: return true;
On 2011/08/04 20:21:51, michaeln wrote:
> maybe simplify as
> return (type == LOCAL) && !path.isEmpty();

Done.

Powered by Google App Engine
This is Rietveld 408576698