- add sources.
[platform/framework/web/crosswalk.git] / src / content / child / service_worker / service_worker_message_filter.h
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_MESSAGE_FILTER_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_MESSAGE_FILTER_H_
7
8 #include <map>
9
10 #include "content/common/content_export.h"
11 #include "ipc/ipc_channel_proxy.h"
12
13 namespace content {
14
15 class ThreadSafeSender;
16 class MessageLoopProxy;
17
18 class CONTENT_EXPORT ServiceWorkerMessageFilter
19     : public IPC::ChannelProxy::MessageFilter {
20  public:
21   explicit ServiceWorkerMessageFilter(ThreadSafeSender* thread_safe_sender);
22
23   // IPC::Listener implementation
24   virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
25
26  protected:
27   virtual ~ServiceWorkerMessageFilter();
28
29  private:
30   void DispatchMessage(const IPC::Message& msg);
31
32   scoped_refptr<base::MessageLoopProxy> main_thread_loop_proxy_;
33   scoped_refptr<ThreadSafeSender> thread_safe_sender_;
34
35   DISALLOW_COPY_AND_ASSIGN(ServiceWorkerMessageFilter);
36 };
37
38 }  // namespace content
39
40 #endif  // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_MESSAGE_FILTER_H_