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 <utility> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
10 #include "google_apis/google_api_keys.h" | 12 #include "google_apis/google_api_keys.h" |
11 #include "net/url_request/url_fetcher.h" | 13 #include "net/url_request/url_fetcher.h" |
12 #include "net/url_request/url_request_context_getter.h" | 14 #include "net/url_request/url_request_context_getter.h" |
13 #include "remoting/base/logging.h" | 15 #include "remoting/base/logging.h" |
14 #include "remoting/host/dns_blackhole_checker.h" | 16 #include "remoting/host/dns_blackhole_checker.h" |
15 | 17 |
16 namespace remoting { | 18 namespace remoting { |
(...skipping 21 matching lines...) Expand all Loading... |
38 | 40 |
39 } // namespace | 41 } // namespace |
40 | 42 |
41 SignalingConnector::SignalingConnector( | 43 SignalingConnector::SignalingConnector( |
42 XmppSignalStrategy* signal_strategy, | 44 XmppSignalStrategy* signal_strategy, |
43 scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker, | 45 scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker, |
44 OAuthTokenGetter* oauth_token_getter, | 46 OAuthTokenGetter* oauth_token_getter, |
45 const base::Closure& auth_failed_callback) | 47 const base::Closure& auth_failed_callback) |
46 : signal_strategy_(signal_strategy), | 48 : signal_strategy_(signal_strategy), |
47 auth_failed_callback_(auth_failed_callback), | 49 auth_failed_callback_(auth_failed_callback), |
48 dns_blackhole_checker_(dns_blackhole_checker.Pass()), | 50 dns_blackhole_checker_(std::move(dns_blackhole_checker)), |
49 oauth_token_getter_(oauth_token_getter), | 51 oauth_token_getter_(oauth_token_getter), |
50 reconnect_attempts_(0) { | 52 reconnect_attempts_(0) { |
51 DCHECK(!auth_failed_callback_.is_null()); | 53 DCHECK(!auth_failed_callback_.is_null()); |
52 DCHECK(dns_blackhole_checker_.get()); | 54 DCHECK(dns_blackhole_checker_.get()); |
53 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); | 55 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); |
54 net::NetworkChangeNotifier::AddIPAddressObserver(this); | 56 net::NetworkChangeNotifier::AddIPAddressObserver(this); |
55 signal_strategy_->AddListener(this); | 57 signal_strategy_->AddListener(this); |
56 ScheduleTryReconnect(); | 58 ScheduleTryReconnect(); |
57 } | 59 } |
58 | 60 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 181 } |
180 | 182 |
181 if (signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) { | 183 if (signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) { |
182 HOST_LOG << "Attempting to connect signaling."; | 184 HOST_LOG << "Attempting to connect signaling."; |
183 oauth_token_getter_->CallWithToken( | 185 oauth_token_getter_->CallWithToken( |
184 base::Bind(&SignalingConnector::OnAccessToken, AsWeakPtr())); | 186 base::Bind(&SignalingConnector::OnAccessToken, AsWeakPtr())); |
185 } | 187 } |
186 } | 188 } |
187 | 189 |
188 } // namespace remoting | 190 } // namespace remoting |
OLD | NEW |