diff --git a/common/crash_reporter/crash_reporter.cc b/common/crash_reporter/crash_reporter.cc index 0e238138de0b..8e63cbfeed5e 100644 --- a/common/crash_reporter/crash_reporter.cc +++ b/common/crash_reporter/crash_reporter.cc @@ -12,9 +12,9 @@ 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() { @@ -42,4 +42,12 @@ void CrashReporter::Start(std::string product_name, 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 diff --git a/common/crash_reporter/crash_reporter.h b/common/crash_reporter/crash_reporter.h index 73de0a3baeb0..d9a57e710d20 100644 --- a/common/crash_reporter/crash_reporter.h +++ b/common/crash_reporter/crash_reporter.h @@ -5,6 +5,7 @@ #ifndef ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_ #define ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_ +#include #include #include "base/basictypes.h" @@ -31,7 +32,10 @@ class CrashReporter { const std::string& submit_url, bool auto_submit, bool skip_system_crash_handler) = 0; + virtual void SetUploadParameters(); + typedef std::map StringMap; + StringMap upload_parameters_; bool is_browser_; private: diff --git a/common/crash_reporter/crash_reporter_mac.h b/common/crash_reporter/crash_reporter_mac.h index 8b62699ffc10..800de9c86fbd 100644 --- a/common/crash_reporter/crash_reporter_mac.h +++ b/common/crash_reporter/crash_reporter_mac.h @@ -23,6 +23,7 @@ class CrashReporterMac : public CrashReporter { const std::string& submit_url, bool auto_submit, bool skip_system_crash_handler) OVERRIDE; + virtual void SetUploadParameters() OVERRIDE; private: friend struct DefaultSingletonTraits; diff --git a/common/crash_reporter/crash_reporter_mac.mm b/common/crash_reporter/crash_reporter_mac.mm index 970768cbf6ba..8502b92ea9a7 100644 --- a/common/crash_reporter/crash_reporter_mac.mm +++ b/common/crash_reporter/crash_reporter_mac.mm @@ -48,6 +48,17 @@ void CrashReporterMac::InitBreakpad(const std::string& product_name, [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 diff --git a/common/crash_reporter/crash_reporter_win.cc b/common/crash_reporter/crash_reporter_win.cc index ee8cbe77d3f3..60da71eca484 100644 --- a/common/crash_reporter/crash_reporter_win.cc +++ b/common/crash_reporter/crash_reporter_win.cc @@ -25,6 +25,10 @@ void CrashReporterWin::InitBreakpad(const std::string& product_name, bool skip_system_crash_handler) { } +void CrashReporterWin::SetUploadParameters() { + upload_parameters_["platform"] = "win32"; +} + // static CrashReporterWin* CrashReporterWin::GetInstance() { return Singleton::get(); diff --git a/common/crash_reporter/crash_reporter_win.h b/common/crash_reporter/crash_reporter_win.h index 49c17ed11910..af7b06346c0c 100644 --- a/common/crash_reporter/crash_reporter_win.h +++ b/common/crash_reporter/crash_reporter_win.h @@ -22,6 +22,7 @@ class CrashReporterWin : public CrashReporter { const std::string& submit_url, bool auto_submit, bool skip_system_crash_handler) OVERRIDE; + virtual void SetUploadParameters() OVERRIDE; private: friend struct DefaultSingletonTraits;