summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-22 17:30:56 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-22 17:30:56 +0000
commit88bf664eb388730acafedfc27e80726ed4789515 (patch)
treedd6a50b4fe9afccda07169b6dbc92c97ace3448d
parente7c528e825cca794295bd7bd182d8906e06e8551 (diff)
downloadchromium_src-88bf664eb388730acafedfc27e80726ed4789515.zip
chromium_src-88bf664eb388730acafedfc27e80726ed4789515.tar.gz
chromium_src-88bf664eb388730acafedfc27e80726ed4789515.tar.bz2
Use a NotificationRegistrar to listen for notifications.
BUG=2381 Review URL: http://codereview.chromium.org/113745 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16751 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/worker_host/worker_service.cc6
-rw-r--r--chrome/browser/worker_host/worker_service.h3
2 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/worker_host/worker_service.cc b/chrome/browser/worker_host/worker_service.cc
index a90c30e..5968071 100644
--- a/chrome/browser/worker_host/worker_service.cc
+++ b/chrome/browser/worker_host/worker_service.cc
@@ -30,10 +30,8 @@ WorkerService::WorkerService()
resource_dispatcher_host_(NULL),
ui_loop_(NULL) {
// Receive a notification if the message filter is deleted.
- NotificationService::current()->AddObserver(
- this,
- NotificationType::RESOURCE_MESSAGE_FILTER_SHUTDOWN,
- NotificationService::AllSources());
+ registrar_.Add(this, NotificationType::RESOURCE_MESSAGE_FILTER_SHUTDOWN,
+ NotificationService::AllSources());
}
void WorkerService::Initialize(ResourceDispatcherHost* rdh,
diff --git a/chrome/browser/worker_host/worker_service.h b/chrome/browser/worker_host/worker_service.h
index 0a88071..e009679 100644
--- a/chrome/browser/worker_host/worker_service.h
+++ b/chrome/browser/worker_host/worker_service.h
@@ -10,7 +10,7 @@
#include "base/basictypes.h"
#include "base/singleton.h"
#include "chrome/common/ipc_message.h"
-#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
#include "googleurl/src/gurl.h"
@@ -67,6 +67,7 @@ class WorkerService : public NotificationObserver {
// number of worker instance running.
WorkerProcessHost* GetLeastLoadedWorker();
+ NotificationRegistrar registrar_;
int next_worker_route_id_;
ResourceDispatcherHost* resource_dispatcher_host_;
MessageLoop* ui_loop_;