Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 #include "remoting/host/posix/signal_handler.h" | 71 #include "remoting/host/posix/signal_handler.h" |
| 72 #endif // defined(OS_POSIX) | 72 #endif // defined(OS_POSIX) |
| 73 | 73 |
| 74 #if defined(OS_MACOSX) | 74 #if defined(OS_MACOSX) |
| 75 #include "base/mac/scoped_cftyperef.h" | 75 #include "base/mac/scoped_cftyperef.h" |
| 76 #include "base/mac/scoped_nsautorelease_pool.h" | 76 #include "base/mac/scoped_nsautorelease_pool.h" |
| 77 #endif // defined(OS_MACOSX) | 77 #endif // defined(OS_MACOSX) |
| 78 | 78 |
| 79 #if defined(OS_LINUX) | 79 #if defined(OS_LINUX) |
| 80 #include "remoting/host/audio_capturer_linux.h" | 80 #include "remoting/host/audio_capturer_linux.h" |
| 81 #include "remoting/host/pam_authorization_factory_posix.h" | |
| 81 #endif // defined(OS_LINUX) | 82 #endif // defined(OS_LINUX) |
| 82 | 83 |
| 83 // N.B. OS_WIN is defined by including src/base headers. | 84 // N.B. OS_WIN is defined by including src/base headers. |
| 84 #if defined(OS_WIN) | 85 #if defined(OS_WIN) |
| 85 #include <commctrl.h> | 86 #include <commctrl.h> |
| 86 #include "base/win/scoped_handle.h" | 87 #include "base/win/scoped_handle.h" |
| 87 #include "remoting/host/win/session_desktop_environment_factory.h" | 88 #include "remoting/host/win/session_desktop_environment_factory.h" |
| 88 #endif // defined(OS_WIN) | 89 #endif // defined(OS_WIN) |
| 89 | 90 |
| 90 #if defined(TOOLKIT_GTK) | 91 #if defined(TOOLKIT_GTK) |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 std::string local_certificate = key_pair_.GenerateCertificate(); | 387 std::string local_certificate = key_pair_.GenerateCertificate(); |
| 387 if (local_certificate.empty()) { | 388 if (local_certificate.empty()) { |
| 388 LOG(ERROR) << "Failed to generate host certificate."; | 389 LOG(ERROR) << "Failed to generate host certificate."; |
| 389 Shutdown(kInitializationFailed); | 390 Shutdown(kInitializationFailed); |
| 390 return; | 391 return; |
| 391 } | 392 } |
| 392 | 393 |
| 393 scoped_ptr<protocol::AuthenticatorFactory> factory( | 394 scoped_ptr<protocol::AuthenticatorFactory> factory( |
| 394 new protocol::Me2MeHostAuthenticatorFactory( | 395 new protocol::Me2MeHostAuthenticatorFactory( |
| 395 local_certificate, *key_pair_.private_key(), host_secret_hash_)); | 396 local_certificate, *key_pair_.private_key(), host_secret_hash_)); |
| 397 #if defined(OS_LINUX) | |
| 398 factory.reset(new PamAuthorizationFactory(factory.Pass())); | |
|
Wez
2012/10/26 03:25:43
nit: Precede this with a brief comment explaining
Jamie
2012/10/26 17:53:30
Done.
| |
| 399 #endif | |
| 396 host_->SetAuthenticatorFactory(factory.Pass()); | 400 host_->SetAuthenticatorFactory(factory.Pass()); |
| 397 } | 401 } |
| 398 | 402 |
| 399 // IPC::Listener implementation. | 403 // IPC::Listener implementation. |
| 400 bool HostProcess::OnMessageReceived(const IPC::Message& message) { | 404 bool HostProcess::OnMessageReceived(const IPC::Message& message) { |
| 401 DCHECK(context_->ui_task_runner()->BelongsToCurrentThread()); | 405 DCHECK(context_->ui_task_runner()->BelongsToCurrentThread()); |
| 402 | 406 |
| 403 #if defined(REMOTING_MULTI_PROCESS) | 407 #if defined(REMOTING_MULTI_PROCESS) |
| 404 bool handled = true; | 408 bool handled = true; |
| 405 IPC_BEGIN_MESSAGE_MAP(HostProcess, message) | 409 IPC_BEGIN_MESSAGE_MAP(HostProcess, message) |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 945 user32.GetFunctionPointer("SetProcessDPIAware")); | 949 user32.GetFunctionPointer("SetProcessDPIAware")); |
| 946 set_process_dpi_aware(); | 950 set_process_dpi_aware(); |
| 947 } | 951 } |
| 948 | 952 |
| 949 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 953 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
| 950 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 954 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
| 951 return main(0, NULL); | 955 return main(0, NULL); |
| 952 } | 956 } |
| 953 | 957 |
| 954 #endif // defined(OS_WIN) | 958 #endif // defined(OS_WIN) |
| OLD | NEW |