• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1diff --git chrome/chrome_elf/BUILD.gn chrome/chrome_elf/BUILD.gn
2index 9b08e23e921b..49182504ae36 100644
3--- chrome/chrome_elf/BUILD.gn
4+++ chrome/chrome_elf/BUILD.gn
5@@ -7,6 +7,7 @@
6
7 import("//build/config/compiler/compiler.gni")
8 import("//build/config/win/manifest.gni")
9+import("//cef/libcef/features/features.gni")
10 import("//chrome/process_version_rc_template.gni")
11 import("//testing/test.gni")
12
13@@ -104,9 +105,6 @@ source_set("constants") {
14
15 static_library("crash") {
16   sources = [
17-    "../app/chrome_crash_reporter_client_win.cc",
18-    "../app/chrome_crash_reporter_client_win.h",
19-    "../common/chrome_result_codes.h",
20     "crash/crash_helper.cc",
21     "crash/crash_helper.h",
22   ]
23@@ -114,6 +112,7 @@ static_library("crash") {
24     ":hook_util",
25     "//base",  # This needs to go.  DEP of app, crash_keys, client.
26     "//base:base_static",  # pe_image
27+    "//cef/libcef/features",
28     "//chrome/install_static:install_static_util",
29     "//components/crash/core/app",
30     "//components/crash/core/common",  # crash_keys
31@@ -121,6 +120,17 @@ static_library("crash") {
32     "//content/public/common:result_codes",
33     "//third_party/crashpad/crashpad/client",  # DumpWithoutCrash
34   ]
35+
36+  if (enable_cef) {
37+    deps += [ "//cef:chrome_elf_set" ]
38+    include_dirs = [ "//cef" ]
39+  } else {
40+    sources += [
41+      "//chrome/app/chrome_crash_reporter_client_win.cc",
42+      "//chrome/app/chrome_crash_reporter_client_win.h",
43+      "//chrome/common/chrome_result_codes.h",
44+    ]
45+  }
46 }
47
48 source_set("dll_hash") {
49diff --git chrome/chrome_elf/crash/crash_helper.cc chrome/chrome_elf/crash/crash_helper.cc
50index 886372e11489..ad3bc2242883 100644
51--- chrome/chrome_elf/crash/crash_helper.cc
52+++ chrome/chrome_elf/crash/crash_helper.cc
53@@ -11,12 +11,17 @@
54 #include <string>
55 #include <vector>
56
57+#include "cef/libcef/features/features.h"
58 #include "chrome/app/chrome_crash_reporter_client_win.h"
59 #include "chrome/chrome_elf/hook_util/hook_util.h"
60 #include "components/crash/core/app/crashpad.h"
61 #include "components/crash/core/common/crash_keys.h"
62 #include "third_party/crashpad/crashpad/client/crashpad_client.h"
63
64+#if BUILDFLAG(ENABLE_CEF)
65+#include "cef/libcef/common/crash_reporter_client.h"
66+#endif
67+
68 namespace {
69
70 // Crash handling from elf is only enabled for the chrome.exe process.
71@@ -77,7 +82,11 @@ bool InitializeCrashReporting() {
72   g_crash_reports = new std::vector<crash_reporter::Report>;
73   g_set_unhandled_exception_filter = new elf_hook::IATHook();
74
75+#if BUILDFLAG(ENABLE_CEF)
76+  CefCrashReporterClient::InitializeCrashReportingForProcess();
77+#else
78   ChromeCrashReporterClient::InitializeCrashReportingForProcess();
79+#endif
80
81   g_crash_helper_enabled = true;
82   return true;
83diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc
84index b84f727c9dc6..817df167e5a6 100644
85--- chrome/common/crash_keys.cc
86+++ chrome/common/crash_keys.cc
87@@ -4,6 +4,8 @@
88
89 #include "chrome/common/crash_keys.h"
90
91+#include <iterator>
92+
93 #include "base/base_switches.h"
94 #include "base/command_line.h"
95 #include "base/stl_util.h"
96@@ -28,7 +30,7 @@
97 namespace crash_keys {
98
99 // Return true if we DON'T want to upload this flag to the crash server.
100-static bool IsBoringSwitch(const std::string& flag) {
101+bool IsBoringChromeSwitch(const std::string& flag) {
102   static const char* const kIgnoreSwitches[] = {
103     switches::kEnableLogging,
104     switches::kFlagSwitchesBegin,
105@@ -81,7 +83,7 @@ static bool IsBoringSwitch(const std::string& flag) {
106 }
107
108 void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
109-  return SetSwitchesFromCommandLine(command_line, &IsBoringSwitch);
110+  return SetSwitchesFromCommandLine(command_line, &IsBoringChromeSwitch);
111 }
112
113 void SetActiveExtensions(const std::set<std::string>& extensions) {
114diff --git chrome/common/crash_keys.h chrome/common/crash_keys.h
115index bcf172e645a2..f879aa745adf 100644
116--- chrome/common/crash_keys.h
117+++ chrome/common/crash_keys.h
118@@ -17,6 +17,10 @@ class CommandLine;
119
120 namespace crash_keys {
121
122+// Returns true if the specified command-line flag should be excluded from
123+// crash reporting.
124+bool IsBoringChromeSwitch(const std::string& flag);
125+
126 // Sets the kNumSwitches key and the set of keys named using kSwitchFormat based
127 // on the given |command_line|.
128 void SetCrashKeysFromCommandLine(const base::CommandLine& command_line);
129diff --git components/crash/core/app/breakpad_linux.cc components/crash/core/app/breakpad_linux.cc
130index 00009dacdc2b..e6454d5b1a23 100644
131--- components/crash/core/app/breakpad_linux.cc
132+++ components/crash/core/app/breakpad_linux.cc
133@@ -28,6 +28,7 @@
134 #include "base/base_switches.h"
135 #include "base/command_line.h"
136 #include "base/debug/dump_without_crashing.h"
137+#include "base/debug/leak_annotations.h"
138 #include "base/files/file_path.h"
139 #include "base/lazy_instance.h"
140 #include "base/linux_util.h"
141@@ -720,7 +721,7 @@ bool CrashDone(const MinidumpDescriptor& minidump,
142   info.process_type_length = 7;
143   info.distro = base::g_linux_distro;
144   info.distro_length = my_strlen(base::g_linux_distro);
145-  info.upload = upload;
146+  info.upload = upload && g_upload_url;
147   info.process_start_time = g_process_start_time;
148   info.oom_size = base::g_oom_size;
149   info.pid = g_pid;
150@@ -1734,10 +1735,27 @@ void HandleCrashDump(const BreakpadInfo& info) {
151     GetCrashReporterClient()->GetProductNameAndVersion(&product_name, &version);
152
153     writer.AddBoundary();
154-    writer.AddPairString("prod", product_name);
155+    writer.AddPairString("product", product_name);
156+    writer.AddBoundary();
157+    writer.AddPairString("version", version);
158     writer.AddBoundary();
159-    writer.AddPairString("ver", version);
160+
161+#if defined(ARCH_CPU_ARM_FAMILY)
162+#if defined(ARCH_CPU_32_BITS)
163+    const char* platform = "linuxarm";
164+#elif defined(ARCH_CPU_64_BITS)
165+    const char* platform = "linuxarm64";
166+#endif
167+#else
168+#if defined(ARCH_CPU_32_BITS)
169+    const char* platform = "linux32";
170+#elif defined(ARCH_CPU_64_BITS)
171+    const char* platform = "linux64";
172+#endif
173+#endif  // defined(ARCH_CPU_ARM_FAMILY)
174+    writer.AddPairString("platform", platform);
175     writer.AddBoundary();
176+
177     if (info.pid > 0) {
178       char pid_value_buf[kUint64StringSize];
179       uint64_t pid_value_len = my_uint64_len(info.pid);
180@@ -1854,6 +1872,9 @@ void HandleCrashDump(const BreakpadInfo& info) {
181         crash_reporter::internal::TransitionalCrashKeyStorage;
182     CrashKeyStorage::Iterator crash_key_iterator(*info.crash_keys);
183     const CrashKeyStorage::Entry* entry;
184+
185+    crash_reporter::CrashReporterClient::ParameterMap parameters;
186+
187     while ((entry = crash_key_iterator.Next())) {
188       size_t key_size, value_size;
189       // Check for malformed messages.
190@@ -1864,7 +1885,13 @@ void HandleCrashDump(const BreakpadInfo& info) {
191                        ? CrashKeyStorage::value_size - 1
192                        : my_strlen(entry->value);
193
194-      writer.AddPairData(entry->key, key_size, entry->value, value_size);
195+      parameters.insert(std::make_pair(std::string{entry->key, key_size}, std::string{entry->value, value_size}));
196+    }
197+    if (!parameters.empty())
198+      parameters = GetCrashReporterClient()->FilterParameters(parameters);
199+
200+    for (const auto& param : parameters) {
201+      writer.AddPairData(param.first.data(), param.first.size(), param.second.data(), param.second.size());
202       writer.AddBoundary();
203       writer.Flush();
204     }
205diff --git components/crash/core/app/breakpad_linux.h components/crash/core/app/breakpad_linux.h
206index 9ea80370a842..3043f7d32f33 100644
207--- components/crash/core/app/breakpad_linux.h
208+++ components/crash/core/app/breakpad_linux.h
209@@ -20,6 +20,9 @@ extern void InitCrashReporter(const std::string& process_type);
210 // Sets the product/distribution channel crash key.
211 void SetChannelCrashKey(const std::string& channel);
212
213+// Set the crash server URL.
214+void SetCrashServerURL(const std::string& url);
215+
216 #if defined(OS_ANDROID)
217 extern void InitCrashKeysForTesting();
218
219diff --git components/crash/core/app/crash_reporter_client.cc components/crash/core/app/crash_reporter_client.cc
220index 89b4bfccd5d3..7cb0a85470d2 100644
221--- components/crash/core/app/crash_reporter_client.cc
222+++ components/crash/core/app/crash_reporter_client.cc
223@@ -87,7 +87,7 @@ int CrashReporterClient::GetResultCodeRespawnFailed() {
224 }
225 #endif
226
227-#if defined(OS_POSIX) && !defined(OS_MAC)
228+#if defined(OS_POSIX)
229 void CrashReporterClient::GetProductNameAndVersion(const char** product_name,
230                                                    const char** version) {
231 }
232@@ -96,6 +96,7 @@ void CrashReporterClient::GetProductNameAndVersion(std::string* product_name,
233                                                    std::string* version,
234                                                    std::string* channel) {}
235
236+#if !defined(OS_MAC)
237 base::FilePath CrashReporterClient::GetReporterLogFilename() {
238   return base::FilePath();
239 }
240@@ -105,6 +106,7 @@ bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename,
241   return false;
242 }
243 #endif
244+#endif
245
246 #if defined(OS_WIN)
247 bool CrashReporterClient::GetCrashDumpLocation(std::wstring* crash_dir) {
248@@ -139,6 +141,28 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
249   return false;
250 }
251
252+bool CrashReporterClient::EnableBreakpadForProcess(
253+    const std::string& process_type) {
254+  return false;
255+}
256+
257+void CrashReporterClient::GetCrashOptionalArguments(
258+    std::vector<std::string>* arguments) {
259+}
260+
261+#if defined(OS_WIN)
262+std::wstring CrashReporterClient::GetCrashExternalHandler(
263+    const std::wstring& exe_dir) {
264+  return exe_dir + L"\\crashpad_handler.exe";
265+}
266+#endif
267+
268+#if defined(OS_MAC)
269+bool CrashReporterClient::EnableBrowserCrashForwarding() {
270+  return true;
271+}
272+#endif
273+
274 #if defined(OS_ANDROID)
275 unsigned int CrashReporterClient::GetCrashDumpPercentage() {
276   return 100;
277@@ -201,9 +225,11 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
278   return false;
279 }
280
281-bool CrashReporterClient::EnableBreakpadForProcess(
282-    const std::string& process_type) {
283-  return false;
284+#if defined(OS_POSIX) && !defined(OS_MAC)
285+CrashReporterClient::ParameterMap
286+CrashReporterClient::FilterParameters(const ParameterMap& parameters) {
287+  return parameters;
288 }
289+#endif
290
291 }  // namespace crash_reporter
292diff --git components/crash/core/app/crash_reporter_client.h components/crash/core/app/crash_reporter_client.h
293index 39557cce4744..236806090021 100644
294--- components/crash/core/app/crash_reporter_client.h
295+++ components/crash/core/app/crash_reporter_client.h
296@@ -5,7 +5,9 @@
297 #ifndef COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
298 #define COMPONENTS_CRASH_CORE_APP_CRASH_REPORTER_CLIENT_H_
299
300+#include <map>
301 #include <string>
302+#include <vector>
303
304 #include "build/build_config.h"
305
306@@ -87,7 +89,7 @@ class CrashReporterClient {
307   virtual int GetResultCodeRespawnFailed();
308 #endif
309
310-#if defined(OS_POSIX) && !defined(OS_MAC)
311+#if defined(OS_POSIX)
312   // Returns a textual description of the product type and version to include
313   // in the crash report. Neither out parameter should be set to NULL.
314   // TODO(jperaza): Remove the 2-parameter overload of this method once all
315@@ -98,6 +100,7 @@ class CrashReporterClient {
316                                         std::string* version,
317                                         std::string* channel);
318
319+#if !defined(OS_MAC)
320   virtual base::FilePath GetReporterLogFilename();
321
322   // Custom crash minidump handler after the minidump is generated.
323@@ -107,6 +110,7 @@ class CrashReporterClient {
324   // libc nor allocate memory normally.
325   virtual bool HandleCrashDump(const char* crashdump_filename,
326                                uint64_t crash_pid);
327+#endif
328 #endif
329
330   // The location where minidump files should be written. Returns true if
331@@ -204,6 +208,27 @@ class CrashReporterClient {
332
333   // Returns true if breakpad should run in the given process type.
334   virtual bool EnableBreakpadForProcess(const std::string& process_type);
335+
336+  // Populate |arguments| with additional optional arguments.
337+  virtual void GetCrashOptionalArguments(std::vector<std::string>* arguments);
338+
339+#if defined(OS_WIN)
340+  // Returns the absolute path to the external crash handler exe.
341+  virtual std::wstring GetCrashExternalHandler(const std::wstring& exe_dir);
342+#endif
343+
344+#if defined(OS_MAC)
345+  // Returns true if forwarding of crashes to the system crash reporter is
346+  // enabled for the browser process.
347+  virtual bool EnableBrowserCrashForwarding();
348+#endif
349+
350+#if defined(OS_POSIX) && !defined(OS_MAC)
351+  // Provides an oportunity to modify the parameters that will be sent with a
352+  // crash upload.
353+  using ParameterMap = std::map<std::string, std::string>;
354+  virtual ParameterMap FilterParameters(const ParameterMap& parameters);
355+#endif
356 };
357
358 }  // namespace crash_reporter
359diff --git components/crash/core/app/crashpad.cc components/crash/core/app/crashpad.cc
360index 27f5504d544a..fd901ccd5b75 100644
361--- components/crash/core/app/crashpad.cc
362+++ components/crash/core/app/crashpad.cc
363@@ -152,7 +152,8 @@ void InitializeCrashpadImpl(bool initial_client,
364   // fallback. Forwarding is turned off for debug-mode builds even for the
365   // browser process, because the system's crash reporter can take a very long
366   // time to chew on symbols.
367-  if (!browser_process || is_debug_build) {
368+  if (!browser_process || is_debug_build ||
369+      !GetCrashReporterClient()->EnableBrowserCrashForwarding()) {
370     crashpad::CrashpadInfo::GetCrashpadInfo()
371         ->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled);
372   }
373diff --git components/crash/core/app/crashpad_mac.mm components/crash/core/app/crashpad_mac.mm
374index 2be2fd857bc5..04ebef6442af 100644
375--- components/crash/core/app/crashpad_mac.mm
376+++ components/crash/core/app/crashpad_mac.mm
377@@ -16,12 +16,15 @@
378 #include "base/files/file_path.h"
379 #include "base/mac/bundle_locations.h"
380 #include "base/mac/foundation_util.h"
381+#include "base/path_service.h"
382 #include "base/strings/string_number_conversions.h"
383 #include "base/strings/string_piece.h"
384 #include "base/strings/stringprintf.h"
385 #include "base/strings/sys_string_conversions.h"
386 #include "build/branding_buildflags.h"
387 #include "components/crash/core/app/crash_reporter_client.h"
388+#include "components/crash/core/app/crash_switches.h"
389+#include "content/public/common/content_paths.h"
390 #include "third_party/crashpad/crashpad/client/crash_report_database.h"
391 #include "third_party/crashpad/crashpad/client/crashpad_client.h"
392 #include "third_party/crashpad/crashpad/client/crashpad_info.h"
393@@ -39,14 +42,24 @@ std::map<std::string, std::string> GetProcessSimpleAnnotations() {
394     std::map<std::string, std::string> process_annotations;
395     @autoreleasepool {
396       NSBundle* outer_bundle = base::mac::OuterBundle();
397+      CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
398+      const char* product_name = "";
399+      const char* product_version = "";
400+      crash_reporter_client->GetProductNameAndVersion(&product_name,
401+                                                      &product_version);
402+
403+      if (strlen(product_name) == 0) {
404 #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
405-      process_annotations["prod"] = "Chrome_Mac";
406+        process_annotations["product"] = "Chrome_Mac";
407 #else
408-      NSString* product = base::mac::ObjCCast<NSString>([outer_bundle
409-          objectForInfoDictionaryKey:base::mac::CFToNSCast(kCFBundleNameKey)]);
410-      process_annotations["prod"] =
411-          base::SysNSStringToUTF8(product).append("_Mac");
412+        NSString* product = base::mac::ObjCCast<NSString>([outer_bundle
413+            objectForInfoDictionaryKey:base::mac::CFToNSCast(kCFBundleNameKey)]);
414+        process_annotations["product"] =
415+            base::SysNSStringToUTF8(product).append("_Mac");
416 #endif
417+      } else {
418+        process_annotations["product"] = product_name;
419+      }
420
421 #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
422       // Empty means stable.
423@@ -77,12 +90,20 @@ std::map<std::string, std::string> GetProcessSimpleAnnotations() {
424         }
425       }
426
427-      NSString* version =
428-          base::mac::ObjCCast<NSString>([base::mac::FrameworkBundle()
429-              objectForInfoDictionaryKey:@"CFBundleShortVersionString"]);
430-      process_annotations["ver"] = base::SysNSStringToUTF8(version);
431+      if (strlen(product_version) == 0) {
432+        NSString* version =
433+            base::mac::ObjCCast<NSString>([base::mac::FrameworkBundle()
434+                objectForInfoDictionaryKey:@"CFBundleShortVersionString"]);
435+        process_annotations["version"] = base::SysNSStringToUTF8(version);
436+      } else {
437+        process_annotations["version"] = product_version;
438+      }
439
440-      process_annotations["plat"] = std::string("OS X");
441+#if defined(ARCH_CPU_ARM64)
442+      process_annotations["platform"] = std::string("macosarm64");
443+#else
444+      process_annotations["platform"] = std::string("macos");
445+#endif
446     }  // @autoreleasepool
447     return process_annotations;
448   }();
449@@ -142,10 +163,10 @@ base::FilePath PlatformCrashpadInitialization(
450
451   if (initial_client) {
452     @autoreleasepool {
453-      base::FilePath framework_bundle_path = base::mac::FrameworkBundlePath();
454-      base::FilePath handler_path =
455-          framework_bundle_path.Append("Helpers").Append(
456-              "chrome_crashpad_handler");
457+      // Use the same subprocess helper exe.
458+      base::FilePath handler_path;
459+      base::PathService::Get(content::CHILD_PROCESS_EXE, &handler_path);
460+      DCHECK(!handler_path.empty());
461
462       // Is there a way to recover if this fails?
463       CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
464@@ -174,6 +195,12 @@ base::FilePath PlatformCrashpadInitialization(
465             "--reset-own-crash-exception-port-to-system-default");
466       }
467
468+      // Since we're using the same subprocess helper exe we must specify the
469+      // process type.
470+      arguments.push_back(std::string("--type=") + switches::kCrashpadHandler);
471+
472+      crash_reporter_client->GetCrashOptionalArguments(&arguments);
473+
474       bool result = GetCrashpadClient().StartHandler(
475           handler_path, database_path, metrics_path, url,
476           GetProcessSimpleAnnotations(), arguments, true, false);
477diff --git components/crash/core/app/crashpad_win.cc components/crash/core/app/crashpad_win.cc
478index 686be7964d77..6059aab2b69a 100644
479--- components/crash/core/app/crashpad_win.cc
480+++ components/crash/core/app/crashpad_win.cc
481@@ -36,8 +36,8 @@ void GetPlatformCrashpadAnnotations(
482   std::wstring product_name, version, special_build, channel_name;
483   crash_reporter_client->GetProductNameAndVersion(
484       exe_file, &product_name, &version, &special_build, &channel_name);
485-  (*annotations)["prod"] = base::WideToUTF8(product_name);
486-  (*annotations)["ver"] = base::WideToUTF8(version);
487+  (*annotations)["product"] = base::WideToUTF8(product_name);
488+  (*annotations)["version"] = base::WideToUTF8(version);
489 #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
490   // Empty means stable.
491   const bool allow_empty_channel = true;
492@@ -54,9 +54,11 @@ void GetPlatformCrashpadAnnotations(
493   if (!special_build.empty())
494     (*annotations)["special"] = base::WideToUTF8(special_build);
495 #if defined(ARCH_CPU_X86)
496-  (*annotations)["plat"] = std::string("Win32");
497+  (*annotations)["platform"] = std::string("win32");
498 #elif defined(ARCH_CPU_X86_64)
499-  (*annotations)["plat"] = std::string("Win64");
500+  (*annotations)["platform"] = std::string("win64");
501+#elif defined(ARCH_CPU_ARM64)
502+  (*annotations)["platform"] = std::string("winarm64");
503 #endif
504 }
505
506@@ -71,7 +73,9 @@ base::FilePath PlatformCrashpadInitialization(
507   base::FilePath metrics_path;  // Only valid in the browser process.
508
509   const char kPipeNameVar[] = "CHROME_CRASHPAD_PIPE_NAME";
510+#if defined(GOOGLE_CHROME_BUILD)
511   const char kServerUrlVar[] = "CHROME_CRASHPAD_SERVER_URL";
512+#endif
513   std::unique_ptr<base::Environment> env(base::Environment::Create());
514
515   CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
516@@ -92,9 +96,11 @@ base::FilePath PlatformCrashpadInitialization(
517
518     std::string url = crash_reporter_client->GetUploadUrl();
519
520+#if defined(GOOGLE_CHROME_BUILD)
521     // Allow the crash server to be overridden for testing. If the variable
522     // isn't present in the environment then the default URL will remain.
523     env->GetVar(kServerUrlVar, &url);
524+#endif
525
526     base::FilePath exe_file(exe_path);
527     if (exe_file.empty()) {
528@@ -105,13 +111,14 @@ base::FilePath PlatformCrashpadInitialization(
529       exe_file = base::FilePath(exe_file_path);
530     }
531
532-    // If the handler is embedded in the binary (e.g. chrome, setup), we
533-    // reinvoke it with --type=crashpad-handler. Otherwise, we use the
534-    // standalone crashpad_handler.exe (for tests, etc.).
535     std::vector<std::string> start_arguments(initial_arguments);
536+
537+    // Always add --type=crashpad-handler because the value is expected by
538+    // CefExecuteProcess.
539+    start_arguments.push_back(
540+        std::string("--type=") + switches::kCrashpadHandler);
541+
542     if (embedded_handler) {
543-      start_arguments.push_back(std::string("--type=") +
544-                                switches::kCrashpadHandler);
545       if (!user_data_dir.empty()) {
546         start_arguments.push_back(std::string("--user-data-dir=") +
547                                   user_data_dir);
548@@ -122,9 +129,12 @@ base::FilePath PlatformCrashpadInitialization(
549       start_arguments.push_back("/prefetch:7");
550     } else {
551       base::FilePath exe_dir = exe_file.DirName();
552-      exe_file = exe_dir.Append(FILE_PATH_LITERAL("crashpad_handler.exe"));
553+      exe_file = base::FilePath(
554+          crash_reporter_client->GetCrashExternalHandler(exe_dir.value()));
555     }
556
557+    crash_reporter_client->GetCrashOptionalArguments(&start_arguments);
558+
559     std::vector<std::string> arguments(start_arguments);
560
561     if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
562