diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-07 00:25:42 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-07 00:25:42 +0000 |
commit | fc8857f2f7f664e515e6e792c0d3f27ec4efaf9e (patch) | |
tree | 10761f558ca1c30b909a37d90ee352bac6858c0f | |
parent | bc9438ce9c170609e06c9ba9ed99d05eb962280d (diff) | |
download | chromium_src-fc8857f2f7f664e515e6e792c0d3f27ec4efaf9e.zip chromium_src-fc8857f2f7f664e515e6e792c0d3f27ec4efaf9e.tar.gz chromium_src-fc8857f2f7f664e515e6e792c0d3f27ec4efaf9e.tar.bz2 |
DomStorage: Clear the renderer side cache too when the user clears browsing data.
Review URL: https://chromiumcodereview.appspot.com/10910045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155284 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/dom_storage/OWNERS | 1 | ||||
-rw-r--r-- | webkit/dom_storage/dom_storage_context.cc | 5 | ||||
-rw-r--r-- | webkit/dom_storage/dom_storage_namespace.cc | 7 | ||||
-rw-r--r-- | webkit/dom_storage/dom_storage_namespace.h | 3 |
4 files changed, 16 insertions, 0 deletions
diff --git a/webkit/dom_storage/OWNERS b/webkit/dom_storage/OWNERS index 3723f40..e765c6f 100644 --- a/webkit/dom_storage/OWNERS +++ b/webkit/dom_storage/OWNERS @@ -1 +1,2 @@ michaeln@chromium.org +marja@chromium.org diff --git a/webkit/dom_storage/dom_storage_context.cc b/webkit/dom_storage/dom_storage_context.cc index 9b4b7cb..667de83 100644 --- a/webkit/dom_storage/dom_storage_context.cc +++ b/webkit/dom_storage/dom_storage_context.cc @@ -111,6 +111,11 @@ void DomStorageContext::DeleteOrigin(const GURL& origin) { DCHECK(!is_shutdown_); DomStorageNamespace* local = GetStorageNamespace(kLocalStorageNamespaceId); local->DeleteOrigin(origin); + // Synthesize a 'cleared' event if the area is open so CachedAreas in + // renderers get emptied out too. + DomStorageArea* area = local->GetOpenStorageArea(origin); + if (area) + NotifyAreaCleared(area, origin); } void DomStorageContext::PurgeMemory() { diff --git a/webkit/dom_storage/dom_storage_namespace.cc b/webkit/dom_storage/dom_storage_namespace.cc index 693954c..e620fa6 100644 --- a/webkit/dom_storage/dom_storage_namespace.cc +++ b/webkit/dom_storage/dom_storage_namespace.cc @@ -63,6 +63,13 @@ void DomStorageNamespace::CloseStorageArea(DomStorageArea* area) { // The in-process-webkit based impl didn't do this either, but would be nice. } +DomStorageArea* DomStorageNamespace::GetOpenStorageArea(const GURL& origin) { + AreaHolder* holder = GetAreaHolder(origin); + if (holder && holder->open_count_) + return holder->area_; + return NULL; +} + DomStorageNamespace* DomStorageNamespace::Clone( int64 clone_namespace_id, const std::string& clone_persistent_namespace_id) { diff --git a/webkit/dom_storage/dom_storage_namespace.h b/webkit/dom_storage/dom_storage_namespace.h index ecc0f92..f1c0c07 100644 --- a/webkit/dom_storage/dom_storage_namespace.h +++ b/webkit/dom_storage/dom_storage_namespace.h @@ -47,6 +47,9 @@ class DomStorageNamespace DomStorageArea* OpenStorageArea(const GURL& origin); void CloseStorageArea(DomStorageArea* area); + // Returns the area for |origin| if it's open, otherwise NULL. + DomStorageArea* GetOpenStorageArea(const GURL& origin); + // Creates a clone of |this| namespace including // shallow copies of all contained areas. // Should only be called for session storage namespaces. |