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

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

Issue 12096071: Adding a unit test to verify the IPC channel between the network and desktop processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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) 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 "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/process.h"
13 #include "base/single_thread_task_runner.h" 14 #include "base/single_thread_task_runner.h"
14 #include "base/time.h" 15 #include "base/time.h"
15 #include "base/timer.h" 16 #include "base/timer.h"
16 #include "base/utf_string_conversions.h" 17 #include "base/utf_string_conversions.h"
17 #include "base/win/scoped_handle.h" 18 #include "base/win/scoped_handle.h"
18 #include "ipc/ipc_message.h" 19 #include "ipc/ipc_message.h"
19 #include "ipc/ipc_message_macros.h" 20 #include "ipc/ipc_message_macros.h"
20 #include "remoting/base/auto_thread_task_runner.h" 21 #include "remoting/base/auto_thread_task_runner.h"
21 #include "remoting/host/chromoting_messages.h" 22 #include "remoting/host/chromoting_messages.h"
22 #include "remoting/host/desktop_session_win.h" 23 #include "remoting/host/desktop_session_win.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 104 }
104 } 105 }
105 106
106 bool DaemonProcessWin::OnDesktopSessionAgentAttached( 107 bool DaemonProcessWin::OnDesktopSessionAgentAttached(
107 int terminal_id, 108 int terminal_id,
108 base::ProcessHandle desktop_process, 109 base::ProcessHandle desktop_process,
109 IPC::PlatformFileForTransit desktop_pipe) { 110 IPC::PlatformFileForTransit desktop_pipe) {
110 // Prepare |desktop_process| handle for sending over to the network process. 111 // Prepare |desktop_process| handle for sending over to the network process.
111 // |desktop_pipe| is a handle in the desktop process. It will be duplicated 112 // |desktop_pipe| is a handle in the desktop process. It will be duplicated
112 // by the network process directly from the desktop process. 113 // by the network process directly from the desktop process.
113 IPC::PlatformFileForTransit desktop_process_for_transit = 114 base::ProcessHandle desktop_process_for_transit =
Sergey Ulanov 2013/02/04 21:04:41 Why do you need this change?
alexeypa (please no reviews) 2013/02/04 23:45:58 This is caused by changing DesktopSessionProxy::At
114 IPC::GetFileHandleForProcess(desktop_process, network_process_, false); 115 IPC::GetFileHandleForProcess(desktop_process, network_process_, false);
115 if (desktop_process_for_transit == IPC::InvalidPlatformFileForTransit()) { 116 if (desktop_process_for_transit == IPC::InvalidPlatformFileForTransit()) {
116 LOG(ERROR) << "Failed to duplicate the desktop process handle"; 117 LOG(ERROR) << "Failed to duplicate the desktop process handle";
117 return false; 118 return false;
118 } 119 }
119 120
120 SendToNetwork(new ChromotingDaemonNetworkMsg_DesktopAttached( 121 SendToNetwork(new ChromotingDaemonNetworkMsg_DesktopAttached(
121 terminal_id, desktop_process_for_transit, desktop_pipe)); 122 terminal_id, desktop_process_for_transit, desktop_pipe));
122 return true; 123 return true;
123 } 124 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 scoped_refptr<AutoThreadTaskRunner> io_task_runner, 162 scoped_refptr<AutoThreadTaskRunner> io_task_runner,
162 const base::Closure& stopped_callback) { 163 const base::Closure& stopped_callback) {
163 scoped_ptr<DaemonProcessWin> daemon_process( 164 scoped_ptr<DaemonProcessWin> daemon_process(
164 new DaemonProcessWin(caller_task_runner, io_task_runner, 165 new DaemonProcessWin(caller_task_runner, io_task_runner,
165 stopped_callback)); 166 stopped_callback));
166 daemon_process->Initialize(); 167 daemon_process->Initialize();
167 return daemon_process.PassAs<DaemonProcess>(); 168 return daemon_process.PassAs<DaemonProcess>();
168 } 169 }
169 170
170 } // namespace remoting 171 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698