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

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: 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_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..417ce0ca785c0b782d2bbc5eeb5ca2e19ad2ce63 100644
--- a/chrome/browser/browsing_data_file_system_helper.cc
+++ b/chrome/browser/browsing_data_file_system_helper.cc
@@ -11,6 +11,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 "webkit/fileapi/file_system_context.h"
@@ -124,11 +125,11 @@ void BrowsingDataFileSystemHelperImpl::FetchFileSystemInfoInFileThread() {
fileapi::kFileSystemTypeTemporary);
GURL current;
+
while (!(current = origin_enumerator->Next()).is_empty()) {
- if (current.SchemeIs(chrome::kExtensionScheme)) {
- // Extension state is not considered browsing data.
- continue;
- }
+ if (!BrowsingDataHelper::HasValidScheme(current))
+ 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 +243,9 @@ void CannedBrowsingDataFileSystemHelper::AddFileSystem(
if (duplicate_origin)
return;
+ if (!BrowsingDataHelper::HasValidScheme(origin))
+ return; // Non-websafe state is not considered browsing data.
+
file_system_info_.push_back(FileSystemInfo(
origin,
(type == fileapi::kFileSystemTypePersistent),
« no previous file with comments | « chrome/browser/browsing_data_database_helper_unittest.cc ('k') | chrome/browser/browsing_data_file_system_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698