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

Side by Side Diff: content/child/navigator_connect/navigator_connect_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, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_H_ 5 #ifndef CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_H_
6 #define CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_H_ 6 #define CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_H_
7 7
8 #include "content/child/child_message_filter.h" 8 #include "content/child/worker_thread_message_filter.h"
9
10 namespace base {
11 class MessageLoopProxy;
12 }
13 9
14 namespace content { 10 namespace content {
15 11
16 class ThreadSafeSender;
17
18 // Receives IPC messages from the browser process and dispatches them to the 12 // Receives IPC messages from the browser process and dispatches them to the
19 // correct thread specific NavigatorConnectProvider. 13 // correct thread specific NavigatorConnectProvider.
20 class NavigatorConnectDispatcher : public ChildMessageFilter { 14 class NavigatorConnectDispatcher : public WorkerThreadMessageFilter {
21 public: 15 public:
22 explicit NavigatorConnectDispatcher(ThreadSafeSender* thread_safe_sender); 16 explicit NavigatorConnectDispatcher(ThreadSafeSender* thread_safe_sender);
23 17
24 private: 18 private:
25 ~NavigatorConnectDispatcher() override; 19 ~NavigatorConnectDispatcher() override;
26 20
27 // ChildMessageFilter implementation: 21 // WorkerThreadMessageFilter:
28 base::TaskRunner* OverrideTaskRunnerForMessage( 22 bool ShouldHandleMessage(const IPC::Message& msg) const override;
29 const IPC::Message& msg) override; 23 void OnFilteredMessageReceived(const IPC::Message& msg) override;
30 bool OnMessageReceived(const IPC::Message& msg) override; 24 bool GetWorkerThreadIdForMessage(const IPC::Message& msg,
31 25 int* ipc_thread_id) override;
32 scoped_refptr<base::MessageLoopProxy> main_thread_loop_proxy_;
33 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
34 26
35 DISALLOW_COPY_AND_ASSIGN(NavigatorConnectDispatcher); 27 DISALLOW_COPY_AND_ASSIGN(NavigatorConnectDispatcher);
36 }; 28 };
37 29
38 } // namespace content 30 } // namespace content
39 31
40 #endif // CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_H_ 32 #endif // CONTENT_CHILD_NAVIGATOR_CONNECT_NAVIGATOR_CONNECT_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/child/indexed_db/indexed_db_message_filter.cc ('k') | content/child/navigator_connect/navigator_connect_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698