extrapolate removeExtraParameter into new method

This commit is contained in:
Shelley Vohr 2017-10-30 23:12:04 -04:00
parent 603060f051
commit 06075c4499
No known key found for this signature in database
GPG key ID: F13993A75599653C

View file

@ -31,12 +31,12 @@ struct Converter<CrashReporter::UploadReportResult> {
namespace { namespace {
void SetExtraParameter(const std::string& key, mate::Arguments* args) { void SetExtraParameter(const std::string& key, const std::string& value) {
std::string value; CrashReporter::GetInstance()->SetExtraParameter(key, value);
if (args->GetNext(&value)) }
CrashReporter::GetInstance()->SetExtraParameter(key, value);
else void RemoveExtraParameter(const std::string& key) {
CrashReporter::GetInstance()->RemoveExtraParameter(key); CrashReporter::GetInstance()->RemoveExtraParameter(key);
} }
@ -46,6 +46,7 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
auto reporter = base::Unretained(CrashReporter::GetInstance()); auto reporter = base::Unretained(CrashReporter::GetInstance());
dict.SetMethod("start", base::Bind(&CrashReporter::Start, reporter)); dict.SetMethod("start", base::Bind(&CrashReporter::Start, reporter));
dict.SetMethod("setExtraParameter", &SetExtraParameter); dict.SetMethod("setExtraParameter", &SetExtraParameter);
dict.SetMethod("removeExtraParameter", &SetExtraParameter);
dict.SetMethod("getUploadedReports", dict.SetMethod("getUploadedReports",
base::Bind(&CrashReporter::GetUploadedReports, reporter)); base::Bind(&CrashReporter::GetUploadedReports, reporter));
dict.SetMethod("setUploadToServer", dict.SetMethod("setUploadToServer",