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

Unified Diff: components/nacl/renderer/ppb_nacl_private_impl.cc

Issue 433633003: Pepper: Fix renderer crash on plugin destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/renderer/ppb_nacl_private_impl.cc
diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc
index 5c7b9f980b7700c0f4a599ccce6f61e333b45985..9b94422daf0f2027bbd89eeec80831a0908357c3 100644
--- a/components/nacl/renderer/ppb_nacl_private_impl.cc
+++ b/components/nacl/renderer/ppb_nacl_private_impl.cc
@@ -1602,6 +1602,11 @@ class PexeDownloader : public blink::WebURLLoaderClient {
virtual void didGetNexeFd(int32_t pp_error,
bool cache_hit,
PP_FileHandle file_handle) {
+ if (!content::PepperPluginInstance::Get(instance_)) {
+ delete this;
+ return;
+ }
+
HistogramEnumerate("NaCl.Perf.PNaClCache.IsHit", cache_hit, 2);
if (cache_hit) {
stream_handler_->DidCacheHit(stream_handler_user_data_, file_handle);
@@ -1623,17 +1628,21 @@ class PexeDownloader : public blink::WebURLLoaderClient {
const char* data,
int data_length,
int encoded_data_length) {
- // Stream the data we received to the stream callback.
- stream_handler_->DidStreamData(stream_handler_user_data_,
- data,
- data_length);
+ if (content::PepperPluginInstance::Get(instance_)) {
+ // Stream the data we received to the stream callback.
+ stream_handler_->DidStreamData(stream_handler_user_data_,
+ data,
+ data_length);
+ }
}
virtual void didFinishLoading(blink::WebURLLoader* loader,
double finish_time,
int64_t total_encoded_data_length) {
int32_t result = success_ ? PP_OK : PP_ERROR_FAILED;
- stream_handler_->DidFinishStream(stream_handler_user_data_, result);
+
+ if (content::PepperPluginInstance::Get(instance_))
+ stream_handler_->DidFinishStream(stream_handler_user_data_, result);
delete this;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698