| 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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 namespace content { | 30 namespace content { |
| 31 | 31 |
| 32 class PepperInProcessRouter; | 32 class PepperInProcessRouter; |
| 33 class PepperPluginInstanceImpl; | 33 class PepperPluginInstanceImpl; |
| 34 class PluginModule; | 34 class PluginModule; |
| 35 | 35 |
| 36 // This class is attached to a PluginModule which manages our lifetime. | 36 // This class is attached to a PluginModule which manages our lifetime. |
| 37 class RendererPpapiHostImpl : public RendererPpapiHost { | 37 class RendererPpapiHostImpl : public RendererPpapiHost { |
| 38 public: | 38 public: |
| 39 virtual ~RendererPpapiHostImpl(); | 39 ~RendererPpapiHostImpl() override; |
| 40 | 40 |
| 41 // Factory functions to create in process or out-of-process host impls. The | 41 // Factory functions to create in process or out-of-process host impls. The |
| 42 // host will be created and associated with the given module, which must not | 42 // host will be created and associated with the given module, which must not |
| 43 // already have embedder state on it. | 43 // already have embedder state on it. |
| 44 // | 44 // |
| 45 // The module will take ownership of the new host impl. The returned value | 45 // The module will take ownership of the new host impl. The returned value |
| 46 // does not pass ownership, it's just for the information of the caller. | 46 // does not pass ownership, it's just for the information of the caller. |
| 47 static RendererPpapiHostImpl* CreateOnModuleForOutOfProcess( | 47 static RendererPpapiHostImpl* CreateOnModuleForOutOfProcess( |
| 48 PluginModule* module, | 48 PluginModule* module, |
| 49 ppapi::proxy::HostDispatcher* dispatcher, | 49 ppapi::proxy::HostDispatcher* dispatcher, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 69 // creation object is associated with the instance, this will generally | 69 // creation object is associated with the instance, this will generally |
| 70 // happen automatically. | 70 // happen automatically. |
| 71 scoped_ptr<ppapi::thunk::ResourceCreationAPI> | 71 scoped_ptr<ppapi::thunk::ResourceCreationAPI> |
| 72 CreateInProcessResourceCreationAPI(PepperPluginInstanceImpl* instance); | 72 CreateInProcessResourceCreationAPI(PepperPluginInstanceImpl* instance); |
| 73 | 73 |
| 74 PepperPluginInstanceImpl* GetPluginInstanceImpl(PP_Instance instance) const; | 74 PepperPluginInstanceImpl* GetPluginInstanceImpl(PP_Instance instance) const; |
| 75 | 75 |
| 76 bool IsExternalPluginHost() const; | 76 bool IsExternalPluginHost() const; |
| 77 | 77 |
| 78 // RendererPpapiHost implementation. | 78 // RendererPpapiHost implementation. |
| 79 virtual ppapi::host::PpapiHost* GetPpapiHost() override; | 79 ppapi::host::PpapiHost* GetPpapiHost() override; |
| 80 virtual bool IsValidInstance(PP_Instance instance) const override; | 80 bool IsValidInstance(PP_Instance instance) const override; |
| 81 virtual PepperPluginInstance* GetPluginInstance(PP_Instance instance) const | 81 PepperPluginInstance* GetPluginInstance(PP_Instance instance) const override; |
| 82 override; | 82 RenderFrame* GetRenderFrameForInstance(PP_Instance instance) const override; |
| 83 virtual RenderFrame* GetRenderFrameForInstance(PP_Instance instance) const | 83 RenderView* GetRenderViewForInstance(PP_Instance instance) const override; |
| 84 override; | 84 blink::WebPluginContainer* GetContainerForInstance( |
| 85 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const | |
| 86 override; | |
| 87 virtual blink::WebPluginContainer* GetContainerForInstance( | |
| 88 PP_Instance instance) const override; | 85 PP_Instance instance) const override; |
| 89 virtual base::ProcessId GetPluginPID() const override; | 86 base::ProcessId GetPluginPID() const override; |
| 90 virtual bool HasUserGesture(PP_Instance instance) const override; | 87 bool HasUserGesture(PP_Instance instance) const override; |
| 91 virtual int GetRoutingIDForWidget(PP_Instance instance) const override; | 88 int GetRoutingIDForWidget(PP_Instance instance) const override; |
| 92 virtual gfx::Point PluginPointToRenderFrame(PP_Instance instance, | 89 gfx::Point PluginPointToRenderFrame(PP_Instance instance, |
| 93 const gfx::Point& pt) const | 90 const gfx::Point& pt) const override; |
| 94 override; | 91 IPC::PlatformFileForTransit ShareHandleWithRemote( |
| 95 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( | |
| 96 base::PlatformFile handle, | 92 base::PlatformFile handle, |
| 97 bool should_close_source) override; | 93 bool should_close_source) override; |
| 98 virtual bool IsRunningInProcess() const override; | 94 bool IsRunningInProcess() const override; |
| 99 virtual std::string GetPluginName() const override; | 95 std::string GetPluginName() const override; |
| 100 virtual void SetToExternalPluginHost() override; | 96 void SetToExternalPluginHost() override; |
| 101 virtual void CreateBrowserResourceHosts( | 97 void CreateBrowserResourceHosts( |
| 102 PP_Instance instance, | 98 PP_Instance instance, |
| 103 const std::vector<IPC::Message>& nested_msgs, | 99 const std::vector<IPC::Message>& nested_msgs, |
| 104 const base::Callback<void(const std::vector<int>&)>& callback) const | 100 const base::Callback<void(const std::vector<int>&)>& callback) |
| 105 override; | 101 const override; |
| 106 virtual GURL GetDocumentURL(PP_Instance instance) const override; | 102 GURL GetDocumentURL(PP_Instance instance) const override; |
| 107 | 103 |
| 108 private: | 104 private: |
| 109 RendererPpapiHostImpl(PluginModule* module, | 105 RendererPpapiHostImpl(PluginModule* module, |
| 110 ppapi::proxy::HostDispatcher* dispatcher, | 106 ppapi::proxy::HostDispatcher* dispatcher, |
| 111 const ppapi::PpapiPermissions& permissions); | 107 const ppapi::PpapiPermissions& permissions); |
| 112 RendererPpapiHostImpl(PluginModule* module, | 108 RendererPpapiHostImpl(PluginModule* module, |
| 113 const ppapi::PpapiPermissions& permissions); | 109 const ppapi::PpapiPermissions& permissions); |
| 114 | 110 |
| 115 // Retrieves the plugin instance object associated with the given PP_Instance | 111 // Retrieves the plugin instance object associated with the given PP_Instance |
| 116 // and validates that it is one of the instances associated with our module. | 112 // and validates that it is one of the instances associated with our module. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 136 | 132 |
| 137 // Whether this is a host for external plugins. | 133 // Whether this is a host for external plugins. |
| 138 bool is_external_plugin_host_; | 134 bool is_external_plugin_host_; |
| 139 | 135 |
| 140 DISALLOW_COPY_AND_ASSIGN(RendererPpapiHostImpl); | 136 DISALLOW_COPY_AND_ASSIGN(RendererPpapiHostImpl); |
| 141 }; | 137 }; |
| 142 | 138 |
| 143 } // namespace content | 139 } // namespace content |
| 144 | 140 |
| 145 #endif // CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ | 141 #endif // CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ |
| OLD | NEW |