2013-11-14 05:42:28 +00:00
|
|
|
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_WIN_H_
|
|
|
|
#define ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_WIN_H_
|
|
|
|
|
|
|
|
#include "base/compiler_specific.h"
|
2013-11-19 13:37:02 +00:00
|
|
|
#include "base/memory/scoped_ptr.h"
|
2013-11-14 05:42:28 +00:00
|
|
|
#include "common/crash_reporter/crash_reporter.h"
|
2013-11-19 13:37:02 +00:00
|
|
|
#include "vendor/breakpad/src/client/windows/handler/exception_handler.h"
|
2013-11-14 05:42:28 +00:00
|
|
|
|
|
|
|
template <typename T> struct DefaultSingletonTraits;
|
|
|
|
|
|
|
|
namespace crash_reporter {
|
|
|
|
|
|
|
|
class CrashReporterWin : public CrashReporter {
|
|
|
|
public:
|
|
|
|
static CrashReporterWin* GetInstance();
|
|
|
|
|
|
|
|
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) OVERRIDE;
|
2013-11-14 10:02:15 +00:00
|
|
|
virtual void SetUploadParameters() OVERRIDE;
|
2013-11-14 05:42:28 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
friend struct DefaultSingletonTraits<CrashReporterWin>;
|
|
|
|
|
|
|
|
CrashReporterWin();
|
|
|
|
virtual ~CrashReporterWin();
|
|
|
|
|
2013-11-19 13:37:02 +00:00
|
|
|
static bool FilterCallback(void* context,
|
|
|
|
EXCEPTION_POINTERS* exinfo,
|
|
|
|
MDRawAssertionInfo* assertion);
|
|
|
|
|
|
|
|
static bool MinidumpCallback(const wchar_t* dump_path,
|
|
|
|
const wchar_t* minidump_id,
|
|
|
|
void* context,
|
|
|
|
EXCEPTION_POINTERS* exinfo,
|
|
|
|
MDRawAssertionInfo* assertion,
|
|
|
|
bool succeeded);
|
|
|
|
|
2013-11-24 14:57:47 +00:00
|
|
|
// Returns the custom info structure based on parameters.
|
|
|
|
google_breakpad::CustomClientInfo* GetCustomInfo(
|
|
|
|
const std::string& product_name,
|
|
|
|
const std::string& version,
|
|
|
|
const std::string& company_name);
|
|
|
|
|
|
|
|
// Custom information to be passed to crash handler.
|
|
|
|
std::vector<google_breakpad::CustomInfoEntry> custom_info_entries_;
|
|
|
|
google_breakpad::CustomClientInfo custom_info_;
|
|
|
|
|
2013-11-19 13:37:02 +00:00
|
|
|
bool skip_system_crash_handler_;
|
|
|
|
scoped_ptr<google_breakpad::ExceptionHandler> breakpad_;
|
|
|
|
|
2013-11-14 05:42:28 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(CrashReporterWin);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace crash_reporter
|
|
|
|
|
|
|
|
#endif // ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_WIN_H_
|