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

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

Issue 10758025: Add IsEmpty() check to blind IsUndefined() check in ExtensionDispatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/extension_dispatcher.cc
diff --git a/chrome/renderer/extensions/extension_dispatcher.cc b/chrome/renderer/extensions/extension_dispatcher.cc
index 16a70dfd08df56da25b4bea0ae8d0db536e33582..dfe3bf9a0e1a6f29aaad692953a6fc483a854e1d 100644
--- a/chrome/renderer/extensions/extension_dispatcher.cc
+++ b/chrome/renderer/extensions/extension_dispatcher.cc
@@ -694,7 +694,8 @@ void ExtensionDispatcher::DidCreateScriptContext(
v8::HandleScope handle_scope;
v8::Handle<v8::String> chrome_string(v8::String::New("chrome"));
v8::Handle<v8::Object> global(v8::Context::GetCurrent()->Global());
- if (global->Get(chrome_string)->IsUndefined())
+ v8::Handle<v8::Value> chrome(global->Get(chrome_string));
+ if (chrome.IsEmpty() || chrome->IsUndefined())
global->Set(chrome_string, v8::Object::New());
}
« 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