diff options
author | estark <estark@chromium.org> | 2015-10-12 13:10:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-12 20:11:45 +0000 |
commit | 7625d810fa64325f2f2574d25d5429a7754f17de (patch) | |
tree | 1b7fffa6d1d93d20c1041f9c84b23596929585ec /net | |
parent | 659c758f070333905acee302474fb4bc2ce1ba46 (diff) | |
download | chromium_src-7625d810fa64325f2f2574d25d5429a7754f17de.zip chromium_src-7625d810fa64325f2f2574d25d5429a7754f17de.tar.gz chromium_src-7625d810fa64325f2f2574d25d5429a7754f17de.tar.bz2 |
Rename NetworkDelegate first-party-only flag
Renames the NetworkDelegate flag to
AreExperimentalCookieFeaturesEnabled(). This is in preparation for adding
experimental support for cookie prefixes in
https://codereview.chromium.org/1393193005/.
BUG=541511
Review URL: https://codereview.chromium.org/1392853006
Cr-Commit-Position: refs/heads/master@{#353584}
Diffstat (limited to 'net')
-rw-r--r-- | net/base/layered_network_delegate.cc | 11 | ||||
-rw-r--r-- | net/base/layered_network_delegate.h | 4 | ||||
-rw-r--r-- | net/base/network_delegate.cc | 4 | ||||
-rw-r--r-- | net/base/network_delegate.h | 14 | ||||
-rw-r--r-- | net/base/network_delegate_impl.cc | 2 | ||||
-rw-r--r-- | net/base/network_delegate_impl.h | 5 | ||||
-rw-r--r-- | net/url_request/url_request_http_job.cc | 2 | ||||
-rw-r--r-- | net/url_request/url_request_test_util.cc | 6 | ||||
-rw-r--r-- | net/url_request/url_request_test_util.h | 8 | ||||
-rw-r--r-- | net/url_request/url_request_unittest.cc | 12 |
10 files changed, 35 insertions, 33 deletions
diff --git a/net/base/layered_network_delegate.cc b/net/base/layered_network_delegate.cc index d384d5ea..9652d1c 100644 --- a/net/base/layered_network_delegate.cc +++ b/net/base/layered_network_delegate.cc @@ -258,14 +258,13 @@ void LayeredNetworkDelegate::OnCanEnablePrivacyModeInternal( const GURL& first_party_for_cookies) const { } -bool LayeredNetworkDelegate::OnFirstPartyOnlyCookieExperimentEnabled() const { - OnFirstPartyOnlyCookieExperimentEnabledInternal(); - return nested_network_delegate_->FirstPartyOnlyCookieExperimentEnabled(); +bool LayeredNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const { + OnAreExperimentalCookieFeaturesEnabledInternal(); + return nested_network_delegate_->AreExperimentalCookieFeaturesEnabled(); } -void LayeredNetworkDelegate::OnFirstPartyOnlyCookieExperimentEnabledInternal() - const { -} +void LayeredNetworkDelegate::OnAreExperimentalCookieFeaturesEnabledInternal() + const {} bool LayeredNetworkDelegate:: OnCancelURLRequestWithPolicyViolatingReferrerHeader( diff --git a/net/base/layered_network_delegate.h b/net/base/layered_network_delegate.h index dabe681..381aac9 100644 --- a/net/base/layered_network_delegate.h +++ b/net/base/layered_network_delegate.h @@ -84,7 +84,7 @@ class NET_EXPORT LayeredNetworkDelegate : public NetworkDelegate { const base::FilePath& path) const final; bool OnCanEnablePrivacyMode(const GURL& url, const GURL& first_party_for_cookies) const final; - bool OnFirstPartyOnlyCookieExperimentEnabled() const final; + bool OnAreExperimentalCookieFeaturesEnabled() const final; bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( const URLRequest& request, const GURL& target_url, @@ -158,7 +158,7 @@ class NET_EXPORT LayeredNetworkDelegate : public NetworkDelegate { const GURL& url, const GURL& first_party_for_cookies) const; - virtual void OnFirstPartyOnlyCookieExperimentEnabledInternal() const; + virtual void OnAreExperimentalCookieFeaturesEnabledInternal() const; virtual void OnCancelURLRequestWithPolicyViolatingReferrerHeaderInternal( const URLRequest& request, diff --git a/net/base/network_delegate.cc b/net/base/network_delegate.cc index 1538028..dfe2abb 100644 --- a/net/base/network_delegate.cc +++ b/net/base/network_delegate.cc @@ -174,8 +174,8 @@ bool NetworkDelegate::CanEnablePrivacyMode( return OnCanEnablePrivacyMode(url, first_party_for_cookies); } -bool NetworkDelegate::FirstPartyOnlyCookieExperimentEnabled() const { - return OnFirstPartyOnlyCookieExperimentEnabled(); +bool NetworkDelegate::AreExperimentalCookieFeaturesEnabled() const { + return OnAreExperimentalCookieFeaturesEnabled(); } bool NetworkDelegate::CancelURLRequestWithPolicyViolatingReferrerHeader( diff --git a/net/base/network_delegate.h b/net/base/network_delegate.h index cad221e..e8d82a3 100644 --- a/net/base/network_delegate.h +++ b/net/base/network_delegate.h @@ -109,8 +109,9 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe { const GURL& first_party_for_cookies) const; // TODO(mkwst): Remove this once we decide whether or not we wish to ship - // first-party cookies. https://crbug.com/459154 - bool FirstPartyOnlyCookieExperimentEnabled() const; + // first-party cookies and cookie prefixes. https://crbug.com/459154, + // https://crbug.com/541511 + bool AreExperimentalCookieFeaturesEnabled() const; bool CancelURLRequestWithPolicyViolatingReferrerHeader( const URLRequest& request, @@ -294,12 +295,13 @@ class NET_EXPORT NetworkDelegate : public base::NonThreadSafe { const GURL& url, const GURL& first_party_for_cookies) const = 0; - // Returns true if the embedder has enabled the "first-party" cookie - // experiment, and false otherwise. + // Returns true if the embedder has enabled the experimental features, + // and false otherwise. // // TODO(mkwst): Remove this once we decide whether or not we wish to ship - // first-party cookies. https://crbug.com/459154 - virtual bool OnFirstPartyOnlyCookieExperimentEnabled() const = 0; + // first-party cookies and cookie prefixes. https://crbug.com/459154, + // https://crbug.com/541511 + virtual bool OnAreExperimentalCookieFeaturesEnabled() const = 0; // Called when the |referrer_url| for requesting |target_url| during handling // of the |request| is does not comply with the referrer policy (e.g. a diff --git a/net/base/network_delegate_impl.cc b/net/base/network_delegate_impl.cc index af4d708..5b3a946 100644 --- a/net/base/network_delegate_impl.cc +++ b/net/base/network_delegate_impl.cc @@ -104,7 +104,7 @@ bool NetworkDelegateImpl::OnCanEnablePrivacyMode( return false; } -bool NetworkDelegateImpl::OnFirstPartyOnlyCookieExperimentEnabled() const { +bool NetworkDelegateImpl::OnAreExperimentalCookieFeaturesEnabled() const { return false; } diff --git a/net/base/network_delegate_impl.h b/net/base/network_delegate_impl.h index b0345dd..4b68d95 100644 --- a/net/base/network_delegate_impl.h +++ b/net/base/network_delegate_impl.h @@ -210,8 +210,9 @@ class NET_EXPORT NetworkDelegateImpl : public NetworkDelegate { // experiment, and false otherwise. // // TODO(mkwst): Remove this once we decide whether or not we wish to ship - // first-party cookies. https://crbug.com/459154 - bool OnFirstPartyOnlyCookieExperimentEnabled() const override; + // first-party cookies and cookie prefixes. https://crbug.com/459154, + // https://crbug.com/541511 + bool OnAreExperimentalCookieFeaturesEnabled() const override; // Called when the |referrer_url| for requesting |target_url| during handling // of the |request| is does not comply with the referrer policy (e.g. a diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc index c317469..3cace90 100644 --- a/net/url_request/url_request_http_job.cc +++ b/net/url_request/url_request_http_job.cc @@ -661,7 +661,7 @@ void URLRequestHttpJob::DoLoadCookies() { // TODO(mkwst): Drop this `if` once we decide whether or not to ship // first-party cookies: https://crbug.com/459154 if (network_delegate() && - network_delegate()->FirstPartyOnlyCookieExperimentEnabled()) + network_delegate()->AreExperimentalCookieFeaturesEnabled()) options.set_first_party_url(request_->first_party_for_cookies()); else options.set_include_first_party_only(); diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc index 278566b..91c3542 100644 --- a/net/url_request/url_request_test_util.cc +++ b/net/url_request/url_request_test_util.cc @@ -332,7 +332,7 @@ TestNetworkDelegate::TestNetworkDelegate() has_load_timing_info_before_redirect_(false), has_load_timing_info_before_auth_(false), can_access_files_(true), - first_party_only_cookies_enabled_(false), + experimental_cookie_features_enabled_(false), cancel_request_with_policy_violating_referrer_(false), will_be_intercepted_on_next_error_(false) {} @@ -616,8 +616,8 @@ bool TestNetworkDelegate::OnCanAccessFile(const URLRequest& request, return can_access_files_; } -bool TestNetworkDelegate::OnFirstPartyOnlyCookieExperimentEnabled() const { - return first_party_only_cookies_enabled_; +bool TestNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const { + return experimental_cookie_features_enabled_; } bool TestNetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( diff --git a/net/url_request/url_request_test_util.h b/net/url_request/url_request_test_util.h index 09d44df..74987d6 100644 --- a/net/url_request/url_request_test_util.h +++ b/net/url_request/url_request_test_util.h @@ -273,8 +273,8 @@ class TestNetworkDelegate : public NetworkDelegateImpl { void set_can_access_files(bool val) { can_access_files_ = val; } bool can_access_files() const { return can_access_files_; } - void set_first_party_only_cookies_enabled(bool val) { - first_party_only_cookies_enabled_ = val; + void set_experimental_cookie_features_enabled(bool val) { + experimental_cookie_features_enabled_ = val; } void set_cancel_request_with_policy_violating_referrer(bool val) { @@ -340,7 +340,7 @@ class TestNetworkDelegate : public NetworkDelegateImpl { CookieOptions* options) override; bool OnCanAccessFile(const URLRequest& request, const base::FilePath& path) const override; - bool OnFirstPartyOnlyCookieExperimentEnabled() const override; + bool OnAreExperimentalCookieFeaturesEnabled() const override; bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( const URLRequest& request, const GURL& target_url, @@ -387,7 +387,7 @@ class TestNetworkDelegate : public NetworkDelegateImpl { bool has_load_timing_info_before_auth_; bool can_access_files_; // true by default - bool first_party_only_cookies_enabled_; // false by default + bool experimental_cookie_features_enabled_; // false by default bool cancel_request_with_policy_violating_referrer_; // false by default bool will_be_intercepted_on_next_error_; }; diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index f188535..645173e 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc @@ -2610,7 +2610,7 @@ TEST_F(URLRequestTest, FirstPartyOnlyCookiesEnabled) { // LocalHttpTestServer points). { TestNetworkDelegate network_delegate; - network_delegate.set_first_party_only_cookies_enabled(true); + network_delegate.set_experimental_cookie_features_enabled(true); default_context_.set_network_delegate(&network_delegate); TestDelegate d; @@ -2628,7 +2628,7 @@ TEST_F(URLRequestTest, FirstPartyOnlyCookiesEnabled) { // Verify that the cookie is sent for first-party requests. { TestNetworkDelegate network_delegate; - network_delegate.set_first_party_only_cookies_enabled(true); + network_delegate.set_experimental_cookie_features_enabled(true); default_context_.set_network_delegate(&network_delegate); TestDelegate d; scoped_ptr<URLRequest> req(default_context_.CreateRequest( @@ -2646,7 +2646,7 @@ TEST_F(URLRequestTest, FirstPartyOnlyCookiesEnabled) { // Verify that the cookie is not-sent for non-first-party requests. { TestNetworkDelegate network_delegate; - network_delegate.set_first_party_only_cookies_enabled(true); + network_delegate.set_experimental_cookie_features_enabled(true); default_context_.set_network_delegate(&network_delegate); TestDelegate d; scoped_ptr<URLRequest> req(default_context_.CreateRequest( @@ -2670,7 +2670,7 @@ TEST_F(URLRequestTest, FirstPartyOnlyCookiesDisabled) { // LocalHttpTestServer points). { TestNetworkDelegate network_delegate; - network_delegate.set_first_party_only_cookies_enabled(false); + network_delegate.set_experimental_cookie_features_enabled(false); default_context_.set_network_delegate(&network_delegate); TestDelegate d; @@ -2688,7 +2688,7 @@ TEST_F(URLRequestTest, FirstPartyOnlyCookiesDisabled) { // Verify that the cookie is sent for first-party requests. { TestNetworkDelegate network_delegate; - network_delegate.set_first_party_only_cookies_enabled(false); + network_delegate.set_experimental_cookie_features_enabled(false); default_context_.set_network_delegate(&network_delegate); TestDelegate d; scoped_ptr<URLRequest> req(default_context_.CreateRequest( @@ -2706,7 +2706,7 @@ TEST_F(URLRequestTest, FirstPartyOnlyCookiesDisabled) { // Verify that the cookie is also sent for non-first-party requests. { TestNetworkDelegate network_delegate; - network_delegate.set_first_party_only_cookies_enabled(false); + network_delegate.set_experimental_cookie_features_enabled(false); default_context_.set_network_delegate(&network_delegate); TestDelegate d; scoped_ptr<URLRequest> req(default_context_.CreateRequest( |