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

Unified Diff: components/browser_watcher/watcher_client_win.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Merge 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 side-by-side diff with in-line comments
Download patch
Index: components/browser_watcher/watcher_client_win.cc
diff --git a/components/browser_watcher/watcher_client_win.cc b/components/browser_watcher/watcher_client_win.cc
index 179480e8ed9d2d5879831133926f6948e3ab2e98..b236d5c0a7c0aa3efc5565beeb1abd16dc9f0ce0 100644
--- a/components/browser_watcher/watcher_client_win.cc
+++ b/components/browser_watcher/watcher_client_win.cc
@@ -38,13 +38,14 @@ void WatcherClient::LaunchWatcher() {
DCHECK(self.IsValid());
base::CommandLine cmd_line(command_line_generator_.Run(self.Handle()));
- base::HandlesToInheritVector to_inherit;
base::LaunchOptions options;
options.start_hidden = true;
- to_inherit.push_back(self.Handle());
- to_inherit.insert(to_inherit.end(), inherited_handles_.begin(),
- inherited_handles_.end());
- options.handles_to_inherit = &to_inherit;
+
+ // Launch the child process inheriting only |self|.
+ options.handles_to_inherit.push_back(self.Handle());
+ options.handles_to_inherit.insert(options.handles_to_inherit.end(),
+ inherited_handles_.begin(),
+ inherited_handles_.end());
process_ = base::LaunchProcess(cmd_line, options);
if (!process_.IsValid())

Powered by Google App Engine
This is Rietveld 408576698