complete GetParameters method & all tests passing

This commit is contained in:
Shelley Vohr 2017-10-31 18:19:04 -04:00
parent 3136f833a5
commit a538e47994
No known key found for this signature in database
GPG key ID: F13993A75599653C
3 changed files with 26 additions and 14 deletions

View file

@ -5,6 +5,7 @@
#ifndef ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_MAC_H_
#define ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_MAC_H_
#include <map>
#include <string>
#include <vector>
@ -37,6 +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;
private:
friend struct base::DefaultSingletonTraits<CrashReporterMac>;

View file

@ -121,6 +121,21 @@ void CrashReporterMac::RemoveExtraParameter(const std::string& key) {
upload_parameters_.erase(key);
}
std::map<std::string, std::string> CrashReporterMac::GetParameters() {
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();
if (!entry) break;
ret[entry->key] = entry->value;
}
return ret;
} else {
return upload_parameters_;
}
}
std::vector<CrashReporter::UploadReportResult>
CrashReporterMac::GetUploadedReports(const base::FilePath& crashes_dir) {
std::vector<CrashReporter::UploadReportResult> uploaded_reports;