| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/host/signaling_connector.h" | 5 #include "remoting/host/signaling_connector.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "google_apis/google_api_keys.h" | 10 #include "google_apis/google_api_keys.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 SignalingConnector::SignalingConnector( | 41 SignalingConnector::SignalingConnector( |
| 42 XmppSignalStrategy* signal_strategy, | 42 XmppSignalStrategy* signal_strategy, |
| 43 scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker, | 43 scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker, |
| 44 OAuthTokenGetter* oauth_token_getter, | 44 OAuthTokenGetter* oauth_token_getter, |
| 45 const base::Closure& auth_failed_callback) | 45 const base::Closure& auth_failed_callback) |
| 46 : signal_strategy_(signal_strategy), | 46 : signal_strategy_(signal_strategy), |
| 47 auth_failed_callback_(auth_failed_callback), | 47 auth_failed_callback_(auth_failed_callback), |
| 48 dns_blackhole_checker_(dns_blackhole_checker.Pass()), | 48 dns_blackhole_checker_(std::move(dns_blackhole_checker)), |
| 49 oauth_token_getter_(oauth_token_getter), | 49 oauth_token_getter_(oauth_token_getter), |
| 50 reconnect_attempts_(0) { | 50 reconnect_attempts_(0) { |
| 51 DCHECK(!auth_failed_callback_.is_null()); | 51 DCHECK(!auth_failed_callback_.is_null()); |
| 52 DCHECK(dns_blackhole_checker_.get()); | 52 DCHECK(dns_blackhole_checker_.get()); |
| 53 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); | 53 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); |
| 54 net::NetworkChangeNotifier::AddIPAddressObserver(this); | 54 net::NetworkChangeNotifier::AddIPAddressObserver(this); |
| 55 signal_strategy_->AddListener(this); | 55 signal_strategy_->AddListener(this); |
| 56 ScheduleTryReconnect(); | 56 ScheduleTryReconnect(); |
| 57 } | 57 } |
| 58 | 58 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 179 } |
| 180 | 180 |
| 181 if (signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) { | 181 if (signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) { |
| 182 HOST_LOG << "Attempting to connect signaling."; | 182 HOST_LOG << "Attempting to connect signaling."; |
| 183 oauth_token_getter_->CallWithToken( | 183 oauth_token_getter_->CallWithToken( |
| 184 base::Bind(&SignalingConnector::OnAccessToken, AsWeakPtr())); | 184 base::Bind(&SignalingConnector::OnAccessToken, AsWeakPtr())); |
| 185 } | 185 } |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace remoting | 188 } // namespace remoting |
| OLD | NEW |