diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-04 09:37:20 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-04 09:37:20 +0000 |
commit | 53d270ef9d6336a8d2f4b70008121c4aee142a13 (patch) | |
tree | dd98b08e398d9ce8bf210351cc73c28451982ccd | |
parent | b0cad5d48859e6fb30f2d46bdf5f0aa1a6fa73d5 (diff) | |
download | chromium_src-53d270ef9d6336a8d2f4b70008121c4aee142a13.zip chromium_src-53d270ef9d6336a8d2f4b70008121c4aee142a13.tar.gz chromium_src-53d270ef9d6336a8d2f4b70008121c4aee142a13.tar.bz2 |
Revert 130578 - Enable cookies per default in net. Add an API to disable them by default, and do that in Chrome
BUG=none
TEST=existing tests shouldn't break
Review URL: https://chromiumcodereview.appspot.com/9865018
TBR=jochen@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9956142
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130581 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chrome_browser_main.cc | 5 | ||||
-rw-r--r-- | chrome/service/service_main.cc | 7 | ||||
-rw-r--r-- | net/url_request/url_request.cc | 17 | ||||
-rw-r--r-- | net/url_request/url_request.h | 8 |
4 files changed, 3 insertions, 34 deletions
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index 17a1534..97de7c0 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -569,11 +569,6 @@ 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. - net::URLRequest::SetDefaultCookiePolicyToBlock(); } ChromeBrowserMainParts::~ChromeBrowserMainParts() { diff --git a/chrome/service/service_main.cc b/chrome/service/service_main.cc index d85134a..bcde1ba 100644 --- a/chrome/service/service_main.cc +++ b/chrome/service/service_main.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,7 +8,6 @@ #include "chrome/common/service_process_util.h" #include "chrome/service/service_process.h" #include "content/public/common/main_function_params.h" -#include "net/url_request/url_request.h" #if defined(OS_WIN) #include "content/common/sandbox_policy.h" @@ -19,10 +18,6 @@ // Mainline routine for running as the service process. int ServiceProcessMain(const content::MainFunctionParams& parameters) { - // Chrome disallows cookies by default. All code paths that want to use - // cookies should go through the browser process. - net::URLRequest::SetDefaultCookiePolicyToBlock(); - #if defined(OS_MACOSX) chrome_service_application_mac::RegisterServiceApp(); #endif diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc index 3f51f3d..4c2e2c3 100644 --- a/net/url_request/url_request.cc +++ b/net/url_request/url_request.cc @@ -64,12 +64,6 @@ uint64 GenerateURLRequestIdentifier() { return g_next_url_request_identifier++; } -// True once the first URLRequest was started. -bool g_url_requests_started = false; - -// True if cookies are accepted by default. -bool g_default_can_use_cookies = true; - } // namespace URLRequest::ProtocolFactory* @@ -327,12 +321,6 @@ int URLRequest::GetResponseCode() { } // static -void URLRequest::SetDefaultCookiePolicyToBlock() { - CHECK(!g_url_requests_started); - g_default_can_use_cookies = false; -} - -// static bool URLRequest::IsHandledProtocol(const std::string& scheme) { return URLRequestJobManager::GetInstance()->SupportsScheme(scheme); } @@ -391,7 +379,6 @@ void URLRequest::set_delegate(Delegate* delegate) { } void URLRequest::Start() { - g_url_requests_started = true; response_info_.request_time = Time::Now(); // Only notify the delegate for the initial request. @@ -832,7 +819,7 @@ bool URLRequest::CanGetCookies(const CookieList& cookie_list) const { return context_->network_delegate()->NotifyReadingCookies(this, cookie_list); } - return g_default_can_use_cookies; + return false; } bool URLRequest::CanSetCookie(const std::string& cookie_line, @@ -843,7 +830,7 @@ bool URLRequest::CanSetCookie(const std::string& cookie_line, cookie_line, options); } - return g_default_can_use_cookies; + return false; } diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index e204c6b..d73d2fe 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h @@ -291,14 +291,6 @@ class NET_EXPORT URLRequest : NON_EXPORTED_BASE(public base::NonThreadSafe), // will not have any more of its methods called. virtual ~URLRequest(); - // Changes the default cookie policy from allowing all cookies to blocking all - // cookies. Embedders that want to implement a more flexible policy should - // change the default to blocking all cookies, and provide a NetworkDelegate - // with the URLRequestContext that maintains the CookieStore. - // The cookie policy default has to be set before the first URLRequest is - // started. Once it was set to block all cookies, it cannot be changed back. - static void SetDefaultCookiePolicyToBlock(); - // Returns true if the scheme can be handled by URLRequest. False otherwise. static bool IsHandledProtocol(const std::string& scheme); |