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

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

Issue 719983002: Reporting of policy errors via host-offline-reason: part 3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hor-nohoststatussender
Patch Set: Rebasing... Created 5 years, 11 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/signaling_connector.h ('k') | remoting/remoting_host_srcs.gypi » ('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 #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
38 signal_strategy_->AddListener(this); 38 signal_strategy_->AddListener(this);
39 ScheduleTryReconnect(); 39 ScheduleTryReconnect();
40 } 40 }
41 41
42 SignalingConnector::~SignalingConnector() { 42 SignalingConnector::~SignalingConnector() {
43 signal_strategy_->RemoveListener(this); 43 signal_strategy_->RemoveListener(this);
44 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); 44 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
45 net::NetworkChangeNotifier::RemoveIPAddressObserver(this); 45 net::NetworkChangeNotifier::RemoveIPAddressObserver(this);
46 } 46 }
47 47
48 void SignalingConnector::EnableOAuth(OAuthTokenGetter* oauth_token_getter) { 48 void SignalingConnector::EnableOAuth(
49 oauth_token_getter_ = oauth_token_getter; 49 scoped_ptr<OAuthTokenGetter> oauth_token_getter) {
50 oauth_token_getter_ = oauth_token_getter.Pass();
50 } 51 }
51 52
52 void SignalingConnector::OnSignalStrategyStateChange( 53 void SignalingConnector::OnSignalStrategyStateChange(
53 SignalStrategy::State state) { 54 SignalStrategy::State state) {
54 DCHECK(CalledOnValidThread()); 55 DCHECK(CalledOnValidThread());
55 56
56 if (state == SignalStrategy::CONNECTED) { 57 if (state == SignalStrategy::CONNECTED) {
57 HOST_LOG << "Signaling connected."; 58 HOST_LOG << "Signaling connected.";
58 reconnect_attempts_ = 0; 59 reconnect_attempts_ = 0;
59 } else if (state == SignalStrategy::DISCONNECTED) { 60 } else if (state == SignalStrategy::DISCONNECTED) {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 168 }
168 169
169 if (signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) { 170 if (signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) {
170 HOST_LOG << "Attempting to connect signaling."; 171 HOST_LOG << "Attempting to connect signaling.";
171 oauth_token_getter_->CallWithToken( 172 oauth_token_getter_->CallWithToken(
172 base::Bind(&SignalingConnector::OnAccessToken, AsWeakPtr())); 173 base::Bind(&SignalingConnector::OnAccessToken, AsWeakPtr()));
173 } 174 }
174 } 175 }
175 176
176 } // namespace remoting 177 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/signaling_connector.h ('k') | remoting/remoting_host_srcs.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698