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

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

Issue 332313003: Add Finch experiment for selectively bypassing proxies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: callback design (not yet done) Created 6 years, 6 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/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.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 "google_apis/gcm/engine/connection_handler_impl.h" 10 #include "google_apis/gcm/engine/connection_handler_impl.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 DCHECK(!socket_handle_.socket()); 273 DCHECK(!socket_handle_.socket());
274 274
275 if (waiting_for_network_online_) 275 if (waiting_for_network_online_)
276 return; 276 return;
277 277
278 connecting_ = true; 278 connecting_ = true;
279 GURL current_endpoint = GetCurrentEndpoint(); 279 GURL current_endpoint = GetCurrentEndpoint();
280 recorder_->RecordConnectionInitiated(current_endpoint.host()); 280 recorder_->RecordConnectionInitiated(current_endpoint.host());
281 int status = network_session_->proxy_service()->ResolveProxy( 281 int status = network_session_->proxy_service()->ResolveProxy(
282 current_endpoint, 282 current_endpoint,
283 0,
283 &proxy_info_, 284 &proxy_info_,
284 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone, 285 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone,
285 weak_ptr_factory_.GetWeakPtr()), 286 weak_ptr_factory_.GetWeakPtr()),
286 &pac_request_, 287 &pac_request_,
287 bound_net_log_); 288 bound_net_log_);
288 if (status != net::ERR_IO_PENDING) 289 if (status != net::ERR_IO_PENDING)
289 OnProxyResolveDone(status); 290 OnProxyResolveDone(status);
290 } 291 }
291 292
292 void ConnectionFactoryImpl::InitHandler() { 293 void ConnectionFactoryImpl::InitHandler() {
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 // the destroyed socket. 534 // the destroyed socket.
534 if (connection_handler_) 535 if (connection_handler_)
535 connection_handler_->Reset(); 536 connection_handler_->Reset();
536 537
537 if (socket_handle_.socket() && socket_handle_.socket()->IsConnected()) 538 if (socket_handle_.socket() && socket_handle_.socket()->IsConnected())
538 socket_handle_.socket()->Disconnect(); 539 socket_handle_.socket()->Disconnect();
539 socket_handle_.Reset(); 540 socket_handle_.Reset();
540 } 541 }
541 542
542 } // namespace gcm 543 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698