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

Side by Side Diff: content/renderer/renderer_webstoragenamespace_impl.cc

Issue 10005049: DomStorage house cleaning (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/renderer_webstoragenamespace_impl.h" 5 #include "content/renderer/renderer_webstoragenamespace_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/renderer/renderer_webstoragearea_impl.h" 8 #include "content/renderer/renderer_webstoragearea_impl.h"
9 9
10 using WebKit::WebStorageArea; 10 using WebKit::WebStorageArea;
11 using WebKit::WebStorageNamespace; 11 using WebKit::WebStorageNamespace;
12 using WebKit::WebString; 12 using WebKit::WebString;
13 13
14 RendererWebStorageNamespaceImpl::RendererWebStorageNamespaceImpl( 14 RendererWebStorageNamespaceImpl::RendererWebStorageNamespaceImpl()
15 DOMStorageType storage_type) 15 : namespace_id_(dom_storage::kLocalStorageNamespaceId) {
16 : namespace_id_(kLocalStorageNamespaceId) {
17 DCHECK(storage_type == DOM_STORAGE_LOCAL);
18 } 16 }
19 17
20 RendererWebStorageNamespaceImpl::RendererWebStorageNamespaceImpl( 18 RendererWebStorageNamespaceImpl::RendererWebStorageNamespaceImpl(
21 DOMStorageType storage_type, int64 namespace_id) 19 int64 namespace_id)
22 : namespace_id_(namespace_id) { 20 : namespace_id_(namespace_id) {
23 DCHECK(storage_type == DOM_STORAGE_SESSION); 21 DCHECK_NE(dom_storage::kLocalStorageNamespaceId, namespace_id);
ericu 2012/04/10 23:53:03 Should this be kInvalidSessionStorageNamespaceId?
michaeln 2012/04/11 00:31:53 Done.
24 } 22 }
25 23
26 RendererWebStorageNamespaceImpl::~RendererWebStorageNamespaceImpl() { 24 RendererWebStorageNamespaceImpl::~RendererWebStorageNamespaceImpl() {
27 } 25 }
28 26
29 WebStorageArea* RendererWebStorageNamespaceImpl::createStorageArea( 27 WebStorageArea* RendererWebStorageNamespaceImpl::createStorageArea(
30 const WebString& origin) { 28 const WebString& origin) {
31 // Ideally, we'd keep a hash map of origin to these objects. Unfortunately 29 // Ideally, we'd keep a hash map of origin to these objects. Unfortunately
32 // this doesn't seem practical because there's no good way to ref-count these 30 // this doesn't seem practical because there's no good way to ref-count these
33 // objects, and it'd be unclear who owned them. So, instead, we'll pay the 31 // objects, and it'd be unclear who owned them. So, instead, we'll pay the
34 // price in terms of wasted memory. 32 // price in terms of wasted memory.
35 return new RendererWebStorageAreaImpl(namespace_id_, origin); 33 return new RendererWebStorageAreaImpl(namespace_id_, origin);
36 } 34 }
37 35
38 WebStorageNamespace* RendererWebStorageNamespaceImpl::copy() { 36 WebStorageNamespace* RendererWebStorageNamespaceImpl::copy() {
39 // By returning NULL, we're telling WebKit to lazily fetch it the next time 37 // By returning NULL, we're telling WebKit to lazily fetch it the next time
40 // session storage is used. In the WebViewClient::createView, we do the 38 // session storage is used. In the WebViewClient::createView, we do the
41 // book-keeping necessary to make it a true copy-on-write despite not doing 39 // book-keeping necessary to make it a true copy-on-write despite not doing
42 // anything here, now. 40 // anything here, now.
43 return NULL; 41 return NULL;
44 } 42 }
45 43
46 void RendererWebStorageNamespaceImpl::close() { 44 void RendererWebStorageNamespaceImpl::close() {
47 // This is called only on LocalStorage namespaces when WebKit thinks its 45 // TOOD(michaeln): remove this deprecated method.
48 // shutting down. This has no impact on Chromium.
49 } 46 }
OLDNEW
« no previous file with comments | « content/renderer/renderer_webstoragenamespace_impl.h ('k') | content/test/render_view_fake_resources_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698