From 3e18d8baf564943664951fd385bb23296a302e95 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 2 Feb 2017 13:00:00 -0800 Subject: [PATCH 01/12] Remove _ prefix on binding methods --- atom/common/api/atom_api_crash_reporter.cc | 6 +++--- lib/common/api/crash-reporter.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/atom/common/api/atom_api_crash_reporter.cc b/atom/common/api/atom_api_crash_reporter.cc index aaaf200b32f3..57f880ff1944 100644 --- a/atom/common/api/atom_api_crash_reporter.cc +++ b/atom/common/api/atom_api_crash_reporter.cc @@ -38,11 +38,11 @@ void Initialize(v8::Local exports, v8::Local unused, auto report = base::Unretained(CrashReporter::GetInstance()); dict.SetMethod("start", base::Bind(&CrashReporter::Start, report)); - dict.SetMethod("_getUploadedReports", + dict.SetMethod("getUploadedReports", base::Bind(&CrashReporter::GetUploadedReports, report)); - dict.SetMethod("_setUploadToServer", + dict.SetMethod("setUploadToServer", base::Bind(&CrashReporter::SetUploadToServer, report)); - dict.SetMethod("_getUploadToServer", + dict.SetMethod("getUploadToServer", base::Bind(&CrashReporter::GetUploadToServer, report)); } diff --git a/lib/common/api/crash-reporter.js b/lib/common/api/crash-reporter.js index c5a462cf5110..3579a8c375b6 100644 --- a/lib/common/api/crash-reporter.js +++ b/lib/common/api/crash-reporter.js @@ -104,7 +104,7 @@ class CrashReporter { getUploadToServer () { if (process.type === 'browser') { - return binding._getUploadToServer() + return binding.getUploadToServer() } else { throw new Error('getUploadToServer can only be called from the main process') } @@ -112,7 +112,7 @@ class CrashReporter { setUploadToServer (uploadToServer) { if (process.type === 'browser') { - return binding._setUploadToServer(uploadToServer) + return binding.setUploadToServer(uploadToServer) } else { throw new Error('setUploadToServer can only be called from the main process') } From cfe3ae234b2d820b971ec28b9dc299f59bf95cdd Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 2 Feb 2017 13:01:49 -0800 Subject: [PATCH 02/12] Correct , -> . typo --- docs/api/crash-reporter.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/crash-reporter.md b/docs/api/crash-reporter.md index 3e93de4a25b4..164ee7d74996 100644 --- a/docs/api/crash-reporter.md +++ b/docs/api/crash-reporter.md @@ -44,14 +44,14 @@ The `crashReporter` module has the following methods: Default is `true`. * `ignoreSystemCrashHandler` Boolean (optional) - Default is `false`. * `extra` Object (optional) - An object you can define that will be sent along with the - report. Only string properties are sent correctly, Nested objects are not + report. Only string properties are sent correctly. Nested objects are not supported. You are required to call this method before using any other `crashReporter` APIs and in each process (main/renderer) from which you want to collect crash reports. You can pass different options to `crashReporter.start` when calling from different processes. -**Note** Child processes created via the `child_process` module will not have access to the Electron modules. +**Note** Child processes created via the `child_process` module will not have access to the Electron modules. Therefore, to collect crash reports from them, use `process.crashReporter.start` instead. Pass the same options as above along with an additional one called `crashesDirectory` that should point to a directory to store the crash reports temporarily. You can test this out by calling `process.crash()` to crash the child process. From ba975d552a8adbf1699d38fc28e8659218fb6faf Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 2 Feb 2017 14:23:21 -0800 Subject: [PATCH 03/12] Add setExtraParameter support on macOS --- atom/common/api/atom_api_crash_reporter.cc | 13 +++++++------ atom/common/crash_reporter/crash_reporter.cc | 4 ++++ atom/common/crash_reporter/crash_reporter.h | 2 ++ atom/common/crash_reporter/crash_reporter_mac.h | 2 ++ atom/common/crash_reporter/crash_reporter_mac.mm | 8 ++++++++ lib/common/api/crash-reporter.js | 4 ++++ 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/atom/common/api/atom_api_crash_reporter.cc b/atom/common/api/atom_api_crash_reporter.cc index 57f880ff1944..6820e7a7929d 100644 --- a/atom/common/api/atom_api_crash_reporter.cc +++ b/atom/common/api/atom_api_crash_reporter.cc @@ -35,15 +35,16 @@ namespace { void Initialize(v8::Local exports, v8::Local unused, v8::Local context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); - auto report = base::Unretained(CrashReporter::GetInstance()); - dict.SetMethod("start", - base::Bind(&CrashReporter::Start, report)); + auto reporter = base::Unretained(CrashReporter::GetInstance()); + dict.SetMethod("start", base::Bind(&CrashReporter::Start, reporter)); + dict.SetMethod("setExtraParameter", + base::Bind(&CrashReporter::SetExtraParameter, reporter)); dict.SetMethod("getUploadedReports", - base::Bind(&CrashReporter::GetUploadedReports, report)); + base::Bind(&CrashReporter::GetUploadedReports, reporter)); dict.SetMethod("setUploadToServer", - base::Bind(&CrashReporter::SetUploadToServer, report)); + base::Bind(&CrashReporter::SetUploadToServer, reporter)); dict.SetMethod("getUploadToServer", - base::Bind(&CrashReporter::GetUploadToServer, report)); + base::Bind(&CrashReporter::GetUploadToServer, reporter)); } } // namespace diff --git a/atom/common/crash_reporter/crash_reporter.cc b/atom/common/crash_reporter/crash_reporter.cc index f8a5f5e29ecb..bc3176275fe8 100644 --- a/atom/common/crash_reporter/crash_reporter.cc +++ b/atom/common/crash_reporter/crash_reporter.cc @@ -86,6 +86,10 @@ void CrashReporter::InitBreakpad(const std::string& product_name, void CrashReporter::SetUploadParameters() { } +void CrashReporter::SetExtraParameter(const std::string& key, + const std::string& value) { +} + #if defined(OS_MACOSX) && defined(MAS_BUILD) // static CrashReporter* CrashReporter::GetInstance() { diff --git a/atom/common/crash_reporter/crash_reporter.h b/atom/common/crash_reporter/crash_reporter.h index c564527109b8..cd93f171c05b 100644 --- a/atom/common/crash_reporter/crash_reporter.h +++ b/atom/common/crash_reporter/crash_reporter.h @@ -37,6 +37,8 @@ class CrashReporter { virtual void SetUploadToServer(bool upload_to_server); virtual bool GetUploadToServer(); + virtual void SetExtraParameter(const std::string& key, + const std::string& value); protected: CrashReporter(); diff --git a/atom/common/crash_reporter/crash_reporter_mac.h b/atom/common/crash_reporter/crash_reporter_mac.h index 9066f2017bb2..8d1b1d0de1c3 100644 --- a/atom/common/crash_reporter/crash_reporter_mac.h +++ b/atom/common/crash_reporter/crash_reporter_mac.h @@ -34,6 +34,8 @@ class CrashReporterMac : public CrashReporter { void SetUploadParameters() override; void SetUploadToServer(bool upload_to_server) override; bool GetUploadToServer() override; + void SetExtraParameter(const std::string& key, + const std::string& value) override; private: friend struct base::DefaultSingletonTraits; diff --git a/atom/common/crash_reporter/crash_reporter_mac.mm b/atom/common/crash_reporter/crash_reporter_mac.mm index cdaa5d2f52e6..0e9b20d6f663 100644 --- a/atom/common/crash_reporter/crash_reporter_mac.mm +++ b/atom/common/crash_reporter/crash_reporter_mac.mm @@ -100,6 +100,14 @@ void CrashReporterMac::SetCrashKeyValue(const base::StringPiece& key, simple_string_dictionary_->SetKeyValue(key.data(), value.data()); } +void CrashReporterMac::SetExtraParameter(const std::string& key, + const std::string& value) { + if (simple_string_dictionary_) + SetCrashKeyValue(key, value); + else + upload_parameters_[key] = value; +} + std::vector CrashReporterMac::GetUploadedReports(const base::FilePath& crashes_dir) { std::vector uploaded_reports; diff --git a/lib/common/api/crash-reporter.js b/lib/common/api/crash-reporter.js index 3579a8c375b6..f168251cc18f 100644 --- a/lib/common/api/crash-reporter.js +++ b/lib/common/api/crash-reporter.js @@ -117,6 +117,10 @@ class CrashReporter { throw new Error('setUploadToServer can only be called from the main process') } } + + setExtraParameter (key, value) { + binding.setExtraParameter(key, value) + } } module.exports = new CrashReporter() From 9a434af03e34d2aa325f93af6a0e702235dabaa4 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Feb 2017 16:31:20 -0800 Subject: [PATCH 04/12] Clear crash keys in InitBreakpad --- atom/common/crash_reporter/crash_reporter_linux.cc | 10 ++++++---- atom/common/crash_reporter/crash_reporter_linux.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/atom/common/crash_reporter/crash_reporter_linux.cc b/atom/common/crash_reporter/crash_reporter_linux.cc index 50e1c5ec862c..9020977716ec 100644 --- a/atom/common/crash_reporter/crash_reporter_linux.cc +++ b/atom/common/crash_reporter/crash_reporter_linux.cc @@ -64,13 +64,15 @@ void CrashReporterLinux::InitBreakpad(const std::string& product_name, bool skip_system_crash_handler) { EnableCrashDumping(crashes_dir); - crash_keys_.SetKeyValue("prod", ATOM_PRODUCT_NAME); - crash_keys_.SetKeyValue("ver", version.c_str()); + crash_keys_.reset(new CrashKeyStorage()); + + crash_keys_->SetKeyValue("prod", ATOM_PRODUCT_NAME); + crash_keys_->SetKeyValue("ver", version.c_str()); upload_url_ = submit_url; for (StringMap::const_iterator iter = upload_parameters_.begin(); iter != upload_parameters_.end(); ++iter) - crash_keys_.SetKeyValue(iter->first.c_str(), iter->second.c_str()); + crash_keys_->SetKeyValue(iter->first.c_str(), iter->second.c_str()); } void CrashReporterLinux::SetUploadParameters() { @@ -120,7 +122,7 @@ bool CrashReporterLinux::CrashDone(const MinidumpDescriptor& minidump, info.oom_size = base::g_oom_size; info.pid = self->pid_; info.upload_url = self->upload_url_.c_str(); - info.crash_keys = &self->crash_keys_; + info.crash_keys = self->crash_keys_.get(); HandleCrashDump(info); return true; } diff --git a/atom/common/crash_reporter/crash_reporter_linux.h b/atom/common/crash_reporter/crash_reporter_linux.h index 846e1f1b0a91..997caf1c271e 100644 --- a/atom/common/crash_reporter/crash_reporter_linux.h +++ b/atom/common/crash_reporter/crash_reporter_linux.h @@ -49,7 +49,7 @@ class CrashReporterLinux : public CrashReporter { const bool succeeded); std::unique_ptr breakpad_; - CrashKeyStorage crash_keys_; + std::unique_ptr crash_keys_; uint64_t process_start_time_; pid_t pid_; From 41fef3999c276b640d3e67a1fad1acad9ba2bcad Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 9 Feb 2017 12:47:02 -0800 Subject: [PATCH 05/12] Document setExtraParameter --- docs/api/crash-reporter.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/api/crash-reporter.md b/docs/api/crash-reporter.md index 164ee7d74996..096276a3ffa6 100644 --- a/docs/api/crash-reporter.md +++ b/docs/api/crash-reporter.md @@ -60,6 +60,10 @@ reports temporarily. You can test this out by calling `process.crash()` to crash This will start the process that will monitor and send the crash reports. Replace `submitURL`, `productName` and `crashesDirectory` with appropriate values. +**Note:** If you need send additional/updated `extra` parameters after your +first call `start` you can call `setExtraParameter` on macOS or call `start` +again with the new/updated `extra` parameters on Linux and Windows. + ```js const args = [ `--reporter-url=${submitURL}`, @@ -111,6 +115,18 @@ called before `start` is called. **Note:** This API can only be called from the main process. +### `crashReporter.setExtraParameter(key, value)` _macOS_ + +* `key` String - Parameter key. +* `value` String - Parameter value. + +Set an extra data to set be sent with the crash report. The values specified +here will be sent in addition to any values set via the `extra` option to +the `start` API. This API is only available on macOS, if you need to +add additional extra parameters on Linux and Windows after your first call to +`start` you can call `start` again with the updated `extra` options for the +parameters to send. + ## Crash Report Payload The crash reporter will send the following data to the `submitURL` as From 3b7207da9fb47a638561920ed30fd73288398def Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 9 Feb 2017 13:05:23 -0800 Subject: [PATCH 06/12] Support removing extra parameters --- atom/common/api/atom_api_crash_reporter.cc | 11 +++++++++-- atom/common/crash_reporter/crash_reporter.cc | 3 +++ atom/common/crash_reporter/crash_reporter.h | 1 + atom/common/crash_reporter/crash_reporter_mac.h | 1 + atom/common/crash_reporter/crash_reporter_mac.mm | 7 +++++++ docs/api/crash-reporter.md | 3 ++- 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/atom/common/api/atom_api_crash_reporter.cc b/atom/common/api/atom_api_crash_reporter.cc index 6820e7a7929d..0edd787e558c 100644 --- a/atom/common/api/atom_api_crash_reporter.cc +++ b/atom/common/api/atom_api_crash_reporter.cc @@ -31,14 +31,21 @@ struct Converter { namespace { +void SetExtraParameter(const std::string& key, mate::Arguments* args) { + std::string value; + if (args->GetNext(&value)) + CrashReporter::GetInstance()->SetExtraParameter(key, value); + else + CrashReporter::GetInstance()->RemoveExtraParameter(key); +} + void Initialize(v8::Local exports, v8::Local unused, v8::Local context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); auto reporter = base::Unretained(CrashReporter::GetInstance()); dict.SetMethod("start", base::Bind(&CrashReporter::Start, reporter)); - dict.SetMethod("setExtraParameter", - base::Bind(&CrashReporter::SetExtraParameter, reporter)); + dict.SetMethod("setExtraParameter", &SetExtraParameter); dict.SetMethod("getUploadedReports", base::Bind(&CrashReporter::GetUploadedReports, reporter)); dict.SetMethod("setUploadToServer", diff --git a/atom/common/crash_reporter/crash_reporter.cc b/atom/common/crash_reporter/crash_reporter.cc index bc3176275fe8..d901f83fa49f 100644 --- a/atom/common/crash_reporter/crash_reporter.cc +++ b/atom/common/crash_reporter/crash_reporter.cc @@ -90,6 +90,9 @@ void CrashReporter::SetExtraParameter(const std::string& key, const std::string& value) { } +void CrashReporter::RemoveExtraParameter(const std::string& key) { +} + #if defined(OS_MACOSX) && defined(MAS_BUILD) // static CrashReporter* CrashReporter::GetInstance() { diff --git a/atom/common/crash_reporter/crash_reporter.h b/atom/common/crash_reporter/crash_reporter.h index cd93f171c05b..2bdcd9b02d3b 100644 --- a/atom/common/crash_reporter/crash_reporter.h +++ b/atom/common/crash_reporter/crash_reporter.h @@ -39,6 +39,7 @@ class CrashReporter { virtual bool GetUploadToServer(); virtual void SetExtraParameter(const std::string& key, const std::string& value); + virtual void RemoveExtraParameter(const std::string& key); protected: CrashReporter(); diff --git a/atom/common/crash_reporter/crash_reporter_mac.h b/atom/common/crash_reporter/crash_reporter_mac.h index 8d1b1d0de1c3..583c99a86e9c 100644 --- a/atom/common/crash_reporter/crash_reporter_mac.h +++ b/atom/common/crash_reporter/crash_reporter_mac.h @@ -36,6 +36,7 @@ class CrashReporterMac : public CrashReporter { bool GetUploadToServer() override; void SetExtraParameter(const std::string& key, const std::string& value) override; + void RemoveExtraParameter(const std::string& key) override; private: friend struct base::DefaultSingletonTraits; diff --git a/atom/common/crash_reporter/crash_reporter_mac.mm b/atom/common/crash_reporter/crash_reporter_mac.mm index 0e9b20d6f663..4b59be5dfca8 100644 --- a/atom/common/crash_reporter/crash_reporter_mac.mm +++ b/atom/common/crash_reporter/crash_reporter_mac.mm @@ -108,6 +108,13 @@ void CrashReporterMac::SetExtraParameter(const std::string& key, upload_parameters_[key] = value; } +void CrashReporterMac::RemoveExtraParameter(const std::string& key) { + if (simple_string_dictionary_) + simple_string_dictionary_->RemoveKey(key.data()); + else + upload_parameters_.erase(key); +} + std::vector CrashReporterMac::GetUploadedReports(const base::FilePath& crashes_dir) { std::vector uploaded_reports; diff --git a/docs/api/crash-reporter.md b/docs/api/crash-reporter.md index 096276a3ffa6..f4ed2d2ce0fa 100644 --- a/docs/api/crash-reporter.md +++ b/docs/api/crash-reporter.md @@ -118,7 +118,8 @@ called before `start` is called. ### `crashReporter.setExtraParameter(key, value)` _macOS_ * `key` String - Parameter key. -* `value` String - Parameter value. +* `value` String - Parameter value. Specifying `null` or `undefined` will + remove the key from the extra parameters. Set an extra data to set be sent with the crash report. The values specified here will be sent in addition to any values set via the `extra` option to From f3756ccf2962c243fbe67f20c4a642fc2bf7f41f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Feb 2017 10:07:10 -0800 Subject: [PATCH 07/12] Run crash reporter specs on all platforms --- spec/api-crash-reporter-spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/api-crash-reporter-spec.js b/spec/api-crash-reporter-spec.js index 0871670de370..876e2f099672 100644 --- a/spec/api-crash-reporter-spec.js +++ b/spec/api-crash-reporter-spec.js @@ -35,7 +35,7 @@ describe('crashReporter module', function () { } it('should send minidump when renderer crashes', function (done) { - if (process.platform !== 'darwin') return done() + if (process.env.APPVEYOR === 'True') return done() if (process.env.TRAVIS === 'true') return done() this.timeout(120000) @@ -55,7 +55,7 @@ describe('crashReporter module', function () { }) it('should send minidump when node processes crash', function (done) { - if (process.platform !== 'darwin') return done() + if (process.env.APPVEYOR === 'True') return done() if (process.env.TRAVIS === 'true') return done() this.timeout(120000) From a4bbad03c26d90c369163e5939ab9ea9b6a9ca90 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Feb 2017 10:08:43 -0800 Subject: [PATCH 08/12] autoSubmit -> uploadToServer --- spec/api-crash-reporter-spec.js | 2 +- spec/fixtures/api/crash.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/api-crash-reporter-spec.js b/spec/api-crash-reporter-spec.js index 876e2f099672..8e9ba64673d3 100644 --- a/spec/api-crash-reporter-spec.js +++ b/spec/api-crash-reporter-spec.js @@ -111,7 +111,7 @@ describe('crashReporter module', function () { crashReporter.start({ companyName: 'Umbrella Corporation', submitURL: 'http://127.0.0.1/crashes', - autoSubmit: true + uploadToServer: true }) assert.equal(crashReporter.getUploadToServer(), true) crashReporter.setUploadToServer(false) diff --git a/spec/fixtures/api/crash.html b/spec/fixtures/api/crash.html index c1fb621426af..2b1cea6e9af3 100644 --- a/spec/fixtures/api/crash.html +++ b/spec/fixtures/api/crash.html @@ -7,7 +7,7 @@ crashReporter.start({ productName: 'Zombies', companyName: 'Umbrella Corporation', submitURL: 'http://127.0.0.1:' + port, - autoSubmit: true, + uploadToServer: true, ignoreSystemCrashHandler: true, extra: { 'extra1': 'extra1', From b51adf8ae54f7951f1e5d71d889b0a0df65b9a9d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Feb 2017 10:46:19 -0800 Subject: [PATCH 09/12] Add spec for updated extra parameters --- lib/common/api/crash-reporter.js | 2 +- spec/api-crash-reporter-spec.js | 22 +++++++++++++ spec/fixtures/api/crash-restart.html | 46 ++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 spec/fixtures/api/crash-restart.html diff --git a/lib/common/api/crash-reporter.js b/lib/common/api/crash-reporter.js index f168251cc18f..658622e8f5a7 100644 --- a/lib/common/api/crash-reporter.js +++ b/lib/common/api/crash-reporter.js @@ -75,7 +75,7 @@ class CrashReporter { } getUploadedReports () { - return binding._getUploadedReports(this.getCrashesDirectory()) + return binding.getUploadedReports(this.getCrashesDirectory()) } getCrashesDirectory () { diff --git a/spec/api-crash-reporter-spec.js b/spec/api-crash-reporter-spec.js index 8e9ba64673d3..c269cfe1324b 100644 --- a/spec/api-crash-reporter-spec.js +++ b/spec/api-crash-reporter-spec.js @@ -72,6 +72,26 @@ describe('crashReporter module', function () { }) }) + it('should send minidump with updated extra parameters', function (done) { + if (process.env.APPVEYOR === 'True') return done() + if (process.env.TRAVIS === 'true') return done() + + this.timeout(10000) + + startServer({ + callback (port) { + const crashUrl = url.format({ + protocol: 'file', + pathname: path.join(fixtures, 'api', 'crash-restart.html'), + search: '?port=' + port + }) + w.loadURL(crashUrl) + }, + processType: 'renderer', + done: done + }) + }) + describe('.start(options)', function () { it('requires that the companyName and submitURL options be specified', function () { assert.throws(function () { @@ -155,6 +175,7 @@ const startServer = ({callback, processType, done}) => { assert.equal(fields.platform, process.platform) assert.equal(fields.extra1, 'extra1') assert.equal(fields.extra2, 'extra2') + assert.equal(fields.extra3, undefined) assert.equal(fields._productName, 'Zombies') assert.equal(fields._companyName, 'Umbrella Corporation') assert.equal(fields._version, app.getVersion()) @@ -165,6 +186,7 @@ const startServer = ({callback, processType, done}) => { assert.equal(crashReporter.getLastCrashReport().id, reportId) assert.notEqual(crashReporter.getUploadedReports().length, 0) assert.equal(crashReporter.getUploadedReports()[0].id, reportId) + req.socket.destroy() done() }, done) }) diff --git a/spec/fixtures/api/crash-restart.html b/spec/fixtures/api/crash-restart.html new file mode 100644 index 000000000000..1877596d1c1f --- /dev/null +++ b/spec/fixtures/api/crash-restart.html @@ -0,0 +1,46 @@ + + + + + From 07173cdd9dbb4877075386427df38d6db94f1353 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Feb 2017 10:48:04 -0800 Subject: [PATCH 10/12] Tweak setExtraParameter description --- docs/api/crash-reporter.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/api/crash-reporter.md b/docs/api/crash-reporter.md index f4ed2d2ce0fa..818aa8e7b54f 100644 --- a/docs/api/crash-reporter.md +++ b/docs/api/crash-reporter.md @@ -121,12 +121,11 @@ called before `start` is called. * `value` String - Parameter value. Specifying `null` or `undefined` will remove the key from the extra parameters. -Set an extra data to set be sent with the crash report. The values specified -here will be sent in addition to any values set via the `extra` option to -the `start` API. This API is only available on macOS, if you need to -add additional extra parameters on Linux and Windows after your first call to -`start` you can call `start` again with the updated `extra` options for the -parameters to send. +Set an extra parameter to set be sent with the crash report. The values +specified here will be sent in addition to any values set via the `extra` option +when `start` was called. This API is only available on macOS, if you need to +add/update extra parameters on Linux and Windows after your first call to +`start` you can call `start` again with the updated `extra` options. ## Crash Report Payload From af7702d0f2f3d76c3e350203b6f31db27931e8e1 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Feb 2017 10:52:40 -0800 Subject: [PATCH 11/12] :art: --- spec/fixtures/api/crash-restart.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/fixtures/api/crash-restart.html b/spec/fixtures/api/crash-restart.html index 1877596d1c1f..4a96baeaedc6 100644 --- a/spec/fixtures/api/crash-restart.html +++ b/spec/fixtures/api/crash-restart.html @@ -12,9 +12,9 @@ crashReporter.start({ uploadToServer: true, ignoreSystemCrashHandler: true, extra: { - 'extra1': 'extra1', - 'extra2':'initial', - 'extra3': 'extra3' + extra1: 'extra1', + extra2: 'initial', + extra3: 'extra3' } }) @@ -30,8 +30,8 @@ setImmediate(() => { uploadToServer: true, ignoreSystemCrashHandler: true, extra: { - 'extra1': 'extra1', - 'extra2': 'extra2' + extra1: 'extra1', + extra2: 'extra2' } }) } From 272a0824e87236b7c63e4a11722f780814e4daf8 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 13 Feb 2017 11:15:40 -0800 Subject: [PATCH 12/12] Fix darwin platform name --- spec/fixtures/api/crash-restart.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/fixtures/api/crash-restart.html b/spec/fixtures/api/crash-restart.html index 4a96baeaedc6..2f55c539bbd8 100644 --- a/spec/fixtures/api/crash-restart.html +++ b/spec/fixtures/api/crash-restart.html @@ -19,7 +19,7 @@ crashReporter.start({ }) setImmediate(() => { - if (process.platform === 'darwin2') { + if (process.platform === 'darwin') { crashReporter.setExtraParameter('extra2', 'extra2') crashReporter.setExtraParameter('extra3', null) } else {