summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/chrome_url_request_context.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-22 01:52:43 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-22 01:52:43 +0000
commitf1c8a2bde28415af7f2af63bfeaa7bc4b781e6d0 (patch)
tree8f7b62ff82b2315b3f997cb15f249a2994ddbdb9 /chrome/browser/net/chrome_url_request_context.cc
parent88cf329e3b89404544ad80a70a5a0a325e420227 (diff)
downloadchromium_src-f1c8a2bde28415af7f2af63bfeaa7bc4b781e6d0.zip
chromium_src-f1c8a2bde28415af7f2af63bfeaa7bc4b781e6d0.tar.gz
chromium_src-f1c8a2bde28415af7f2af63bfeaa7bc4b781e6d0.tar.bz2
Use a NotificationRegistrar to listen for notifications.
BUG=2381 Review URL: http://codereview.chromium.org/113738 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16702 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/chrome_url_request_context.cc')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index ae75216..12fef56 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -309,9 +309,8 @@ ChromeURLRequestContext::ChromeURLRequestContext(Profile* profile)
prefs_->AddPrefObserver(prefs::kAcceptLanguages, this);
prefs_->AddPrefObserver(prefs::kCookieBehavior, this);
- NotificationService::current()->AddObserver(
- this, NotificationType::EXTENSIONS_LOADED,
- NotificationService::AllSources());
+ registrar_.Add(this, NotificationType::EXTENSIONS_LOADED,
+ NotificationService::AllSources());
NotificationService::current()->AddObserver(
this, NotificationType::EXTENSION_UNLOADED,
NotificationService::AllSources());
@@ -368,9 +367,7 @@ void ChromeURLRequestContext::CleanupOnUIThread() {
prefs_->RemovePrefObserver(prefs::kCookieBehavior, this);
prefs_ = NULL;
- NotificationService::current()->RemoveObserver(
- this, NotificationType::EXTENSIONS_LOADED,
- NotificationService::AllSources());
+ registrar_.RemoveAll();
NotificationService::current()->RemoveObserver(
this, NotificationType::EXTENSION_UNLOADED,
NotificationService::AllSources());