diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 22:14:01 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 22:14:01 +0000 |
commit | b6ce15971b4139103635132bb9c9d3cd2224973e (patch) | |
tree | 07ac0724aed49c2adb8d8c47aadeb23a34d3e324 /chrome/renderer/extensions/bindings_utils.h | |
parent | 95c3c59d275042225cda4589525cb279f66f1f2c (diff) | |
download | chromium_src-b6ce15971b4139103635132bb9c9d3cd2224973e.zip chromium_src-b6ce15971b4139103635132bb9c9d3cd2224973e.tar.gz chromium_src-b6ce15971b4139103635132bb9c9d3cd2224973e.tar.bz2 |
Chrome-side of fixes for content-script messaging.
This change adds registration of content scripts, parented to a frame's
context. When a frame's context goes away, we unregister it and any content
script contexts for it.
There's a corresponding webkit change that lets us know when a content script
context is created. Filed upstream as
https://bugs.webkit.org/show_bug.cgi?id=27104.
BUG=16228
TEST=install an extension with a content script that communicates with a parent
process. Messages should be sendable both ways.
Review URL: http://codereview.chromium.org/155309
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20677 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions/bindings_utils.h')
-rw-r--r-- | chrome/renderer/extensions/bindings_utils.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/renderer/extensions/bindings_utils.h b/chrome/renderer/extensions/bindings_utils.h index 2e8935a5..2c81b0c 100644 --- a/chrome/renderer/extensions/bindings_utils.h +++ b/chrome/renderer/extensions/bindings_utils.h @@ -61,9 +61,15 @@ struct ContextInfo { v8::Persistent<v8::Context> context; std::string extension_id; // empty if the context is not an extension + // If this context is a content script, parent will be the frame that it + // was injected in. This is empty if the context is not a content script. + v8::Persistent<v8::Context> parent_context; + ContextInfo(v8::Persistent<v8::Context> context, - const std::string& extension_id) - : context(context), extension_id(extension_id) {} + const std::string& extension_id, + v8::Persistent<v8::Context> parent_context) + : context(context), extension_id(extension_id), + parent_context(parent_context) {} }; typedef std::list< linked_ptr<ContextInfo> > ContextList; |