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 : BrowserMessageFilter(ExtensionMsgStart), | 23 : render_process_id_(render_process_id), browser_context_(context) { |
24 render_process_id_(render_process_id), | |
25 browser_context_(context) { | |
26 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 24 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
27 } | 25 } |
28 | 26 |
29 ExtensionMessageFilter::~ExtensionMessageFilter() {} | 27 ExtensionMessageFilter::~ExtensionMessageFilter() {} |
30 | 28 |
31 void ExtensionMessageFilter::OverrideThreadForMessage( | 29 void ExtensionMessageFilter::OverrideThreadForMessage( |
32 const IPC::Message& message, | 30 const IPC::Message& message, |
33 BrowserThread::ID* thread) { | 31 BrowserThread::ID* thread) { |
34 switch (message.type()) { | 32 switch (message.type()) { |
35 case ExtensionHostMsg_AddListener::ID: | 33 case ExtensionHostMsg_AddListener::ID: |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 static int next_unique_id = 0; | 164 static int next_unique_id = 0; |
167 *unique_id = ++next_unique_id; | 165 *unique_id = ++next_unique_id; |
168 } | 166 } |
169 | 167 |
170 void ExtensionMessageFilter::OnExtensionResumeRequests(int route_id) { | 168 void ExtensionMessageFilter::OnExtensionResumeRequests(int route_id) { |
171 content::ResourceDispatcherHost::Get()->ResumeBlockedRequestsForRoute( | 169 content::ResourceDispatcherHost::Get()->ResumeBlockedRequestsForRoute( |
172 render_process_id_, route_id); | 170 render_process_id_, route_id); |
173 } | 171 } |
174 | 172 |
175 } // namespace extensions | 173 } // namespace extensions |
OLD | NEW |