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

Side by Side Diff: util/test/multiprocess_posix.cc

Issue 853853002: win: Stub reorganization of MultiprocessExec (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 11 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
« no previous file with comments | « util/test/multiprocess_exec_win.cc ('k') | util/test/multiprocess_posix_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 info_->pipe_p2c_read.reset(pipe_fds_p2c[0]); 147 info_->pipe_p2c_read.reset(pipe_fds_p2c[0]);
148 info_->pipe_p2c_write.reset(pipe_fds_p2c[1]); 148 info_->pipe_p2c_write.reset(pipe_fds_p2c[1]);
149 } 149 }
150 150
151 pid_t Multiprocess::ChildPID() const { 151 pid_t Multiprocess::ChildPID() const {
152 EXPECT_NE(0, info_->child_pid); 152 EXPECT_NE(0, info_->child_pid);
153 return info_->child_pid; 153 return info_->child_pid;
154 } 154 }
155 155
156 int Multiprocess::ReadPipeFD() const { 156 FileHandle Multiprocess::ReadPipeHandle() const {
157 int fd = info_->child_pid ? info_->pipe_c2p_read.get() 157 int fd = info_->child_pid ? info_->pipe_c2p_read.get()
158 : info_->pipe_p2c_read.get(); 158 : info_->pipe_p2c_read.get();
159 CHECK_NE(fd, -1); 159 CHECK_NE(fd, -1);
160 return fd; 160 return fd;
161 } 161 }
162 162
163 int Multiprocess::WritePipeFD() const { 163 FileHandle Multiprocess::WritePipeHandle() const {
164 int fd = info_->child_pid ? info_->pipe_p2c_write.get() 164 int fd = info_->child_pid ? info_->pipe_p2c_write.get()
165 : info_->pipe_c2p_write.get(); 165 : info_->pipe_c2p_write.get();
166 CHECK_NE(fd, -1); 166 CHECK_NE(fd, -1);
167 return fd; 167 return fd;
168 } 168 }
169 169
170 void Multiprocess::CloseReadPipe() { 170 void Multiprocess::CloseReadPipe() {
171 if (info_->child_pid) { 171 if (info_->child_pid) {
172 info_->pipe_c2p_read.reset(); 172 info_->pipe_c2p_read.reset();
173 } else { 173 } else {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 if (testing::Test::HasFailure()) { 209 if (testing::Test::HasFailure()) {
210 // Trigger the ScopedForbidReturn destructor. 210 // Trigger the ScopedForbidReturn destructor.
211 return; 211 return;
212 } 212 }
213 213
214 exit(0); 214 exit(0);
215 } 215 }
216 216
217 } // namespace test 217 } // namespace test
218 } // namespace crashpad 218 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/test/multiprocess_exec_win.cc ('k') | util/test/multiprocess_posix_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698