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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 | 77 |
78 // In test binaries, use crashpad_handler directly. Otherwise, we launch | 78 // In test binaries, use crashpad_handler directly. Otherwise, we launch |
79 // chrome.exe with --type=crashpad-handler. | 79 // chrome.exe with --type=crashpad-handler. |
80 base::FilePath exe_file; | 80 base::FilePath exe_file; |
81 CHECK(PathService::Get(base::FILE_EXE, &exe_file)); | 81 CHECK(PathService::Get(base::FILE_EXE, &exe_file)); |
82 if (exe_file.BaseName().value() != FILE_PATH_LITERAL("chrome.exe")) { | 82 if (exe_file.BaseName().value() != FILE_PATH_LITERAL("chrome.exe")) { |
83 base::FilePath exe_dir = exe_file.DirName(); | 83 base::FilePath exe_dir = exe_file.DirName(); |
84 exe_file = exe_dir.Append(FILE_PATH_LITERAL("crashpad_handler.exe")); | 84 exe_file = exe_dir.Append(FILE_PATH_LITERAL("crashpad_handler.exe")); |
85 } else { | 85 } else { |
86 arguments.push_back("--type=crashpad-handler"); | 86 arguments.push_back("--type=crashpad-handler"); |
87 | |
88 // Add a prefetch argument to avoid polluting the prefetch profile of the | |
89 // browser process. | |
90 arguments.push_back("/prefetch:8"); | |
gab
2016/01/26 21:40:26
I hate having to use hardcoded strings, why can't
fdoray
2016/01/27 20:12:19
Done. I was scared of adding the crashpad->content
fdoray
2016/01/28 22:11:06
Unfortunately, I can't use the constant here.
- Th
| |
87 } | 91 } |
88 | 92 |
89 // TODO(scottmg): See https://crashpad.chromium.org/bug/23. | 93 // TODO(scottmg): See https://crashpad.chromium.org/bug/23. |
90 arguments.push_back("--no-rate-limit"); | 94 arguments.push_back("--no-rate-limit"); |
91 | 95 |
92 result = g_crashpad_client.Get().StartHandler( | 96 result = g_crashpad_client.Get().StartHandler( |
93 exe_file, database_path, url, process_annotations, arguments, false); | 97 exe_file, database_path, url, process_annotations, arguments, false); |
94 | 98 |
95 // If we're the browser, push the pipe name into the environment so child | 99 // If we're the browser, push the pipe name into the environment so child |
96 // processes can connect to it. If we inherited another crashpad_handler's | 100 // processes can connect to it. If we inherited another crashpad_handler's |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( | 269 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( |
266 void* start) { | 270 void* start) { |
267 ExceptionHandlerRecord* record = | 271 ExceptionHandlerRecord* record = |
268 reinterpret_cast<ExceptionHandlerRecord*>(start); | 272 reinterpret_cast<ExceptionHandlerRecord*>(start); |
269 | 273 |
270 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); | 274 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); |
271 } | 275 } |
272 #endif // ARCH_CPU_X86_64 | 276 #endif // ARCH_CPU_X86_64 |
273 | 277 |
274 } // extern "C" | 278 } // extern "C" |
OLD | NEW |