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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_helper.cc

Issue 976553002: Remove the '--enable-file-cookies' flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Whole method. Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browsing_data/browsing_data_helper.h" 5 #include "chrome/browser/browsing_data/browsing_data_helper.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
erikwright (departed) 2015/03/30 14:22:30 no longer required?
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
erikwright (departed) 2015/03/30 14:22:30 ditto
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
erikwright (departed) 2015/03/30 14:22:30 ditto?
11 #include "content/public/browser/child_process_security_policy.h" 11 #include "content/public/browser/child_process_security_policy.h"
12 #include "extensions/common/constants.h" 12 #include "extensions/common/constants.h"
13 #include "storage/browser/quota/special_storage_policy.h" 13 #include "storage/browser/quota/special_storage_policy.h"
14 #include "url/gurl.h" 14 #include "url/gurl.h"
15 15
16 // Static 16 // Static
17 bool BrowsingDataHelper::IsWebScheme(const std::string& scheme) { 17 bool BrowsingDataHelper::IsWebScheme(const std::string& scheme) {
18 // Special-case `file://` scheme iff cookies and site data are enabled via 18 // All "web safe" schemes are valid, except `chrome-extension://`
19 // the `--allow-file-cookies` CLI flag.
20 if (scheme == url::kFileScheme) {
21 return base::CommandLine::ForCurrentProcess()->HasSwitch(
22 switches::kEnableFileCookies);
23 }
24
25 // Otherwise, all "web safe" schemes are valid, except `chrome-extension://`
26 // and `chrome-devtools://`. 19 // and `chrome-devtools://`.
27 content::ChildProcessSecurityPolicy* policy = 20 content::ChildProcessSecurityPolicy* policy =
28 content::ChildProcessSecurityPolicy::GetInstance(); 21 content::ChildProcessSecurityPolicy::GetInstance();
29 return (policy->IsWebSafeScheme(scheme) && 22 return (policy->IsWebSafeScheme(scheme) &&
30 !BrowsingDataHelper::IsExtensionScheme(scheme) && 23 !BrowsingDataHelper::IsExtensionScheme(scheme) &&
31 scheme != content::kChromeDevToolsScheme); 24 scheme != content::kChromeDevToolsScheme);
32 } 25 }
33 26
34 // Static 27 // Static
35 bool BrowsingDataHelper::HasWebScheme(const GURL& origin) { 28 bool BrowsingDataHelper::HasWebScheme(const GURL& origin) {
(...skipping 28 matching lines...) Expand all
64 57
65 // Hosted applications (protected and websafe origins) iff PROTECTED_WEB. 58 // Hosted applications (protected and websafe origins) iff PROTECTED_WEB.
66 if (policy && 59 if (policy &&
67 policy->IsStorageProtected(origin.GetOrigin()) && 60 policy->IsStorageProtected(origin.GetOrigin()) &&
68 BrowsingDataHelper::HasWebScheme(origin.GetOrigin()) && 61 BrowsingDataHelper::HasWebScheme(origin.GetOrigin()) &&
69 origin_set_mask & PROTECTED_WEB) 62 origin_set_mask & PROTECTED_WEB)
70 return true; 63 return true;
71 64
72 return false; 65 return false;
73 } 66 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/history_browsertest.cc » ('j') | chrome/browser/history/history_browsertest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698