OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" | 5 #include "content/browser/renderer_host/pepper/browser_ppapi_host_impl.h" |
6 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" | 6 #include "content/browser/renderer_host/pepper/pepper_message_filter.h" |
7 | 7 |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
10 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 BrowserPpapiHostImpl* browser_ppapi_host = | 23 BrowserPpapiHostImpl* browser_ppapi_host = |
24 new BrowserPpapiHostImpl(sender, permissions); | 24 new BrowserPpapiHostImpl(sender, permissions); |
25 browser_ppapi_host->set_plugin_process_handle(plugin_child_process); | 25 browser_ppapi_host->set_plugin_process_handle(plugin_child_process); |
26 | 26 |
27 channel->AddFilter( | 27 channel->AddFilter( |
28 new PepperMessageFilter(PepperMessageFilter::NACL, | 28 new PepperMessageFilter(PepperMessageFilter::NACL, |
29 permissions, | 29 permissions, |
30 host_resolver, | 30 host_resolver, |
31 render_process_id, | 31 render_process_id, |
32 render_view_id)); | 32 render_view_id)); |
| 33 channel->AddFilter(browser_ppapi_host->message_filter()); |
33 | 34 |
34 return browser_ppapi_host; | 35 return browser_ppapi_host; |
35 } | 36 } |
36 | 37 |
37 BrowserPpapiHostImpl::BrowserPpapiHostImpl( | 38 BrowserPpapiHostImpl::BrowserPpapiHostImpl( |
38 IPC::Sender* sender, | 39 IPC::Sender* sender, |
39 const ppapi::PpapiPermissions& permissions) | 40 const ppapi::PpapiPermissions& permissions) |
40 : ppapi_host_(sender, permissions), | 41 : ppapi_host_(sender, permissions), |
41 plugin_process_handle_(base::kNullProcessHandle) { | 42 plugin_process_handle_(base::kNullProcessHandle) { |
42 message_filter_ = new HostMessageFilter(&ppapi_host_); | 43 message_filter_ = new HostMessageFilter(&ppapi_host_); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 */ | 116 */ |
116 return ppapi_host_->OnMessageReceived(msg); | 117 return ppapi_host_->OnMessageReceived(msg); |
117 } | 118 } |
118 | 119 |
119 void BrowserPpapiHostImpl::HostMessageFilter::OnHostDestroyed() { | 120 void BrowserPpapiHostImpl::HostMessageFilter::OnHostDestroyed() { |
120 DCHECK(ppapi_host_); | 121 DCHECK(ppapi_host_); |
121 ppapi_host_ = NULL; | 122 ppapi_host_ = NULL; |
122 } | 123 } |
123 | 124 |
124 } // namespace content | 125 } // namespace content |
OLD | NEW |