| 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 10 matching lines...) Expand all Loading... |
| 21 #include "ppapi/c/pp_module.h" | 21 #include "ppapi/c/pp_module.h" |
| 22 #include "ppapi/c/ppb.h" | 22 #include "ppapi/c/ppb.h" |
| 23 #include "webkit/plugins/ppapi/plugin_delegate.h" | 23 #include "webkit/plugins/ppapi/plugin_delegate.h" |
| 24 #include "webkit/plugins/webkit_plugins_export.h" | 24 #include "webkit/plugins/webkit_plugins_export.h" |
| 25 | 25 |
| 26 class FilePath; | 26 class FilePath; |
| 27 struct PPB_Core; | 27 struct PPB_Core; |
| 28 typedef void* NPIdentifier; | 28 typedef void* NPIdentifier; |
| 29 | 29 |
| 30 namespace ppapi { | 30 namespace ppapi { |
| 31 class CallbackTracker; |
| 31 class WebKitForwarding; | 32 class WebKitForwarding; |
| 32 } // namespace ppapi | 33 } // namespace ppapi |
| 33 | 34 |
| 34 namespace webkit { | 35 namespace webkit { |
| 35 namespace ppapi { | 36 namespace ppapi { |
| 36 | 37 |
| 37 class CallbackTracker; | 38 class CallbackTracker; |
| 38 class PluginDelegate; | 39 class PluginDelegate; |
| 39 class PluginInstance; | 40 class PluginInstance; |
| 40 | 41 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // which could be NULL. | 111 // which could be NULL. |
| 111 const void* GetPluginInterface(const char* name) const; | 112 const void* GetPluginInterface(const char* name) const; |
| 112 | 113 |
| 113 // This module is associated with a set of instances. The PluginInstance | 114 // This module is associated with a set of instances. The PluginInstance |
| 114 // object declares its association with this module in its destructor and | 115 // object declares its association with this module in its destructor and |
| 115 // releases us in its destructor. | 116 // releases us in its destructor. |
| 116 void InstanceCreated(PluginInstance* instance); | 117 void InstanceCreated(PluginInstance* instance); |
| 117 void InstanceDeleted(PluginInstance* instance); | 118 void InstanceDeleted(PluginInstance* instance); |
| 118 | 119 |
| 119 scoped_refptr<CallbackTracker> GetCallbackTracker(); | 120 scoped_refptr<CallbackTracker> GetCallbackTracker(); |
| 121 scoped_refptr< ::ppapi::CallbackTracker> GetNewCallbackTracker(); |
| 120 | 122 |
| 121 // Called when running out of process and the plugin crashed. This will | 123 // Called when running out of process and the plugin crashed. This will |
| 122 // release relevant resources and update all affected instances. | 124 // release relevant resources and update all affected instances. |
| 123 void PluginCrashed(); | 125 void PluginCrashed(); |
| 124 | 126 |
| 125 bool is_in_destructor() const { return is_in_destructor_; } | 127 bool is_in_destructor() const { return is_in_destructor_; } |
| 126 bool is_crashed() const { return is_crashed_; } | 128 bool is_crashed() const { return is_crashed_; } |
| 127 | 129 |
| 128 // Reserves the given instance is unique within the plugin, checking for | 130 // Reserves the given instance is unique within the plugin, checking for |
| 129 // collisions. See PPB_Proxy_Private for more information. | 131 // collisions. See PPB_Proxy_Private for more information. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 147 private: | 149 private: |
| 148 // Calls the InitializeModule entrypoint. The entrypoint must have been | 150 // Calls the InitializeModule entrypoint. The entrypoint must have been |
| 149 // set and the plugin must not be out of process (we don't maintain | 151 // set and the plugin must not be out of process (we don't maintain |
| 150 // entrypoints in that case). | 152 // entrypoints in that case). |
| 151 bool InitializeModule(const EntryPoints& entry_points); | 153 bool InitializeModule(const EntryPoints& entry_points); |
| 152 | 154 |
| 153 PluginDelegate::ModuleLifetime* lifetime_delegate_; | 155 PluginDelegate::ModuleLifetime* lifetime_delegate_; |
| 154 | 156 |
| 155 // Tracker for completion callbacks, used mainly to ensure that all callbacks | 157 // Tracker for completion callbacks, used mainly to ensure that all callbacks |
| 156 // are properly aborted on module shutdown. | 158 // are properly aborted on module shutdown. |
| 157 scoped_refptr<CallbackTracker> callback_tracker_; | 159 // |
| 160 // TODO(brettw) remove this in favor of the ::ppapi:: one below. |
| 161 scoped_refptr<CallbackTracker> old_callback_tracker_; |
| 162 |
| 163 scoped_refptr< ::ppapi::CallbackTracker> callback_tracker_; |
| 158 | 164 |
| 159 PP_Module pp_module_; | 165 PP_Module pp_module_; |
| 160 | 166 |
| 161 // True when we're running in the destructor. This allows us to write some | 167 // True when we're running in the destructor. This allows us to write some |
| 162 // assertions. | 168 // assertions. |
| 163 bool is_in_destructor_; | 169 bool is_in_destructor_; |
| 164 | 170 |
| 165 // True if the plugin is running out-of-process and has crashed. | 171 // True if the plugin is running out-of-process and has crashed. |
| 166 bool is_crashed_; | 172 bool is_crashed_; |
| 167 | 173 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 // Lazily created by GetWebKitForwarding. | 205 // Lazily created by GetWebKitForwarding. |
| 200 scoped_ptr< ::ppapi::WebKitForwarding> webkit_forwarding_; | 206 scoped_ptr< ::ppapi::WebKitForwarding> webkit_forwarding_; |
| 201 | 207 |
| 202 DISALLOW_COPY_AND_ASSIGN(PluginModule); | 208 DISALLOW_COPY_AND_ASSIGN(PluginModule); |
| 203 }; | 209 }; |
| 204 | 210 |
| 205 } // namespace ppapi | 211 } // namespace ppapi |
| 206 } // namespace webkit | 212 } // namespace webkit |
| 207 | 213 |
| 208 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ | 214 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ |
| OLD | NEW |