| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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_BROWSER_WORKER_HOST_WORKER_MESSAGE_FILTER_H_ | |
| 6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_MESSAGE_FILTER_H_ | |
| 7 | |
| 8 #include "base/callback.h" | |
| 9 #include "content/browser/worker_host/worker_storage_partition.h" | |
| 10 #include "content/public/browser/browser_message_filter.h" | |
| 11 | |
| 12 class ResourceDispatcherHost; | |
| 13 struct ViewHostMsg_CreateWorker_Params; | |
| 14 | |
| 15 namespace content { | |
| 16 class MessagePortMessageFilter; | |
| 17 class ResourceContext; | |
| 18 | |
| 19 class WorkerMessageFilter : public BrowserMessageFilter { | |
| 20 public: | |
| 21 WorkerMessageFilter(int render_process_id, | |
| 22 ResourceContext* resource_context, | |
| 23 const WorkerStoragePartition& partition, | |
| 24 MessagePortMessageFilter* message_port_filter); | |
| 25 | |
| 26 // BrowserMessageFilter implementation. | |
| 27 virtual void OnChannelClosing() OVERRIDE; | |
| 28 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
| 29 | |
| 30 int GetNextRoutingID(); | |
| 31 int render_process_id() const { return render_process_id_; } | |
| 32 | |
| 33 MessagePortMessageFilter* message_port_message_filter() const { | |
| 34 return message_port_message_filter_; | |
| 35 } | |
| 36 | |
| 37 private: | |
| 38 virtual ~WorkerMessageFilter(); | |
| 39 | |
| 40 // Message handlers. | |
| 41 void OnCreateWorker(const ViewHostMsg_CreateWorker_Params& params, | |
| 42 int* route_id); | |
| 43 void OnForwardToWorker(const IPC::Message& message); | |
| 44 void OnDocumentDetached(unsigned long long document_id); | |
| 45 | |
| 46 int render_process_id_; | |
| 47 ResourceContext* const resource_context_; | |
| 48 WorkerStoragePartition partition_; | |
| 49 | |
| 50 MessagePortMessageFilter* message_port_message_filter_; | |
| 51 DISALLOW_IMPLICIT_CONSTRUCTORS(WorkerMessageFilter); | |
| 52 }; | |
| 53 | |
| 54 } // namespace content | |
| 55 | |
| 56 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_MESSAGE_FILTER_H_ | |
| OLD | NEW |