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

Unified Diff: remoting/host/win/wts_console_session_process_driver.cc

Issue 15077010: [Chromoting] Refactored worker process launching code and speeded up the desktop process launch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/win/wts_console_session_process_driver.cc
diff --git a/remoting/host/win/wts_console_session_process_driver.cc b/remoting/host/win/wts_console_session_process_driver.cc
index b77cfccdb309c346dfe9ce3c6030ba52ab2c9bbe..597f07456aef5e2f67cf45077cb4194d968fd464 100644
--- a/remoting/host/win/wts_console_session_process_driver.cc
+++ b/remoting/host/win/wts_console_session_process_driver.cc
@@ -9,6 +9,7 @@
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/single_thread_task_runner.h"
+#include "base/win/windows_version.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_macros.h"
#include "remoting/host/chromoting_messages.h"
@@ -89,9 +90,19 @@ void WtsConsoleSessionProcessDriver::OnSessionAttached(uint32 session_id) {
DCHECK(launcher_.get() == NULL);
- // Get the host binary name.
+ // Launch elevated on Win8 to be able to inject Alt+Tab.
+ bool launch_elevated = base::win::GetVersion() >= base::win::VERSION_WIN8;
+
+ // Get the name of the executable the desktop process will run.
base::FilePath desktop_binary;
- if (!GetInstalledBinaryPath(kDesktopBinaryName, &desktop_binary)) {
+ bool result;
+ if (launch_elevated) {
+ result = GetInstalledBinaryPath(kDesktopBinaryName, &desktop_binary);
+ } else {
+ result = GetInstalledBinaryPath(kHostBinaryName, &desktop_binary);
+ }
+
+ if (!result) {
Stop();
return;
}
@@ -104,16 +115,17 @@ void WtsConsoleSessionProcessDriver::OnSessionAttached(uint32 session_id) {
// Create a Delegate capable of launching an elevated process in the session.
scoped_ptr<WtsSessionProcessDelegate> delegate(
- new WtsSessionProcessDelegate(caller_task_runner_,
- io_task_runner_,
+ new WtsSessionProcessDelegate(io_task_runner_,
target.Pass(),
- session_id,
- true,
+ launch_elevated,
kDaemonIpcSecurityDescriptor));
+ if (!delegate->Initialize(session_id)) {
+ Stop();
+ return;
+ }
// Use the Delegate to launch the host process.
- launcher_.reset(new WorkerProcessLauncher(
- caller_task_runner_, delegate.Pass(), this));
+ launcher_.reset(new WorkerProcessLauncher(delegate.Pass(), this));
}
void WtsConsoleSessionProcessDriver::OnSessionDetached() {

Powered by Google App Engine
This is Rietveld 408576698