OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/crashpad.h" | 5 #include "components/crash/content/app/crashpad.h" |
6 | 6 |
7 #include "base/environment.h" | 7 #include "base/environment.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 std::string url = "https://clients2.google.com/cr/report"; | 61 std::string url = "https://clients2.google.com/cr/report"; |
62 #else | 62 #else |
63 std::string url; | 63 std::string url; |
64 #endif | 64 #endif |
65 | 65 |
66 std::vector<std::string> arguments; | 66 std::vector<std::string> arguments; |
67 | 67 |
68 // In test binaries, use crashpad_handler directly. Otherwise, we launch | 68 // In test binaries, use crashpad_handler directly. Otherwise, we launch |
69 // chrome.exe with --type=crashpad-handler. | 69 // chrome.exe with --type=crashpad-handler. |
70 if (exe_file.BaseName().value() != FILE_PATH_LITERAL("chrome.exe")) { | 70 if (exe_file.BaseName().value() != FILE_PATH_LITERAL("chrome.exe")) { |
71 base::FilePath exe_dir; | 71 base::FilePath exe_dir = exe_file.DirName(); |
72 CHECK(PathService::Get(base::DIR_EXE, &exe_dir)); | |
73 exe_file = exe_dir.Append(FILE_PATH_LITERAL("crashpad_handler.exe")); | 72 exe_file = exe_dir.Append(FILE_PATH_LITERAL("crashpad_handler.exe")); |
74 } else { | 73 } else { |
75 arguments.push_back("--type=crashpad-handler"); | 74 arguments.push_back("--type=crashpad-handler"); |
76 } | 75 } |
77 | 76 |
78 result = g_crashpad_client.Get().StartHandler( | 77 result = g_crashpad_client.Get().StartHandler( |
79 exe_file, database_path, url, process_annotations, arguments, false); | 78 exe_file, database_path, url, process_annotations, arguments, false); |
80 | 79 |
81 // If we're the browser, push the pipe name into the environment so child | 80 // If we're the browser, push the pipe name into the environment so child |
82 // processes can connect to it. If we inherited another crashpad_handler's | 81 // processes can connect to it. If we inherited another crashpad_handler's |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 reinterpret_cast<ExceptionHandlerRecord*>(start); | 192 reinterpret_cast<ExceptionHandlerRecord*>(start); |
194 | 193 |
195 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); | 194 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); |
196 } | 195 } |
197 #endif // ARCH_CPU_X86_64 | 196 #endif // ARCH_CPU_X86_64 |
198 | 197 |
199 } // extern "C" | 198 } // extern "C" |
200 | 199 |
201 } // namespace internal | 200 } // namespace internal |
202 } // namespace crash_reporter | 201 } // namespace crash_reporter |
OLD | NEW |