namespace crash_reporter {
CrashReporter::CrashReporter() {
- const CommandLine& command = *CommandLine::ForCurrentProcess();
- std::string type = command.GetSwitchValueASCII(switches::kProcessType);
- is_browser_ = type.empty();
+ SetUploadParameters();
+
+ is_browser_ = upload_parameters_["process_type"].empty();
}
CrashReporter::~CrashReporter() {
skip_system_crash_handler);
}
+void CrashReporter::SetUploadParameters() {
+ const CommandLine& command = *CommandLine::ForCurrentProcess();
+ std::string type = command.GetSwitchValueASCII(switches::kProcessType);
+
+ upload_parameters_["process_type"] = type;
+ upload_parameters_["atom_shell_version"] = ATOM_VERSION_STRING;
+}
+
} // namespace crash_reporter
#ifndef ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_
#define ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_
+#include <map>
#include <string>
#include "base/basictypes.h"
const std::string& submit_url,
bool auto_submit,
bool skip_system_crash_handler) = 0;
+ virtual void SetUploadParameters();
+ typedef std::map<std::string, std::string> StringMap;
+ StringMap upload_parameters_;
bool is_browser_;
private:
const std::string& submit_url,
bool auto_submit,
bool skip_system_crash_handler) OVERRIDE;
+ virtual void SetUploadParameters() OVERRIDE;
private:
friend struct DefaultSingletonTraits<CrashReporterMac>;
[parameters setValue:@"0" forKey:@BREAKPAD_REPORT_INTERVAL];
breakpad_ = BreakpadCreate(parameters);
+
+ for (StringMap::const_iterator iter = upload_parameters_.begin();
+ iter != upload_parameters_.end(); ++iter) {
+ BreakpadAddUploadParameter(breakpad_,
+ base::SysUTF8ToNSString(iter->first),
+ base::SysUTF8ToNSString(iter->second));
+ }
+}
+
+void CrashReporterMac::SetUploadParameters() {
+ upload_parameters_["platform"] = "darwin";
}
// static
bool skip_system_crash_handler) {
}
+void CrashReporterWin::SetUploadParameters() {
+ upload_parameters_["platform"] = "win32";
+}
+
// static
CrashReporterWin* CrashReporterWin::GetInstance() {
return Singleton<CrashReporterWin>::get();
const std::string& submit_url,
bool auto_submit,
bool skip_system_crash_handler) OVERRIDE;
+ virtual void SetUploadParameters() OVERRIDE;
private:
friend struct DefaultSingletonTraits<CrashReporterWin>;