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_PLUGIN_MODULE_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PLUGIN_MODULE_H_ |
6 #define CONTENT_RENDERER_PEPPER_PLUGIN_MODULE_H_ | 6 #define CONTENT_RENDERER_PEPPER_PLUGIN_MODULE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/native_library.h" | 17 #include "base/native_library.h" |
18 #include "base/process/process.h" | 18 #include "base/process/process.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/public/common/pepper_plugin_info.h" | 20 #include "content/public/common/pepper_plugin_info.h" |
21 #include "content/renderer/pepper/plugin_delegate.h" | |
22 #include "ppapi/c/pp_bool.h" | 21 #include "ppapi/c/pp_bool.h" |
23 #include "ppapi/c/pp_instance.h" | 22 #include "ppapi/c/pp_instance.h" |
24 #include "ppapi/c/ppb_core.h" | 23 #include "ppapi/c/ppb_core.h" |
25 #include "ppapi/c/private/ppb_instance_private.h" | 24 #include "ppapi/c/private/ppb_instance_private.h" |
26 #include "ppapi/shared_impl/ppapi_permissions.h" | 25 #include "ppapi/shared_impl/ppapi_permissions.h" |
27 | 26 |
28 typedef void* NPIdentifier; | 27 typedef void* NPIdentifier; |
29 | 28 |
| 29 class GURL; |
| 30 |
30 namespace base { | 31 namespace base { |
31 class FilePath; | 32 class FilePath; |
32 } | 33 } |
33 | 34 |
34 namespace ppapi { | 35 namespace ppapi { |
35 class CallbackTracker; | 36 class CallbackTracker; |
36 class WebKitForwarding; | 37 class WebKitForwarding; |
37 } // namespace ppapi | 38 } // namespace ppapi |
38 | 39 |
39 namespace WebKit { | 40 namespace WebKit { |
40 class WebPluginContainer; | 41 class WebPluginContainer; |
41 } // namespace WebKit | 42 } // namespace WebKit |
42 | 43 |
43 namespace content { | 44 namespace content { |
44 class HostDispatcherWrapper; | 45 class HostDispatcherWrapper; |
| 46 class PepperPluginDelegateImpl; |
45 class PepperPluginInstanceImpl; | 47 class PepperPluginInstanceImpl; |
46 class PepperBroker; | 48 class PepperBroker; |
47 class PluginDelegate; | |
48 class RendererPpapiHostImpl; | 49 class RendererPpapiHostImpl; |
49 class RenderViewImpl; | 50 class RenderViewImpl; |
50 | 51 |
51 // Represents one plugin library loaded into one renderer. This library may | 52 // Represents one plugin library loaded into one renderer. This library may |
52 // have multiple instances. | 53 // have multiple instances. |
53 // | 54 // |
54 // Note: to get from a PP_Instance to a PepperPluginInstance*, use the | 55 // Note: to get from a PP_Instance to a PepperPluginInstance*, use the |
55 // ResourceTracker. | 56 // ResourceTracker. |
56 class CONTENT_EXPORT PluginModule : | 57 class CONTENT_EXPORT PluginModule : |
57 public base::RefCounted<PluginModule>, | 58 public base::RefCounted<PluginModule>, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 132 |
132 // Returns the module handle. This may be used before Init() is called (the | 133 // Returns the module handle. This may be used before Init() is called (the |
133 // proxy needs this information to set itself up properly). | 134 // proxy needs this information to set itself up properly). |
134 PP_Module pp_module() const { return pp_module_; } | 135 PP_Module pp_module() const { return pp_module_; } |
135 | 136 |
136 const std::string& name() const { return name_; } | 137 const std::string& name() const { return name_; } |
137 const base::FilePath& path() const { return path_; } | 138 const base::FilePath& path() const { return path_; } |
138 const ::ppapi::PpapiPermissions& permissions() const { return permissions_; } | 139 const ::ppapi::PpapiPermissions& permissions() const { return permissions_; } |
139 | 140 |
140 PepperPluginInstanceImpl* CreateInstance( | 141 PepperPluginInstanceImpl* CreateInstance( |
141 PluginDelegate* delegate, | 142 PepperPluginDelegateImpl* delegate, |
142 RenderViewImpl* render_view, | 143 RenderViewImpl* render_view, |
143 WebKit::WebPluginContainer* container, | 144 WebKit::WebPluginContainer* container, |
144 const GURL& plugin_url); | 145 const GURL& plugin_url); |
145 | 146 |
146 // Returns "some" plugin instance associated with this module. This is not | 147 // Returns "some" plugin instance associated with this module. This is not |
147 // guaranteed to be any one in particular. This is normally used to execute | 148 // guaranteed to be any one in particular. This is normally used to execute |
148 // callbacks up to the browser layer that are not inherently per-instance, | 149 // callbacks up to the browser layer that are not inherently per-instance, |
149 // but the delegate lives only on the plugin instance so we need one of them. | 150 // but the delegate lives only on the plugin instance so we need one of them. |
150 PepperPluginInstanceImpl* GetSomeInstance() const; | 151 PepperPluginInstanceImpl* GetSomeInstance() const; |
151 | 152 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 PluginInstanceSet instances_; | 247 PluginInstanceSet instances_; |
247 | 248 |
248 PP_Bool (*reserve_instance_id_)(PP_Module, PP_Instance); | 249 PP_Bool (*reserve_instance_id_)(PP_Module, PP_Instance); |
249 | 250 |
250 DISALLOW_COPY_AND_ASSIGN(PluginModule); | 251 DISALLOW_COPY_AND_ASSIGN(PluginModule); |
251 }; | 252 }; |
252 | 253 |
253 } // namespace content | 254 } // namespace content |
254 | 255 |
255 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_MODULE_H_ | 256 #endif // CONTENT_RENDERER_PEPPER_PLUGIN_MODULE_H_ |
OLD | NEW |