Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Side by Side Diff: content/renderer/pepper/renderer_ppapi_host_impl.h

Issue 19744007: Create a public API around webkit::ppapi::PluginInstance and use it in chrome. After this, webkit/p… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 13 matching lines...) Expand all
24 } 24 }
25 25
26 namespace thunk { 26 namespace thunk {
27 class ResourceCreationAPI; 27 class ResourceCreationAPI;
28 } 28 }
29 29
30 } // namespace ppapi 30 } // namespace ppapi
31 31
32 namespace webkit { 32 namespace webkit {
33 namespace ppapi { 33 namespace ppapi {
34 class PluginInstance; 34 class PluginInstanceImpl;
35 class PluginModule; 35 class PluginModule;
36 } 36 }
37 } 37 }
38 38
39 namespace content { 39 namespace content {
40 40
41 class PepperBrowserConnection; 41 class PepperBrowserConnection;
42 class PepperInProcessRouter; 42 class PepperInProcessRouter;
43 43
44 // This class is attached to a PluginModule via the module's embedder state. 44 // This class is attached to a PluginModule via the module's embedder state.
(...skipping 29 matching lines...) Expand all
74 return in_process_router_.get(); 74 return in_process_router_.get();
75 } 75 }
76 76
77 // Creates the in-process resource creation API wrapper for the given 77 // Creates the in-process resource creation API wrapper for the given
78 // plugin instance. This object will reference the host impl, so the 78 // plugin instance. This object will reference the host impl, so the
79 // host impl should outlive the returned pointer. Since the resource 79 // host impl should outlive the returned pointer. Since the resource
80 // creation object is associated with the instance, this will generally 80 // creation object is associated with the instance, this will generally
81 // happen automatically. 81 // happen automatically.
82 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> 82 scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
83 CreateInProcessResourceCreationAPI( 83 CreateInProcessResourceCreationAPI(
84 webkit::ppapi::PluginInstance* instance); 84 webkit::ppapi::PluginInstanceImpl* instance);
85 85
86 PepperBrowserConnection* GetBrowserConnection(PP_Instance instance) const; 86 PepperBrowserConnection* GetBrowserConnection(PP_Instance instance) const;
87 87
88 // RendererPpapiHost implementation. 88 // RendererPpapiHost implementation.
89 virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; 89 virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE;
90 virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE; 90 virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE;
91 virtual webkit::ppapi::PluginInstance* GetPluginInstance( 91 virtual webkit::ppapi::PluginInstance* GetPluginInstance(
92 PP_Instance instance) const OVERRIDE; 92 PP_Instance instance) const OVERRIDE;
93 virtual RenderView* GetRenderViewForInstance( 93 virtual RenderView* GetRenderViewForInstance(
94 PP_Instance instance) const OVERRIDE; 94 PP_Instance instance) const OVERRIDE;
(...skipping 20 matching lines...) Expand all
115 const ppapi::PpapiPermissions& permissions); 115 const ppapi::PpapiPermissions& permissions);
116 RendererPpapiHostImpl(webkit::ppapi::PluginModule* module, 116 RendererPpapiHostImpl(webkit::ppapi::PluginModule* module,
117 const ppapi::PpapiPermissions& permissions); 117 const ppapi::PpapiPermissions& permissions);
118 118
119 // Retrieves the plugin instance object associated with the given PP_Instance 119 // Retrieves the plugin instance object associated with the given PP_Instance
120 // and validates that it is one of the instances associated with our module. 120 // and validates that it is one of the instances associated with our module.
121 // Returns NULL on failure. 121 // Returns NULL on failure.
122 // 122 //
123 // We use this to security check the PP_Instance values sent from a plugin to 123 // We use this to security check the PP_Instance values sent from a plugin to
124 // make sure it's not trying to spoof another instance. 124 // make sure it's not trying to spoof another instance.
125 webkit::ppapi::PluginInstance* GetAndValidateInstance( 125 webkit::ppapi::PluginInstanceImpl* GetAndValidateInstance(
126 PP_Instance instance) const; 126 PP_Instance instance) const;
127 127
128 webkit::ppapi::PluginModule* module_; // Non-owning pointer. 128 webkit::ppapi::PluginModule* module_; // Non-owning pointer.
129 129
130 // The dispatcher we use to send messagse when the plugin is out-of-process. 130 // The dispatcher we use to send messagse when the plugin is out-of-process.
131 // Will be null when running in-process. Non-owning pointer. 131 // Will be null when running in-process. Non-owning pointer.
132 ppapi::proxy::HostDispatcher* dispatcher_; 132 ppapi::proxy::HostDispatcher* dispatcher_;
133 133
134 scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; 134 scoped_ptr<ppapi::host::PpapiHost> ppapi_host_;
135 135
136 // Null when running out-of-process. 136 // Null when running out-of-process.
137 scoped_ptr<PepperInProcessRouter> in_process_router_; 137 scoped_ptr<PepperInProcessRouter> in_process_router_;
138 138
139 // Whether the plugin is running in process. 139 // Whether the plugin is running in process.
140 bool is_running_in_process_; 140 bool is_running_in_process_;
141 141
142 DISALLOW_COPY_AND_ASSIGN(RendererPpapiHostImpl); 142 DISALLOW_COPY_AND_ASSIGN(RendererPpapiHostImpl);
143 }; 143 };
144 144
145 } // namespace content 145 } // namespace content
146 146
147 #endif // CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ 147 #endif // CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698