Commit 7bc4defd authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Remove alternative_proxy configuration.

This is no longer in use. Previously, it was used by the data reduction
proxy. This was also the only code path that could race proxied and
direct connections, so removing it lets us slim down tests a bit.

Bug: 1109329
Change-Id: I463f55e02d67eeaa894375659dfb515df5b6ba84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2324174Reviewed-by: default avatarDavid Schinazi <dschinazi@chromium.org>
Reviewed-by: default avatarEric Roman <eroman@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792862}
parent 6a12339e
......@@ -32,28 +32,18 @@ void TestProxyDelegate::OnResolveProxy(
const std::string& method,
const ProxyRetryInfoMap& proxy_retry_info,
ProxyInfo* result) {
if (trusted_spdy_proxy_.is_valid()) {
ProxyList new_proxy_list;
for (const auto& proxy_server : result->proxy_list().GetAll()) {
if (proxy_server == trusted_spdy_proxy_) {
new_proxy_list.AddProxyServer(ProxyServer(
proxy_server.scheme(), proxy_server.host_port_pair(), true));
} else {
new_proxy_list.AddProxyServer(proxy_server);
}
if (!trusted_spdy_proxy_.is_valid())
return;
ProxyList new_proxy_list;
for (const auto& proxy_server : result->proxy_list().GetAll()) {
if (proxy_server == trusted_spdy_proxy_) {
new_proxy_list.AddProxyServer(ProxyServer(
proxy_server.scheme(), proxy_server.host_port_pair(), true));
} else {
new_proxy_list.AddProxyServer(proxy_server);
}
result->UseProxyList(new_proxy_list);
result->set_traffic_annotation(
MutableNetworkTrafficAnnotationTag(TRAFFIC_ANNOTATION_FOR_TESTS));
}
// Only set |alternative_proxy_server_| as the alternative proxy if the
// ProxyService has not marked it as bad.
ProxyInfo alternative_proxy_info;
alternative_proxy_info.UseProxyServer(alternative_proxy_server_);
alternative_proxy_info.DeprioritizeBadProxies(proxy_retry_info);
if (!alternative_proxy_info.is_empty())
result->SetAlternativeProxy(alternative_proxy_info.proxy_server());
result->UseProxyList(new_proxy_list);
result->set_traffic_annotation(
MutableNetworkTrafficAnnotationTag(TRAFFIC_ANNOTATION_FOR_TESTS));
}
......
......@@ -47,20 +47,11 @@ class TestProxyDelegate : public ProxyDelegate {
const ProxyServer& proxy_server,
const HttpResponseHeaders& response_headers) override;
void set_alternative_proxy_server(
const ProxyServer& alternative_proxy_server) {
alternative_proxy_server_ = alternative_proxy_server;
}
const ProxyServer& alternative_proxy_server() const {
return alternative_proxy_server_;
}
private:
bool on_before_tunnel_request_called_ = false;
ProxyServer on_tunnel_headers_received_proxy_server_;
scoped_refptr<HttpResponseHeaders> on_tunnel_headers_received_headers_;
ProxyServer trusted_spdy_proxy_;
ProxyServer alternative_proxy_server_;
};
} // namespace net
......
......@@ -14,32 +14,6 @@ namespace net {
namespace {
enum AlternativeProxyUsage {
// Alternative Proxy was used without racing a normal connection.
ALTERNATIVE_PROXY_USAGE_NO_RACE = 0,
// Alternative Proxy was used by winning a race with a normal connection.
ALTERNATIVE_PROXY_USAGE_WON_RACE = 1,
// Alternative Proxy was not used by losing a race with a normal connection.
ALTERNATIVE_PROXY_USAGE_LOST_RACE = 2,
// Maximum value for the enum.
ALTERNATIVE_PROXY_USAGE_MAX,
};
AlternativeProxyUsage ConvertProtocolUsageToProxyUsage(
AlternateProtocolUsage usage) {
switch (usage) {
case ALTERNATE_PROTOCOL_USAGE_NO_RACE:
return ALTERNATIVE_PROXY_USAGE_NO_RACE;
case ALTERNATE_PROTOCOL_USAGE_WON_RACE:
return ALTERNATIVE_PROXY_USAGE_WON_RACE;
case ALTERNATE_PROTOCOL_USAGE_LOST_RACE:
return ALTERNATIVE_PROXY_USAGE_LOST_RACE;
default:
NOTREACHED();
return ALTERNATIVE_PROXY_USAGE_MAX;
}
}
quic::ParsedQuicVersion ParsedQuicVersionFromAlpn(
base::StringPiece str,
quic::ParsedQuicVersionVector supported_versions) {
......@@ -53,21 +27,13 @@ quic::ParsedQuicVersion ParsedQuicVersionFromAlpn(
} // anonymous namespace
void HistogramAlternateProtocolUsage(AlternateProtocolUsage usage,
bool proxy_server_used,
bool is_google_host) {
if (proxy_server_used) {
DCHECK_LE(usage, ALTERNATE_PROTOCOL_USAGE_LOST_RACE);
LOCAL_HISTOGRAM_ENUMERATION("Net.QuicAlternativeProxy.Usage",
ConvertProtocolUsageToProxyUsage(usage),
ALTERNATIVE_PROXY_USAGE_MAX);
} else {
UMA_HISTOGRAM_ENUMERATION("Net.AlternateProtocolUsage", usage,
ALTERNATE_PROTOCOL_USAGE_MAX);
if (is_google_host) {
UMA_HISTOGRAM_ENUMERATION("Net.AlternateProtocolUsageGoogle", usage,
ALTERNATE_PROTOCOL_USAGE_MAX);
}
}
}
void HistogramBrokenAlternateProtocolLocation(
......
......@@ -41,7 +41,6 @@ enum AlternateProtocolUsage {
// Log a histogram to reflect |usage|.
NET_EXPORT void HistogramAlternateProtocolUsage(AlternateProtocolUsage usage,
bool proxy_server_used,
bool is_google_host);
enum BrokenAlternateProtocolLocation {
......
......@@ -872,7 +872,7 @@ void HttpServerProperties::SetAlternativeServicesInternal(
// before the first completes. In this case, only one of the jobs
// would reach this code, whereas all of them should should have.
HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_MAPPING_MISSING,
false, IsGoogleHost(origin.host()));
IsGoogleHost(origin.host()));
}
// If this host ends with a canonical suffix, then set it as the
......
......@@ -105,7 +105,6 @@ HttpStreamFactory::Job::Job(Delegate* delegate,
GURL origin_url,
NextProto alternative_protocol,
quic::ParsedQuicVersion quic_version,
const ProxyServer& alternative_proxy_server,
bool is_websocket,
bool enable_ip_based_pooling,
NetLog* net_log)
......@@ -123,7 +122,6 @@ HttpStreamFactory::Job::Job(Delegate* delegate,
next_state_(STATE_NONE),
destination_(destination),
origin_url_(origin_url),
alternative_proxy_server_(alternative_proxy_server),
is_websocket_(is_websocket),
try_websocket_over_http2_(is_websocket_ &&
origin_url_.SchemeIs(url::kWssScheme) &&
......@@ -188,20 +186,10 @@ HttpStreamFactory::Job::Job(Delegate* delegate,
DCHECK(session);
if (alternative_protocol != kProtoUnknown) {
// The job cannot have protocol requirements dictated by alternative service
// and have an alternative proxy server set at the same time, since
// alternative services are used for requests that are fetched directly,
// while the alternative proxy server is used for requests that should be
// fetched using proxy.
DCHECK(!alternative_proxy_server_.is_valid());
// If the alternative service protocol is specified, then the job type must
// be either ALTERNATIVE or PRECONNECT.
DCHECK(job_type_ == ALTERNATIVE || job_type_ == PRECONNECT);
}
// If the alternative proxy server is set, then the job must be ALTERNATIVE.
if (alternative_proxy_server_.is_valid()) {
DCHECK(job_type_ == ALTERNATIVE);
}
if (expect_spdy_) {
DCHECK(origin_url_.SchemeIs(url::kHttpsScheme));
......@@ -1235,14 +1223,6 @@ int HttpStreamFactory::Job::ReconsiderProxyAfterError(int error) {
if (!CanFalloverToNextProxy(proxy_info_.proxy_server(), error, &error))
return error;
// Alternative proxy server job should not use fallback proxies, and instead
// return. This would resume the main job (if possible) which may try the
// fallback proxies.
if (alternative_proxy_server().is_valid()) {
DCHECK_EQ(STATE_NONE, next_state_);
return error;
}
should_reconsider_proxy_ = true;
return error;
}
......@@ -1297,8 +1277,8 @@ HttpStreamFactory::JobFactory::CreateMainJob(
return std::make_unique<HttpStreamFactory::Job>(
delegate, job_type, session, request_info, priority, proxy_info,
server_ssl_config, proxy_ssl_config, destination, origin_url,
kProtoUnknown, quic::ParsedQuicVersion::Unsupported(), ProxyServer(),
is_websocket, enable_ip_based_pooling, net_log);
kProtoUnknown, quic::ParsedQuicVersion::Unsupported(), is_websocket,
enable_ip_based_pooling, net_log);
}
std::unique_ptr<HttpStreamFactory::Job>
......@@ -1321,31 +1301,8 @@ HttpStreamFactory::JobFactory::CreateAltSvcJob(
return std::make_unique<HttpStreamFactory::Job>(
delegate, job_type, session, request_info, priority, proxy_info,
server_ssl_config, proxy_ssl_config, destination, origin_url,
alternative_protocol, quic_version, ProxyServer(), is_websocket,
enable_ip_based_pooling, net_log);
}
std::unique_ptr<HttpStreamFactory::Job>
HttpStreamFactory::JobFactory::CreateAltProxyJob(
HttpStreamFactory::Job::Delegate* delegate,
HttpStreamFactory::JobType job_type,
HttpNetworkSession* session,
const HttpRequestInfo& request_info,
RequestPriority priority,
const ProxyInfo& proxy_info,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HostPortPair destination,
GURL origin_url,
const ProxyServer& alternative_proxy_server,
bool is_websocket,
bool enable_ip_based_pooling,
NetLog* net_log) {
return std::make_unique<HttpStreamFactory::Job>(
delegate, job_type, session, request_info, priority, proxy_info,
server_ssl_config, proxy_ssl_config, destination, origin_url,
kProtoUnknown, quic::ParsedQuicVersion::Unsupported(),
alternative_proxy_server, is_websocket, enable_ip_based_pooling, net_log);
alternative_protocol, quic_version, is_websocket, enable_ip_based_pooling,
net_log);
}
bool HttpStreamFactory::Job::ShouldThrottleConnectForSpdy() const {
......
......@@ -147,13 +147,6 @@ class HttpStreamFactory::Job
// Note that this can be overwritten by specifying a QUIC proxy in
// |proxy_info|, or by setting
// HttpNetworkSession::Params::origins_to_force_quic_on.
//
// If |alternative_proxy_server| is a valid proxy server, then the Job will
// use that instead of using ProxyResolutionService for proxy resolution.
// Further, if |alternative_proxy_server| is a valid but bad proxy, then
// fallback proxies are not used. It is illegal to call this constructor with
// a valid |alternative_proxy_server| and an |alternate_protocol| different
// from kProtoUnknown.
Job(Delegate* delegate,
JobType job_type,
HttpNetworkSession* session,
......@@ -166,7 +159,6 @@ class HttpStreamFactory::Job
GURL origin_url,
NextProto alternative_protocol,
quic::ParsedQuicVersion quic_version,
const ProxyServer& alternative_proxy_server,
bool is_websocket,
bool enable_ip_based_pooling,
NetLog* net_log);
......@@ -218,10 +210,6 @@ class HttpStreamFactory::Job
JobType job_type() const { return job_type_; }
const ProxyServer alternative_proxy_server() const {
return alternative_proxy_server_;
}
bool using_existing_quic_session() const {
return using_existing_quic_session_;
}
......@@ -380,10 +368,6 @@ class HttpStreamFactory::Job
// original request when host mapping rules are set-up.
const GURL origin_url_;
// Alternative proxy server that should be used by |this| to fetch the
// request.
const ProxyServer alternative_proxy_server_;
// True if request is for Websocket.
const bool is_websocket_;
......@@ -520,22 +504,6 @@ class HttpStreamFactory::JobFactory {
bool is_websocket,
bool enable_ip_based_pooling,
NetLog* net_log);
virtual std::unique_ptr<HttpStreamFactory::Job> CreateAltProxyJob(
HttpStreamFactory::Job::Delegate* delegate,
HttpStreamFactory::JobType job_type,
HttpNetworkSession* session,
const HttpRequestInfo& request_info,
RequestPriority priority,
const ProxyInfo& proxy_info,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HostPortPair destination,
GURL origin_url,
const ProxyServer& alternative_proxy_server,
bool is_websocket,
bool enable_ip_based_pooling,
NetLog* net_log);
};
} // namespace net
......
......@@ -93,7 +93,6 @@ HttpStreamFactory::JobController::JobController(
main_job_is_blocked_(false),
main_job_is_resumed_(false),
bound_job_(nullptr),
can_start_alternative_proxy_job_(true),
next_state_(STATE_RESOLVE_PROXY),
proxy_resolve_request_(nullptr),
request_info_(request_info),
......@@ -296,11 +295,7 @@ void HttpStreamFactory::JobController::OnStreamFailed(
const SSLConfig& used_ssl_config) {
if (job->job_type() == ALTERNATIVE) {
DCHECK_EQ(alternative_job_.get(), job);
if (alternative_job_->alternative_proxy_server().is_valid()) {
OnAlternativeProxyJobFailed(status);
} else {
OnAlternativeServiceJobFailed(status);
}
OnAlternativeServiceJobFailed(status);
} else {
DCHECK_EQ(main_job_.get(), job);
main_job_net_error_ = status;
......@@ -729,23 +724,8 @@ int HttpStreamFactory::JobController::DoCreateJobs() {
main_job_is_blocked_ = true;
alternative_job_->Start(request_->stream_type());
} else {
ProxyInfo alternative_proxy_info;
if (ShouldCreateAlternativeProxyServerJob(proxy_info_, request_info_.url,
&alternative_proxy_info)) {
DCHECK(!main_job_is_blocked_);
alternative_job_ = job_factory_->CreateAltProxyJob(
this, ALTERNATIVE, session_, request_info_, priority_,
alternative_proxy_info, server_ssl_config_, proxy_ssl_config_,
destination, origin_url, alternative_proxy_info.proxy_server(),
is_websocket_, enable_ip_based_pooling_, net_log_.net_log());
can_start_alternative_proxy_job_ = false;
main_job_is_blocked_ = true;
alternative_job_->Start(request_->stream_type());
}
}
// Even if |alternative_job| has already finished, it will not have notified
// the request yet, since we defer that to the next iteration of the
// MessageLoop, so starting |main_job_| is always safe.
......@@ -840,24 +820,6 @@ void HttpStreamFactory::JobController::OnAlternativeServiceJobFailed(
alternative_job_net_error_ = net_error;
}
void HttpStreamFactory::JobController::OnAlternativeProxyJobFailed(
int net_error) {
DCHECK_EQ(alternative_job_->job_type(), ALTERNATIVE);
DCHECK_NE(OK, net_error);
DCHECK(alternative_job_->alternative_proxy_server().is_valid());
DCHECK(alternative_job_->alternative_proxy_server() ==
alternative_job_->proxy_info().proxy_server());
// Need to mark alt proxy as broken regardless of whether the job is bound.
// The proxy will be marked bad until the proxy retry information is cleared
// by an event such as a network change.
if (net_error != ERR_NETWORK_CHANGED &&
net_error != ERR_INTERNET_DISCONNECTED) {
session_->proxy_resolution_service()->MarkProxiesAsBadUntil(
alternative_job_->proxy_info(), base::TimeDelta::Max(), {}, net_log_);
}
}
void HttpStreamFactory::JobController::MaybeReportBrokenAlternativeService() {
// If alternative job succeeds on the default network, no brokenness to
// report.
......@@ -1015,7 +977,7 @@ HttpStreamFactory::JobController::GetAlternativeServiceInfoInternal(
if (!is_any_broken) {
// Only log the broken alternative service once per request.
is_any_broken = true;
HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_BROKEN, false,
HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_BROKEN,
HasGoogleHost(original_url));
}
continue;
......@@ -1117,77 +1079,27 @@ quic::ParsedQuicVersion HttpStreamFactory::JobController::SelectQuicVersion(
return quic::ParsedQuicVersion::Unsupported();
}
bool HttpStreamFactory::JobController::ShouldCreateAlternativeProxyServerJob(
const ProxyInfo& proxy_info,
const GURL& url,
ProxyInfo* alternative_proxy_info) const {
DCHECK(alternative_proxy_info->is_empty());
if (!enable_alternative_services_)
return false;
if (!can_start_alternative_proxy_job_) {
// Either an alternative service job or an alternative proxy server job has
// already been started.
return false;
}
if (proxy_info.is_empty() || proxy_info.is_direct() || proxy_info.is_quic()) {
// Alternative proxy server job can be created only if |job| fetches the
// |request_| through a non-QUIC proxy.
return false;
}
if (!url.SchemeIs(url::kHttpScheme)) {
// Only HTTP URLs can be fetched through alternative proxy server, since the
// alternative proxy server may not support fetching of URLs with other
// schemes.
return false;
}
alternative_proxy_info->UseProxyServer(proxy_info.alternative_proxy());
if (alternative_proxy_info->is_empty())
return false;
DCHECK(alternative_proxy_info->proxy_server() != proxy_info.proxy_server());
if (!alternative_proxy_info->is_secure_http_like()) {
// Alternative proxy server should be a secure server.
return false;
}
if (alternative_proxy_info->is_quic()) {
// Check that QUIC is enabled globally.
if (!session_->IsQuicEnabled())
return false;
}
return true;
}
void HttpStreamFactory::JobController::ReportAlternateProtocolUsage(
Job* job) const {
DCHECK(main_job_ && alternative_job_);
bool proxy_server_used =
alternative_job_->alternative_proxy_server().is_quic();
bool is_google_host = HasGoogleHost(job->origin_url());
if (job == main_job_.get()) {
HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_LOST_RACE,
proxy_server_used, is_google_host);
is_google_host);
return;
}
DCHECK_EQ(alternative_job_.get(), job);
if (job->using_existing_quic_session()) {
HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_NO_RACE,
proxy_server_used, is_google_host);
is_google_host);
return;
}
HistogramAlternateProtocolUsage(ALTERNATE_PROTOCOL_USAGE_WON_RACE,
proxy_server_used, is_google_host);
is_google_host);
}
bool HttpStreamFactory::JobController::IsJobOrphaned(Job* job) const {
......@@ -1204,8 +1116,6 @@ int HttpStreamFactory::JobController::ReconsiderProxyAfterError(Job* job,
if (!job->should_reconsider_proxy())
return error;
DCHECK(!job->alternative_proxy_server().is_valid());
if (request_info_.load_flags & LOAD_BYPASS_PROXY)
return error;
......
......@@ -208,10 +208,6 @@ class HttpStreamFactory::JobController
// net error of the failed alternative service job.
void OnAlternativeServiceJobFailed(int net_error);
// Must be called when the alternative proxy job fails. |net_error| is the
// net error of the failed alternative proxy job.
void OnAlternativeProxyJobFailed(int net_error);
// Called when all Jobs complete. Reports alternative service brokenness to
// HttpServerProperties if apply and resets net errors afterwards:
// - report broken if the main job has no error and the alternative job has an
......@@ -257,15 +253,6 @@ class HttpStreamFactory::JobController
quic::ParsedQuicVersion SelectQuicVersion(
const quic::ParsedQuicVersionVector& advertised_versions);
// Returns true if the |request_| can be fetched via an alternative
// proxy server, and sets |alternative_proxy_info| to the alternative proxy
// server configuration. |alternative_proxy_info| should not be null,
// and is owned by the caller.
bool ShouldCreateAlternativeProxyServerJob(
const ProxyInfo& proxy_info_,
const GURL& url,
ProxyInfo* alternative_proxy_info) const;
// Records histogram metrics for the usage of alternative protocol. Must be
// called when |job| has succeeded and the other job will be orphaned.
void ReportAlternateProtocolUsage(Job* job) const;
......@@ -345,9 +332,6 @@ class HttpStreamFactory::JobController
// It will be nulled when the |request_| is finished.
Job* bound_job_;
// True if an alternative proxy server job can be started to fetch |request_|.
bool can_start_alternative_proxy_job_;
State next_state_;
std::unique_ptr<ProxyResolutionRequest> proxy_resolve_request_;
const HttpRequestInfo request_info_;
......
......@@ -28,7 +28,6 @@ MockHttpStreamFactoryJob::MockHttpStreamFactoryJob(
GURL origin_url,
NextProto alternative_protocol,
quic::ParsedQuicVersion quic_version,
const ProxyServer& alternative_proxy_server,
bool is_websocket,
bool enable_ip_based_pooling,
NetLog* net_log)
......@@ -44,7 +43,6 @@ MockHttpStreamFactoryJob::MockHttpStreamFactoryJob(
origin_url,
alternative_protocol,
quic_version,
alternative_proxy_server,
is_websocket,
enable_ip_based_pooling,
net_log) {
......@@ -80,7 +78,7 @@ std::unique_ptr<HttpStreamFactory::Job> TestJobFactory::CreateMainJob(
auto main_job = std::make_unique<MockHttpStreamFactoryJob>(
delegate, job_type, session, request_info, priority, proxy_info,
SSLConfig(), SSLConfig(), destination, origin_url, kProtoUnknown,
quic::ParsedQuicVersion::Unsupported(), ProxyServer(), is_websocket,
quic::ParsedQuicVersion::Unsupported(), is_websocket,
enable_ip_based_pooling, net_log);
// Keep raw pointer to Job but pass ownership.
......@@ -108,35 +106,7 @@ std::unique_ptr<HttpStreamFactory::Job> TestJobFactory::CreateAltSvcJob(
auto alternative_job = std::make_unique<MockHttpStreamFactoryJob>(
delegate, job_type, session, request_info, priority, proxy_info,
SSLConfig(), SSLConfig(), destination, origin_url, alternative_protocol,
quic_version, ProxyServer(), is_websocket, enable_ip_based_pooling,
net_log);
// Keep raw pointer to Job but pass ownership.
alternative_job_ = alternative_job.get();
return std::move(alternative_job);
}
std::unique_ptr<HttpStreamFactory::Job> TestJobFactory::CreateAltProxyJob(
HttpStreamFactory::Job::Delegate* delegate,
HttpStreamFactory::JobType job_type,
HttpNetworkSession* session,
const HttpRequestInfo& request_info,
RequestPriority priority,
const ProxyInfo& proxy_info,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HostPortPair destination,
GURL origin_url,
const ProxyServer& alternative_proxy_server,
bool is_websocket,
bool enable_ip_based_pooling,
NetLog* net_log) {
auto alternative_job = std::make_unique<MockHttpStreamFactoryJob>(
delegate, job_type, session, request_info, priority, proxy_info,
SSLConfig(), SSLConfig(), destination, origin_url, kProtoUnknown,
quic::ParsedQuicVersion::Unsupported(), alternative_proxy_server,
is_websocket, enable_ip_based_pooling, net_log);
quic_version, is_websocket, enable_ip_based_pooling, net_log);
// Keep raw pointer to Job but pass ownership.
alternative_job_ = alternative_job.get();
......
......@@ -8,7 +8,6 @@
#include <memory>
#include "base/memory/ptr_util.h"
#include "net/base/proxy_server.h"
#include "net/http/http_stream.h"
#include "net/http/http_stream_factory.h"
#include "net/http/http_stream_factory_job.h"
......@@ -114,7 +113,6 @@ class MockHttpStreamFactoryJob : public HttpStreamFactory::Job {
GURL origin_url,
NextProto alternative_protocol,
quic::ParsedQuicVersion quic_version,
const ProxyServer& alternative_proxy_server,
bool is_websocket,
bool enable_ip_based_pooling,
NetLog* net_log);
......@@ -164,22 +162,6 @@ class TestJobFactory : public HttpStreamFactory::JobFactory {
bool enable_ip_based_pooling,
NetLog* net_log) override;
std::unique_ptr<HttpStreamFactory::Job> CreateAltProxyJob(
HttpStreamFactory::Job::Delegate* delegate,
HttpStreamFactory::JobType job_type,
HttpNetworkSession* session,
const HttpRequestInfo& request_info,
RequestPriority priority,
const ProxyInfo& proxy_info,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HostPortPair destination,
GURL origin_url,
const ProxyServer& alternative_proxy_server,
bool is_websocket,
bool enable_ip_based_pooling,
NetLog* net_log) override;
MockHttpStreamFactoryJob* main_job() const { return main_job_; }
MockHttpStreamFactoryJob* alternative_job() const { return alternative_job_; }
......
This diff is collapsed.
......@@ -19,7 +19,6 @@ void ProxyInfo::Use(const ProxyInfo& other) {
proxy_resolve_end_time_ = other.proxy_resolve_end_time_;
proxy_list_ = other.proxy_list_;
proxy_retry_info_ = other.proxy_retry_info_;
traffic_annotation_ = other.traffic_annotation_;
did_bypass_proxy_ = other.did_bypass_proxy_;
}
......@@ -57,10 +56,6 @@ void ProxyInfo::OverrideProxyList(const ProxyList& proxy_list) {
proxy_list_ = proxy_list;
}
void ProxyInfo::SetAlternativeProxy(const ProxyServer& proxy_server) {
alternative_proxy_ = proxy_server;
}
std::string ProxyInfo::ToPacString() const {
return proxy_list_.ToPacString();
}
......@@ -82,9 +77,7 @@ void ProxyInfo::Reset() {
proxy_resolve_start_time_ = base::TimeTicks();
proxy_resolve_end_time_ = base::TimeTicks();
proxy_list_.Clear();
alternative_proxy_ = net::ProxyServer();
proxy_retry_info_.clear();
traffic_annotation_.reset();
did_bypass_proxy_ = false;
}
......
......@@ -67,10 +67,6 @@ class NET_EXPORT ProxyInfo {
// proxy configuration.
void OverrideProxyList(const ProxyList& proxy_list);
// Sets the alternative service to try when connecting to the first valid
// proxy server, but does not otherwise reset the proxy configuration.
void SetAlternativeProxy(const ProxyServer& proxy_server);
// Returns true if this proxy info specifies a direct connection.
bool is_direct() const {
// We don't implicitly fallback to DIRECT unless it was added to the list.
......@@ -161,9 +157,6 @@ class NET_EXPORT ProxyInfo {
// Deletes any entry which doesn't have one of the specified proxy schemes.
void RemoveProxiesWithoutScheme(int scheme_bit_field);
// Returns the alternative proxy, which may be invalid.
const ProxyServer& alternative_proxy() const { return alternative_proxy_; }
void set_proxy_resolve_start_time(
const base::TimeTicks& proxy_resolve_start_time) {
proxy_resolve_start_time_ = proxy_resolve_start_time;
......@@ -203,10 +196,6 @@ class NET_EXPORT ProxyInfo {
// try. If proxy_list_ is empty, then there is nothing left to fall back to.
ProxyList proxy_list_;
// An alternative to proxy_server() (in the sense of HTTP Alternative
// Services).
ProxyServer alternative_proxy_;
// List of proxies that have been tried already.
ProxyRetryInfoMap proxy_retry_info_;
......
......@@ -103,8 +103,6 @@ TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxySuccessHttpProxy) {
expected_proxy_list.AddProxyServer(
net::ProxyServer::FromPacString("PROXY foo"));
EXPECT_TRUE(result.proxy_list().Equals(expected_proxy_list));
// HTTP proxies are not used as alternative QUIC proxies.
EXPECT_FALSE(result.alternative_proxy().is_valid());
}
TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxySuccessHttpsUrl) {
......@@ -150,7 +148,6 @@ TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyNoRuleForHttpsUrl) {
&result);
EXPECT_TRUE(result.is_direct());
EXPECT_FALSE(result.alternative_proxy().is_valid());
}
TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyLocalhost) {
......@@ -164,7 +161,6 @@ TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyLocalhost) {
&result);
EXPECT_TRUE(result.is_direct());
EXPECT_FALSE(result.alternative_proxy().is_valid());
}
TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyEmptyConfig) {
......@@ -176,7 +172,6 @@ TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyEmptyConfig) {
&result);
EXPECT_TRUE(result.is_direct());
EXPECT_FALSE(result.alternative_proxy().is_valid());
}
TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyNonIdempotentMethod) {
......@@ -190,7 +185,6 @@ TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyNonIdempotentMethod) {
&result);
EXPECT_TRUE(result.is_direct());
EXPECT_FALSE(result.alternative_proxy().is_valid());
}
TEST_F(NetworkServiceProxyDelegateTest,
......@@ -225,7 +219,6 @@ TEST_F(NetworkServiceProxyDelegateTest,
&result);
EXPECT_TRUE(result.is_direct());
EXPECT_FALSE(result.alternative_proxy().is_valid());
}
TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyDoesNotOverrideExisting) {
......@@ -243,7 +236,6 @@ TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyDoesNotOverrideExisting) {
expected_proxy_list.AddProxyServer(
net::ProxyServer::FromPacString("PROXY bar"));
EXPECT_TRUE(result.proxy_list().Equals(expected_proxy_list));
EXPECT_FALSE(result.alternative_proxy().is_valid());
}
TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyOverridesExisting) {
......@@ -261,7 +253,6 @@ TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyOverridesExisting) {
expected_proxy_list.AddProxyServer(
net::ProxyServer::FromPacString("PROXY foo"));
EXPECT_TRUE(result.proxy_list().Equals(expected_proxy_list));
EXPECT_FALSE(result.alternative_proxy().is_valid());
}
TEST_F(NetworkServiceProxyDelegateTest, OnResolveProxyDeprioritizesBadProxies) {
......
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