From a702da7952a19cc3def379d573dca5a6c191273c Mon Sep 17 00:00:00 2001
From: "rcs@chromium.org"
 <rcs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Wed, 9 Jul 2014 05:23:54 +0000
Subject: Add Finch experiment for selectively bypassing proxies.

Add option to bypass the data compression proxy if the request resource
type (as inferred by the renderer process) is not an image.

For background, see this design doc:

https://docs.google.com/a/google.com/document/d/1Kz92Fmw3lv_R-2aNvLp8jW9lkfKOZciTZtni2qQ_Adc/edit

BUG=391836

Review URL: https://codereview.chromium.org/332313003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281951 0039d316-1c4b-4281-b951-d872f2087c98
---
 google_apis/gcm/engine/connection_factory_impl.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'google_apis/gcm/engine')

diff --git a/google_apis/gcm/engine/connection_factory_impl.cc b/google_apis/gcm/engine/connection_factory_impl.cc
index bc5a745..b1a43da 100644
--- a/google_apis/gcm/engine/connection_factory_impl.cc
+++ b/google_apis/gcm/engine/connection_factory_impl.cc
@@ -10,6 +10,7 @@
 #include "google_apis/gcm/engine/connection_handler_impl.h"
 #include "google_apis/gcm/monitoring/gcm_stats_recorder.h"
 #include "google_apis/gcm/protocol/mcs.pb.h"
+#include "net/base/load_flags.h"
 #include "net/base/net_errors.h"
 #include "net/http/http_network_session.h"
 #include "net/http/http_request_headers.h"
@@ -280,10 +281,12 @@ void ConnectionFactoryImpl::ConnectImpl() {
   recorder_->RecordConnectionInitiated(current_endpoint.host());
   int status = network_session_->proxy_service()->ResolveProxy(
       current_endpoint,
+      net::LOAD_NORMAL,
       &proxy_info_,
       base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone,
                  weak_ptr_factory_.GetWeakPtr()),
       &pac_request_,
+      NULL,
       bound_net_log_);
   if (status != net::ERR_IO_PENDING)
     OnProxyResolveDone(status);
@@ -497,10 +500,11 @@ int ConnectionFactoryImpl::ReconsiderProxyAfterError(int error) {
   }
 
   int status = network_session_->proxy_service()->ReconsiderProxyAfterError(
-      GetCurrentEndpoint(), error, &proxy_info_,
+      GetCurrentEndpoint(), net::LOAD_NORMAL, error, &proxy_info_,
       base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone,
                  weak_ptr_factory_.GetWeakPtr()),
       &pac_request_,
+      NULL,
       bound_net_log_);
   if (status == net::OK || status == net::ERR_IO_PENDING) {
     CloseSocket();
-- 
cgit v1.1