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

Side by Side Diff: remoting/host/signaling_connector.h

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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
« no previous file with comments | « remoting/host/setup/start_host.cc ('k') | remoting/host/signaling_connector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef REMOTING_HOST_SIGNALING_CONNECTOR_H_ 5 #ifndef REMOTING_HOST_SIGNALING_CONNECTOR_H_
6 #define REMOTING_HOST_SIGNALING_CONNECTOR_H_ 6 #define REMOTING_HOST_SIGNALING_CONNECTOR_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/threading/non_thread_safe.h" 10 #include "base/threading/non_thread_safe.h"
(...skipping 14 matching lines...) Expand all
25 // whenever connection type changes or IP address changes. 25 // whenever connection type changes or IP address changes.
26 class SignalingConnector 26 class SignalingConnector
27 : public base::SupportsWeakPtr<SignalingConnector>, 27 : public base::SupportsWeakPtr<SignalingConnector>,
28 public base::NonThreadSafe, 28 public base::NonThreadSafe,
29 public SignalStrategy::Listener, 29 public SignalStrategy::Listener,
30 public net::NetworkChangeNotifier::ConnectionTypeObserver, 30 public net::NetworkChangeNotifier::ConnectionTypeObserver,
31 public net::NetworkChangeNotifier::IPAddressObserver { 31 public net::NetworkChangeNotifier::IPAddressObserver {
32 public: 32 public:
33 // The |auth_failed_callback| is called when authentication fails. 33 // The |auth_failed_callback| is called when authentication fails.
34 SignalingConnector(XmppSignalStrategy* signal_strategy, 34 SignalingConnector(XmppSignalStrategy* signal_strategy,
35 scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker, 35 std::unique_ptr<DnsBlackholeChecker> dns_blackhole_checker,
36 OAuthTokenGetter* oauth_token_getter, 36 OAuthTokenGetter* oauth_token_getter,
37 const base::Closure& auth_failed_callback); 37 const base::Closure& auth_failed_callback);
38 ~SignalingConnector() override; 38 ~SignalingConnector() override;
39 39
40 // OAuthTokenGetter callback. 40 // OAuthTokenGetter callback.
41 void OnAccessToken(OAuthTokenGetter::Status status, 41 void OnAccessToken(OAuthTokenGetter::Status status,
42 const std::string& user_email, 42 const std::string& user_email,
43 const std::string& access_token); 43 const std::string& access_token);
44 44
45 // SignalStrategy::Listener interface. 45 // SignalStrategy::Listener interface.
46 void OnSignalStrategyStateChange(SignalStrategy::State state) override; 46 void OnSignalStrategyStateChange(SignalStrategy::State state) override;
47 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override; 47 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override;
48 48
49 // NetworkChangeNotifier::ConnectionTypeObserver interface. 49 // NetworkChangeNotifier::ConnectionTypeObserver interface.
50 void OnConnectionTypeChanged( 50 void OnConnectionTypeChanged(
51 net::NetworkChangeNotifier::ConnectionType type) override; 51 net::NetworkChangeNotifier::ConnectionType type) override;
52 52
53 // NetworkChangeNotifier::IPAddressObserver interface. 53 // NetworkChangeNotifier::IPAddressObserver interface.
54 void OnIPAddressChanged() override; 54 void OnIPAddressChanged() override;
55 55
56 private: 56 private:
57 void OnNetworkError(); 57 void OnNetworkError();
58 void ScheduleTryReconnect(); 58 void ScheduleTryReconnect();
59 void ResetAndTryReconnect(); 59 void ResetAndTryReconnect();
60 void TryReconnect(); 60 void TryReconnect();
61 void OnDnsBlackholeCheckerDone(bool allow); 61 void OnDnsBlackholeCheckerDone(bool allow);
62 62
63 XmppSignalStrategy* signal_strategy_; 63 XmppSignalStrategy* signal_strategy_;
64 base::Closure auth_failed_callback_; 64 base::Closure auth_failed_callback_;
65 scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker_; 65 std::unique_ptr<DnsBlackholeChecker> dns_blackhole_checker_;
66 66
67 OAuthTokenGetter* oauth_token_getter_; 67 OAuthTokenGetter* oauth_token_getter_;
68 68
69 // Number of times we tried to connect without success. 69 // Number of times we tried to connect without success.
70 int reconnect_attempts_; 70 int reconnect_attempts_;
71 71
72 base::OneShotTimer timer_; 72 base::OneShotTimer timer_;
73 73
74 DISALLOW_COPY_AND_ASSIGN(SignalingConnector); 74 DISALLOW_COPY_AND_ASSIGN(SignalingConnector);
75 }; 75 };
76 76
77 } // namespace remoting 77 } // namespace remoting
78 78
79 #endif // REMOTING_HOST_SIGNALING_CONNECTOR_H_ 79 #endif // REMOTING_HOST_SIGNALING_CONNECTOR_H_
OLDNEW
« no previous file with comments | « remoting/host/setup/start_host.cc ('k') | remoting/host/signaling_connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698