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

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

Issue 1267713003: Make the WebURLLoaderClients in the pepper code destroy (or have some guard) the loader in didFail() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 10477fff949c13079ebc76b3ef5faa27a4d1889c..c5f8899df16a4938232c3c16d65f8fd909a83fed 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -398,8 +398,8 @@ void PepperPluginInstanceImpl::ExternalDocumentLoader::ReplayReceivedData(
NULL,
0 /* finish_time */,
blink::WebURLLoaderClient::kUnknownEncodedDataLength);
- }
- if (error_.get()) {
+ } else if (error_.get()) {
+ DCHECK(!finished_loading_);
document_loader->didFail(NULL, *error_);
}
}
@@ -417,6 +417,10 @@ void PepperPluginInstanceImpl::ExternalDocumentLoader::didFinishLoading(
double finish_time,
int64_t total_encoded_data_length) {
DCHECK(!finished_loading_);
+
+ if (error_.get())
+ return;
+
finished_loading_ = true;
}
@@ -424,6 +428,10 @@ void PepperPluginInstanceImpl::ExternalDocumentLoader::didFail(
WebURLLoader* loader,
const WebURLError& error) {
DCHECK(!error_.get());
+
+ if (finished_loading_)
+ return;
+
error_.reset(new WebURLError(error));
}
« no previous file with comments | « content/renderer/pepper/pepper_plugin_instance_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698