From 06075c44990e9ac3a221ac2dddb4c225eb61e38c Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Mon, 30 Oct 2017 23:12:04 -0400 Subject: [PATCH] extrapolate removeExtraParameter into new method --- atom/common/api/atom_api_crash_reporter.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/atom/common/api/atom_api_crash_reporter.cc b/atom/common/api/atom_api_crash_reporter.cc index 0edd787e558c..9a6fd27ed521 100644 --- a/atom/common/api/atom_api_crash_reporter.cc +++ b/atom/common/api/atom_api_crash_reporter.cc @@ -31,12 +31,12 @@ 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 SetExtraParameter(const std::string& key, const std::string& value) { + CrashReporter::GetInstance()->SetExtraParameter(key, value); +} + +void RemoveExtraParameter(const std::string& key) { + CrashReporter::GetInstance()->RemoveExtraParameter(key); } @@ -46,6 +46,7 @@ void Initialize(v8::Local exports, v8::Local unused, auto reporter = base::Unretained(CrashReporter::GetInstance()); dict.SetMethod("start", base::Bind(&CrashReporter::Start, reporter)); dict.SetMethod("setExtraParameter", &SetExtraParameter); + dict.SetMethod("removeExtraParameter", &SetExtraParameter); dict.SetMethod("getUploadedReports", base::Bind(&CrashReporter::GetUploadedReports, reporter)); dict.SetMethod("setUploadToServer",