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

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

Issue 664023002: Avoid entering an empty V8 context in PPB_Var_Deprecated IsInstanceOfDeprecated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/ppb_var_deprecated_impl.cc
diff --git a/content/renderer/pepper/ppb_var_deprecated_impl.cc b/content/renderer/pepper/ppb_var_deprecated_impl.cc
index def6a8d50069d7fecf783f86a97067f7d32b795d..c5a93e2f38960f4590c24a726b5bfe96625ebec2 100644
--- a/content/renderer/pepper/ppb_var_deprecated_impl.cc
+++ b/content/renderer/pepper/ppb_var_deprecated_impl.cc
@@ -303,7 +303,10 @@ bool IsInstanceOfDeprecated(PP_Var var,
return false; // Not an object at all.
v8::HandleScope handle_scope(object->instance()->GetIsolate());
- v8::Context::Scope context_scope(object->instance()->GetMainWorldContext());
+ v8::Handle<v8::Context> context = object->instance()->GetMainWorldContext();
+ if (context.IsEmpty())
+ return false;
+ v8::Context::Scope context_scope(context);
PluginObject* plugin_object = PluginObject::FromV8Object(
object->instance()->GetIsolate(), object->GetHandle());
if (plugin_object && plugin_object->ppp_class() == ppp_class) {
« 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