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

Unified Diff: chrome/browser/browsing_data_local_storage_helper.cc

Issue 9958107: Limiting the "Cookies and site data" form to "web safe" schemes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: License. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browsing_data_local_storage_helper.cc
diff --git a/chrome/browser/browsing_data_local_storage_helper.cc b/chrome/browser/browsing_data_local_storage_helper.cc
index 05b31c1fdca6fbeefab4155f3225e6a00cb9edf6..43bc237f218575b1442d685ad2e67dce1fe29be1 100644
--- a/chrome/browser/browsing_data_local_storage_helper.cc
+++ b/chrome/browser/browsing_data_local_storage_helper.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -9,12 +9,13 @@
#include "base/message_loop.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/browsing_data_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/dom_storage_context.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
#include "webkit/glue/webkit_glue.h"
using content::BrowserContext;
@@ -101,10 +102,9 @@ void BrowsingDataLocalStorageHelper::FetchLocalStorageInfo(
WebSecurityOrigin web_security_origin =
WebSecurityOrigin::createFromDatabaseIdentifier(
webkit_glue::FilePathToWebString(file_path.BaseName()));
- if (EqualsASCII(web_security_origin.protocol(), chrome::kExtensionScheme)) {
- // Extension state is not considered browsing data.
- continue;
- }
+ if (!BrowsingDataHelper::IsValidScheme(web_security_origin.protocol()))
+ continue; // Non-websafe state is not considered browsing data.
+
base::PlatformFileInfo file_info;
bool ret = file_util::GetFileInfo(file_path, &file_info);
if (ret) {
@@ -158,7 +158,8 @@ CannedBrowsingDataLocalStorageHelper::Clone() {
void CannedBrowsingDataLocalStorageHelper::AddLocalStorage(
const GURL& origin) {
- pending_local_storage_info_.insert(origin);
+ if (BrowsingDataHelper::HasValidScheme(origin))
+ pending_local_storage_info_.insert(origin);
}
void CannedBrowsingDataLocalStorageHelper::Reset() {

Powered by Google App Engine
This is Rietveld 408576698