| 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 // On Linux, perform a PAM authorization step after authentication. |
| 399 factory.reset(new PamAuthorizationFactory(factory.Pass())); |
| 400 #endif |
| 396 host_->SetAuthenticatorFactory(factory.Pass()); | 401 host_->SetAuthenticatorFactory(factory.Pass()); |
| 397 } | 402 } |
| 398 | 403 |
| 399 // IPC::Listener implementation. | 404 // IPC::Listener implementation. |
| 400 bool HostProcess::OnMessageReceived(const IPC::Message& message) { | 405 bool HostProcess::OnMessageReceived(const IPC::Message& message) { |
| 401 DCHECK(context_->ui_task_runner()->BelongsToCurrentThread()); | 406 DCHECK(context_->ui_task_runner()->BelongsToCurrentThread()); |
| 402 | 407 |
| 403 #if defined(REMOTING_MULTI_PROCESS) | 408 #if defined(REMOTING_MULTI_PROCESS) |
| 404 bool handled = true; | 409 bool handled = true; |
| 405 IPC_BEGIN_MESSAGE_MAP(HostProcess, message) | 410 IPC_BEGIN_MESSAGE_MAP(HostProcess, message) |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 user32.GetFunctionPointer("SetProcessDPIAware")); | 950 user32.GetFunctionPointer("SetProcessDPIAware")); |
| 946 set_process_dpi_aware(); | 951 set_process_dpi_aware(); |
| 947 } | 952 } |
| 948 | 953 |
| 949 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting | 954 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting |
| 950 // the command line from GetCommandLineW(), so we can safely pass NULL here. | 955 // the command line from GetCommandLineW(), so we can safely pass NULL here. |
| 951 return main(0, NULL); | 956 return main(0, NULL); |
| 952 } | 957 } |
| 953 | 958 |
| 954 #endif // defined(OS_WIN) | 959 #endif // defined(OS_WIN) |
| OLD | NEW |