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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 int num_args; | 47 int num_args; |
48 wchar_t** args = CommandLineToArgvW(GetCommandLine(), &num_args); | 48 wchar_t** args = CommandLineToArgvW(GetCommandLine(), &num_args); |
49 ScopedLocalFree scoped_args(args); // Take ownership. | 49 ScopedLocalFree scoped_args(args); // Take ownership. |
50 if (!args) { | 50 if (!args) { |
51 PLOG(FATAL) << "CommandLineToArgvW"; | 51 PLOG(FATAL) << "CommandLineToArgvW"; |
52 return false; | 52 return false; |
53 } | 53 } |
54 | 54 |
55 std::string switch_name_with_equals(switch_name); | 55 std::string switch_name_with_equals(switch_name); |
56 switch_name_with_equals += "="; | 56 switch_name_with_equals += "="; |
57 for (size_t i = 1; i < num_args; ++i) { | 57 for (int i = 1; i < num_args; ++i) { |
58 const wchar_t* arg = args[i]; | 58 const wchar_t* arg = args[i]; |
59 std::string arg_as_utf8 = base::UTF16ToUTF8(arg); | 59 std::string arg_as_utf8 = base::UTF16ToUTF8(arg); |
60 if (arg_as_utf8.compare( | 60 if (arg_as_utf8.compare( |
61 0, switch_name_with_equals.size(), switch_name_with_equals) == 0) { | 61 0, switch_name_with_equals.size(), switch_name_with_equals) == 0) { |
62 if (value) | 62 if (value) |
63 *value = arg_as_utf8.substr(switch_name_with_equals.size()); | 63 *value = arg_as_utf8.substr(switch_name_with_equals.size()); |
64 return true; | 64 return true; |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
(...skipping 161 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 |