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

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

Issue 2735113003: Changing SpawnChild to return a struct.
Patch Set: Created 3 years, 9 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "content/browser/child_process_launcher.h" 5 #include "content/browser/child_process_launcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/i18n/icu_util.h" 10 #include "base/i18n/icu_util.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 starting_ = false; 78 starting_ = false;
79 process_ = std::move(process); 79 process_ = std::move(process);
80 80
81 // Take ownership of the pending connection here so it's destroyed when 81 // Take ownership of the pending connection here so it's destroyed when
82 // we go out of scope regardless of the outcome below. 82 // we go out of scope regardless of the outcome below.
83 std::unique_ptr<mojo::edk::PendingProcessConnection> pending_connection = 83 std::unique_ptr<mojo::edk::PendingProcessConnection> pending_connection =
84 std::move(pending_connection_); 84 std::move(pending_connection_);
85 if (process_.process.IsValid()) { 85 if (process_.process.IsValid()) {
86 // Set up Mojo IPC to the new process. 86 // Set up Mojo IPC to the new process.
87 DCHECK(pending_connection); 87 DCHECK(pending_connection);
88 pending_connection->Connect(process_.process.Handle(), 88 pending_connection->Connect(
89 std::move(server_handle), 89 process_.process.Handle(),
90 process_error_callback_); 90 mojo::edk::ConnectionParam(std::move(server_handle)),
91 process_error_callback_);
91 client_->OnProcessLaunched(); 92 client_->OnProcessLaunched();
92 } else { 93 } else {
93 termination_status_ = base::TERMINATION_STATUS_LAUNCH_FAILED; 94 termination_status_ = base::TERMINATION_STATUS_LAUNCH_FAILED;
94 95
95 // NOTE: May delete |this|. 96 // NOTE: May delete |this|.
96 client_->OnProcessLaunchFailed(error_code); 97 client_->OnProcessLaunchFailed(error_code);
97 } 98 }
98 } 99 }
99 100
100 bool ChildProcessLauncher::IsStarting() { 101 bool ChildProcessLauncher::IsStarting() {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 } 160 }
160 161
161 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( 162 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest(
162 Client* client) { 163 Client* client) {
163 Client* ret = client_; 164 Client* ret = client_;
164 client_ = client; 165 client_ = client;
165 return ret; 166 return ret;
166 } 167 }
167 168
168 } // namespace content 169 } // namespace content
OLDNEW
« no previous file with comments | « chrome/common/service_process_util_unittest.cc ('k') | content/browser/memory/memory_coordinator_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698