add const and other small edits

This commit is contained in:
Shelley Vohr 2017-10-31 23:42:25 -04:00
parent 7b08a93549
commit 93df164485
No known key found for this signature in database
GPG key ID: F13993A75599653C
7 changed files with 24 additions and 18 deletions

View file

@ -39,7 +39,7 @@ void RemoveExtraParameter(const std::string& key) {
CrashReporter::GetInstance()->RemoveExtraParameter(key);
}
std::map<std::string, std::string> GetParameters() {
std::map<std::string, std::string> GetParameters() const {
return CrashReporter::GetInstance()->GetParameters();
}

View file

@ -80,16 +80,20 @@ void CrashReporter::InitBreakpad(const std::string& product_name,
const std::string& submit_url,
const base::FilePath& crashes_dir,
bool auto_submit,
bool skip_system_crash_handler) {}
bool skip_system_crash_handler) {
}
void CrashReporter::SetUploadParameters() {}
void CrashReporter::SetUploadParameters() {
}
void CrashReporter::SetExtraParameter(const std::string& key,
const std::string& value) {}
const std::string& value) {
}
void CrashReporter::RemoveExtraParameter(const std::string& key) {}
void CrashReporter::RemoveExtraParameter(const std::string& key) {
}
std::map<std::string, std::string> CrashReporter::GetParameters() {
std::map<std::string, std::string> CrashReporter::GetParameters() const {
return upload_parameters_;
}

View file

@ -40,7 +40,7 @@ class CrashReporter {
virtual void SetExtraParameter(const std::string& key,
const std::string& value);
virtual void RemoveExtraParameter(const std::string& key);
virtual std::map<std::string, std::string> GetParameters();
virtual std::map<std::string, std::string> GetParameters() const;
protected:
CrashReporter();

View file

@ -38,7 +38,7 @@ class CrashReporterMac : public CrashReporter {
void SetExtraParameter(const std::string& key,
const std::string& value) override;
void RemoveExtraParameter(const std::string& key) override;
std::map<std::string, std::string> GetParameters() override;
std::map<std::string, std::string> GetParameters() const override;
private:
friend struct base::DefaultSingletonTraits<CrashReporterMac>;

View file

@ -121,19 +121,18 @@ void CrashReporterMac::RemoveExtraParameter(const std::string& key) {
upload_parameters_.erase(key);
}
std::map<std::string, std::string> CrashReporterMac::GetParameters() {
std::map<std::string, std::string> CrashReporterMac::GetParameters() const {
if (simple_string_dictionary_) {
std::map<std::string, std::string> ret;
crashpad::SimpleStringDictionary::Iterator iter(*simple_string_dictionary_);
for(;;) {
const crashpad::SimpleStringDictionary::Entry* entry = iter.Next();
const auto entry = iter.Next();
if (!entry) break;
ret[entry->key] = entry->value;
}
return ret;
} else {
return upload_parameters_;
}
return upload_parameters_;
}
std::vector<CrashReporter::UploadReportResult>