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

Side by Side Diff: webkit/dom_storage/dom_storage_namespace.cc

Issue 10910045: DomStorage: Clear the renderer side cache too when the user clears browsing data. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
« no previous file with comments | « webkit/dom_storage/dom_storage_namespace.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/dom_storage/dom_storage_namespace.h" 5 #include "webkit/dom_storage/dom_storage_namespace.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 void DomStorageNamespace::CloseStorageArea(DomStorageArea* area) { 57 void DomStorageNamespace::CloseStorageArea(DomStorageArea* area) {
58 AreaHolder* holder = GetAreaHolder(area->origin()); 58 AreaHolder* holder = GetAreaHolder(area->origin());
59 DCHECK(holder); 59 DCHECK(holder);
60 DCHECK_EQ(holder->area_.get(), area); 60 DCHECK_EQ(holder->area_.get(), area);
61 --(holder->open_count_); 61 --(holder->open_count_);
62 // TODO(michaeln): Clean up areas that aren't needed in memory anymore. 62 // TODO(michaeln): Clean up areas that aren't needed in memory anymore.
63 // The in-process-webkit based impl didn't do this either, but would be nice. 63 // The in-process-webkit based impl didn't do this either, but would be nice.
64 } 64 }
65 65
66 DomStorageArea* DomStorageNamespace::GetOpenStorageArea(const GURL& origin) {
67 AreaHolder* holder = GetAreaHolder(origin);
68 if (holder && holder->open_count_)
69 return holder->area_;
70 return NULL;
71 }
72
66 DomStorageNamespace* DomStorageNamespace::Clone( 73 DomStorageNamespace* DomStorageNamespace::Clone(
67 int64 clone_namespace_id, 74 int64 clone_namespace_id,
68 const std::string& clone_persistent_namespace_id) { 75 const std::string& clone_persistent_namespace_id) {
69 DCHECK_NE(kLocalStorageNamespaceId, namespace_id_); 76 DCHECK_NE(kLocalStorageNamespaceId, namespace_id_);
70 DCHECK_NE(kLocalStorageNamespaceId, clone_namespace_id); 77 DCHECK_NE(kLocalStorageNamespaceId, clone_namespace_id);
71 DomStorageNamespace* clone = new DomStorageNamespace( 78 DomStorageNamespace* clone = new DomStorageNamespace(
72 clone_namespace_id, clone_persistent_namespace_id, 79 clone_namespace_id, clone_persistent_namespace_id,
73 session_storage_database_, task_runner_); 80 session_storage_database_, task_runner_);
74 AreaMap::const_iterator it = areas_.begin(); 81 AreaMap::const_iterator it = areas_.begin();
75 // Clone the in-memory structures. 82 // Clone the in-memory structures.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 159
153 DomStorageNamespace::AreaHolder::AreaHolder( 160 DomStorageNamespace::AreaHolder::AreaHolder(
154 DomStorageArea* area, int count) 161 DomStorageArea* area, int count)
155 : area_(area), open_count_(count) { 162 : area_(area), open_count_(count) {
156 } 163 }
157 164
158 DomStorageNamespace::AreaHolder::~AreaHolder() { 165 DomStorageNamespace::AreaHolder::~AreaHolder() {
159 } 166 }
160 167
161 } // namespace dom_storage 168 } // namespace dom_storage
OLDNEW
« no previous file with comments | « webkit/dom_storage/dom_storage_namespace.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698