OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/crash/content/app/run_as_crashpad_handler_win.h" | 5 #include "components/crash/content/app/run_as_crashpad_handler_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 std::unique_ptr<char* []> argv_as_utf8(new char*[argv.size() + 1]); | 58 std::unique_ptr<char* []> argv_as_utf8(new char*[argv.size() + 1]); |
59 std::vector<std::string> storage; | 59 std::vector<std::string> storage; |
60 storage.reserve(argv.size()); | 60 storage.reserve(argv.size()); |
61 for (size_t i = 0; i < argv.size(); ++i) { | 61 for (size_t i = 0; i < argv.size(); ++i) { |
62 storage.push_back(base::UTF16ToUTF8(argv[i])); | 62 storage.push_back(base::UTF16ToUTF8(argv[i])); |
63 argv_as_utf8[i] = &storage[i][0]; | 63 argv_as_utf8[i] = &storage[i][0]; |
64 } | 64 } |
65 argv_as_utf8[argv.size()] = nullptr; | 65 argv_as_utf8[argv.size()] = nullptr; |
66 argv.clear(); | 66 argv.clear(); |
67 return crashpad::HandlerMain(static_cast<int>(storage.size()), | 67 return crashpad::HandlerMain(static_cast<int>(storage.size()), |
68 argv_as_utf8.get()); | 68 argv_as_utf8.get(), nullptr); |
69 } | 69 } |
70 | 70 |
71 } // namespace crash_reporter | 71 } // namespace crash_reporter |
OLD | NEW |