2014-10-31 18:17:05 +00:00
|
|
|
// 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
|
2013-07-04 07:54:34 +00:00
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2013-11-13 09:29:35 +00:00
|
|
|
#ifndef ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_
|
|
|
|
#define ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_
|
2013-07-04 07:54:34 +00:00
|
|
|
|
2013-11-14 10:02:15 +00:00
|
|
|
#include <map>
|
2013-07-04 07:54:34 +00:00
|
|
|
#include <string>
|
2015-06-03 03:31:34 +00:00
|
|
|
#include <utility>
|
2015-06-03 01:47:42 +00:00
|
|
|
#include <vector>
|
2013-07-04 07:54:34 +00:00
|
|
|
|
|
|
|
#include "base/basictypes.h"
|
|
|
|
|
|
|
|
namespace crash_reporter {
|
|
|
|
|
|
|
|
class CrashReporter {
|
|
|
|
public:
|
2013-11-18 10:27:50 +00:00
|
|
|
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
|
2013-11-18 10:27:50 +00:00
|
|
|
|
2013-11-14 05:33:09 +00:00
|
|
|
static CrashReporter* GetInstance();
|
|
|
|
|
2013-11-19 04:19:23 +00:00
|
|
|
void Start(const std::string& product_name,
|
2013-11-14 05:33:09 +00:00
|
|
|
const std::string& company_name,
|
|
|
|
const std::string& submit_url,
|
|
|
|
bool auto_submit,
|
2013-11-18 10:27:50 +00:00
|
|
|
bool skip_system_crash_handler,
|
|
|
|
const StringMap& extra_parameters);
|
2013-11-14 05:33:09 +00:00
|
|
|
|
2015-06-05 10:50:52 +00:00
|
|
|
virtual std::vector<CrashReporter::UploadReportResult> GetUploadedReports(
|
|
|
|
const std::string& path);
|
2015-06-03 01:47:42 +00:00
|
|
|
|
2013-11-14 05:33:09 +00:00
|
|
|
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,
|
|
|
|
bool auto_submit,
|
|
|
|
bool skip_system_crash_handler) = 0;
|
2013-11-18 10:27:50 +00:00
|
|
|
virtual void SetUploadParameters() = 0;
|
2013-11-14 05:33:09 +00:00
|
|
|
|
2013-11-14 10:02:15 +00:00
|
|
|
StringMap upload_parameters_;
|
2013-11-14 05:33:09 +00:00
|
|
|
bool is_browser_;
|
2013-07-04 07:54:34 +00:00
|
|
|
|
|
|
|
private:
|
2013-11-18 10:27:50 +00:00
|
|
|
void SetUploadParameters(const StringMap& parameters);
|
|
|
|
|
2013-11-14 05:33:09 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CrashReporter);
|
2013-07-04 07:54:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace crash_reporter
|
|
|
|
|
2013-11-13 09:29:35 +00:00
|
|
|
#endif // ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_H_
|