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

Side by Side Diff: webkit/plugins/ppapi/plugin_module.h

Issue 9015009: Use the new callback tracker and delete the old one (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add IsPending Created 8 years, 11 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
« no previous file with comments | « webkit/plugins/ppapi/host_resource_tracker.cc ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 17 matching lines...) Expand all
28 typedef void* NPIdentifier; 28 typedef void* NPIdentifier;
29 29
30 namespace ppapi { 30 namespace ppapi {
31 class CallbackTracker; 31 class CallbackTracker;
32 class WebKitForwarding; 32 class WebKitForwarding;
33 } // namespace ppapi 33 } // namespace ppapi
34 34
35 namespace webkit { 35 namespace webkit {
36 namespace ppapi { 36 namespace ppapi {
37 37
38 class CallbackTracker;
39 class PluginDelegate; 38 class PluginDelegate;
40 class PluginInstance; 39 class PluginInstance;
41 40
42 // Represents one plugin library loaded into one renderer. This library may 41 // Represents one plugin library loaded into one renderer. This library may
43 // have multiple instances. 42 // have multiple instances.
44 // 43 //
45 // Note: to get from a PP_Instance to a PluginInstance*, use the 44 // Note: to get from a PP_Instance to a PluginInstance*, use the
46 // ResourceTracker. 45 // ResourceTracker.
47 class WEBKIT_PLUGINS_EXPORT PluginModule : 46 class WEBKIT_PLUGINS_EXPORT PluginModule :
48 public base::RefCounted<PluginModule>, 47 public base::RefCounted<PluginModule>,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Calls the plugin's GetInterface and returns the given interface pointer, 109 // Calls the plugin's GetInterface and returns the given interface pointer,
111 // which could be NULL. 110 // which could be NULL.
112 const void* GetPluginInterface(const char* name) const; 111 const void* GetPluginInterface(const char* name) const;
113 112
114 // This module is associated with a set of instances. The PluginInstance 113 // This module is associated with a set of instances. The PluginInstance
115 // object declares its association with this module in its destructor and 114 // object declares its association with this module in its destructor and
116 // releases us in its destructor. 115 // releases us in its destructor.
117 void InstanceCreated(PluginInstance* instance); 116 void InstanceCreated(PluginInstance* instance);
118 void InstanceDeleted(PluginInstance* instance); 117 void InstanceDeleted(PluginInstance* instance);
119 118
120 scoped_refptr<CallbackTracker> GetCallbackTracker(); 119 scoped_refptr< ::ppapi::CallbackTracker> GetCallbackTracker();
121 scoped_refptr< ::ppapi::CallbackTracker> GetNewCallbackTracker();
122 120
123 // Called when running out of process and the plugin crashed. This will 121 // Called when running out of process and the plugin crashed. This will
124 // release relevant resources and update all affected instances. 122 // release relevant resources and update all affected instances.
125 void PluginCrashed(); 123 void PluginCrashed();
126 124
127 bool is_in_destructor() const { return is_in_destructor_; } 125 bool is_in_destructor() const { return is_in_destructor_; }
128 bool is_crashed() const { return is_crashed_; } 126 bool is_crashed() const { return is_crashed_; }
129 127
130 // Reserves the given instance is unique within the plugin, checking for 128 // Reserves the given instance is unique within the plugin, checking for
131 // collisions. See PPB_Proxy_Private for more information. 129 // collisions. See PPB_Proxy_Private for more information.
(...skipping 17 matching lines...) Expand all
149 private: 147 private:
150 // Calls the InitializeModule entrypoint. The entrypoint must have been 148 // Calls the InitializeModule entrypoint. The entrypoint must have been
151 // set and the plugin must not be out of process (we don't maintain 149 // set and the plugin must not be out of process (we don't maintain
152 // entrypoints in that case). 150 // entrypoints in that case).
153 bool InitializeModule(const EntryPoints& entry_points); 151 bool InitializeModule(const EntryPoints& entry_points);
154 152
155 PluginDelegate::ModuleLifetime* lifetime_delegate_; 153 PluginDelegate::ModuleLifetime* lifetime_delegate_;
156 154
157 // Tracker for completion callbacks, used mainly to ensure that all callbacks 155 // Tracker for completion callbacks, used mainly to ensure that all callbacks
158 // are properly aborted on module shutdown. 156 // are properly aborted on module shutdown.
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_; 157 scoped_refptr< ::ppapi::CallbackTracker> callback_tracker_;
164 158
165 PP_Module pp_module_; 159 PP_Module pp_module_;
166 160
167 // True when we're running in the destructor. This allows us to write some 161 // True when we're running in the destructor. This allows us to write some
168 // assertions. 162 // assertions.
169 bool is_in_destructor_; 163 bool is_in_destructor_;
170 164
171 // True if the plugin is running out-of-process and has crashed. 165 // True if the plugin is running out-of-process and has crashed.
172 bool is_crashed_; 166 bool is_crashed_;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 // Lazily created by GetWebKitForwarding. 199 // Lazily created by GetWebKitForwarding.
206 scoped_ptr< ::ppapi::WebKitForwarding> webkit_forwarding_; 200 scoped_ptr< ::ppapi::WebKitForwarding> webkit_forwarding_;
207 201
208 DISALLOW_COPY_AND_ASSIGN(PluginModule); 202 DISALLOW_COPY_AND_ASSIGN(PluginModule);
209 }; 203 };
210 204
211 } // namespace ppapi 205 } // namespace ppapi
212 } // namespace webkit 206 } // namespace webkit
213 207
214 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ 208 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/host_resource_tracker.cc ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698