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

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: Resubmitting with upstream branch set to branch from issue 1680893002 Created 4 years, 10 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 net::LOAD_NORMAL, 310 net::LOAD_NORMAL,
311 &proxy_info_, 311 &proxy_info_,
312 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone, 312 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone,
313 weak_ptr_factory_.GetWeakPtr()), 313 weak_ptr_factory_.GetWeakPtr()),
314 &pac_request_, 314 &pac_request_,
315 NULL, 315 nullptr,
bengr 2016/02/16 20:00:13 NULL and std::string() here and at 538.
RyanSturm 2016/02/17 21:46:11 Done.
316 "",
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 }
320 321
321 void ConnectionFactoryImpl::InitHandler() { 322 void ConnectionFactoryImpl::InitHandler() {
322 // May be null in tests. 323 // May be null in tests.
323 mcs_proto::LoginRequest login_request; 324 mcs_proto::LoginRequest login_request;
324 if (!request_builder_.is_null()) { 325 if (!request_builder_.is_null()) {
325 request_builder_.Run(&login_request); 326 request_builder_.Run(&login_request);
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(), net::LOAD_NORMAL, error, &proxy_info_,
534 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone, 535 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone,
535 weak_ptr_factory_.GetWeakPtr()), 536 weak_ptr_factory_.GetWeakPtr()),
536 &pac_request_, 537 &pac_request_,
537 NULL, 538 nullptr,
539 "",
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
544 // with the last connection error we got. 546 // with the last connection error we got.
545 status = error; 547 status = error;
546 } 548 }
547 549
(...skipping 27 matching lines...) Expand all
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