win: Add stubs for crash reporter.

This commit is contained in:
Cheng Zhao 2013-11-14 13:42:28 +08:00
Родитель dd4e43eb02
Коммит d1a5c49843
3 изменённых файлов: 60 добавлений и 6 удалений

Просмотреть файл

@ -145,6 +145,7 @@
'common/crash_reporter/crash_reporter_mac.h',
'common/crash_reporter/crash_reporter_mac.mm',
'common/crash_reporter/crash_reporter_win.cc',
'common/crash_reporter/crash_reporter_win.h',
'common/draggable_region.cc',
'common/draggable_region.h',
'common/node_bindings.cc',

Просмотреть файл

@ -2,21 +2,37 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "common/crash_reporter/crash_reporter.h"
#include "common/crash_reporter/crash_reporter_win.h"
#include "base/memory/singleton.h"
namespace crash_reporter {
// static
void CrashReporter::SetCompanyName(const std::string& name) {
CrashReporterWin::CrashReporterWin()
: breakpad_(NULL) {
}
CrashReporterWin::~CrashReporterWin() {
if (breakpad_ != NULL)
BreakpadRelease(breakpad_);
}
void CrashReporterWin::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) {
}
// static
void CrashReporter::SetSubmissionURL(const std::string& url) {
CrashReporterWin* CrashReporterWin::GetInstance() {
return Singleton<CrashReporterWin>::get();
}
// static
void CrashReporter::SetAutoSubmit(bool yes) {
CrashReporter* CrashReporter::GetInstance() {
return CrashReporterWin::GetInstance();
}
} // namespace crash_reporter

Просмотреть файл

@ -0,0 +1,37 @@
// 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"
#include "common/crash_reporter/crash_reporter.h"
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;
private:
friend struct DefaultSingletonTraits<CrashReporterWin>;
CrashReporterWin();
virtual ~CrashReporterWin();
DISALLOW_COPY_AND_ASSIGN(CrashReporterWin);
};
} // namespace crash_reporter
#endif // ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_WIN_H_