diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-04 07:21:43 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-04 07:21:43 +0000 |
commit | 4119ac8f30cda71888d7ca437deafc4488cf9cf8 (patch) | |
tree | 23bbe7dc0b2bdae9118eb06fe8b7e714b2e6115a /chrome/browser/extensions | |
parent | 0c244119ef22e07c63c9cfbf7766f4186ffbef4f (diff) | |
download | chromium_src-4119ac8f30cda71888d7ca437deafc4488cf9cf8.zip chromium_src-4119ac8f30cda71888d7ca437deafc4488cf9cf8.tar.gz chromium_src-4119ac8f30cda71888d7ca437deafc4488cf9cf8.tar.bz2 |
Fix bone-headed bug where ExtensionErrorReporter
gets deleted after first message is sent from a
background thread.
Review URL: http://codereview.chromium.org/39034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10881 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extension_error_reporter.cc | 8 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_error_reporter.h | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_error_reporter.cc b/chrome/browser/extensions/extension_error_reporter.cc index bd923f5..8a17f26 100644 --- a/chrome/browser/extensions/extension_error_reporter.cc +++ b/chrome/browser/extensions/extension_error_reporter.cc @@ -10,6 +10,14 @@ #include "chrome/common/win_util.h" #endif +// No AddRef required when using ExtensionErrorReporter with RunnableMethod. +// This is okay since the ExtensionErrorReporter is a singleton that lives until +// the end of the process. +template <> struct RunnableMethodTraits<ExtensionErrorReporter> { + static void RetainCallee(ExtensionErrorReporter*) {} + static void ReleaseCallee(ExtensionErrorReporter*) {} +}; + ExtensionErrorReporter* ExtensionErrorReporter::instance_ = NULL; // static diff --git a/chrome/browser/extensions/extension_error_reporter.h b/chrome/browser/extensions/extension_error_reporter.h index 737e276..151edd5 100644 --- a/chrome/browser/extensions/extension_error_reporter.h +++ b/chrome/browser/extensions/extension_error_reporter.h @@ -19,8 +19,7 @@ // process and plumbing the errors out to the browser. // TODO(aa): Add ReportError(extension_id, message, be_noisy), so that we can // report errors that are specific to a particular extension. -class ExtensionErrorReporter - : public base::RefCountedThreadSafe<ExtensionErrorReporter> { +class ExtensionErrorReporter { public: // Initializes the error reporter. Must be called before any other methods // and on the UI thread. |