| 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 <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "content/public/renderer/renderer_ppapi_host.h" | 11 #include "content/public/renderer/renderer_ppapi_host.h" |
| 11 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h" | 12 #include "content/renderer/pepper/content_renderer_pepper_host_factory.h" |
| 12 #include "ppapi/host/ppapi_host.h" | 13 #include "ppapi/host/ppapi_host.h" |
| 13 | 14 |
| 14 namespace IPC { | 15 namespace IPC { |
| 15 class Sender; | 16 class Sender; |
| 16 } | 17 } |
| 17 | 18 |
| 18 namespace ppapi { | 19 namespace ppapi { |
| 19 | 20 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // is running out-of-process. | 62 // is running out-of-process. |
| 62 PepperInProcessRouter* in_process_router() { | 63 PepperInProcessRouter* in_process_router() { |
| 63 return in_process_router_.get(); | 64 return in_process_router_.get(); |
| 64 } | 65 } |
| 65 | 66 |
| 66 // Creates the in-process resource creation API wrapper for the given | 67 // Creates the in-process resource creation API wrapper for the given |
| 67 // plugin instance. This object will reference the host impl, so the | 68 // plugin instance. This object will reference the host impl, so the |
| 68 // host impl should outlive the returned pointer. Since the resource | 69 // host impl should outlive the returned pointer. Since the resource |
| 69 // creation object is associated with the instance, this will generally | 70 // creation object is associated with the instance, this will generally |
| 70 // happen automatically. | 71 // happen automatically. |
| 71 scoped_ptr<ppapi::thunk::ResourceCreationAPI> | 72 std::unique_ptr<ppapi::thunk::ResourceCreationAPI> |
| 72 CreateInProcessResourceCreationAPI(PepperPluginInstanceImpl* instance); | 73 CreateInProcessResourceCreationAPI(PepperPluginInstanceImpl* instance); |
| 73 | 74 |
| 74 PepperPluginInstanceImpl* GetPluginInstanceImpl(PP_Instance instance) const; | 75 PepperPluginInstanceImpl* GetPluginInstanceImpl(PP_Instance instance) const; |
| 75 | 76 |
| 76 bool IsExternalPluginHost() const; | 77 bool IsExternalPluginHost() const; |
| 77 | 78 |
| 78 // RendererPpapiHost implementation. | 79 // RendererPpapiHost implementation. |
| 79 ppapi::host::PpapiHost* GetPpapiHost() override; | 80 ppapi::host::PpapiHost* GetPpapiHost() override; |
| 80 bool IsValidInstance(PP_Instance instance) const override; | 81 bool IsValidInstance(PP_Instance instance) const override; |
| 81 PepperPluginInstance* GetPluginInstance(PP_Instance instance) const override; | 82 PepperPluginInstance* GetPluginInstance(PP_Instance instance) const override; |
| 82 RenderFrame* GetRenderFrameForInstance(PP_Instance instance) const override; | 83 RenderFrame* GetRenderFrameForInstance(PP_Instance instance) const override; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // We use this to security check the PP_Instance values sent from a plugin to | 118 // We use this to security check the PP_Instance values sent from a plugin to |
| 118 // make sure it's not trying to spoof another instance. | 119 // make sure it's not trying to spoof another instance. |
| 119 PepperPluginInstanceImpl* GetAndValidateInstance(PP_Instance instance) const; | 120 PepperPluginInstanceImpl* GetAndValidateInstance(PP_Instance instance) const; |
| 120 | 121 |
| 121 PluginModule* module_; // Non-owning pointer. | 122 PluginModule* module_; // Non-owning pointer. |
| 122 | 123 |
| 123 // The dispatcher we use to send messagse when the plugin is out-of-process. | 124 // The dispatcher we use to send messagse when the plugin is out-of-process. |
| 124 // Will be null when running in-process. Non-owning pointer. | 125 // Will be null when running in-process. Non-owning pointer. |
| 125 ppapi::proxy::HostDispatcher* dispatcher_; | 126 ppapi::proxy::HostDispatcher* dispatcher_; |
| 126 | 127 |
| 127 scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; | 128 std::unique_ptr<ppapi::host::PpapiHost> ppapi_host_; |
| 128 | 129 |
| 129 // Null when running out-of-process. | 130 // Null when running out-of-process. |
| 130 scoped_ptr<PepperInProcessRouter> in_process_router_; | 131 std::unique_ptr<PepperInProcessRouter> in_process_router_; |
| 131 | 132 |
| 132 // Whether the plugin is running in process. | 133 // Whether the plugin is running in process. |
| 133 bool is_running_in_process_; | 134 bool is_running_in_process_; |
| 134 | 135 |
| 135 // Whether this is a host for external plugins. | 136 // Whether this is a host for external plugins. |
| 136 bool is_external_plugin_host_; | 137 bool is_external_plugin_host_; |
| 137 | 138 |
| 138 DISALLOW_COPY_AND_ASSIGN(RendererPpapiHostImpl); | 139 DISALLOW_COPY_AND_ASSIGN(RendererPpapiHostImpl); |
| 139 }; | 140 }; |
| 140 | 141 |
| 141 } // namespace content | 142 } // namespace content |
| 142 | 143 |
| 143 #endif // CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ | 144 #endif // CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ |
| OLD | NEW |