Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1246)

Unified Diff: content/child/notifications/notification_dispatcher.h

Issue 892543002: workers: Introduce a WorkerMessageFilter to ease routing/processing worker messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/child/notifications/notification_dispatcher.h
diff --git a/content/child/notifications/notification_dispatcher.h b/content/child/notifications/notification_dispatcher.h
index be4ada94f243663d53ef554efa64c2af0ae3f0c8..824cde3bb25d2859b8239a3830a6ba9a7a2d431e 100644
--- a/content/child/notifications/notification_dispatcher.h
+++ b/content/child/notifications/notification_dispatcher.h
@@ -7,19 +7,12 @@
#include <map>
-#include "base/memory/ref_counted.h"
#include "base/synchronization/lock.h"
-#include "content/child/child_message_filter.h"
-
-namespace base {
-class MessageLoopProxy;
-}
+#include "content/child/worker_thread_message_filter.h"
namespace content {
-class ThreadSafeSender;
-
-class NotificationDispatcher : public ChildMessageFilter {
+class NotificationDispatcher : public WorkerThreadMessageFilter {
public:
explicit NotificationDispatcher(ThreadSafeSender* thread_safe_sender);
@@ -31,15 +24,11 @@ class NotificationDispatcher : public ChildMessageFilter {
~NotificationDispatcher() override;
private:
- bool ShouldHandleMessage(const IPC::Message& msg);
-
- // ChildMessageFilter implementation.
- base::TaskRunner* OverrideTaskRunnerForMessage(const IPC::Message& msg)
- override;
- bool OnMessageReceived(const IPC::Message& msg) override;
-
- scoped_refptr<base::MessageLoopProxy> main_thread_loop_proxy_;
- scoped_refptr<ThreadSafeSender> thread_safe_sender_;
+ // WorkerThreadMessageFilter:
+ bool ShouldHandleMessage(const IPC::Message& msg) const override;
+ void OnFilteredMessageReceived(const IPC::Message& msg) override;
+ bool GetWorkerThreadIdForMessage(const IPC::Message& msg,
+ int* ipc_thread_id) override;
using NotificationIdToThreadId = std::map<int, int>;

Powered by Google App Engine
This is Rietveld 408576698