summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/event_bindings.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer/extensions/event_bindings.cc')
-rw-r--r--chrome/renderer/extensions/event_bindings.cc15
1 files changed, 1 insertions, 14 deletions
diff --git a/chrome/renderer/extensions/event_bindings.cc b/chrome/renderer/extensions/event_bindings.cc
index 19a9245..576beba 100644
--- a/chrome/renderer/extensions/event_bindings.cc
+++ b/chrome/renderer/extensions/event_bindings.cc
@@ -168,19 +168,6 @@ void EventBindings::CallFunction(const std::string& function_name,
int argc, v8::Handle<v8::Value>* argv) {
for (ContextList::iterator it = GetRegisteredContexts().begin();
it != GetRegisteredContexts().end(); ++it) {
- DCHECK(!it->IsEmpty());
- v8::Context::Scope context_scope(*it);
- v8::Local<v8::Object> global = (*it)->Global();
-
- v8::Local<v8::Script> script = v8::Script::Compile(
- v8::String::New(function_name.c_str()));
- v8::Local<v8::Value> function_obj = script->Run();
- if (!function_obj->IsFunction())
- continue;
-
- v8::Local<v8::Function> function =
- v8::Local<v8::Function>::Cast(function_obj);
- if (!function.IsEmpty())
- function->Call(v8::Object::New(), argc, argv);
+ CallFunctionInContext(*it, function_name, argc, argv);
}
}