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

Unified Diff: remoting/host/remoting_me2me_host.cc

Issue 141063009: Separate access token caching logic from signaling connector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change C++11 swap() to plain old copy-and-clear. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/oauth_token_getter.cc ('k') | remoting/host/signaling_connector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index b4ab023aec71ba40e330b94eb16c68b1db2f74eb..1bf602e2b49dbc96d9452c6556e8578fa2b52300 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -274,6 +274,7 @@ class HostProcess
bool curtain_required_;
ThirdPartyAuthConfig third_party_auth_config_;
+ scoped_ptr<OAuthTokenGetter> oauth_token_getter_;
scoped_ptr<XmppSignalStrategy> signal_strategy_;
scoped_ptr<SignalingConnector> signaling_connector_;
scoped_ptr<HeartbeatSender> heartbeat_sender_;
@@ -987,16 +988,20 @@ void HostProcess::StartHost() {
signaling_connector_.reset(new SignalingConnector(
signal_strategy_.get(),
- context_->url_request_context_getter(),
dns_blackhole_checker.Pass(),
base::Bind(&HostProcess::OnAuthFailed, this)));
if (!oauth_refresh_token_.empty()) {
- scoped_ptr<SignalingConnector::OAuthCredentials> oauth_credentials(
- new SignalingConnector::OAuthCredentials(
+ scoped_ptr<OAuthTokenGetter::OAuthCredentials> oauth_credentials;
+ oauth_credentials.reset(
+ new OAuthTokenGetter::OAuthCredentials(
xmpp_server_config_.username, oauth_refresh_token_,
use_service_account_));
- signaling_connector_->EnableOAuth(oauth_credentials.Pass());
+
+ oauth_token_getter_.reset(new OAuthTokenGetter(
+ oauth_credentials.Pass(), context_->url_request_context_getter()));
+
+ signaling_connector_->EnableOAuth(oauth_token_getter_.get());
}
NetworkSettings network_settings(
@@ -1114,6 +1119,7 @@ void HostProcess::ShutdownOnNetworkThread() {
host_status_sender_.reset();
host_change_notification_listener_.reset();
signaling_connector_.reset();
+ oauth_token_getter_.reset();
signal_strategy_.reset();
network_change_notifier_.reset();
« no previous file with comments | « remoting/host/oauth_token_getter.cc ('k') | remoting/host/signaling_connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698