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 <memory> | 7 #include <memory> |
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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 if (embedded_handler) { | 100 if (embedded_handler) { |
101 arguments.push_back(std::string("--type=") + switches::kCrashpadHandler); | 101 arguments.push_back(std::string("--type=") + switches::kCrashpadHandler); |
102 // The prefetch argument added here has to be documented in | 102 // The prefetch argument added here has to be documented in |
103 // chrome_switches.cc, below the kPrefetchArgument* constants. A constant | 103 // chrome_switches.cc, below the kPrefetchArgument* constants. A constant |
104 // can't be used here because crashpad can't depend on Chrome. | 104 // can't be used here because crashpad can't depend on Chrome. |
105 arguments.push_back("/prefetch:7"); | 105 arguments.push_back("/prefetch:7"); |
106 } else { | 106 } else { |
107 base::FilePath exe_dir = exe_file.DirName(); | 107 base::FilePath exe_dir = exe_file.DirName(); |
108 exe_file = exe_dir.Append(FILE_PATH_LITERAL("crashpad_handler.exe")); | 108 exe_file = exe_dir.Append(FILE_PATH_LITERAL("crashpad_handler.exe")); |
109 } | 109 } |
110 // TODO(scottmg): See https://crashpad.chromium.org/bug/23. | |
111 arguments.push_back("--no-rate-limit"); | |
112 | 110 |
113 result = g_crashpad_client.Get().StartHandler( | 111 result = g_crashpad_client.Get().StartHandler( |
114 exe_file, database_path, url, process_annotations, arguments, false); | 112 exe_file, database_path, url, process_annotations, arguments, false); |
115 | 113 |
116 // If we're the browser, push the pipe name into the environment so child | 114 // If we're the browser, push the pipe name into the environment so child |
117 // processes can connect to it. If we inherited another crashpad_handler's | 115 // processes can connect to it. If we inherited another crashpad_handler's |
118 // pipe name, we'll overwrite it here. | 116 // pipe name, we'll overwrite it here. |
119 env->SetVar(kPipeNameVar, | 117 env->SetVar(kPipeNameVar, |
120 base::UTF16ToUTF8(g_crashpad_client.Get().GetHandlerIPCPipe())); | 118 base::UTF16ToUTF8(g_crashpad_client.Get().GetHandlerIPCPipe())); |
121 } else { | 119 } else { |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( | 283 void __declspec(dllexport) __cdecl UnregisterNonABICompliantCodeRange( |
286 void* start) { | 284 void* start) { |
287 ExceptionHandlerRecord* record = | 285 ExceptionHandlerRecord* record = |
288 reinterpret_cast<ExceptionHandlerRecord*>(start); | 286 reinterpret_cast<ExceptionHandlerRecord*>(start); |
289 | 287 |
290 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); | 288 CHECK(RtlDeleteFunctionTable(&record->runtime_function)); |
291 } | 289 } |
292 #endif // ARCH_CPU_X86_64 | 290 #endif // ARCH_CPU_X86_64 |
293 | 291 |
294 } // extern "C" | 292 } // extern "C" |
OLD | NEW |