| 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 "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "content/common/frame_messages.h" | 8 #include "content/common/frame_messages.h" |
| 9 #include "content/public/common/origin_util.h" | 9 #include "content/public/common/origin_util.h" |
| 10 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" | 10 #include "content/renderer/pepper/pepper_hung_plugin_filter.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 RendererPpapiHostImpl* host = | 77 RendererPpapiHostImpl* host = |
| 78 RendererPpapiHostImpl::GetForPPInstance(instance); | 78 RendererPpapiHostImpl::GetForPPInstance(instance); |
| 79 // TODO(brettw) remove this null check when the old-style pepper-based | 79 // TODO(brettw) remove this null check when the old-style pepper-based |
| 80 // browser tag is removed from this file. Getting this notification should | 80 // browser tag is removed from this file. Getting this notification should |
| 81 // always give us an instance we can find in the map otherwise, but that | 81 // always give us an instance we can find in the map otherwise, but that |
| 82 // isn't true for browser tag support. | 82 // isn't true for browser tag support. |
| 83 if (host) { | 83 if (host) { |
| 84 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); | 84 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); |
| 85 PepperPluginInstance* plugin_instance = host->GetPluginInstance(instance); | 85 PepperPluginInstance* plugin_instance = host->GetPluginInstance(instance); |
| 86 blink::WebString unused; | |
| 87 bool is_privileged_context = | 86 bool is_privileged_context = |
| 88 plugin_instance->GetContainer() | 87 plugin_instance->GetContainer()->document().isSecureContext() && |
| 89 ->document() | |
| 90 .isSecureContext(unused) && | |
| 91 content::IsOriginSecure(plugin_instance->GetPluginURL()); | 88 content::IsOriginSecure(plugin_instance->GetPluginURL()); |
| 92 render_frame->Send(new FrameHostMsg_DidCreateOutOfProcessPepperInstance( | 89 render_frame->Send(new FrameHostMsg_DidCreateOutOfProcessPepperInstance( |
| 93 plugin_child_id_, instance, | 90 plugin_child_id_, instance, |
| 94 PepperRendererInstanceData( | 91 PepperRendererInstanceData( |
| 95 0, // The render process id will be supplied in the browser. | 92 0, // The render process id will be supplied in the browser. |
| 96 render_frame->GetRoutingID(), host->GetDocumentURL(instance), | 93 render_frame->GetRoutingID(), host->GetDocumentURL(instance), |
| 97 plugin_instance->GetPluginURL(), is_privileged_context), | 94 plugin_instance->GetPluginURL(), is_privileged_context), |
| 98 is_external_)); | 95 is_external_)); |
| 99 } | 96 } |
| 100 } | 97 } |
| 101 | 98 |
| 102 void HostDispatcherWrapper::RemoveInstance(PP_Instance instance) { | 99 void HostDispatcherWrapper::RemoveInstance(PP_Instance instance) { |
| 103 ppapi::proxy::HostDispatcher::RemoveForInstance(instance); | 100 ppapi::proxy::HostDispatcher::RemoveForInstance(instance); |
| 104 | 101 |
| 105 RendererPpapiHostImpl* host = | 102 RendererPpapiHostImpl* host = |
| 106 RendererPpapiHostImpl::GetForPPInstance(instance); | 103 RendererPpapiHostImpl::GetForPPInstance(instance); |
| 107 // TODO(brettw) remove null check as described in AddInstance. | 104 // TODO(brettw) remove null check as described in AddInstance. |
| 108 if (host) { | 105 if (host) { |
| 109 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); | 106 RenderFrame* render_frame = host->GetRenderFrameForInstance(instance); |
| 110 if (render_frame) { | 107 if (render_frame) { |
| 111 render_frame->Send(new FrameHostMsg_DidDeleteOutOfProcessPepperInstance( | 108 render_frame->Send(new FrameHostMsg_DidDeleteOutOfProcessPepperInstance( |
| 112 plugin_child_id_, instance, is_external_)); | 109 plugin_child_id_, instance, is_external_)); |
| 113 } | 110 } |
| 114 } | 111 } |
| 115 } | 112 } |
| 116 | 113 |
| 117 } // namespace content | 114 } // namespace content |
| OLD | NEW |