From 59395014c0ac449ba9b8273800aa09965d36412c Mon Sep 17 00:00:00 2001 From: "chase@chromium.org" Date: Wed, 3 Feb 2010 00:55:28 +0000 Subject: Revert 37913 - Clear local state (cookies, databases, local storage) on exit. BUG=32719 TEST=none Review URL: http://codereview.chromium.org/564012 TBR=jochen@chromium.org Review URL: http://codereview.chromium.org/564023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37915 0039d316-1c4b-4281-b951-d872f2087c98 --- .../in_process_webkit/dom_storage_context.cc | 27 +++------------------- .../in_process_webkit/dom_storage_context.h | 10 +++----- 2 files changed, 6 insertions(+), 31 deletions(-) (limited to 'chrome/browser/in_process_webkit') diff --git a/chrome/browser/in_process_webkit/dom_storage_context.cc b/chrome/browser/in_process_webkit/dom_storage_context.cc index 4156576..c19b6cf 100644 --- a/chrome/browser/in_process_webkit/dom_storage_context.cc +++ b/chrome/browser/in_process_webkit/dom_storage_context.cc @@ -1,21 +1,17 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this +// source code is governed by a BSD-style license that can be found in the +// LICENSE file. #include "chrome/browser/in_process_webkit/dom_storage_context.h" #include "base/file_path.h" #include "base/file_util.h" -#include "base/string_util.h" #include "chrome/browser/chrome_thread.h" #include "chrome/browser/in_process_webkit/dom_storage_area.h" #include "chrome/browser/in_process_webkit/dom_storage_namespace.h" #include "chrome/browser/in_process_webkit/webkit_context.h" #include "chrome/common/dom_storage_common.h" -#include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" -#include "third_party/WebKit/WebKit/chromium/public/WebString.h" #include "webkit/glue/glue_util.h" -#include "webkit/glue/webkit_glue.h" const FilePath::CharType DOMStorageContext::kLocalStorageDirectory[] = FILE_PATH_LITERAL("Local Storage"); @@ -240,20 +236,3 @@ void DOMStorageContext::CompleteCloningSessionStorage( if (existing_namespace) context->RegisterStorageNamespace(existing_namespace->Copy(clone_id)); } - -// static -void DOMStorageContext::ClearLocalState(const FilePath& profile_path, - const char* url_scheme_to_be_skip) { - file_util::FileEnumerator file_enumerator(profile_path.Append( - kLocalStorageDirectory), false, file_util::FileEnumerator::FILES); - for (FilePath file_path = file_enumerator.Next(); !file_path.empty(); - file_path = file_enumerator.Next()) { - if (file_path.Extension() == kLocalStorageExtension) { - scoped_ptr web_security_origin( - WebKit::WebSecurityOrigin::createFromDatabaseIdentifier( - webkit_glue::FilePathToWebString(file_path.BaseName()))); - if (!EqualsASCII(web_security_origin->protocol(), url_scheme_to_be_skip)) - file_util::Delete(file_path, false); - } - } -} diff --git a/chrome/browser/in_process_webkit/dom_storage_context.h b/chrome/browser/in_process_webkit/dom_storage_context.h index 49e3712..4981c07 100644 --- a/chrome/browser/in_process_webkit/dom_storage_context.h +++ b/chrome/browser/in_process_webkit/dom_storage_context.h @@ -1,6 +1,6 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this +// source code is governed by a BSD-style license that can be found in the +// LICENSE file. #ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_CONTEXT_H_ #define CHROME_BROWSER_IN_PROCESS_WEBKIT_DOM_STORAGE_CONTEXT_H_ @@ -78,10 +78,6 @@ class DOMStorageContext { // The local storage file extension. static const FilePath::CharType kLocalStorageExtension[]; - // Delete all non-extension local storage files. - static void ClearLocalState(const FilePath& profile_path, - const char* url_scheme_to_be_skipped); - private: // Get the local storage instance. The object is owned by this class. DOMStorageNamespace* CreateLocalStorage(); -- cgit v1.1