diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-02 20:42:26 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-02 20:42:26 +0000 |
commit | b9eea12850008f465aaa2d20ab84a2b0b5be9671 (patch) | |
tree | 9b813444e9e7bac7f5c3e0c7b8ce47716fd53fd9 /chrome/renderer/extensions | |
parent | 87638af779ecfa2358090671234a3f239db47d37 (diff) | |
download | chromium_src-b9eea12850008f465aaa2d20ab84a2b0b5be9671.zip chromium_src-b9eea12850008f465aaa2d20ab84a2b0b5be9671.tar.gz chromium_src-b9eea12850008f465aaa2d20ab84a2b0b5be9671.tar.bz2 |
Fix some issues with extension messaging:
- Disconnect ports properly (javascript mistake).
- Use the right port ID when dispatching the disconnect event.
- Fix a bug with 2 extensions loaded in the same process.
BUG=12686
BUG=15798
TEST=Load an extension that uses messaging, and make sure it disconnects when you navigate or close the connecting.
Review URL: http://codereview.chromium.org/152003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions')
-rw-r--r-- | chrome/renderer/extensions/event_bindings.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/renderer/extensions/event_bindings.cc b/chrome/renderer/extensions/event_bindings.cc index 240c330..e9efbad 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); |