Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc

Issue 2442633002: Add a QUIC proxy server to the list of QUIC servers supported at start up (Closed)
Patch Set: Rebased, Addressed ryansturm comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
index b6b8f379ce37dca3bb79d6e9b0397783a82315e6..840195645629719bfd7dde5d071b35a3bf35eca7 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate.cc
@@ -18,7 +18,6 @@
#include "net/base/url_util.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
-#include "net/proxy/proxy_server.h"
#include "net/proxy/proxy_service.h"
namespace data_reduction_proxy {
@@ -145,6 +144,27 @@ void DataReductionProxyDelegate::OnAlternativeProxyBroken(
1);
}
+net::ProxyServer
+DataReductionProxyDelegate::GetQuicSupportedProxyServerAtStartUp() const {
+ if (!params::IsIncludedInQuicFieldTrial())
+ return net::ProxyServer();
+
+ if (alternative_proxies_broken_) {
+ RecordQuicProxyAtStartupStatus(QUIC_PROXY_AT_STARTUP_BROKEN);
+ return net::ProxyServer();
+ }
+
+ net::ProxyServer proxy_server(net::ProxyServer::SCHEME_QUIC,
+ net::HostPortPair("proxy.googlezip.net", 443));
RyanSturm 2016/10/24 18:01:07 nit: is it worth declaring "proxy.googlezip.net" a
tbansal1 2016/10/24 18:36:07 Done.
+ if (!config_ || !config_->IsDataReductionProxy(proxy_server, NULL)) {
+ RecordQuicProxyAtStartupStatus(QUIC_PROXY_AT_STARTUP_UNAVAILABLE);
+ return net::ProxyServer();
+ }
+
+ RecordQuicProxyAtStartupStatus(QUIC_PROXY_AT_STARTUP_AVAILABLE);
+ return proxy_server;
+}
+
bool DataReductionProxyDelegate::SupportsQUIC(
const net::ProxyServer& proxy_server) const {
// Enable QUIC for whitelisted proxies.
@@ -160,6 +180,13 @@ void DataReductionProxyDelegate::RecordQuicProxyStatus(
QUIC_PROXY_STATUS_BOUNDARY);
}
+void DataReductionProxyDelegate::RecordQuicProxyAtStartupStatus(
+ QuicProxyAtStartup status) const {
+ UMA_HISTOGRAM_ENUMERATION(
+ "DataReductionProxy.Quic.ProxyServerAtStartUpQueried", status,
+ QUIC_PROXY_AT_STARTUP_BOUNDARY);
+}
+
void OnResolveProxyHandler(const GURL& url,
const std::string& method,
const net::ProxyConfig& data_reduction_proxy_config,

Powered by Google App Engine
This is Rietveld 408576698