electron/atom/common/crash_reporter/crash_reporter.h

65 lines
1.9 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.
#ifndef ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_
#define ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_
#include <map>
#include <string>
2015-06-03 03:31:34 +00:00
#include <utility>
#include <vector>
#include "base/files/file_path.h"
2016-03-08 04:38:49 +00:00
#include "base/macros.h"
namespace crash_reporter {
class CrashReporter {
public:
typedef std::map<std::string, std::string> StringMap;
2015-06-03 03:31:34 +00:00
typedef std::pair<int, std::string> UploadReportResult; // upload-date, id
static CrashReporter* GetInstance();
void Start(const std::string& product_name,
const std::string& company_name,
const std::string& submit_url,
2016-10-05 22:23:51 +00:00
const std::string& temp_path,
bool auto_submit,
bool skip_system_crash_handler,
const StringMap& extra_parameters);
virtual std::vector<CrashReporter::UploadReportResult> GetUploadedReports(
2016-10-05 22:23:51 +00:00
const std::string& product_name,
const std::string& temp_path);
protected:
CrashReporter();
virtual ~CrashReporter();
virtual void InitBreakpad(const std::string& product_name,
const std::string& version,
const std::string& company_name,
const std::string& submit_url,
2016-10-05 22:23:51 +00:00
const std::string& temp_path,
bool auto_submit,
bool skip_system_crash_handler);
virtual void SetUploadParameters();
2016-10-05 22:23:51 +00:00
base::FilePath GetCrashesDirectory(const std::string& product_name,
const std::string& temp_dir);
StringMap upload_parameters_;
bool is_browser_;
private:
void SetUploadParameters(const StringMap& parameters);
DISALLOW_COPY_AND_ASSIGN(CrashReporter);
};
} // namespace crash_reporter
#endif // ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_