OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 EXTENSIONS_BROWSER_EXTENSION_SERVICE_WORKER_MESSAGE_FILTER_H_ |
| 6 #define EXTENSIONS_BROWSER_EXTENSION_SERVICE_WORKER_MESSAGE_FILTER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "content/public/browser/browser_message_filter.h" |
| 10 |
| 11 struct ExtensionHostMsg_Request_Params; |
| 12 |
| 13 namespace content { |
| 14 class BrowserContext; |
| 15 } |
| 16 |
| 17 namespace extensions { |
| 18 |
| 19 class ExtensionFunctionDispatcher; |
| 20 |
| 21 // IPC handler class for extension service worker. |
| 22 class ExtensionServiceWorkerMessageFilter |
| 23 : public content::BrowserMessageFilter { |
| 24 public: |
| 25 ExtensionServiceWorkerMessageFilter(int render_process_id, |
| 26 content::BrowserContext* context); |
| 27 |
| 28 // content::BrowserMessageFilter: |
| 29 bool OnMessageReceived(const IPC::Message& message) override; |
| 30 void OverrideThreadForMessage(const IPC::Message& message, |
| 31 content::BrowserThread::ID* thread) override; |
| 32 |
| 33 private: |
| 34 ~ExtensionServiceWorkerMessageFilter() override; |
| 35 |
| 36 void OnRequestWorker(const ExtensionHostMsg_Request_Params& params); |
| 37 |
| 38 const int render_process_id_; |
| 39 content::BrowserContext* browser_context_; |
| 40 |
| 41 std::unique_ptr<ExtensionFunctionDispatcher, |
| 42 content::BrowserThread::DeleteOnUIThread> |
| 43 dispatcher_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(ExtensionServiceWorkerMessageFilter); |
| 46 }; |
| 47 |
| 48 } // namespace extensions |
| 49 |
| 50 #endif // EXTENSIONS_BROWSER_EXTENSION_SERVICE_WORKER_MESSAGE_FILTER_H_ |
OLD | NEW |