@@ -141,6 +141,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
141141 const std::vector<base::FilePath>& attachments,
142142 const base::FilePath& crash_reporter,
143143 const base::FilePath& crash_envelope,
144+ const std::string& report_id,
144145 bool restartable) {
145146 base::apple::ScopedMachReceiveRight receive_right (
146147 NewMachPort (MACH_PORT_RIGHT_RECEIVE));
@@ -184,6 +185,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
184185 attachments,
185186 crash_reporter,
186187 crash_envelope,
188+ report_id,
187189 std::move (receive_right),
188190 handler_restarter.get (),
189191 false )) {
@@ -200,7 +202,8 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
200202 arguments,
201203 attachments,
202204 crash_reporter,
203- crash_envelope)) {
205+ crash_envelope,
206+ report_id)) {
204207 // The thread owns the object now.
205208 std::ignore = handler_restarter.release ();
206209 }
@@ -239,6 +242,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
239242 attachments_,
240243 crash_reporter_,
241244 crash_envelope_,
245+ report_id_,
242246 base::apple::ScopedMachReceiveRight (rights),
243247 this ,
244248 true );
@@ -258,6 +262,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
258262 attachments_(),
259263 crash_reporter_(),
260264 crash_envelope_(),
265+ report_id_(),
261266 notify_port_(NewMachPort(MACH_PORT_RIGHT_RECEIVE)),
262267 last_start_time_(0 ) {}
263268
@@ -290,6 +295,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
290295 const std::vector<base::FilePath>& attachments,
291296 const base::FilePath& crash_reporter,
292297 const base::FilePath& crash_envelope,
298+ const std::string& report_id,
293299 base::apple::ScopedMachReceiveRight receive_right,
294300 HandlerStarter* handler_restarter,
295301 bool restart) {
@@ -387,6 +393,10 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
387393 FormatArgumentString (" crash-envelope" , crash_envelope.value ()));
388394 }
389395
396+ if (!report_id.empty ()) {
397+ argv.push_back (FormatArgumentString (" report-id" , report_id));
398+ }
399+
390400 argv.push_back (FormatArgumentInt (" handshake-fd" , server_write_fd.get ()));
391401
392402 // When restarting, reset the system default crash handler first. Otherwise,
@@ -426,7 +436,8 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
426436 const std::vector<std::string>& arguments,
427437 const std::vector<base::FilePath>& attachments,
428438 const base::FilePath& crash_reporter,
429- const base::FilePath& crash_envelope) {
439+ const base::FilePath& crash_envelope,
440+ const std::string& report_id) {
430441 handler_ = handler;
431442 database_ = database;
432443 metrics_dir_ = metrics_dir;
@@ -437,6 +448,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
437448 attachments_ = attachments;
438449 crash_reporter_ = crash_reporter;
439450 crash_envelope_ = crash_envelope;
451+ report_id_ = report_id;
440452
441453 pthread_attr_t pthread_attr;
442454 errno = pthread_attr_init (&pthread_attr);
@@ -493,6 +505,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
493505 std::vector<base::FilePath> attachments_;
494506 base::FilePath crash_reporter_;
495507 base::FilePath crash_envelope_;
508+ std::string report_id_;
496509 base::apple::ScopedMachReceiveRight notify_port_;
497510 uint64_t last_start_time_;
498511};
@@ -519,7 +532,8 @@ bool CrashpadClient::StartHandler(
519532 const base::FilePath& screenshot,
520533 bool wait_for_upload,
521534 const base::FilePath& crash_reporter,
522- const base::FilePath& crash_envelope) {
535+ const base::FilePath& crash_envelope,
536+ const std::string& report_id) {
523537 (void ) wait_for_upload; // unused in mac (for now)
524538
525539 // The “restartable” behavior can only be selected on OS X 10.10 and later. In
@@ -536,6 +550,7 @@ bool CrashpadClient::StartHandler(
536550 attachments,
537551 crash_reporter,
538552 crash_envelope,
553+ report_id,
539554 restartable && (__MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_10 ||
540555 MacOSVersionNumber () >= 10'10'00 )));
541556 if (!exception_port.is_valid ()) {
0 commit comments