Commit 03a7b3fa authored by Takashi Toyoshima's avatar Takashi Toyoshima Committed by Commit Bot

Variations: Remove deprecated APIs that no sites call

Bug: 773295
Change-Id: I37fd708a0224d82a460204e9b8f5617c34200e0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1657387
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Auto-Submit: Takashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669168}
parent e82584fb
...@@ -157,14 +157,6 @@ bool AppendVariationsHeader(const GURL& url, ...@@ -157,14 +157,6 @@ bool AppendVariationsHeader(const GURL& url,
.AppendHeaderIfNeeded(url, incognito); .AppendHeaderIfNeeded(url, incognito);
} }
bool AppendVariationsHeader(const GURL& url,
InIncognito incognito,
SignedIn signed_in,
net::URLRequest* request) {
return VariationsHeaderHelper(request, signed_in)
.AppendHeaderIfNeeded(url, incognito);
}
bool AppendVariationsHeaderWithCustomValue(const GURL& url, bool AppendVariationsHeaderWithCustomValue(const GURL& url,
InIncognito incognito, InIncognito incognito,
const std::string& variations_header, const std::string& variations_header,
...@@ -179,12 +171,6 @@ bool AppendVariationsHeaderUnknownSignedIn(const GURL& url, ...@@ -179,12 +171,6 @@ bool AppendVariationsHeaderUnknownSignedIn(const GURL& url,
return VariationsHeaderHelper(request).AppendHeaderIfNeeded(url, incognito); return VariationsHeaderHelper(request).AppendHeaderIfNeeded(url, incognito);
} }
bool AppendVariationsHeaderUnknownSignedIn(const GURL& url,
InIncognito incognito,
net::URLRequest* request) {
return VariationsHeaderHelper(request).AppendHeaderIfNeeded(url, incognito);
}
void RemoveVariationsHeaderIfNeeded( void RemoveVariationsHeaderIfNeeded(
const net::RedirectInfo& redirect_info, const net::RedirectInfo& redirect_info,
const network::ResourceResponseHead& response_head, const network::ResourceResponseHead& response_head,
...@@ -193,12 +179,6 @@ void RemoveVariationsHeaderIfNeeded( ...@@ -193,12 +179,6 @@ void RemoveVariationsHeaderIfNeeded(
to_be_removed_headers->push_back(kClientDataHeader); to_be_removed_headers->push_back(kClientDataHeader);
} }
void StripVariationsHeaderIfNeeded(const GURL& new_location,
net::URLRequest* request) {
if (!ShouldAppendVariationsHeader(new_location))
request->RemoveRequestHeaderByName(kClientDataHeader);
}
std::unique_ptr<network::SimpleURLLoader> std::unique_ptr<network::SimpleURLLoader>
CreateSimpleURLLoaderWithVariationsHeader( CreateSimpleURLLoaderWithVariationsHeader(
std::unique_ptr<network::ResourceRequest> request, std::unique_ptr<network::ResourceRequest> request,
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
namespace net { namespace net {
struct NetworkTrafficAnnotationTag; struct NetworkTrafficAnnotationTag;
struct RedirectInfo; struct RedirectInfo;
class URLRequest;
} }
namespace network { namespace network {
...@@ -45,16 +44,8 @@ bool AppendVariationsHeader(const GURL& url, ...@@ -45,16 +44,8 @@ bool AppendVariationsHeader(const GURL& url,
SignedIn signed_in, SignedIn signed_in,
network::ResourceRequest* request); network::ResourceRequest* request);
// TODO(toyoshim): Remove this deprecated API that takes net::URLRequest* once // Similar to AppendVariationsHeader, but uses specified |variations_header| as
// all callers are removed after NetworkService being fully enabled, or migrated // the custom header value. You should not generally need to use this.
// to use SimpleURLLoader. See, crbug.com/773295.
bool AppendVariationsHeader(const GURL& url,
InIncognito incognito,
SignedIn signed_in,
net::URLRequest* request);
// Similar to functions above, but uses specified |variations_header| as the
// custom header value. You should not generally need to use this.
bool AppendVariationsHeaderWithCustomValue(const GURL& url, bool AppendVariationsHeaderWithCustomValue(const GURL& url,
InIncognito incognito, InIncognito incognito,
const std::string& variations_header, const std::string& variations_header,
...@@ -66,13 +57,6 @@ bool AppendVariationsHeaderUnknownSignedIn(const GURL& url, ...@@ -66,13 +57,6 @@ bool AppendVariationsHeaderUnknownSignedIn(const GURL& url,
InIncognito incognito, InIncognito incognito,
network::ResourceRequest* request); network::ResourceRequest* request);
// TODO(toyoshim): Remove this deprecated API that takes net::URLRequest* once
// all callers are removed after NetworkService being fully enabled, or migrated
// to use SimpleURLLoader. See, crbug.com/773295.
bool AppendVariationsHeaderUnknownSignedIn(const GURL& url,
InIncognito incognito,
net::URLRequest* request);
// Removes the variations header for requests when a redirect to a non-Google // Removes the variations header for requests when a redirect to a non-Google
// URL occurs. // URL occurs.
void RemoveVariationsHeaderIfNeeded( void RemoveVariationsHeaderIfNeeded(
...@@ -80,12 +64,6 @@ void RemoveVariationsHeaderIfNeeded( ...@@ -80,12 +64,6 @@ void RemoveVariationsHeaderIfNeeded(
const network::ResourceResponseHead& response_head, const network::ResourceResponseHead& response_head,
std::vector<std::string>* to_be_removed_headers); std::vector<std::string>* to_be_removed_headers);
// Strips the variations header if |new_location| does not point to a location
// that should receive it. This is being called by the ChromeNetworkDelegate.
// Components calling AppendVariationsHeader() don't need to take care of this.
void StripVariationsHeaderIfNeeded(const GURL& new_location,
net::URLRequest* request);
// Creates a SimpleURLLoader that will include the variations header for // Creates a SimpleURLLoader that will include the variations header for
// requests to Google and ensures they're removed if a redirect to a non-Google // requests to Google and ensures they're removed if a redirect to a non-Google
// URL occurs. // URL occurs.
......
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