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

Unified Diff: chrome/browser/browsing_data_file_system_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_file_system_helper.cc
diff --git a/chrome/browser/browsing_data_file_system_helper.cc b/chrome/browser/browsing_data_file_system_helper.cc
index 9cde50587bc21e08036e62095bc39fab3753089d..81525b478351ed857e81cafa1f9276335c1883e5 100644
--- a/chrome/browser/browsing_data_file_system_helper.cc
+++ b/chrome/browser/browsing_data_file_system_helper.cc
@@ -13,6 +13,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 "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_quota_util.h"
#include "webkit/fileapi/file_system_types.h"
@@ -124,11 +125,13 @@ void BrowsingDataFileSystemHelperImpl::FetchFileSystemInfoInFileThread() {
fileapi::kFileSystemTypeTemporary);
GURL current;
+
+ content::ChildProcessSecurityPolicy* policy =
+ content::ChildProcessSecurityPolicy::GetInstance();
while (!(current = origin_enumerator->Next()).is_empty()) {
- if (current.SchemeIs(chrome::kExtensionScheme)) {
- // Extension state is not considered browsing data.
- continue;
- }
+ if (!policy->IsWebSafeScheme(current.scheme()))
+ continue; // Non-websafe state is not considered browsing data.
+
// We can call these synchronous methods as we've already verified that
// we're running on the FILE thread.
int64 persistent_usage = quota_util->GetOriginUsageOnFileThread(current,
@@ -242,6 +245,11 @@ void CannedBrowsingDataFileSystemHelper::AddFileSystem(
if (duplicate_origin)
return;
+ content::ChildProcessSecurityPolicy* policy =
+ content::ChildProcessSecurityPolicy::GetInstance();
+ if (!policy->IsWebSafeScheme(origin.scheme()))
+ return; // Non-websafe state is not considered browsing data.
+
file_system_info_.push_back(FileSystemInfo(
origin,
(type == fileapi::kFileSystemTypePersistent),

Powered by Google App Engine
This is Rietveld 408576698