| 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 #include "remoting/host/daemon_process.h" | 5 #include "remoting/host/daemon_process.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 10 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 10 #include "base/location.h" | 12 #include "base/location.h" |
| 11 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/process/process.h" | 17 #include "base/process/process.h" |
| 15 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 18 #include "base/win/registry.h" | 21 #include "base/win/registry.h" |
| 19 #include "base/win/scoped_handle.h" | 22 #include "base/win/scoped_handle.h" |
| 20 #include "base/win/win_util.h" | 23 #include "base/win/win_util.h" |
| 21 #include "ipc/ipc_message.h" | 24 #include "ipc/ipc_message.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 67 |
| 65 class DaemonProcessWin : public DaemonProcess { | 68 class DaemonProcessWin : public DaemonProcess { |
| 66 public: | 69 public: |
| 67 DaemonProcessWin( | 70 DaemonProcessWin( |
| 68 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 71 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 69 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 72 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
| 70 const base::Closure& stopped_callback); | 73 const base::Closure& stopped_callback); |
| 71 ~DaemonProcessWin() override; | 74 ~DaemonProcessWin() override; |
| 72 | 75 |
| 73 // WorkerProcessIpcDelegate implementation. | 76 // WorkerProcessIpcDelegate implementation. |
| 74 void OnChannelConnected(int32 peer_pid) override; | 77 void OnChannelConnected(int32_t peer_pid) override; |
| 75 void OnPermanentError(int exit_code) override; | 78 void OnPermanentError(int exit_code) override; |
| 76 | 79 |
| 77 // DaemonProcess overrides. | 80 // DaemonProcess overrides. |
| 78 void SendToNetwork(IPC::Message* message) override; | 81 void SendToNetwork(IPC::Message* message) override; |
| 79 bool OnDesktopSessionAgentAttached( | 82 bool OnDesktopSessionAgentAttached( |
| 80 int terminal_id, | 83 int terminal_id, |
| 81 base::ProcessHandle desktop_process, | 84 base::ProcessHandle desktop_process, |
| 82 IPC::PlatformFileForTransit desktop_pipe) override; | 85 IPC::PlatformFileForTransit desktop_pipe) override; |
| 83 | 86 |
| 84 protected: | 87 protected: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 DaemonProcessWin::DaemonProcessWin( | 119 DaemonProcessWin::DaemonProcessWin( |
| 117 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 120 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
| 118 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 121 scoped_refptr<AutoThreadTaskRunner> io_task_runner, |
| 119 const base::Closure& stopped_callback) | 122 const base::Closure& stopped_callback) |
| 120 : DaemonProcess(caller_task_runner, io_task_runner, stopped_callback) { | 123 : DaemonProcess(caller_task_runner, io_task_runner, stopped_callback) { |
| 121 } | 124 } |
| 122 | 125 |
| 123 DaemonProcessWin::~DaemonProcessWin() { | 126 DaemonProcessWin::~DaemonProcessWin() { |
| 124 } | 127 } |
| 125 | 128 |
| 126 void DaemonProcessWin::OnChannelConnected(int32 peer_pid) { | 129 void DaemonProcessWin::OnChannelConnected(int32_t peer_pid) { |
| 127 // Obtain the handle of the network process. | 130 // Obtain the handle of the network process. |
| 128 network_process_.Set(OpenProcess(PROCESS_DUP_HANDLE, false, peer_pid)); | 131 network_process_.Set(OpenProcess(PROCESS_DUP_HANDLE, false, peer_pid)); |
| 129 if (!network_process_.IsValid()) { | 132 if (!network_process_.IsValid()) { |
| 130 CrashNetworkProcess(FROM_HERE); | 133 CrashNetworkProcess(FROM_HERE); |
| 131 return; | 134 return; |
| 132 } | 135 } |
| 133 | 136 |
| 134 if (!InitializePairingRegistry()) { | 137 if (!InitializePairingRegistry()) { |
| 135 CrashNetworkProcess(FROM_HERE); | 138 CrashNetworkProcess(FROM_HERE); |
| 136 return; | 139 return; |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 << "\\" << kPairingRegistrySecretsKeyName; | 380 << "\\" << kPairingRegistrySecretsKeyName; |
| 378 return false; | 381 return false; |
| 379 } | 382 } |
| 380 | 383 |
| 381 pairing_registry_privileged_key_.Set(privileged.Take()); | 384 pairing_registry_privileged_key_.Set(privileged.Take()); |
| 382 pairing_registry_unprivileged_key_.Set(unprivileged.Take()); | 385 pairing_registry_unprivileged_key_.Set(unprivileged.Take()); |
| 383 return true; | 386 return true; |
| 384 } | 387 } |
| 385 | 388 |
| 386 } // namespace remoting | 389 } // namespace remoting |
| OLD | NEW |