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

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

Issue 558513002: Don't try to access a NULL plugin element or document in PepperPluginInstanceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: 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 c3570db42530fddb2517cfbe5d2f89823cd790f6..b10aa3cfbf96468de8bd7d24244edf8eb121ba65 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -673,13 +673,15 @@ void PepperPluginInstanceImpl::MessageChannelDestroyed() {
}
v8::Local<v8::Context> PepperPluginInstanceImpl::GetContext() {
- if (!container_)
- return v8::Handle<v8::Context>();
- WebLocalFrame* frame = container_->element().document().frame();
- if (!frame)
+ if (!container_ ||
+ container_->element().isNull() ||
+ container_->element().document().isNull() ||
+ !container_->element().document().frame()) {
return v8::Handle<v8::Context>();
+ }
- v8::Local<v8::Context> context = frame->mainWorldScriptContext();
+ v8::Local<v8::Context> context =
+ container_->element().document().frame()->mainWorldScriptContext();
DCHECK(context->GetIsolate() == isolate_);
return context;
}
« 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