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

Side by Side Diff: content/browser/child_process_launcher_helper_win.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Fix Created 3 years, 5 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
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/metrics/field_trial.h" 6 #include "base/metrics/field_trial.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/win/scoped_handle.h" 9 #include "base/win/scoped_handle.h"
10 #include "base/win/win_util.h" 10 #include "base/win/win_util.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 *is_synchronous_launch = true; 58 *is_synchronous_launch = true;
59 if (delegate_->ShouldLaunchElevated()) { 59 if (delegate_->ShouldLaunchElevated()) {
60 // When establishing a Mojo connection, the pipe path has already been added 60 // When establishing a Mojo connection, the pipe path has already been added
61 // to the command line. 61 // to the command line.
62 base::LaunchOptions win_options; 62 base::LaunchOptions win_options;
63 win_options.start_hidden = true; 63 win_options.start_hidden = true;
64 ChildProcessLauncherHelper::Process process; 64 ChildProcessLauncherHelper::Process process;
65 process.process = base::LaunchElevatedProcess(*command_line(), win_options); 65 process.process = base::LaunchElevatedProcess(*command_line(), win_options);
66 return process; 66 return process;
67 } 67 }
68 base::HandlesToInheritVector handles; 68 std::vector<HANDLE> handles;
69 handles.push_back(mojo_client_handle().handle); 69 handles.push_back(mojo_client_handle().handle);
70 base::FieldTrialList::AppendFieldTrialHandleIfNeeded(&handles); 70 base::FieldTrialList::AppendFieldTrialHandleIfNeeded(&handles);
71 command_line()->AppendSwitchASCII( 71 command_line()->AppendSwitchASCII(
72 mojo::edk::PlatformChannelPair::kMojoPlatformChannelHandleSwitch, 72 mojo::edk::PlatformChannelPair::kMojoPlatformChannelHandleSwitch,
73 base::UintToString(base::win::HandleToUint32(handles[0]))); 73 base::UintToString(base::win::HandleToUint32(handles[0])));
74 ChildProcessLauncherHelper::Process process; 74 ChildProcessLauncherHelper::Process process;
75 *launch_result = StartSandboxedProcess( 75 *launch_result = StartSandboxedProcess(
76 delegate_.get(), 76 delegate_.get(),
77 command_line(), 77 command_line(),
78 handles, 78 handles,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 catalog::RequiredFileMap required_files) { 122 catalog::RequiredFileMap required_files) {
123 // No file passing from the manifest on Windows yet. 123 // No file passing from the manifest on Windows yet.
124 DCHECK(required_files.empty()); 124 DCHECK(required_files.empty());
125 } 125 }
126 126
127 // static 127 // static
128 void ChildProcessLauncherHelper::ResetRegisteredFilesForTesting() {} 128 void ChildProcessLauncherHelper::ResetRegisteredFilesForTesting() {}
129 129
130 } // namespace internal 130 } // namespace internal
131 } // namespace content 131 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698