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

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 10383059: Terminate plugins as well as runing onunload handlers during slow shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
===================================================================
--- content/renderer/pepper/pepper_plugin_delegate_impl.cc (revision 135727)
+++ content/renderer/pepper/pepper_plugin_delegate_impl.cc (working copy)
@@ -1408,9 +1408,16 @@
}
void PepperPluginDelegateImpl::OnDestruct() {
- // Nothing to do here. Default implementation in RenderViewObserver does
- // 'delete this' but it's not suitable for PepperPluginDelegateImpl because
- // it's non-pointer member in RenderViewImpl.
+ // This method may be called as part of an abbreviated shutdown by
+ // RenderViewImpl::OnShouldClose() as well as part of a full cleanup.
+ // Default implementation in RenderViewObserver does 'delete this' but it's
+ // not suitable for PepperPluginDelegateImpl because it's non-pointer member
+ // in RenderViewImpl.
+ while (active_instances_.begin() != active_instances_.end()) {
+ webkit::ppapi::PluginInstance* instance = *active_instances_.begin();
+ instance->Delete();
+ active_instances_.erase(instance);
+ }
}
void PepperPluginDelegateImpl::OnTCPSocketConnectACK(
« no previous file with comments | « no previous file | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698