| 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 #ifndef CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "content/public/renderer/renderer_ppapi_host.h" | 10 #include "content/public/renderer/renderer_ppapi_host.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // host impl should outlive the returned pointer. Since the resource | 77 // host impl should outlive the returned pointer. Since the resource |
| 78 // creation object is associated with the instance, this will generally | 78 // creation object is associated with the instance, this will generally |
| 79 // happen automatically. | 79 // happen automatically. |
| 80 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> | 80 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> |
| 81 CreateInProcessResourceCreationAPI( | 81 CreateInProcessResourceCreationAPI( |
| 82 webkit::ppapi::PluginInstance* instance); | 82 webkit::ppapi::PluginInstance* instance); |
| 83 | 83 |
| 84 // RendererPpapiHost. | 84 // RendererPpapiHost. |
| 85 virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; | 85 virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; |
| 86 virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE; | 86 virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE; |
| 87 virtual webkit::ppapi::PluginInstance* GetPluginInstance( |
| 88 PP_Instance instance) const OVERRIDE; |
| 87 virtual RenderView* GetRenderViewForInstance( | 89 virtual RenderView* GetRenderViewForInstance( |
| 88 PP_Instance instance) const OVERRIDE; | 90 PP_Instance instance) const OVERRIDE; |
| 89 virtual WebKit::WebPluginContainer* GetContainerForInstance( | 91 virtual WebKit::WebPluginContainer* GetContainerForInstance( |
| 90 PP_Instance instance) const OVERRIDE; | 92 PP_Instance instance) const OVERRIDE; |
| 91 virtual bool HasUserGesture(PP_Instance instance) const OVERRIDE; | 93 virtual bool HasUserGesture(PP_Instance instance) const OVERRIDE; |
| 94 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( |
| 95 base::PlatformFile handle, |
| 96 bool should_close_source) OVERRIDE; |
| 92 | 97 |
| 93 private: | 98 private: |
| 94 RendererPpapiHostImpl(webkit::ppapi::PluginModule* module, | 99 RendererPpapiHostImpl(webkit::ppapi::PluginModule* module, |
| 95 ppapi::proxy::HostDispatcher* dispatcher, | 100 ppapi::proxy::HostDispatcher* dispatcher, |
| 96 const ppapi::PpapiPermissions& permissions); | 101 const ppapi::PpapiPermissions& permissions); |
| 97 RendererPpapiHostImpl(webkit::ppapi::PluginModule* module, | 102 RendererPpapiHostImpl(webkit::ppapi::PluginModule* module, |
| 98 const ppapi::PpapiPermissions& permissions); | 103 const ppapi::PpapiPermissions& permissions); |
| 99 | 104 |
| 100 // Retrieves the plugin instance object associated with the given PP_Instance | 105 // Retrieves the plugin instance object associated with the given PP_Instance |
| 101 // and validates that it is one of the instances associated with our module. | 106 // and validates that it is one of the instances associated with our module. |
| 102 // Returns NULL on failure. | 107 // Returns NULL on failure. |
| 103 // | 108 // |
| 104 // We use this to security check the PP_Instance values sent from a plugin to | 109 // We use this to security check the PP_Instance values sent from a plugin to |
| 105 // make sure it's not trying to spoof another instance. | 110 // make sure it's not trying to spoof another instance. |
| 106 webkit::ppapi::PluginInstance* GetAndValidateInstance( | 111 webkit::ppapi::PluginInstance* GetAndValidateInstance( |
| 107 PP_Instance instance) const; | 112 PP_Instance instance) const; |
| 108 | 113 |
| 109 webkit::ppapi::PluginModule* module_; // Non-owning pointer. | 114 webkit::ppapi::PluginModule* module_; // Non-owning pointer. |
| 110 | 115 |
| 116 ppapi::proxy::HostDispatcher* dispatcher_; // Non-owning pointer. |
| 117 |
| 111 scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; | 118 scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; |
| 112 | 119 |
| 113 // Null when running out-of-process. | 120 // Null when running out-of-process. |
| 114 scoped_ptr<PepperInProcessRouter> in_process_router_; | 121 scoped_ptr<PepperInProcessRouter> in_process_router_; |
| 115 | 122 |
| 116 DISALLOW_COPY_AND_ASSIGN(RendererPpapiHostImpl); | 123 DISALLOW_COPY_AND_ASSIGN(RendererPpapiHostImpl); |
| 117 }; | 124 }; |
| 118 | 125 |
| 119 } // namespace content | 126 } // namespace content |
| 120 | 127 |
| 121 #endif // CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ | 128 #endif // CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ |
| OLD | NEW |