| 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() {
|
|
|