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 "base/memory/scoped_ptr.h" | |
10 #include "content/public/browser/browser_message_filter.h" | |
11 | |
12 class Profile; | |
Devlin
2016/04/13 19:46:31
mentioning Profile is a layering violation, since
lazyboy
2016/04/14 02:07:53
Right, this somehow creeped in, removed.
| |
13 struct ExtensionHostMsg_Request_Params; | |
14 | |
15 namespace content { | |
16 class BrowserContext; | |
17 } | |
18 | |
19 namespace extensions { | |
20 | |
21 class ExtensionFunctionDispatcher; | |
22 | |
23 // IPC handler class for extension service worker. | |
24 class ExtensionServiceWorkerMessageFilter | |
25 : public content::BrowserMessageFilter { | |
26 public: | |
27 ExtensionServiceWorkerMessageFilter(int render_process_id, | |
28 content::BrowserContext* profile); | |
Devlin
2016/04/13 19:46:31
nit s/profile/context
lazyboy
2016/04/14 02:07:53
Done.
| |
29 | |
30 // content::BrowserMessageFilter methods: | |
31 bool OnMessageReceived(const IPC::Message& message) override; | |
32 void OverrideThreadForMessage(const IPC::Message& message, | |
33 content::BrowserThread::ID* thread) override; | |
34 | |
35 private: | |
36 ~ExtensionServiceWorkerMessageFilter() override; | |
37 | |
38 void OnRequestWorker(const ExtensionHostMsg_Request_Params& params); | |
39 | |
40 const int render_process_id_; | |
41 content::BrowserContext* browser_context_; | |
42 | |
43 scoped_ptr<ExtensionFunctionDispatcher, | |
Devlin
2016/04/13 19:46:31
std::unique_ptr in new code.
lazyboy
2016/04/14 02:07:53
Done.
| |
44 content::BrowserThread::DeleteOnUIThread> | |
45 dispatcher_; | |
46 | |
47 DISALLOW_COPY_AND_ASSIGN(ExtensionServiceWorkerMessageFilter); | |
48 }; | |
49 | |
50 } // namespace extensions | |
51 | |
52 #endif // EXTENSIONS_BROWSER_EXTENSION_SERVICE_WORKER_MESSAGE_FILTER_H_ | |
OLD | NEW |