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> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 return "PROTOCOL_ERROR"; | 35 return "PROTOCOL_ERROR"; |
36 } | 36 } |
37 NOTREACHED(); | 37 NOTREACHED(); |
38 return ""; | 38 return ""; |
39 } | 39 } |
40 | 40 |
41 } // namespace | 41 } // namespace |
42 | 42 |
43 SignalingConnector::SignalingConnector( | 43 SignalingConnector::SignalingConnector( |
44 XmppSignalStrategy* signal_strategy, | 44 XmppSignalStrategy* signal_strategy, |
45 scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker, | 45 std::unique_ptr<DnsBlackholeChecker> dns_blackhole_checker, |
46 OAuthTokenGetter* oauth_token_getter, | 46 OAuthTokenGetter* oauth_token_getter, |
47 const base::Closure& auth_failed_callback) | 47 const base::Closure& auth_failed_callback) |
48 : signal_strategy_(signal_strategy), | 48 : signal_strategy_(signal_strategy), |
49 auth_failed_callback_(auth_failed_callback), | 49 auth_failed_callback_(auth_failed_callback), |
50 dns_blackhole_checker_(std::move(dns_blackhole_checker)), | 50 dns_blackhole_checker_(std::move(dns_blackhole_checker)), |
51 oauth_token_getter_(oauth_token_getter), | 51 oauth_token_getter_(oauth_token_getter), |
52 reconnect_attempts_(0) { | 52 reconnect_attempts_(0) { |
53 DCHECK(!auth_failed_callback_.is_null()); | 53 DCHECK(!auth_failed_callback_.is_null()); |
54 DCHECK(dns_blackhole_checker_.get()); | 54 DCHECK(dns_blackhole_checker_.get()); |
55 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); | 55 net::NetworkChangeNotifier::AddConnectionTypeObserver(this); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 } | 181 } |
182 | 182 |
183 if (signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) { | 183 if (signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) { |
184 HOST_LOG << "Attempting to connect signaling."; | 184 HOST_LOG << "Attempting to connect signaling."; |
185 oauth_token_getter_->CallWithToken( | 185 oauth_token_getter_->CallWithToken( |
186 base::Bind(&SignalingConnector::OnAccessToken, AsWeakPtr())); | 186 base::Bind(&SignalingConnector::OnAccessToken, AsWeakPtr())); |
187 } | 187 } |
188 } | 188 } |
189 | 189 |
190 } // namespace remoting | 190 } // namespace remoting |
OLD | NEW |