| 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 WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ |
| 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // for in-process plugins), the Reserve function will assume that the ID is | 134 // for in-process plugins), the Reserve function will assume that the ID is |
| 135 // usable and will return true. | 135 // usable and will return true. |
| 136 void SetReserveInstanceIDCallback( | 136 void SetReserveInstanceIDCallback( |
| 137 PP_Bool (*reserve)(PP_Module, PP_Instance)); | 137 PP_Bool (*reserve)(PP_Module, PP_Instance)); |
| 138 bool ReserveInstanceID(PP_Instance instance); | 138 bool ReserveInstanceID(PP_Instance instance); |
| 139 | 139 |
| 140 // These should only be called from the main thread. | 140 // These should only be called from the main thread. |
| 141 void SetBroker(PluginDelegate::PpapiBroker* broker); | 141 void SetBroker(PluginDelegate::PpapiBroker* broker); |
| 142 PluginDelegate::PpapiBroker* GetBroker(); | 142 PluginDelegate::PpapiBroker* GetBroker(); |
| 143 | 143 |
| 144 // Retrieves the forwarding interface used for talking to WebKit. | |
| 145 ::ppapi::WebKitForwarding* GetWebKitForwarding(); | |
| 146 | |
| 147 private: | 144 private: |
| 148 // Calls the InitializeModule entrypoint. The entrypoint must have been | 145 // Calls the InitializeModule entrypoint. The entrypoint must have been |
| 149 // set and the plugin must not be out of process (we don't maintain | 146 // set and the plugin must not be out of process (we don't maintain |
| 150 // entrypoints in that case). | 147 // entrypoints in that case). |
| 151 bool InitializeModule(const EntryPoints& entry_points); | 148 bool InitializeModule(const EntryPoints& entry_points); |
| 152 | 149 |
| 153 PluginDelegate::ModuleLifetime* lifetime_delegate_; | 150 PluginDelegate::ModuleLifetime* lifetime_delegate_; |
| 154 | 151 |
| 155 // Tracker for completion callbacks, used mainly to ensure that all callbacks | 152 // Tracker for completion callbacks, used mainly to ensure that all callbacks |
| 156 // are properly aborted on module shutdown. | 153 // are properly aborted on module shutdown. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 const std::string name_; | 186 const std::string name_; |
| 190 const FilePath path_; | 187 const FilePath path_; |
| 191 | 188 |
| 192 // Non-owning pointers to all instances associated with this module. When | 189 // Non-owning pointers to all instances associated with this module. When |
| 193 // there are no more instances, this object should be deleted. | 190 // there are no more instances, this object should be deleted. |
| 194 typedef std::set<PluginInstance*> PluginInstanceSet; | 191 typedef std::set<PluginInstance*> PluginInstanceSet; |
| 195 PluginInstanceSet instances_; | 192 PluginInstanceSet instances_; |
| 196 | 193 |
| 197 PP_Bool (*reserve_instance_id_)(PP_Module, PP_Instance); | 194 PP_Bool (*reserve_instance_id_)(PP_Module, PP_Instance); |
| 198 | 195 |
| 199 // Lazily created by GetWebKitForwarding. | |
| 200 scoped_ptr< ::ppapi::WebKitForwarding> webkit_forwarding_; | |
| 201 | |
| 202 DISALLOW_COPY_AND_ASSIGN(PluginModule); | 196 DISALLOW_COPY_AND_ASSIGN(PluginModule); |
| 203 }; | 197 }; |
| 204 | 198 |
| 205 } // namespace ppapi | 199 } // namespace ppapi |
| 206 } // namespace webkit | 200 } // namespace webkit |
| 207 | 201 |
| 208 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ | 202 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ |
| OLD | NEW |