summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browsing_data_indexed_db_helper.cc
diff options
context:
space:
mode:
authormkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-04 12:01:45 +0000
committermkwst@chromium.org <mkwst@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-04 12:01:45 +0000
commit298f3975f4861aea491f9c3939cee7d54e6c3c6c (patch)
treeea9def7c3a5aaaa5d503e00aeb865cc5302d4ef5 /chrome/browser/browsing_data_indexed_db_helper.cc
parent8b3e1646d50026a5c9a2326e22c6156a9a4b9a3a (diff)
downloadchromium_src-298f3975f4861aea491f9c3939cee7d54e6c3c6c.zip
chromium_src-298f3975f4861aea491f9c3939cee7d54e6c3c6c.tar.gz
chromium_src-298f3975f4861aea491f9c3939cee7d54e6c3c6c.tar.bz2
Limiting the "Cookies and site data" form to valid Browsing Data schemes.
This change will prevent extension and devtools (as well as data from any other internal `chrome-*` URL schemes) from showing up in the list of browsing data. BUG=121441 TEST=unit_test Review URL: https://chromiumcodereview.appspot.com/9958107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130598 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browsing_data_indexed_db_helper.cc')
-rw-r--r--chrome/browser/browsing_data_indexed_db_helper.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/chrome/browser/browsing_data_indexed_db_helper.cc b/chrome/browser/browsing_data_indexed_db_helper.cc
index fea3b26..5794a62 100644
--- a/chrome/browser/browsing_data_indexed_db_helper.cc
+++ b/chrome/browser/browsing_data_indexed_db_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.
@@ -12,6 +12,7 @@
#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/indexed_db_context.h"
@@ -108,8 +109,9 @@ void BrowsingDataIndexedDBHelperImpl::FetchIndexedDBInfoInWebKitThread() {
for (std::vector<GURL>::const_iterator iter = origins.begin();
iter != origins.end(); ++iter) {
const GURL& origin = *iter;
- if (origin.SchemeIs(chrome::kExtensionScheme))
- continue; // Extension state is not considered browsing data.
+ if (!BrowsingDataHelper::HasValidScheme(origin))
+ continue; // Non-websafe state is not considered browsing data.
+
indexed_db_info_.push_back(IndexedDBInfo(
origin,
indexed_db_context_->GetOriginDiskUsage(origin),
@@ -190,6 +192,9 @@ CannedBrowsingDataIndexedDBHelper* CannedBrowsingDataIndexedDBHelper::Clone() {
void CannedBrowsingDataIndexedDBHelper::AddIndexedDB(
const GURL& origin, const string16& description) {
+ if (!BrowsingDataHelper::HasValidScheme(origin))
+ return; // Non-websafe state is not considered browsing data.
+
base::AutoLock auto_lock(lock_);
pending_indexed_db_info_.push_back(PendingIndexedDBInfo(origin, description));
}