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

Side by Side Diff: google_apis/gcm/engine/connection_factory_impl.cc

Issue 1684123004: Bypass the DataReductionProxy for all POST requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing nit issues and Rebase Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "google_apis/gcm/engine/connection_factory_impl.h" 5 #include "google_apis/gcm/engine/connection_factory_impl.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "base/profiler/scoped_tracker.h" 10 #include "base/profiler/scoped_tracker.h"
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 300
301 // TODO(zea): if the network is offline, don't attempt to connect. 301 // TODO(zea): if the network is offline, don't attempt to connect.
302 // See crbug.com/396687 302 // See crbug.com/396687
303 303
304 connecting_ = true; 304 connecting_ = true;
305 GURL current_endpoint = GetCurrentEndpoint(); 305 GURL current_endpoint = GetCurrentEndpoint();
306 recorder_->RecordConnectionInitiated(current_endpoint.host()); 306 recorder_->RecordConnectionInitiated(current_endpoint.host());
307 RebuildNetworkSessionAuthCache(); 307 RebuildNetworkSessionAuthCache();
308 int status = gcm_network_session_->proxy_service()->ResolveProxy( 308 int status = gcm_network_session_->proxy_service()->ResolveProxy(
309 current_endpoint, 309 current_endpoint,
310 std::string(),
bengr 2016/02/26 23:43:33 #include <string>
310 net::LOAD_NORMAL, 311 net::LOAD_NORMAL,
311 &proxy_info_, 312 &proxy_info_,
312 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone, 313 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone,
313 weak_ptr_factory_.GetWeakPtr()), 314 weak_ptr_factory_.GetWeakPtr()),
314 &pac_request_, 315 &pac_request_,
315 NULL, 316 NULL,
316 bound_net_log_); 317 bound_net_log_);
317 if (status != net::ERR_IO_PENDING) 318 if (status != net::ERR_IO_PENDING)
318 OnProxyResolveDone(status); 319 OnProxyResolveDone(status);
319 } 320 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 } 524 }
524 525
525 net::SSLConfig ssl_config; 526 net::SSLConfig ssl_config;
526 gcm_network_session_->ssl_config_service()->GetSSLConfig(&ssl_config); 527 gcm_network_session_->ssl_config_service()->GetSSLConfig(&ssl_config);
527 if (proxy_info_.is_https() && ssl_config.send_client_cert) { 528 if (proxy_info_.is_https() && ssl_config.send_client_cert) {
528 gcm_network_session_->ssl_client_auth_cache()->Remove( 529 gcm_network_session_->ssl_client_auth_cache()->Remove(
529 proxy_info_.proxy_server().host_port_pair()); 530 proxy_info_.proxy_server().host_port_pair());
530 } 531 }
531 532
532 int status = gcm_network_session_->proxy_service()->ReconsiderProxyAfterError( 533 int status = gcm_network_session_->proxy_service()->ReconsiderProxyAfterError(
533 GetCurrentEndpoint(), net::LOAD_NORMAL, error, &proxy_info_, 534 GetCurrentEndpoint(),
535 std::string(), net::LOAD_NORMAL, error, &proxy_info_,
534 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone, 536 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone,
535 weak_ptr_factory_.GetWeakPtr()), 537 weak_ptr_factory_.GetWeakPtr()),
536 &pac_request_, 538 &pac_request_,
537 NULL, 539 NULL,
538 bound_net_log_); 540 bound_net_log_);
539 if (status == net::OK || status == net::ERR_IO_PENDING) { 541 if (status == net::OK || status == net::ERR_IO_PENDING) {
540 CloseSocket(); 542 CloseSocket();
541 } else { 543 } else {
542 // If ReconsiderProxyAfterError() failed synchronously, it means 544 // If ReconsiderProxyAfterError() failed synchronously, it means
543 // there was nothing left to fall-back to, so fail the transaction 545 // there was nothing left to fall-back to, so fail the transaction
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 577
576 void ConnectionFactoryImpl::RebuildNetworkSessionAuthCache() { 578 void ConnectionFactoryImpl::RebuildNetworkSessionAuthCache() {
577 if (!http_network_session_ || !http_network_session_->http_auth_cache()) 579 if (!http_network_session_ || !http_network_session_->http_auth_cache())
578 return; 580 return;
579 581
580 gcm_network_session_->http_auth_cache()->UpdateAllFrom( 582 gcm_network_session_->http_auth_cache()->UpdateAllFrom(
581 *http_network_session_->http_auth_cache()); 583 *http_network_session_->http_auth_cache());
582 } 584 }
583 585
584 } // namespace gcm 586 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698