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