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
This commit is contained in:
@ -1 +1,2 @@
|
||||
michaeln@chromium.org
|
||||
marja@chromium.org
|
||||
|
@ -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() {
|
||||
|
@ -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) {
|
||||
|
@ -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.
|
||||
|
Reference in New Issue
Block a user