| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 WinChildProcess::WinChildProcess() { | 144 WinChildProcess::WinChildProcess() { |
| 145 std::string switch_value; | 145 std::string switch_value; |
| 146 CHECK(GetSwitch(kIsMultiprocessChild, &switch_value)); | 146 CHECK(GetSwitch(kIsMultiprocessChild, &switch_value)); |
| 147 | 147 |
| 148 // Set up the handles we inherited from the parent. These are inherited from | 148 // Set up the handles we inherited from the parent. These are inherited from |
| 149 // the parent and so are open and have the same value as in the parent. The | 149 // the parent and so are open and have the same value as in the parent. The |
| 150 // values are passed to the child on the command line. | 150 // values are passed to the child on the command line. |
| 151 std::string left, right; | 151 std::string left, right; |
| 152 CHECK(SplitString(switch_value, '|', &left, &right)); | 152 CHECK(SplitString(switch_value, '|', &left, &right)); |
| 153 |
| 154 // left and right were formatted as 0x%x, so they need to be converted as |
| 155 // unsigned ints. |
| 153 unsigned int write, read; | 156 unsigned int write, read; |
| 154 CHECK(StringToNumber(left, &write)); | 157 CHECK(StringToNumber(left, &write)); |
| 155 CHECK(StringToNumber(right, &read)); | 158 CHECK(StringToNumber(right, &read)); |
| 159 |
| 156 pipe_write_.reset(IntToHandle(write)); | 160 pipe_write_.reset(IntToHandle(write)); |
| 157 pipe_read_.reset(IntToHandle(read)); | 161 pipe_read_.reset(IntToHandle(read)); |
| 158 | 162 |
| 159 // Notify the parent that it's OK to proceed. We only need to wait to get to | 163 // Notify the parent that it's OK to proceed. We only need to wait to get to |
| 160 // the process entry point, but this is the easiest place we can notify. | 164 // the process entry point, but this is the easiest place we can notify. |
| 161 char c = ' '; | 165 char c = ' '; |
| 162 CheckedWriteFile(WritePipeHandle(), &c, sizeof(c)); | 166 CheckedWriteFile(WritePipeHandle(), &c, sizeof(c)); |
| 163 } | 167 } |
| 164 | 168 |
| 165 // static | 169 // static |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 void WinChildProcess::CloseReadPipe() { | 234 void WinChildProcess::CloseReadPipe() { |
| 231 pipe_read_.reset(); | 235 pipe_read_.reset(); |
| 232 } | 236 } |
| 233 | 237 |
| 234 void WinChildProcess::CloseWritePipe() { | 238 void WinChildProcess::CloseWritePipe() { |
| 235 pipe_write_.reset(); | 239 pipe_write_.reset(); |
| 236 } | 240 } |
| 237 | 241 |
| 238 } // namespace test | 242 } // namespace test |
| 239 } // namespace crashpad | 243 } // namespace crashpad |
| OLD | NEW |