| 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/renderer/pepper/host_dispatcher_wrapper.h" | 5 #include "content/renderer/pepper/host_dispatcher_wrapper.h" |
| 6 | 6 |
| 7 #include "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
| 8 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" | 8 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" |
| 9 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 9 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 10 #include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h" | 10 #include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h" |
| 11 #include "content/renderer/pepper/plugin_module.h" | 11 #include "content/renderer/pepper/plugin_module.h" |
| 12 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 12 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" |
| 13 #include "content/renderer/pepper/renderer_restrict_dispatch_group.h" | 13 #include "content/renderer/pepper/renderer_restrict_dispatch_group.h" |
| 14 #include "content/renderer/render_view_impl.h" | 14 #include "content/renderer/render_frame_impl.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 HostDispatcherWrapper::HostDispatcherWrapper( | 18 HostDispatcherWrapper::HostDispatcherWrapper( |
| 19 PluginModule* module, | 19 PluginModule* module, |
| 20 base::ProcessId peer_pid, | 20 base::ProcessId peer_pid, |
| 21 int plugin_child_id, | 21 int plugin_child_id, |
| 22 const ppapi::PpapiPermissions& perms, | 22 const ppapi::PpapiPermissions& perms, |
| 23 bool is_external) | 23 bool is_external) |
| 24 : module_(module), | 24 : module_(module), |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void HostDispatcherWrapper::AddInstance(PP_Instance instance) { | 69 void HostDispatcherWrapper::AddInstance(PP_Instance instance) { |
| 70 ppapi::proxy::HostDispatcher::SetForInstance(instance, dispatcher_.get()); | 70 ppapi::proxy::HostDispatcher::SetForInstance(instance, dispatcher_.get()); |
| 71 | 71 |
| 72 RendererPpapiHostImpl* host = | 72 RendererPpapiHostImpl* host = |
| 73 RendererPpapiHostImpl::GetForPPInstance(instance); | 73 RendererPpapiHostImpl::GetForPPInstance(instance); |
| 74 // TODO(brettw) remove this null check when the old-style pepper-based | 74 // TODO(brettw) remove this null check when the old-style pepper-based |
| 75 // browser tag is removed from this file. Getting this notification should | 75 // browser tag is removed from this file. Getting this notification should |
| 76 // always give us an instance we can find in the map otherwise, but that | 76 // always give us an instance we can find in the map otherwise, but that |
| 77 // isn't true for browser tag support. | 77 // isn't true for browser tag support. |
| 78 if (host) { | 78 if (host) { |
| 79 RenderView* render_view = host->GetRenderViewForInstance(instance); | 79 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); |
| 80 PepperPluginInstance* plugin_instance = host->GetPluginInstance(instance); | 80 PepperPluginInstance* plugin_instance = host->GetPluginInstance(instance); |
| 81 render_view->Send(new ViewHostMsg_DidCreateOutOfProcessPepperInstance( | 81 render_frame->Send(new ViewHostMsg_DidCreateOutOfProcessPepperInstance( |
| 82 plugin_child_id_, | 82 plugin_child_id_, |
| 83 instance, | 83 instance, |
| 84 PepperRendererInstanceData( | 84 PepperRendererInstanceData( |
| 85 0, // The render process id will be supplied in the browser. | 85 0, // The render process id will be supplied in the browser. |
| 86 render_view->GetRoutingID(), | 86 render_frame->GetRoutingID(), |
| 87 host->GetDocumentURL(instance), | 87 host->GetDocumentURL(instance), |
| 88 plugin_instance->GetPluginURL()), | 88 plugin_instance->GetPluginURL()), |
| 89 is_external_)); | 89 is_external_)); |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 void HostDispatcherWrapper::RemoveInstance(PP_Instance instance) { | 93 void HostDispatcherWrapper::RemoveInstance(PP_Instance instance) { |
| 94 ppapi::proxy::HostDispatcher::RemoveForInstance(instance); | 94 ppapi::proxy::HostDispatcher::RemoveForInstance(instance); |
| 95 | 95 |
| 96 RendererPpapiHostImpl* host = | 96 RendererPpapiHostImpl* host = |
| 97 RendererPpapiHostImpl::GetForPPInstance(instance); | 97 RendererPpapiHostImpl::GetForPPInstance(instance); |
| 98 // TODO(brettw) remove null check as described in AddInstance. | 98 // TODO(brettw) remove null check as described in AddInstance. |
| 99 if (host) { | 99 if (host) { |
| 100 RenderView* render_view = host->GetRenderViewForInstance(instance); | 100 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); |
| 101 render_view->Send(new ViewHostMsg_DidDeleteOutOfProcessPepperInstance( | 101 render_frame->Send(new ViewHostMsg_DidDeleteOutOfProcessPepperInstance( |
| 102 plugin_child_id_, | 102 plugin_child_id_, |
| 103 instance, | 103 instance, |
| 104 is_external_)); | 104 is_external_)); |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace content | 108 } // namespace content |
| OLD | NEW |