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

Unified Diff: webkit/glue/plugins/plugin_stream_url.cc

Issue 393017: This CL fixes the document-open.html and window-open.html plugin layout tests... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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
Index: webkit/glue/plugins/plugin_stream_url.cc
===================================================================
--- webkit/glue/plugins/plugin_stream_url.cc (revision 31913)
+++ webkit/glue/plugins/plugin_stream_url.cc (working copy)
@@ -29,6 +29,9 @@
}
bool PluginStreamUrl::Close(NPReason reason) {
+ // Protect the stream against it being destroyed or the whole plugin instance
+ // being destroyed within the destroy stream handler.
+ scoped_refptr<PluginStream> protect(this);
CancelRequest();
bool result = PluginStream::Close(reason);
instance()->RemoveStream(this);
@@ -45,6 +48,10 @@
uint32 expected_length,
uint32 last_modified,
bool request_is_seekable) {
+ // Protect the stream against it being destroyed or the whole plugin instance
+ // being destroyed within the new stream handler.
+ scoped_refptr<PluginStream> protect(this);
+
bool opened = Open(mime_type,
headers,
expected_length,
@@ -64,6 +71,10 @@
if (!open())
return;
+ // Protect the stream against it being destroyed or the whole plugin instance
+ // being destroyed within the write handlers
+ scoped_refptr<PluginStream> protect(this);
+
if (length > 0) {
// The PluginStreamUrl instance could get deleted if the plugin fails to
// accept data in NPP_Write.

Powered by Google App Engine
This is Rietveld 408576698