electron/atom/common/crash_reporter/crash_reporter.cc

43 lines
1.3 KiB
C++
Raw Normal View History

// Copyright (c) 2013 GitHub, Inc.
2014-04-25 09:49:37 +00:00
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
2014-03-16 00:30:26 +00:00
#include "atom/common/crash_reporter/crash_reporter.h"
2014-03-16 00:30:26 +00:00
#include "atom/browser/browser.h"
#include "atom/common/atom_version.h"
2014-03-16 01:37:04 +00:00
#include "base/command_line.h"
#include "content/public/common/content_switches.h"
namespace crash_reporter {
CrashReporter::CrashReporter() {
2015-03-11 00:00:55 +00:00
auto cmd = base::CommandLine::ForCurrentProcess();
is_browser_ = cmd->GetSwitchValueASCII(switches::kProcessType).empty();
}
CrashReporter::~CrashReporter() {
}
void CrashReporter::Start(const std::string& product_name,
const std::string& company_name,
const std::string& submit_url,
bool auto_submit,
bool skip_system_crash_handler,
const StringMap& extra_parameters) {
SetUploadParameters(extra_parameters);
InitBreakpad(product_name, ATOM_VERSION_STRING, company_name, submit_url,
auto_submit, skip_system_crash_handler);
}
void CrashReporter::SetUploadParameters(const StringMap& parameters) {
upload_parameters_ = parameters;
upload_parameters_["process_type"] = is_browser_ ? "browser" : "renderer";
// Setting platform dependent parameters.
SetUploadParameters();
}
} // namespace crash_reporter