diff options
author | jabdelmalek@google.com <jabdelmalek@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 01:55:43 +0000 |
---|---|---|
committer | jabdelmalek@google.com <jabdelmalek@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 01:55:43 +0000 |
commit | 35941fdf7a367e4a20778dfe89ec397b36ce301d (patch) | |
tree | f8b0598cdbfd8c53f9896b77b899081b0ad68508 /chrome | |
parent | f30f04cb5fd0d2108ddca89e311937fbe45cfa09 (diff) | |
download | chromium_src-35941fdf7a367e4a20778dfe89ec397b36ce301d.zip chromium_src-35941fdf7a367e4a20778dfe89ec397b36ce301d.tar.gz chromium_src-35941fdf7a367e4a20778dfe89ec397b36ce301d.tar.bz2 |
Renable sending page urls in renderer crashes on Mac.
Review URL: http://codereview.chromium.org/149370
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20226 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/breakpad_mac.mm | 5 | ||||
-rw-r--r-- | chrome/common/child_process_logging.h | 3 | ||||
-rw-r--r-- | chrome/common/child_process_logging_mac.mm | 20 |
3 files changed, 18 insertions, 10 deletions
diff --git a/chrome/app/breakpad_mac.mm b/chrome/app/breakpad_mac.mm index 87c8fe3..0356258 100644 --- a/chrome/app/breakpad_mac.mm +++ b/chrome/app/breakpad_mac.mm @@ -13,6 +13,7 @@ #import "base/scoped_nsautorelease_pool.h" #include "base/sys_string_conversions.h" #import "breakpad/src/client/mac/Framework/Breakpad.h" +#include "chrome/common/child_process_logging.h" #include "chrome/installer/util/google_update_settings.h" extern "C" { @@ -110,6 +111,10 @@ void InitCrashReporter() { NSString* prod_name_str = [info_dictionary objectForKey:@BREAKPAD_PRODUCT]; SetCrashKeyValue(@"prod", prod_name_str); SetCrashKeyValue(@"plat", @"OS X"); + + // Enable child process crashes to include the page url. + child_process_logging::SetCrashKeyFunctions( + SetCrashKeyValue, ClearCrashKeyValue); } void InitCrashProcessInfo() { diff --git a/chrome/common/child_process_logging.h b/chrome/common/child_process_logging.h index 43b34d2..7d1f16f 100644 --- a/chrome/common/child_process_logging.h +++ b/chrome/common/child_process_logging.h @@ -33,7 +33,6 @@ class ScopedActiveURLSetter { } // namespace child_process_logging #if defined(OS_MACOSX) && __OBJC__ -// Exported for testing purposes. @class NSString; @@ -41,6 +40,8 @@ typedef void (*SetCrashKeyValueFuncPtr)(NSString*, NSString*); typedef void (*ClearCrashKeyValueFuncPtr)(NSString*); namespace child_process_logging { +void SetCrashKeyFunctions(SetCrashKeyValueFuncPtr set_key_func, + ClearCrashKeyValueFuncPtr clear_key_func); void SetActiveURLImpl(const GURL& url, SetCrashKeyValueFuncPtr set_key_func, ClearCrashKeyValueFuncPtr clear_key_func); diff --git a/chrome/common/child_process_logging_mac.mm b/chrome/common/child_process_logging_mac.mm index c07dbe5..e863239 100644 --- a/chrome/common/child_process_logging_mac.mm +++ b/chrome/common/child_process_logging_mac.mm @@ -8,7 +8,6 @@ #include "base/string_util.h" #include "googleurl/src/gurl.h" -//#import "chrome/app/breakpad_mac.h" namespace child_process_logging { @@ -16,6 +15,15 @@ const int kMaxNumCrashURLChunks = 8; const int kMaxNumURLChunkValueLength = 255; const char *kUrlChunkFormatStr = "url-chunk-%d"; +static SetCrashKeyValueFuncPtr g_set_key_func; +static ClearCrashKeyValueFuncPtr g_clear_key_func; + +void SetCrashKeyFunctions(SetCrashKeyValueFuncPtr set_key_func, + ClearCrashKeyValueFuncPtr clear_key_func) { + g_set_key_func = set_key_func; + g_clear_key_func = clear_key_func; +} + void SetActiveURLImpl(const GURL& url, SetCrashKeyValueFuncPtr set_key_func, ClearCrashKeyValueFuncPtr clear_key_func) { @@ -60,14 +68,8 @@ void SetActiveURLImpl(const GURL& url, } void SetActiveURL(const GURL& url) { -/* - // If Breakpad isn't initialized then bail. - if (IsCrashReporterDisabled()) { - return; - } - - SetActiveURLImpl(url, SetCrashKeyValue, ClearCrashKeyValue); -*/ + if (g_set_key_func && g_clear_key_func) + SetActiveURLImpl(url, g_set_key_func, g_clear_key_func); } } // namespace child_process_logging |