summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation
diff options
context:
space:
mode:
authorhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-08 21:26:07 +0000
committerhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-08 21:26:07 +0000
commitc300deb3962c263d6b084d6755274fe35f3b03e8 (patch)
tree1fd0c03d75b65b3afd43d093c3a2df596a8fdae3 /chrome/browser/automation
parentef9d24ab03688e51cc8bd6193034b5da88749234 (diff)
downloadchromium_src-c300deb3962c263d6b084d6755274fe35f3b03e8.zip
chromium_src-c300deb3962c263d6b084d6755274fe35f3b03e8.tar.gz
chromium_src-c300deb3962c263d6b084d6755274fe35f3b03e8.tar.bz2
Fix a potential crash in automation framework when
a browser window is closed. BUG=http://crbug.com/11659 Review URL: http://codereview.chromium.org/113155 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15682 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation')
-rw-r--r--chrome/browser/automation/automation_provider.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index 282bb16..3e0fba0 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -484,8 +484,8 @@ class BrowserClosedNotificationObserver : public NotificationObserver {
routing_id_(routing_id),
reply_message_(reply_message),
for_browser_command_(false) {
- NotificationService::current()->AddObserver(this,
- NotificationType::BROWSER_CLOSED, Source<Browser>(browser));
+ registrar_.Add(this, NotificationType::BROWSER_CLOSED,
+ Source<Browser>(browser));
}
virtual void Observe(NotificationType type,
@@ -512,6 +512,7 @@ class BrowserClosedNotificationObserver : public NotificationObserver {
AutomationProvider* automation_;
int32 routing_id_;
IPC::Message* reply_message_;
+ NotificationRegistrar registrar_;
bool for_browser_command_;
};