diff options
author | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-14 02:03:20 +0000 |
---|---|---|
committer | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-14 02:03:20 +0000 |
commit | 05349986a0c968101b8925be496794b1f2bc40f5 (patch) | |
tree | 7cb79c84d92e7e5910664e94979debb9980b3e3d /chrome/browser/extensions/extension_message_service.h | |
parent | 3401b00e41731a8816d9aec9592b09efb4bf5eac (diff) | |
download | chromium_src-05349986a0c968101b8925be496794b1f2bc40f5.zip chromium_src-05349986a0c968101b8925be496794b1f2bc40f5.tar.gz chromium_src-05349986a0c968101b8925be496794b1f2bc40f5.tar.bz2 |
Fix a crash where the ResourceMessageFilter is deleted before a
SafeBrowsing check has completed. The problem occurs since the
SafeBrowsingResourceHandler is not deleted when its associated
URLRequest is cleaned up *and* a SafeBrowsing check is in progress.
When the check completes, the next resource handler in the chain
(the AsyncResourceHandler which caches a pointer the now deleted
ResourceMessageFilter) will crash.
This CL adds a notification for objects to know when the
ResourceMessageFilter is destroyed.
BUG=8544 (http://crbug.com)
Review URL: http://codereview.chromium.org/63036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13644 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_message_service.h')
-rwxr-xr-x | chrome/browser/extensions/extension_message_service.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_message_service.h b/chrome/browser/extensions/extension_message_service.h index a63837a..1fc3c51 100755 --- a/chrome/browser/extensions/extension_message_service.h +++ b/chrome/browser/extensions/extension_message_service.h @@ -9,6 +9,7 @@ #include <string> #include "base/lock.h" +#include "chrome/common/notification_observer.h" class ExtensionView; class ResourceMessageFilter; @@ -23,7 +24,7 @@ class URLRequestContext; // port: an IPC::Message::Sender interface through which we communicate to a // process. We use MessageFilters for this since that allows us to send our // messages on the IO thread. -class ExtensionMessageService { +class ExtensionMessageService : public NotificationObserver { public: // Returns the message service for the given context. Messages can only // be sent within a single context. @@ -54,8 +55,10 @@ class ExtensionMessageService { // Called to let us know that a renderer has been started. void RendererReady(ResourceMessageFilter* port); - // Called to let us know that a renderer is going away. - void RendererShutdown(ResourceMessageFilter* port); + // NotificationObserver interface. + void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); private: // A map of extension ID to the render_process_id that the extension lives in. |