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

Unified Diff: chrome/browser/browsing_data_indexed_db_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: The others. 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_indexed_db_helper.cc
diff --git a/chrome/browser/browsing_data_indexed_db_helper.cc b/chrome/browser/browsing_data_indexed_db_helper.cc
index fea3b26d0f6cf3c56a98d7029811211d9820dba5..431ea51eea9bca527e478b05077f96d4cc8aa1bc 100644
--- a/chrome/browser/browsing_data_indexed_db_helper.cc
+++ b/chrome/browser/browsing_data_indexed_db_helper.cc
@@ -14,6 +14,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/indexed_db_context.h"
#include "webkit/database/database_util.h"
#include "webkit/glue/webkit_glue.h"
@@ -105,11 +106,14 @@ void BrowsingDataIndexedDBHelperImpl::DeleteIndexedDB(
void BrowsingDataIndexedDBHelperImpl::FetchIndexedDBInfoInWebKitThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::WEBKIT_DEPRECATED));
std::vector<GURL> origins = indexed_db_context_->GetAllOrigins();
+ content::ChildProcessSecurityPolicy* policy =
+ content::ChildProcessSecurityPolicy::GetInstance();
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 (!policy->IsWebSafeScheme(origin.scheme()))
+ continue; // Non-websafe state is not considered browsing data.
+
indexed_db_info_.push_back(IndexedDBInfo(
origin,
indexed_db_context_->GetOriginDiskUsage(origin),
@@ -190,6 +194,11 @@ CannedBrowsingDataIndexedDBHelper* CannedBrowsingDataIndexedDBHelper::Clone() {
void CannedBrowsingDataIndexedDBHelper::AddIndexedDB(
const GURL& origin, const string16& description) {
+ content::ChildProcessSecurityPolicy* policy =
+ content::ChildProcessSecurityPolicy::GetInstance();
+ if (!policy->IsWebSafeScheme(origin.scheme()))
+ return; // Non-websafe state is not considered browsing data.
+
base::AutoLock auto_lock(lock_);
pending_indexed_db_info_.push_back(PendingIndexedDBInfo(origin, description));
}

Powered by Google App Engine
This is Rietveld 408576698