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

Unified Diff: chrome/renderer/extensions/module_system.cc

Issue 10928170: Add IsEmpty() check to ModuleSystem::IsPresentInCurrentContext(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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: chrome/renderer/extensions/module_system.cc
diff --git a/chrome/renderer/extensions/module_system.cc b/chrome/renderer/extensions/module_system.cc
index f87f48b7c6ffc70289759ed982ee848bb2187389..594f645377750507d543c3eab99b98661ecfc88f 100644
--- a/chrome/renderer/extensions/module_system.cc
+++ b/chrome/renderer/extensions/module_system.cc
@@ -56,6 +56,8 @@ ModuleSystem::NativesEnabledScope::~NativesEnabledScope() {
// static
bool ModuleSystem::IsPresentInCurrentContext() {
v8::Handle<v8::Object> global(v8::Context::GetCurrent()->Global());
+ if (global.IsEmpty())
+ return false;
v8::Handle<v8::Value> module_system =
global->GetHiddenValue(v8::String::New(kModuleSystem));
return !module_system.IsEmpty() && !module_system->IsUndefined();
« 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