From: Cheng Zhao Date: Thu, 14 Nov 2013 05:42:28 +0000 (+0800) Subject: win: Add stubs for crash reporter. X-Git-Tag: v0.7.0~1^2~40 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=d1a5c498431633e618e98c879fe5643843622f3c;p=electron.git win: Add stubs for crash reporter. --- diff --git a/atom.gyp b/atom.gyp index ee99c907..e374c1d9 100644 --- a/atom.gyp +++ b/atom.gyp @@ -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', diff --git a/common/crash_reporter/crash_reporter_win.cc b/common/crash_reporter/crash_reporter_win.cc index e5187f0e..ee8cbe77 100644 --- a/common/crash_reporter/crash_reporter_win.cc +++ b/common/crash_reporter/crash_reporter_win.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::get(); } // static -void CrashReporter::SetAutoSubmit(bool yes) { +CrashReporter* CrashReporter::GetInstance() { + return CrashReporterWin::GetInstance(); } } // namespace crash_reporter - diff --git a/common/crash_reporter/crash_reporter_win.h b/common/crash_reporter/crash_reporter_win.h new file mode 100644 index 00000000..49c17ed1 --- /dev/null +++ b/common/crash_reporter/crash_reporter_win.h @@ -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 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(); + virtual ~CrashReporterWin(); + + DISALLOW_COPY_AND_ASSIGN(CrashReporterWin); +}; + +} // namespace crash_reporter + +#endif // ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_WIN_H_