| 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/renderer_ppapi_host_impl.h" | 5 #include "content/renderer/pepper/renderer_ppapi_host_impl.h" | 
| 6 | 6 | 
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" | 
| 8 #include "base/logging.h" | 8 #include "base/logging.h" | 
| 9 #include "base/process/process_handle.h" | 9 #include "base/process/process_handle.h" | 
| 10 #include "content/common/sandbox_util.h" | 10 #include "content/common/sandbox_util.h" | 
| 11 #include "content/renderer/pepper/fullscreen_container.h" | 11 #include "content/renderer/pepper/fullscreen_container.h" | 
| 12 #include "content/renderer/pepper/host_globals.h" | 12 #include "content/renderer/pepper/host_globals.h" | 
| 13 #include "content/renderer/pepper/pepper_browser_connection.h" | 13 #include "content/renderer/pepper/pepper_browser_connection.h" | 
| 14 #include "content/renderer/pepper/pepper_graphics_2d_host.h" | 14 #include "content/renderer/pepper/pepper_graphics_2d_host.h" | 
|  | 15 #include "content/renderer/pepper/pepper_helper_impl.h" | 
| 15 #include "content/renderer/pepper/pepper_in_process_resource_creation.h" | 16 #include "content/renderer/pepper/pepper_in_process_resource_creation.h" | 
| 16 #include "content/renderer/pepper/pepper_in_process_router.h" | 17 #include "content/renderer/pepper/pepper_in_process_router.h" | 
| 17 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |  | 
| 18 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 18 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 
| 19 #include "content/renderer/pepper/plugin_module.h" | 19 #include "content/renderer/pepper/plugin_module.h" | 
| 20 #include "content/renderer/render_view_impl.h" | 20 #include "content/renderer/render_view_impl.h" | 
| 21 #include "content/renderer/render_widget_fullscreen_pepper.h" | 21 #include "content/renderer/render_widget_fullscreen_pepper.h" | 
| 22 #include "ipc/ipc_message.h" | 22 #include "ipc/ipc_message.h" | 
| 23 #include "ppapi/host/ppapi_host.h" | 23 #include "ppapi/host/ppapi_host.h" | 
| 24 #include "ppapi/proxy/host_dispatcher.h" | 24 #include "ppapi/proxy/host_dispatcher.h" | 
| 25 #include "third_party/WebKit/public/platform/WebRect.h" | 25 #include "third_party/WebKit/public/platform/WebRect.h" | 
| 26 #include "third_party/WebKit/public/web/WebDocument.h" | 26 #include "third_party/WebKit/public/web/WebDocument.h" | 
| 27 #include "third_party/WebKit/public/web/WebElement.h" | 27 #include "third_party/WebKit/public/web/WebElement.h" | 
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 121   return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>( | 121   return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>( | 
| 122       new PepperInProcessResourceCreation(this, instance)); | 122       new PepperInProcessResourceCreation(this, instance)); | 
| 123 } | 123 } | 
| 124 | 124 | 
| 125 PepperBrowserConnection* | 125 PepperBrowserConnection* | 
| 126 RendererPpapiHostImpl::GetBrowserConnection(PP_Instance instance) const { | 126 RendererPpapiHostImpl::GetBrowserConnection(PP_Instance instance) const { | 
| 127   PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); | 127   PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); | 
| 128   if (!instance_object) | 128   if (!instance_object) | 
| 129     return NULL; | 129     return NULL; | 
| 130 | 130 | 
| 131   // Since we're the embedder, we can make assumptions about the delegate on | 131   // Since we're the embedder, we can make assumptions about the helper on | 
| 132   // the instance. | 132   // the instance. | 
| 133   PepperPluginDelegateImpl* delegate = instance_object->delegate(); | 133   PepperHelperImpl* helper = instance_object->helper(); | 
| 134   if (!delegate) | 134   if (!helper) | 
| 135     return NULL; | 135     return NULL; | 
| 136 | 136 | 
| 137   return delegate->pepper_browser_connection(); | 137   return helper->pepper_browser_connection(); | 
| 138 } | 138 } | 
| 139 | 139 | 
| 140 PepperPluginInstanceImpl* RendererPpapiHostImpl::GetPluginInstanceImpl( | 140 PepperPluginInstanceImpl* RendererPpapiHostImpl::GetPluginInstanceImpl( | 
| 141     PP_Instance instance) const { | 141     PP_Instance instance) const { | 
| 142   return GetAndValidateInstance(instance); | 142   return GetAndValidateInstance(instance); | 
| 143 } | 143 } | 
| 144 | 144 | 
| 145 ppapi::host::PpapiHost* RendererPpapiHostImpl::GetPpapiHost() { | 145 ppapi::host::PpapiHost* RendererPpapiHostImpl::GetPpapiHost() { | 
| 146   return ppapi_host_.get(); | 146   return ppapi_host_.get(); | 
| 147 } | 147 } | 
| 148 | 148 | 
| 149 RenderView* RendererPpapiHostImpl::GetRenderViewForInstance( | 149 RenderView* RendererPpapiHostImpl::GetRenderViewForInstance( | 
| 150     PP_Instance instance) const { | 150     PP_Instance instance) const { | 
| 151   PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); | 151   PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); | 
| 152   if (!instance_object) | 152   if (!instance_object) | 
| 153     return NULL; | 153     return NULL; | 
| 154 | 154 | 
| 155   // Since we're the embedder, we can make assumptions about the delegate on | 155   // Since we're the embedder, we can make assumptions about the helper on | 
| 156   // the instance and get back to our RenderView. | 156   // the instance and get back to our RenderView. | 
| 157   return instance_object->delegate()->render_view(); | 157   return instance_object->helper()->render_view(); | 
| 158 } | 158 } | 
| 159 | 159 | 
| 160 bool RendererPpapiHostImpl::IsValidInstance(PP_Instance instance) const { | 160 bool RendererPpapiHostImpl::IsValidInstance(PP_Instance instance) const { | 
| 161   return !!GetAndValidateInstance(instance); | 161   return !!GetAndValidateInstance(instance); | 
| 162 } | 162 } | 
| 163 | 163 | 
| 164 PepperPluginInstance* RendererPpapiHostImpl::GetPluginInstance( | 164 PepperPluginInstance* RendererPpapiHostImpl::GetPluginInstance( | 
| 165     PP_Instance instance) const { | 165     PP_Instance instance) const { | 
| 166   return GetAndValidateInstance(instance); | 166   return GetAndValidateInstance(instance); | 
| 167 } | 167 } | 
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 261   PepperPluginInstanceImpl* instance = | 261   PepperPluginInstanceImpl* instance = | 
| 262       HostGlobals::Get()->GetInstance(pp_instance); | 262       HostGlobals::Get()->GetInstance(pp_instance); | 
| 263   if (!instance) | 263   if (!instance) | 
| 264     return NULL; | 264     return NULL; | 
| 265   if (!instance->IsValidInstanceOf(module_)) | 265   if (!instance->IsValidInstanceOf(module_)) | 
| 266     return NULL; | 266     return NULL; | 
| 267   return instance; | 267   return instance; | 
| 268 } | 268 } | 
| 269 | 269 | 
| 270 }  // namespace content | 270 }  // namespace content | 
| OLD | NEW | 
|---|