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

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

Issue 668333002: Avoid entering an empty V8 context in PPB_Var_Deprecated IsInstanceOfDeprecated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2171
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 9f86e6b5141fe09806ba98d806a93cff88f6991a..28c9cde65131d987a7b642ed2bca4c84085cf48b 100644
--- a/content/renderer/pepper/ppb_var_deprecated_impl.cc
+++ b/content/renderer/pepper/ppb_var_deprecated_impl.cc
@@ -290,7 +290,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