Commit 778cb84a authored by Xi Han's avatar Xi Han Committed by Commit Bot

Set default cookie policy early.

SetDefaultCookiePolicyToBlock() should be called before any url request. Call it
it in the early startup.

Bug: 899276
Change-Id: Idf747013cd19d057506d7e0314a2d8c64c413c29
Reviewed-on: https://chromium-review.googlesource.com/c/1301842Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: Xi Han <hanxi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603151}
parent 0919936b
......@@ -57,6 +57,7 @@
#include "content/public/common/content_switches.h"
#include "content/public/common/service_names.mojom.h"
#include "extensions/common/constants.h"
#include "net/url_request/url_request.h"
#include "pdf/buildflags.h"
#include "ppapi/buildflags/buildflags.h"
#include "printing/buildflags/buildflags.h"
......@@ -507,6 +508,11 @@ ChromeMainDelegate::~ChromeMainDelegate() {
#if !defined(CHROME_MULTIPLE_DLL_CHILD)
void ChromeMainDelegate::PostEarlyInitialization(bool is_running_tests) {
// 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.
net::URLRequest::SetDefaultCookiePolicyToBlock();
DCHECK(chrome_feature_list_creator_);
chrome_feature_list_creator_->CreateFeatureList();
......
......@@ -185,7 +185,6 @@
#include "net/cookies/cookie_monster.h"
#include "net/http/http_network_layer.h"
#include "net/http/http_stream_factory.h"
#include "net/url_request/url_request.h"
#include "printing/buildflags/buildflags.h"
#include "rlz/buildflags/buildflags.h"
#include "services/service_manager/public/cpp/connector.h"
......@@ -683,11 +682,6 @@ ChromeBrowserMainParts::ChromeBrowserMainParts(
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.
net::URLRequest::SetDefaultCookiePolicyToBlock();
#if !defined(OS_ANDROID)
startup_watcher_ = std::make_unique<StartupTimeBomb>();
shutdown_watcher_ = std::make_unique<ShutdownWatcherHelper>();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment