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