| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 14 matching lines...) Expand all Loading... |
| 25 class FilePath; | 25 class FilePath; |
| 26 class MessageLoop; | 26 class MessageLoop; |
| 27 struct PPB_Core; | 27 struct PPB_Core; |
| 28 typedef void* NPIdentifier; | 28 typedef void* NPIdentifier; |
| 29 | 29 |
| 30 namespace base { | 30 namespace base { |
| 31 class WaitableEvent; | 31 class WaitableEvent; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace pp { | 34 namespace pp { |
| 35 |
| 35 namespace proxy { | 36 namespace proxy { |
| 36 class HostDispatcher; | 37 class HostDispatcher; |
| 37 } // proxy | 38 } // namespace proxy |
| 38 } // pp | 39 |
| 40 namespace shared_impl { |
| 41 class WebKitForwarding; |
| 42 } // namespace shared_impl |
| 43 |
| 44 } // namespace pp |
| 39 | 45 |
| 40 namespace IPC { | 46 namespace IPC { |
| 41 struct ChannelHandle; | 47 struct ChannelHandle; |
| 42 } | 48 } |
| 43 | 49 |
| 44 namespace webkit { | 50 namespace webkit { |
| 45 namespace ppapi { | 51 namespace ppapi { |
| 46 | 52 |
| 47 class CallbackTracker; | 53 class CallbackTracker; |
| 48 class PluginDelegate; | 54 class PluginDelegate; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 // for in-process plugins), the Reserve function will assume that the ID is | 148 // for in-process plugins), the Reserve function will assume that the ID is |
| 143 // usable and will return true. | 149 // usable and will return true. |
| 144 void SetReserveInstanceIDCallback( | 150 void SetReserveInstanceIDCallback( |
| 145 PP_Bool (*reserve)(PP_Module, PP_Instance)); | 151 PP_Bool (*reserve)(PP_Module, PP_Instance)); |
| 146 bool ReserveInstanceID(PP_Instance instance); | 152 bool ReserveInstanceID(PP_Instance instance); |
| 147 | 153 |
| 148 // These should only be called from the main thread. | 154 // These should only be called from the main thread. |
| 149 void SetBroker(PluginDelegate::PpapiBroker* broker); | 155 void SetBroker(PluginDelegate::PpapiBroker* broker); |
| 150 PluginDelegate::PpapiBroker* GetBroker(); | 156 PluginDelegate::PpapiBroker* GetBroker(); |
| 151 | 157 |
| 158 // Retrieves the forwarding interface used for talking to WebKit. |
| 159 pp::shared_impl::WebKitForwarding* GetWebKitForwarding(); |
| 160 |
| 152 private: | 161 private: |
| 153 // Calls the InitializeModule entrypoint. The entrypoint must have been | 162 // Calls the InitializeModule entrypoint. The entrypoint must have been |
| 154 // set and the plugin must not be out of process (we don't maintain | 163 // set and the plugin must not be out of process (we don't maintain |
| 155 // entrypoints in that case). | 164 // entrypoints in that case). |
| 156 bool InitializeModule(); | 165 bool InitializeModule(); |
| 157 | 166 |
| 158 PluginDelegate::ModuleLifetime* lifetime_delegate_; | 167 PluginDelegate::ModuleLifetime* lifetime_delegate_; |
| 159 | 168 |
| 160 // Tracker for completion callbacks, used mainly to ensure that all callbacks | 169 // Tracker for completion callbacks, used mainly to ensure that all callbacks |
| 161 // are properly aborted on module shutdown. | 170 // are properly aborted on module shutdown. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 190 const std::string name_; | 199 const std::string name_; |
| 191 const FilePath path_; | 200 const FilePath path_; |
| 192 | 201 |
| 193 // Non-owning pointers to all instances associated with this module. When | 202 // Non-owning pointers to all instances associated with this module. When |
| 194 // there are no more instances, this object should be deleted. | 203 // there are no more instances, this object should be deleted. |
| 195 typedef std::set<PluginInstance*> PluginInstanceSet; | 204 typedef std::set<PluginInstance*> PluginInstanceSet; |
| 196 PluginInstanceSet instances_; | 205 PluginInstanceSet instances_; |
| 197 | 206 |
| 198 PP_Bool (*reserve_instance_id_)(PP_Module, PP_Instance); | 207 PP_Bool (*reserve_instance_id_)(PP_Module, PP_Instance); |
| 199 | 208 |
| 209 // Lazily created by GetWebKitForwarding. |
| 210 scoped_ptr<pp::shared_impl::WebKitForwarding> webkit_forwarding_; |
| 211 |
| 200 DISALLOW_COPY_AND_ASSIGN(PluginModule); | 212 DISALLOW_COPY_AND_ASSIGN(PluginModule); |
| 201 }; | 213 }; |
| 202 | 214 |
| 203 } // namespace ppapi | 215 } // namespace ppapi |
| 204 } // namespace webkit | 216 } // namespace webkit |
| 205 | 217 |
| 206 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ | 218 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ |
| OLD | NEW |