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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 10178009: Reland 130578 - Enable cookies per default in net. Add an API to disable them by default, and do th… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « chrome/browser/chrome_browser_main.h ('k') | chrome/browser/chrome_browser_main_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index b95a87e66ef5092daab0f4dd08ac46ce9dae6738..d7e7a98301974d7966a3dcead654f6bf175aeefc 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -554,6 +554,10 @@ const char kMissingLocaleDataMessage[] =
// BrowserMainParts ------------------------------------------------------------
+// static
+bool ChromeBrowserMainParts::disable_enforcing_cookie_policies_for_tests_ =
+ false;
+
ChromeBrowserMainParts::ChromeBrowserMainParts(
const content::MainFunctionParams& parameters)
: parameters_(parameters),
@@ -573,6 +577,12 @@ ChromeBrowserMainParts::ChromeBrowserMainParts(
// If we're running tests (ui_task is non-null).
if (parameters.ui_task)
browser_defaults::enable_help_app = false;
+
+ // Chrome disallows cookies by default. All code paths that want to use
+ // cookies need to go through one of Chrome's URLRequestContexts which have
+ // a ChromeNetworkDelegate attached that selectively allows cookies again.
+ if (!disable_enforcing_cookie_policies_for_tests_)
+ net::URLRequest::SetDefaultCookiePolicyToBlock();
}
ChromeBrowserMainParts::~ChromeBrowserMainParts() {
« no previous file with comments | « chrome/browser/chrome_browser_main.h ('k') | chrome/browser/chrome_browser_main_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698