From 3b781fed071f7681c6113dd0042388ceaf7f4d15 Mon Sep 17 00:00:00 2001 From: "ananta@chromium.org" Date: Wed, 9 Dec 2009 19:59:25 +0000 Subject: The ChromeFrame crash reporting code should not depend on chrome frame as it is also linked in by toolbar. This CL gets rid of this dependency and also ensures that full crash dumps are gathered during chrome frame reliability test runs. Review URL: http://codereview.chromium.org/481003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34180 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome_frame/crash_reporting/crash_report.cc | 31 +++++++++++++++++----------- chrome_frame/crash_reporting/crash_report.h | 7 +++++++ 2 files changed, 26 insertions(+), 12 deletions(-) (limited to 'chrome_frame/crash_reporting') diff --git a/chrome_frame/crash_reporting/crash_report.cc b/chrome_frame/crash_reporting/crash_report.cc index f858941..43d602d 100644 --- a/chrome_frame/crash_reporting/crash_report.cc +++ b/chrome_frame/crash_reporting/crash_report.cc @@ -11,12 +11,10 @@ #include "breakpad/src/client/windows/handler/exception_handler.h" #include "chrome_frame/crash_reporting/vectored_handler.h" #include "chrome_frame/crash_reporting/vectored_handler-impl.h" -#include "chrome_frame/utils.h" namespace { // TODO(joshia): factor out common code with chrome used for crash reporting const wchar_t kGoogleUpdatePipeName[] = L"\\\\.\\pipe\\GoogleCrashServices\\"; -const wchar_t kChromePipeName[] = L"\\\\.\\pipe\\ChromeCrashServices"; google_breakpad::ExceptionHandler* g_breakpad = NULL; @@ -61,26 +59,19 @@ class Win32VEHTraits : public VEHTraitsBase { extern "C" IMAGE_DOS_HEADER __ImageBase; std::wstring GetCrashServerPipeName(const std::wstring& user_sid) { - if (IsHeadlessMode()) - return kChromePipeName; - std::wstring pipe_name = kGoogleUpdatePipeName; pipe_name += user_sid; return pipe_name; } -bool InitializeVectoredCrashReporting( +bool InitializeVectoredCrashReportingWithPipeName( bool full_dump, - const wchar_t* user_sid, + const wchar_t* pipe_name, const std::wstring& dump_path, google_breakpad::CustomClientInfo* client_info) { - DCHECK(user_sid); - DCHECK(client_info); if (g_breakpad) return true; - std::wstring pipe_name = GetCrashServerPipeName(user_sid); - if (dump_path.empty()) { return false; } @@ -90,7 +81,7 @@ bool InitializeVectoredCrashReporting( dump_path, NULL, NULL, NULL, google_breakpad::ExceptionHandler::HANDLER_INVALID_PARAMETER | google_breakpad::ExceptionHandler::HANDLER_PURECALL, dump_type, - pipe_name.c_str(), client_info); + pipe_name, client_info); if (g_breakpad) { // Find current module boundaries. @@ -105,6 +96,22 @@ bool InitializeVectoredCrashReporting( return g_breakpad != NULL; } +bool InitializeVectoredCrashReporting( + bool full_dump, + const wchar_t* user_sid, + const std::wstring& dump_path, + google_breakpad::CustomClientInfo* client_info) { + DCHECK(user_sid); + DCHECK(client_info); + + std::wstring pipe_name = GetCrashServerPipeName(user_sid); + + return InitializeVectoredCrashReportingWithPipeName(full_dump, + pipe_name.c_str(), + dump_path, + client_info); +} + bool ShutdownVectoredCrashReporting() { VectoredHandler::Unregister(); delete g_breakpad; diff --git a/chrome_frame/crash_reporting/crash_report.h b/chrome_frame/crash_reporting/crash_report.h index 0bcc89b..e98fd05 100644 --- a/chrome_frame/crash_reporting/crash_report.h +++ b/chrome_frame/crash_reporting/crash_report.h @@ -16,6 +16,13 @@ bool InitializeVectoredCrashReporting( const wchar_t* user_sid, const std::wstring& dump_path, google_breakpad::CustomClientInfo* client_info); + +bool InitializeVectoredCrashReportingWithPipeName( + bool full_dump, + const wchar_t* pipe_name, + const std::wstring& dump_path, + google_breakpad::CustomClientInfo* client_info); + bool ShutdownVectoredCrashReporting(); #endif // CHROME_FRAME_CRASH_REPORTING_CRASH_REPORT_H_ -- cgit v1.1