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

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

Issue 152003: Fix some issues with extension messaging: (Closed)
Patch Set: Created 11 years, 6 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 | « chrome/browser/extensions/extension_messages_unittest.cc ('k') | chrome/renderer/renderer_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/event_bindings.cc
diff --git a/chrome/renderer/extensions/event_bindings.cc b/chrome/renderer/extensions/event_bindings.cc
index 240c33068456a07a1740127a11ca6dc20bea0c02..e9efbad207a25a4c93c5adffe4877e8101806fa9 100644
--- a/chrome/renderer/extensions/event_bindings.cc
+++ b/chrome/renderer/extensions/event_bindings.cc
@@ -144,6 +144,10 @@ void EventBindings::HandleContextCreated(WebFrame* frame) {
v8::Persistent<v8::Context>::New(context);
GetContexts().push_back(linked_ptr<ContextInfo>(
new ContextInfo(persistent_context, extension_id)));
+
+ v8::Handle<v8::Value> argv[1];
+ argv[0] = v8::String::New(extension_id.c_str());
+ CallFunctionInContext(context, "dispatchOnLoad", arraysize(argv), argv);
}
// static
@@ -182,7 +186,6 @@ void EventBindings::HandleContextDestroyed(WebFrame* frame) {
// static
void EventBindings::CallFunction(const std::string& function_name,
int argc, v8::Handle<v8::Value>* argv) {
- v8::HandleScope handle_scope;
for (ContextList::iterator it = GetContexts().begin();
it != GetContexts().end(); ++it) {
CallFunctionInContext((*it)->context, function_name, argc, argv);
« no previous file with comments | « chrome/browser/extensions/extension_messages_unittest.cc ('k') | chrome/renderer/renderer_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698