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

Unified Diff: webkit/glue/webplugin_impl.cc

Issue 174383: Fixes a crash caused due to a call to NPP_DestroyStream occuring in the conte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 | « webkit/glue/webplugin_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webplugin_impl.cc
===================================================================
--- webkit/glue/webplugin_impl.cc (revision 24564)
+++ webkit/glue/webplugin_impl.cc (working copy)
@@ -769,11 +769,9 @@
// The plugin instance could be in the process of deletion here.
// Verify if the WebPluginResourceClient instance still exists before
// use.
- WebPluginResourceClient* resource_client = GetClientFromLoader(loader);
- if (resource_client) {
- loader->cancel();
- resource_client->DidFail();
- RemoveClient(loader);
+ ClientInfo* client_info = GetClientInfoFromLoader(loader);
+ if (client_info) {
+ client_info->pending_failure_notification = true;
}
}
}
@@ -942,6 +940,7 @@
info.request.setRequestorProcessID(delegate_->GetProcessId());
info.request.setTargetType(WebURLRequest::TargetIsObject);
info.request.setHTTPMethod(WebString::fromUTF8(method));
+ info.pending_failure_notification = false;
if (range_info) {
info.request.addHTTPHeaderField(WebString::fromUTF8("Range"),
@@ -1002,6 +1001,17 @@
if (client_info.id == resource_id) {
client_info.loader->setDefersLoading(defer);
+
+ // If we determined that the request had failed via the HTTP headers
+ // in the response then we send out a failure notification to the
+ // plugin process, as certain plugins don't handle HTTP failure codes
+ // correctly.
+ if (!defer && client_info.client &&
+ client_info.pending_failure_notification) {
+ client_info.loader->cancel();
+ client_info.client->DidFail();
+ clients_.erase(client_index++);
+ }
break;
}
client_index++;
@@ -1129,10 +1139,7 @@
if (client_info.loader.get())
client_info.loader->cancel();
- WebPluginResourceClient* resource_client = client_info.client;
client_index = clients_.erase(client_index);
- if (resource_client)
- resource_client->DidFail();
}
// This needs to be called now and not in the destructor since the
« no previous file with comments | « webkit/glue/webplugin_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698