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

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

Issue 8222021: Prevent reentrant destructors in the PluginModule. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | « ppapi/proxy/host_dispatcher.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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // releases us in its destructor. 131 // releases us in its destructor.
132 void InstanceCreated(PluginInstance* instance); 132 void InstanceCreated(PluginInstance* instance);
133 void InstanceDeleted(PluginInstance* instance); 133 void InstanceDeleted(PluginInstance* instance);
134 134
135 scoped_refptr<CallbackTracker> GetCallbackTracker(); 135 scoped_refptr<CallbackTracker> GetCallbackTracker();
136 136
137 // Called when running out of process and the plugin crashed. This will 137 // Called when running out of process and the plugin crashed. This will
138 // release relevant resources and update all affected instances. 138 // release relevant resources and update all affected instances.
139 void PluginCrashed(); 139 void PluginCrashed();
140 140
141 bool is_in_destructor() const { return is_in_destructor_; }
141 bool is_crashed() const { return is_crashed_; } 142 bool is_crashed() const { return is_crashed_; }
142 143
143 // Reserves the given instance is unique within the plugin, checking for 144 // Reserves the given instance is unique within the plugin, checking for
144 // collisions. See PPB_Proxy_Private for more information. 145 // collisions. See PPB_Proxy_Private for more information.
145 // 146 //
146 // The setter will set the callback which is set up when the proxy 147 // The setter will set the callback which is set up when the proxy
147 // initializes. The Reserve function will call the previously set callback if 148 // initializes. The Reserve function will call the previously set callback if
148 // it exists to validate the ID. If the callback has not been set (such as 149 // it exists to validate the ID. If the callback has not been set (such as
149 // for in-process plugins), the Reserve function will assume that the ID is 150 // for in-process plugins), the Reserve function will assume that the ID is
150 // usable and will return true. 151 // usable and will return true.
(...skipping 15 matching lines...) Expand all
166 bool InitializeModule(const EntryPoints& entry_points); 167 bool InitializeModule(const EntryPoints& entry_points);
167 168
168 PluginDelegate::ModuleLifetime* lifetime_delegate_; 169 PluginDelegate::ModuleLifetime* lifetime_delegate_;
169 170
170 // Tracker for completion callbacks, used mainly to ensure that all callbacks 171 // Tracker for completion callbacks, used mainly to ensure that all callbacks
171 // are properly aborted on module shutdown. 172 // are properly aborted on module shutdown.
172 scoped_refptr<CallbackTracker> callback_tracker_; 173 scoped_refptr<CallbackTracker> callback_tracker_;
173 174
174 PP_Module pp_module_; 175 PP_Module pp_module_;
175 176
177 // True when we're running in the destructor. This allows us to write some
178 // assertions.
179 bool is_in_destructor_;
180
176 // True if the plugin is running out-of-process and has crashed. 181 // True if the plugin is running out-of-process and has crashed.
177 bool is_crashed_; 182 bool is_crashed_;
178 183
179 // Manages the out of process proxy interface. The presence of this 184 // Manages the out of process proxy interface. The presence of this
180 // pointer indicates that the plugin is running out of process and that the 185 // pointer indicates that the plugin is running out of process and that the
181 // entry_points_ aren't valid. 186 // entry_points_ aren't valid.
182 scoped_ptr<PluginDelegate::OutOfProcessProxy> out_of_process_proxy_; 187 scoped_ptr<PluginDelegate::OutOfProcessProxy> out_of_process_proxy_;
183 188
184 // Non-owning pointer to the broker for this plugin module, if one exists. 189 // Non-owning pointer to the broker for this plugin module, if one exists.
185 // It is populated and cleared in the main thread. 190 // It is populated and cleared in the main thread.
(...skipping 24 matching lines...) Expand all
210 // Lazily created by GetWebKitForwarding. 215 // Lazily created by GetWebKitForwarding.
211 scoped_ptr< ::ppapi::WebKitForwarding> webkit_forwarding_; 216 scoped_ptr< ::ppapi::WebKitForwarding> webkit_forwarding_;
212 217
213 DISALLOW_COPY_AND_ASSIGN(PluginModule); 218 DISALLOW_COPY_AND_ASSIGN(PluginModule);
214 }; 219 };
215 220
216 } // namespace ppapi 221 } // namespace ppapi
217 } // namespace webkit 222 } // namespace webkit
218 223
219 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_ 224 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_MODULE_H_
OLDNEW
« no previous file with comments | « ppapi/proxy/host_dispatcher.cc ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698