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

Side by Side Diff: remoting/host/host_main.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 the common entry point shared by all Chromoting Host 5 // This file implements the common entry point shared by all Chromoting Host
6 // processes. 6 // processes.
7 7
8 #include "remoting/host/host_main.h" 8 #include "remoting/host/host_main.h"
9 9
10 #include <string> 10 #include <string>
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 // Launch the child process requesting elevation. 118 // Launch the child process requesting elevation.
119 SHELLEXECUTEINFO info; 119 SHELLEXECUTEINFO info;
120 memset(&info, 0, sizeof(info)); 120 memset(&info, 0, sizeof(info));
121 info.cbSize = sizeof(info); 121 info.cbSize = sizeof(info);
122 info.lpVerb = L"runas"; 122 info.lpVerb = L"runas";
123 info.lpFile = binary.value().c_str(); 123 info.lpFile = binary.value().c_str();
124 info.lpParameters = parameters.c_str(); 124 info.lpParameters = parameters.c_str();
125 info.nShow = SW_SHOWNORMAL; 125 info.nShow = SW_SHOWNORMAL;
126 126
127 if (!ShellExecuteEx(&info)) { 127 if (!ShellExecuteEx(&info)) {
128 return GetLastError(); 128 DWORD exit_code = GetLastError();
129 LOG_GETLASTERROR(ERROR) << "Unable to launch '" << binary.value() << "'";
130 return exit_code;
129 } 131 }
130 132
131 return kSuccessExitCode; 133 return kSuccessExitCode;
132 } 134 }
133 135
134 #endif // defined(OS_WIN) 136 #endif // defined(OS_WIN)
135 137
136 // Select the entry point corresponding to the process type. 138 // Select the entry point corresponding to the process type.
137 MainRoutineFn SelectMainRoutine(const std::string& process_type) { 139 MainRoutineFn SelectMainRoutine(const std::string& process_type) {
138 MainRoutineFn main_routine = NULL; 140 MainRoutineFn main_routine = NULL;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 231
230 // Invoke the entry point. 232 // Invoke the entry point.
231 int exit_code = main_routine(); 233 int exit_code = main_routine();
232 if (exit_code == kUsageExitCode) { 234 if (exit_code == kUsageExitCode) {
233 Usage(command_line->GetProgram()); 235 Usage(command_line->GetProgram());
234 } 236 }
235 return exit_code; 237 return exit_code;
236 } 238 }
237 239
238 } // namespace remoting 240 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698