From 88bf664eb388730acafedfc27e80726ed4789515 Mon Sep 17 00:00:00 2001 From: "pkasting@chromium.org" Date: Fri, 22 May 2009 17:30:56 +0000 Subject: 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 --- chrome/browser/worker_host/worker_service.cc | 6 ++---- chrome/browser/worker_host/worker_service.h | 3 ++- 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_; -- cgit v1.1