| OLD | NEW |
| 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 base::MessageLoop::current()->PostTask( | 528 base::MessageLoop::current()->PostTask( |
| 529 FROM_HERE, | 529 FROM_HERE, |
| 530 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone, | 530 base::Bind(&ConnectionFactoryImpl::OnProxyResolveDone, |
| 531 weak_ptr_factory_.GetWeakPtr(), status)); | 531 weak_ptr_factory_.GetWeakPtr(), status)); |
| 532 status = net::ERR_IO_PENDING; | 532 status = net::ERR_IO_PENDING; |
| 533 } | 533 } |
| 534 return status; | 534 return status; |
| 535 } | 535 } |
| 536 | 536 |
| 537 void ConnectionFactoryImpl::ReportSuccessfulProxyConnection() { | 537 void ConnectionFactoryImpl::ReportSuccessfulProxyConnection() { |
| 538 if (gcm_network_session_ && gcm_network_session_->proxy_service()) | 538 if (gcm_network_session_.get() && gcm_network_session_->proxy_service()) |
| 539 gcm_network_session_->proxy_service()->ReportSuccess(proxy_info_, NULL); | 539 gcm_network_session_->proxy_service()->ReportSuccess(proxy_info_, NULL); |
| 540 } | 540 } |
| 541 | 541 |
| 542 void ConnectionFactoryImpl::CloseSocket() { | 542 void ConnectionFactoryImpl::CloseSocket() { |
| 543 // The connection handler needs to be reset, else it'll attempt to keep using | 543 // The connection handler needs to be reset, else it'll attempt to keep using |
| 544 // the destroyed socket. | 544 // the destroyed socket. |
| 545 if (connection_handler_) | 545 if (connection_handler_) |
| 546 connection_handler_->Reset(); | 546 connection_handler_->Reset(); |
| 547 | 547 |
| 548 if (socket_handle_.socket() && socket_handle_.socket()->IsConnected()) | 548 if (socket_handle_.socket() && socket_handle_.socket()->IsConnected()) |
| 549 socket_handle_.socket()->Disconnect(); | 549 socket_handle_.socket()->Disconnect(); |
| 550 socket_handle_.Reset(); | 550 socket_handle_.Reset(); |
| 551 } | 551 } |
| 552 | 552 |
| 553 void ConnectionFactoryImpl::RebuildNetworkSessionAuthCache() { | 553 void ConnectionFactoryImpl::RebuildNetworkSessionAuthCache() { |
| 554 if (!http_network_session_ || !http_network_session_->http_auth_cache()) | 554 if (!http_network_session_.get() || !http_network_session_->http_auth_cache()) |
| 555 return; | 555 return; |
| 556 | 556 |
| 557 gcm_network_session_->http_auth_cache()->UpdateAllFrom( | 557 gcm_network_session_->http_auth_cache()->UpdateAllFrom( |
| 558 *http_network_session_->http_auth_cache()); | 558 *http_network_session_->http_auth_cache()); |
| 559 } | 559 } |
| 560 | 560 |
| 561 } // namespace gcm | 561 } // namespace gcm |
| OLD | NEW |