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

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

Issue 10378110: Verify that xmpp_login specified in the config matches auth token. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
« no previous file with comments | « no previous file | remoting/host/signaling_connector.h » ('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 // This file implements a standalone host process for Me2Me. 5 // This file implements a standalone host process for Me2Me.
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 void StartHost() { 305 void StartHost() {
306 DCHECK(context_->network_message_loop()->BelongsToCurrentThread()); 306 DCHECK(context_->network_message_loop()->BelongsToCurrentThread());
307 DCHECK(!host_); 307 DCHECK(!host_);
308 308
309 if (!signal_strategy_.get()) { 309 if (!signal_strategy_.get()) {
310 signal_strategy_.reset( 310 signal_strategy_.reset(
311 new XmppSignalStrategy(context_->jingle_thread(), xmpp_login_, 311 new XmppSignalStrategy(context_->jingle_thread(), xmpp_login_,
312 xmpp_auth_token_, xmpp_auth_service_)); 312 xmpp_auth_token_, xmpp_auth_service_));
313 313
314 signaling_connector_.reset( 314 signaling_connector_.reset(new SignalingConnector(
315 new SignalingConnector(signal_strategy_.get())); 315 signal_strategy_.get(),
316 base::Bind(&HostProcess::OnAuthFailed, base::Unretained(this))));
316 317
317 if (!oauth_refresh_token_.empty()) { 318 if (!oauth_refresh_token_.empty()) {
318 OAuthClientInfo client_info = { 319 OAuthClientInfo client_info = {
319 kUnofficialOAuth2ClientId, 320 kUnofficialOAuth2ClientId,
320 kUnofficialOAuth2ClientSecret 321 kUnofficialOAuth2ClientSecret
321 }; 322 };
322 323
323 #ifdef OFFICIAL_BUILD 324 #ifdef OFFICIAL_BUILD
324 if (oauth_use_official_client_id_) { 325 if (oauth_use_official_client_id_) {
325 OAuthClientInfo official_client_info = { 326 OAuthClientInfo official_client_info = {
326 kOfficialOAuth2ClientId, 327 kOfficialOAuth2ClientId,
327 kOfficialOAuth2ClientSecret 328 kOfficialOAuth2ClientSecret
328 }; 329 };
329 330
330 client_info = official_client_info; 331 client_info = official_client_info;
331 } 332 }
332 #endif // OFFICIAL_BUILD 333 #endif // OFFICIAL_BUILD
333 334
334 scoped_ptr<SignalingConnector::OAuthCredentials> oauth_credentials( 335 scoped_ptr<SignalingConnector::OAuthCredentials> oauth_credentials(
335 new SignalingConnector::OAuthCredentials( 336 new SignalingConnector::OAuthCredentials(
336 xmpp_login_, oauth_refresh_token_, client_info)); 337 xmpp_login_, oauth_refresh_token_, client_info));
337 signaling_connector_->EnableOAuth( 338 signaling_connector_->EnableOAuth(
338 oauth_credentials.Pass(), 339 oauth_credentials.Pass(),
339 base::Bind(&HostProcess::OnOAuthFailed, base::Unretained(this)),
340 context_->url_request_context_getter()); 340 context_->url_request_context_getter());
341 } 341 }
342 } 342 }
343 343
344 if (!desktop_environment_.get()) { 344 if (!desktop_environment_.get()) {
345 desktop_environment_ = 345 desktop_environment_ =
346 DesktopEnvironment::CreateForService(context_.get()); 346 DesktopEnvironment::CreateForService(context_.get());
347 } 347 }
348 348
349 NetworkSettings network_settings( 349 NetworkSettings network_settings(
(...skipping 14 matching lines...) Expand all
364 364
365 log_to_server_.reset( 365 log_to_server_.reset(
366 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get())); 366 new LogToServer(host_, ServerLogEntry::ME2ME, signal_strategy_.get()));
367 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName); 367 host_event_logger_ = HostEventLogger::Create(host_, kApplicationName);
368 368
369 host_->Start(); 369 host_->Start();
370 370
371 CreateAuthenticatorFactory(); 371 CreateAuthenticatorFactory();
372 } 372 }
373 373
374 void OnOAuthFailed() { 374 void OnAuthFailed() {
375 Shutdown(kInvalidOauthCredentialsExitCode); 375 Shutdown(kInvalidOauthCredentialsExitCode);
376 } 376 }
377 377
378 void RestartHost() { 378 void RestartHost() {
379 DCHECK(context_->network_message_loop()->BelongsToCurrentThread()); 379 DCHECK(context_->network_message_loop()->BelongsToCurrentThread());
380 380
381 if (restarting_ || shutting_down_) 381 if (restarting_ || shutting_down_)
382 return; 382 return;
383 383
384 restarting_ = true; 384 restarting_ = true;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 int CALLBACK WinMain(HINSTANCE instance, 506 int CALLBACK WinMain(HINSTANCE instance,
507 HINSTANCE previous_instance, 507 HINSTANCE previous_instance,
508 LPSTR command_line, 508 LPSTR command_line,
509 int show_command) { 509 int show_command) {
510 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting 510 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting
511 // the command line from GetCommandLineW(), so we can safely pass NULL here. 511 // the command line from GetCommandLineW(), so we can safely pass NULL here.
512 return main(0, NULL); 512 return main(0, NULL);
513 } 513 }
514 514
515 #endif // defined(OS_WIN) 515 #endif // defined(OS_WIN)
OLDNEW
« no previous file with comments | « no previous file | remoting/host/signaling_connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698