| OLD | NEW |
| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 : info_(NULL), | 56 : info_(NULL), |
| 57 code_(EXIT_SUCCESS), | 57 code_(EXIT_SUCCESS), |
| 58 reason_(kTerminationNormal) { | 58 reason_(kTerminationNormal) { |
| 59 } | 59 } |
| 60 | 60 |
| 61 void Multiprocess::Run() { | 61 void Multiprocess::Run() { |
| 62 ASSERT_EQ(NULL, info_); | 62 ASSERT_EQ(NULL, info_); |
| 63 scoped_ptr<internal::MultiprocessInfo> info(new internal::MultiprocessInfo); | 63 scoped_ptr<internal::MultiprocessInfo> info(new internal::MultiprocessInfo); |
| 64 base::AutoReset<internal::MultiprocessInfo*> reset_info(&info_, info.get()); | 64 base::AutoReset<internal::MultiprocessInfo*> reset_info(&info_, info.get()); |
| 65 | 65 |
| 66 PreFork(); | 66 ASSERT_NO_FATAL_FAILURE(PreFork()); |
| 67 if (testing::Test::HasFatalFailure()) { | |
| 68 return; | |
| 69 } | |
| 70 | 67 |
| 71 pid_t pid = fork(); | 68 pid_t pid = fork(); |
| 72 ASSERT_GE(pid, 0) << ErrnoMessage("fork"); | 69 ASSERT_GE(pid, 0) << ErrnoMessage("fork"); |
| 73 | 70 |
| 74 if (pid > 0) { | 71 if (pid > 0) { |
| 75 info_->child_pid = pid; | 72 info_->child_pid = pid; |
| 76 | 73 |
| 77 RunParent(); | 74 RunParent(); |
| 78 | 75 |
| 79 // Waiting for the child happens here instead of in RunParent() because even | 76 // Waiting for the child happens here instead of in RunParent() because even |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 if (testing::Test::HasFailure()) { | 209 if (testing::Test::HasFailure()) { |
| 213 // Trigger the ScopedForbidReturn destructor. | 210 // Trigger the ScopedForbidReturn destructor. |
| 214 return; | 211 return; |
| 215 } | 212 } |
| 216 | 213 |
| 217 exit(0); | 214 exit(0); |
| 218 } | 215 } |
| 219 | 216 |
| 220 } // namespace test | 217 } // namespace test |
| 221 } // namespace crashpad | 218 } // namespace crashpad |
| OLD | NEW |