summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/event_bindings.cc
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 00:06:47 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 00:06:47 +0000
commit2f25d7b91d75afea74cf4ba9e3b2a2db0d853f50 (patch)
treef6d95141295b9b03d4961ad8063c44f2c09e8cce /chrome/renderer/extensions/event_bindings.cc
parent661feb7cadf6362ddd34f85b887ec8f4d24eeee9 (diff)
downloadchromium_src-2f25d7b91d75afea74cf4ba9e3b2a2db0d853f50.zip
chromium_src-2f25d7b91d75afea74cf4ba9e3b2a2db0d853f50.tar.gz
chromium_src-2f25d7b91d75afea74cf4ba9e3b2a2db0d853f50.tar.bz2
Change the extension callback system to work more like events, where we track
contexts rather than frames. Also change the way we call through to javascript, to avoid a v8::Compile. This is so we don't skew the histogram stats on our script cache. BUG=? TEST=none Review URL: http://codereview.chromium.org/119369 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18001 0039d316-1c4b-4281-b951-d872f2087c98
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);
}
}