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

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: 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_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..405d56498f1df1d934ee8b5d4bf1664d693878e0 100644
--- a/chrome/browser/browsing_data_local_storage_helper.cc
+++ b/chrome/browser/browsing_data_local_storage_helper.cc
@@ -11,9 +11,10 @@
#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/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"
jochen (gone - plz use gerrit) 2012/04/03 09:41:21 W > p
Mike West 2012/04/03 14:45:51 Done.
+#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebCString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h"
#include "webkit/glue/webkit_glue.h"
@@ -96,15 +97,16 @@ void BrowsingDataLocalStorageHelper::GetAllStorageFilesCallback(
void BrowsingDataLocalStorageHelper::FetchLocalStorageInfo(
const std::vector<FilePath>& files) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ content::ChildProcessSecurityPolicy* policy =
+ content::ChildProcessSecurityPolicy::GetInstance();
for (size_t i = 0; i < files.size(); ++i) {
FilePath file_path = files[i];
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 (!policy->IsWebSafeScheme(UTF16ToUTF8(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) {

Powered by Google App Engine
This is Rietveld 408576698