| OLD | NEW |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. | 1 // Copyright 2015 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 MultiprocessExec::~MultiprocessExec() { | 131 MultiprocessExec::~MultiprocessExec() { |
| 132 delete info_; | 132 delete info_; |
| 133 } | 133 } |
| 134 | 134 |
| 135 void MultiprocessExec::PreFork() { | 135 void MultiprocessExec::PreFork() { |
| 136 ASSERT_FALSE(command_.empty()); | 136 ASSERT_FALSE(command_.empty()); |
| 137 | 137 |
| 138 argv_.clear(); | 138 argv_.clear(); |
| 139 ArgvQuote(base::UTF8ToUTF16(command_), &argv_); |
| 139 for (size_t i = 0; i < arguments_.size(); ++i) { | 140 for (size_t i = 0; i < arguments_.size(); ++i) { |
| 141 argv_ += L" "; |
| 140 ArgvQuote(base::UTF8ToUTF16(arguments_[i]), &argv_); | 142 ArgvQuote(base::UTF8ToUTF16(arguments_[i]), &argv_); |
| 141 if (i < arguments_.size() - 1) | |
| 142 argv_ += L" "; | |
| 143 } | 143 } |
| 144 | 144 |
| 145 // Make pipes for child-to-parent and parent-to-child communication. Mark them | 145 // Make pipes for child-to-parent and parent-to-child communication. Mark them |
| 146 // as inheritable via the SECURITY_ATTRIBUTES, but use SetHandleInformation to | 146 // as inheritable via the SECURITY_ATTRIBUTES, but use SetHandleInformation to |
| 147 // ensure that the parent sides are not inherited. | 147 // ensure that the parent sides are not inherited. |
| 148 ASSERT_EQ(nullptr, info_); | 148 ASSERT_EQ(nullptr, info_); |
| 149 info_ = new internal::MultiprocessInfo; | 149 info_ = new internal::MultiprocessInfo; |
| 150 | 150 |
| 151 SECURITY_ATTRIBUTES security_attributes = {0}; | 151 SECURITY_ATTRIBUTES security_attributes = {0}; |
| 152 security_attributes.nLength = sizeof(SECURITY_ATTRIBUTES); | 152 security_attributes.nLength = sizeof(SECURITY_ATTRIBUTES); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 179 TRUE, | 179 TRUE, |
| 180 0, | 180 0, |
| 181 nullptr, | 181 nullptr, |
| 182 nullptr, | 182 nullptr, |
| 183 &startup_info, | 183 &startup_info, |
| 184 &info_->process_info)); | 184 &info_->process_info)); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace test | 187 } // namespace test |
| 188 } // namespace crashpad | 188 } // namespace crashpad |
| OLD | NEW |