diff options
-rw-r--r-- | chrome/browser/net/chrome_network_delegate.cc | 2 | ||||
-rw-r--r-- | chrome/browser/net/chrome_network_delegate.h | 2 | ||||
-rw-r--r-- | chrome/browser/net/chrome_network_delegate_unittest.cc | 4 | ||||
-rw-r--r-- | content/shell/browser/shell_network_delegate.cc | 2 | ||||
-rw-r--r-- | content/shell/browser/shell_network_delegate.h | 2 | ||||
-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 |
15 files changed, 41 insertions, 39 deletions
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc index ef78b9e..8547e49 100644 --- a/chrome/browser/net/chrome_network_delegate.cc +++ b/chrome/browser/net/chrome_network_delegate.cc @@ -731,7 +731,7 @@ bool ChromeNetworkDelegate::OnCanEnablePrivacyMode( return privacy_mode; } -bool ChromeNetworkDelegate::OnFirstPartyOnlyCookieExperimentEnabled() const { +bool ChromeNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const { return experimental_web_platform_features_enabled_; } diff --git a/chrome/browser/net/chrome_network_delegate.h b/chrome/browser/net/chrome_network_delegate.h index 43dbc57..2d86467 100644 --- a/chrome/browser/net/chrome_network_delegate.h +++ b/chrome/browser/net/chrome_network_delegate.h @@ -183,7 +183,7 @@ class ChromeNetworkDelegate : public net::NetworkDelegateImpl { bool OnCanEnablePrivacyMode( const GURL& url, const GURL& first_party_for_cookies) const override; - bool OnFirstPartyOnlyCookieExperimentEnabled() const override; + bool OnAreExperimentalCookieFeaturesEnabled() const override; bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( const net::URLRequest& request, const GURL& target_url, diff --git a/chrome/browser/net/chrome_network_delegate_unittest.cc b/chrome/browser/net/chrome_network_delegate_unittest.cc index a4d97af..5fb4b59 100644 --- a/chrome/browser/net/chrome_network_delegate_unittest.cc +++ b/chrome/browser/net/chrome_network_delegate_unittest.cc @@ -282,14 +282,14 @@ TEST_F(ChromeNetworkDelegateTest, DataUseMeasurementUserTestWithRedirect) { TEST_F(ChromeNetworkDelegateTest, DisableFirstPartyOnlyCookiesIffFlagDisabled) { Initialize(); - EXPECT_FALSE(network_delegate()->FirstPartyOnlyCookieExperimentEnabled()); + EXPECT_FALSE(network_delegate()->AreExperimentalCookieFeaturesEnabled()); } TEST_F(ChromeNetworkDelegateTest, EnableFirstPartyOnlyCookiesIffFlagEnabled) { base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kEnableExperimentalWebPlatformFeatures); Initialize(); - EXPECT_TRUE(network_delegate()->FirstPartyOnlyCookieExperimentEnabled()); + EXPECT_TRUE(network_delegate()->AreExperimentalCookieFeaturesEnabled()); } TEST_F(ChromeNetworkDelegateTest, ReportDataUseToAggregator) { diff --git a/content/shell/browser/shell_network_delegate.cc b/content/shell/browser/shell_network_delegate.cc index 2120904..c4cd0da 100644 --- a/content/shell/browser/shell_network_delegate.cc +++ b/content/shell/browser/shell_network_delegate.cc @@ -107,7 +107,7 @@ bool ShellNetworkDelegate::OnCanAccessFile(const net::URLRequest& request, return true; } -bool ShellNetworkDelegate::OnFirstPartyOnlyCookieExperimentEnabled() const { +bool ShellNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const { return base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableExperimentalWebPlatformFeatures); } diff --git a/content/shell/browser/shell_network_delegate.h b/content/shell/browser/shell_network_delegate.h index 49b8f23..cffc3b9 100644 --- a/content/shell/browser/shell_network_delegate.h +++ b/content/shell/browser/shell_network_delegate.h @@ -52,7 +52,7 @@ class ShellNetworkDelegate : public net::NetworkDelegateImpl { net::CookieOptions* options) override; bool OnCanAccessFile(const net::URLRequest& request, const base::FilePath& path) const override; - bool OnFirstPartyOnlyCookieExperimentEnabled() const override; + bool OnAreExperimentalCookieFeaturesEnabled() const override; DISALLOW_COPY_AND_ASSIGN(ShellNetworkDelegate); }; 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( |