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

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

Issue 7008003: Wire in OAuth2 support into non-sandboxed connections in libjingle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chromoting_host.h" 5 #include "remoting/host/chromoting_host.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "remoting/base/constants.h" 8 #include "remoting/base/constants.h"
9 #include "remoting/base/encoder.h" 9 #include "remoting/base/encoder.h"
10 #include "remoting/base/encoder_row_based.h" 10 #include "remoting/base/encoder_row_based.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 if (state_ != kInitial) 88 if (state_ != kInitial)
89 return; 89 return;
90 state_ = kStarted; 90 state_ = kStarted;
91 } 91 }
92 92
93 // Save the shutdown task. 93 // Save the shutdown task.
94 shutdown_task_.reset(shutdown_task); 94 shutdown_task_.reset(shutdown_task);
95 95
96 std::string xmpp_login; 96 std::string xmpp_login;
97 std::string xmpp_auth_token; 97 std::string xmpp_auth_token;
98 std::string xmpp_auth_service;
98 if (!config_->GetString(kXmppLoginConfigPath, &xmpp_login) || 99 if (!config_->GetString(kXmppLoginConfigPath, &xmpp_login) ||
99 !config_->GetString(kXmppAuthTokenConfigPath, &xmpp_auth_token)) { 100 !config_->GetString(kXmppAuthTokenConfigPath, &xmpp_auth_token) ||
101 !config_->GetString(kXmppAuthServiceConfigPath, &xmpp_auth_service)) {
100 LOG(ERROR) << "XMPP credentials are not defined in the config."; 102 LOG(ERROR) << "XMPP credentials are not defined in the config.";
101 return; 103 return;
102 } 104 }
103 105
104 // Connect to the talk network with a JingleClient. 106 // Connect to the talk network with a JingleClient.
105 signal_strategy_.reset( 107 signal_strategy_.reset(
106 new XmppSignalStrategy(context_->jingle_thread(), xmpp_login, 108 new XmppSignalStrategy(context_->jingle_thread(), xmpp_login,
107 xmpp_auth_token, 109 xmpp_auth_token,
108 kChromotingTokenServiceName)); 110 xmpp_auth_service));
109 jingle_client_ = new JingleClient(context_->jingle_thread(), 111 jingle_client_ = new JingleClient(context_->jingle_thread(),
110 signal_strategy_.get(), 112 signal_strategy_.get(),
111 NULL, NULL, NULL, this); 113 NULL, NULL, NULL, this);
112 jingle_client_->Init(); 114 jingle_client_->Init();
113 } 115 }
114 116
115 // This method is called when we need to destroy the host process. 117 // This method is called when we need to destroy the host process.
116 void ChromotingHost::Shutdown() { 118 void ChromotingHost::Shutdown() {
117 if (MessageLoop::current() != context_->main_message_loop()) { 119 if (MessageLoop::current() != context_->main_message_loop()) {
118 context_->main_message_loop()->PostTask( 120 context_->main_message_loop()->PostTask(
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 ClientList::iterator client; 483 ClientList::iterator client;
482 for (client = clients_.begin(); client != clients_.end(); ++client) { 484 for (client = clients_.begin(); client != clients_.end(); ++client) {
483 if (client->get()->connection() == connection) 485 if (client->get()->connection() == connection)
484 break; 486 break;
485 } 487 }
486 CHECK(client != clients_.end()); 488 CHECK(client != clients_.end());
487 client->get()->OnAuthorizationComplete(true); 489 client->get()->OnAuthorizationComplete(true);
488 } 490 }
489 491
490 } // namespace remoting 492 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698