OLD | NEW |
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 #include "extensions/browser/extension_message_filter.h" | 5 #include "extensions/browser/extension_message_filter.h" |
6 | 6 |
7 #include "chrome/common/extensions/extension_messages.h" | 7 #include "chrome/common/extensions/extension_messages.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/render_process_host.h" | 9 #include "content/public/browser/render_process_host.h" |
10 #include "content/public/browser/resource_dispatcher_host.h" | 10 #include "content/public/browser/resource_dispatcher_host.h" |
11 #include "extensions/browser/event_router.h" | 11 #include "extensions/browser/event_router.h" |
12 #include "extensions/browser/extension_system.h" | 12 #include "extensions/browser/extension_system.h" |
13 #include "extensions/browser/process_manager.h" | 13 #include "extensions/browser/process_manager.h" |
14 #include "ipc/ipc_message_macros.h" | 14 #include "ipc/ipc_message_macros.h" |
15 | 15 |
16 using content::BrowserThread; | 16 using content::BrowserThread; |
17 using content::RenderProcessHost; | 17 using content::RenderProcessHost; |
18 | 18 |
19 namespace extensions { | 19 namespace extensions { |
20 | 20 |
21 ExtensionMessageFilter::ExtensionMessageFilter(int render_process_id, | 21 ExtensionMessageFilter::ExtensionMessageFilter(int render_process_id, |
22 content::BrowserContext* context) | 22 content::BrowserContext* context) |
23 : render_process_id_(render_process_id), browser_context_(context) { | 23 : BrowserMessageFilter(ExtensionMsgStart), |
| 24 render_process_id_(render_process_id), |
| 25 browser_context_(context) { |
24 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 26 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
25 } | 27 } |
26 | 28 |
27 ExtensionMessageFilter::~ExtensionMessageFilter() {} | 29 ExtensionMessageFilter::~ExtensionMessageFilter() {} |
28 | 30 |
29 void ExtensionMessageFilter::OverrideThreadForMessage( | 31 void ExtensionMessageFilter::OverrideThreadForMessage( |
30 const IPC::Message& message, | 32 const IPC::Message& message, |
31 BrowserThread::ID* thread) { | 33 BrowserThread::ID* thread) { |
32 switch (message.type()) { | 34 switch (message.type()) { |
33 case ExtensionHostMsg_AddListener::ID: | 35 case ExtensionHostMsg_AddListener::ID: |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 static int next_unique_id = 0; | 166 static int next_unique_id = 0; |
165 *unique_id = ++next_unique_id; | 167 *unique_id = ++next_unique_id; |
166 } | 168 } |
167 | 169 |
168 void ExtensionMessageFilter::OnExtensionResumeRequests(int route_id) { | 170 void ExtensionMessageFilter::OnExtensionResumeRequests(int route_id) { |
169 content::ResourceDispatcherHost::Get()->ResumeBlockedRequestsForRoute( | 171 content::ResourceDispatcherHost::Get()->ResumeBlockedRequestsForRoute( |
170 render_process_id_, route_id); | 172 render_process_id_, route_id); |
171 } | 173 } |
172 | 174 |
173 } // namespace extensions | 175 } // namespace extensions |
OLD | NEW |