diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-14 03:26:03 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-14 03:26:03 +0000 |
commit | 1152b7ea95609ce835bdb9ab4454b4589b60ea87 (patch) | |
tree | fd9a09dee7e9457d793564cf605388d1359a24a1 /chrome | |
parent | 60f1e8fe0973d60e3e786237a283395749550a40 (diff) | |
download | chromium_src-1152b7ea95609ce835bdb9ab4454b4589b60ea87.zip chromium_src-1152b7ea95609ce835bdb9ab4454b4589b60ea87.tar.gz chromium_src-1152b7ea95609ce835bdb9ab4454b4589b60ea87.tar.bz2 |
Send Breakpad and debugger status to the metrics service on the Mac.
BUG=21731
TEST=Metrics data should have the correct values for breakpadregistrationok,
breakpadregistrationfail, debuggerpresent, and debuggernotpresent in
log.profile.stability.
Review URL: http://codereview.chromium.org/203050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26093 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_main.cc | 23 | ||||
-rw-r--r-- | chrome/browser/browser_main.h | 31 | ||||
-rw-r--r-- | chrome/browser/browser_main_gtk.cc | 19 | ||||
-rw-r--r-- | chrome/browser/browser_main_mac.mm | 14 | ||||
-rw-r--r-- | chrome/browser/browser_main_win.cc | 26 | ||||
-rw-r--r-- | chrome/browser/browser_main_win.h | 5 |
6 files changed, 77 insertions, 41 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index fa591d1..c20c7a3 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "build/build_config.h" +#include "chrome/browser/browser_main.h" #include <algorithm> @@ -125,25 +125,6 @@ #include "chrome/browser/chromeos/external_cookie_handler.h" #endif -namespace Platform { - -void WillInitializeMainMessageLoop(const MainFunctionParams& parameters); -void WillTerminate(); - -#if defined(OS_WIN) || defined(OS_LINUX) -// Perform any platform-specific work that needs to be done before the main -// message loop is created and initialized. -void WillInitializeMainMessageLoop(const MainFunctionParams& parameters) { -} - -// Perform platform-specific work that needs to be done after the main event -// loop has ended. -void WillTerminate() { -} -#endif - -} // namespace Platform - namespace { // This function provides some ways to test crash and assertion handling @@ -817,7 +798,7 @@ int BrowserMain(const MainFunctionParams& parameters) { #endif HandleErrorTestParameters(parsed_command_line); - RecordBreakpadStatusUMA(metrics); + Platform::RecordBreakpadStatusUMA(metrics); // Start up the extensions service. This should happen before Start(). profile->InitExtensions(); // Start up the web resource service. This starts loading data after a diff --git a/chrome/browser/browser_main.h b/chrome/browser/browser_main.h new file mode 100644 index 0000000..2044670 --- /dev/null +++ b/chrome/browser/browser_main.h @@ -0,0 +1,31 @@ +// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_BROWSER_MAIN_H_ +#define CHROME_BROWSER_BROWSER_MAIN_H_ + +#include "build/build_config.h" + +struct MainFunctionParams; +class MetricsService; + +namespace Platform { + +// Perform platform-specific work that needs to be done before the main +// message loop is created, initialized, and entered. +void WillInitializeMainMessageLoop(const MainFunctionParams& parameters); + +// Perform platform-specific work that needs to be done after the main event +// loop has ended. +void WillTerminate(); + +// Records the conditions that can prevent Breakpad from generating and +// sending crash reports. The presence of a Breakpad handler (after +// attempting to initialize crash reporting) and the presence of a debugger +// are registered with the UMA metrics service. +void RecordBreakpadStatusUMA(MetricsService* metrics); + +} // namespace Platform + +#endif // CHROME_BROWSER_BROWSER_MAIN_H_ diff --git a/chrome/browser/browser_main_gtk.cc b/chrome/browser/browser_main_gtk.cc index 794fa30..6bfa6de 100644 --- a/chrome/browser/browser_main_gtk.cc +++ b/chrome/browser/browser_main_gtk.cc @@ -2,10 +2,26 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/browser_main.h" + #include "base/command_line.h" #include "chrome/browser/browser_main_win.h" #include "chrome/common/result_codes.h" +namespace Platform { + +void WillInitializeMainMessageLoop(const MainFunctionParams& parameters) { +} + +void WillTerminate() { +} + +void RecordBreakpadStatusUMA(MetricsService* metrics) { + // TODO(port): http://crbug.com/21732 +} + +} // namespace Platform + // From browser_main_win.h, stubs until we figure out the right thing... int DoUninstallTasks(bool chrome_still_running) { @@ -30,6 +46,3 @@ bool CheckMachineLevelInstall() { void PrepareRestartOnCrashEnviroment(const CommandLine &parsed_command_line) { } - -void RecordBreakpadStatusUMA(MetricsService* metrics) { -} diff --git a/chrome/browser/browser_main_mac.mm b/chrome/browser/browser_main_mac.mm index d3041cc..ca6d346 100644 --- a/chrome/browser/browser_main_mac.mm +++ b/chrome/browser/browser_main_mac.mm @@ -2,11 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/browser_main.h" + #import <Cocoa/Cocoa.h> + #include "app/resource_bundle.h" #include "base/command_line.h" +#include "base/debug_util.h" +#include "chrome/app/breakpad_mac.h" #import "chrome/app/keystone_glue.h" #include "chrome/browser/browser_main_win.h" +#include "chrome/browser/metrics/metrics_service.h" #include "chrome/common/main_function_params.h" #include "chrome/common/result_codes.h" @@ -49,6 +55,11 @@ void WillTerminate() { object:NSApp]; } +void RecordBreakpadStatusUMA(MetricsService* metrics) { + metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); + metrics->RecordBreakpadHasDebugger(DebugUtil::BeingDebugged()); +} + } // namespace Platform // From browser_main_win.h, stubs until we figure out the right thing... @@ -75,6 +86,3 @@ bool CheckMachineLevelInstall() { void PrepareRestartOnCrashEnviroment(const CommandLine& parsed_command_line) { } - -void RecordBreakpadStatusUMA(MetricsService* metrics) { -} diff --git a/chrome/browser/browser_main_win.cc b/chrome/browser/browser_main_win.cc index cb3551a..b59572f 100644 --- a/chrome/browser/browser_main_win.cc +++ b/chrome/browser/browser_main_win.cc @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/browser_main.h" #include "chrome/browser/browser_main_win.h" #include <windows.h> @@ -27,6 +28,22 @@ #include "views/focus/accelerator_handler.h" #include "views/window/window.h" +namespace Platform { + +void WillInitializeMainMessageLoop(const MainFunctionParams& parameters) { +} + +void WillTerminate() { +} + +void RecordBreakpadStatusUMA(MetricsService* metrics) { + DWORD len = ::GetEnvironmentVariableW(env_vars::kNoOOBreakpad, NULL, 0); + metrics->RecordBreakpadRegistration((len == 0)); + metrics->RecordBreakpadHasDebugger(TRUE == ::IsDebuggerPresent()); +} + +} // namespace Platform + // Displays a warning message if the user is running chrome on windows 2000. // Returns true if the OS is win2000, false otherwise. bool CheckForWin2000() { @@ -192,12 +209,3 @@ bool DoUpgradeTasks(const CommandLine& command_line) { } return true; } - -// We record in UMA the conditions that can prevent breakpad from generating -// and sending crash reports. Namely that the crash reporting registration -// failed and that the process is being debugged. -void RecordBreakpadStatusUMA(MetricsService* metrics) { - DWORD len = ::GetEnvironmentVariableW(env_vars::kNoOOBreakpad, NULL, 0); - metrics->RecordBreakpadRegistration((len == 0)); - metrics->RecordBreakpadHasDebugger(TRUE == ::IsDebuggerPresent()); -} diff --git a/chrome/browser/browser_main_win.h b/chrome/browser/browser_main_win.h index 1ce9726..4b8636a 100644 --- a/chrome/browser/browser_main_win.h +++ b/chrome/browser/browser_main_win.h @@ -40,9 +40,4 @@ bool CheckMachineLevelInstall(); // Handle upgrades if Chromium was upgraded while it was last running. bool DoUpgradeTasks(const CommandLine& command_line); -// We record in UMA the conditions that can prevent breakpad from generating -// and sending crash reports. Namely that the crash reporting registration -// failed and that the process is being debugged. -void RecordBreakpadStatusUMA(MetricsService* metrics); - #endif // CHROME_BROWSER_BROWSER_MAIN_WIN_H_ |