summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/renderer_extension_bindings.h
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-02 23:56:11 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-02 23:56:11 +0000
commit75e5a879a500897b2409c49d4ef205e2e954c9fd (patch)
tree166ca53e8cc29520402efd7cc6ee2804edf744eb /chrome/renderer/extensions/renderer_extension_bindings.h
parent720ac73783ea732c130ff6d11dffa41919a25809 (diff)
downloadchromium_src-75e5a879a500897b2409c49d4ef205e2e954c9fd.zip
chromium_src-75e5a879a500897b2409c49d4ef205e2e954c9fd.tar.gz
chromium_src-75e5a879a500897b2409c49d4ef205e2e954c9fd.tar.bz2
Add code to support 2-way communication between extensions and renderers. The code is almost fully symmetrical, except that right now a channel can only be opened to an extension (by ID). It should be trivial to open a channel to a tab, once we have a solid tab API.
Review URL: http://codereview.chromium.org/56037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13057 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions/renderer_extension_bindings.h')
-rwxr-xr-xchrome/renderer/extensions/renderer_extension_bindings.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/chrome/renderer/extensions/renderer_extension_bindings.h b/chrome/renderer/extensions/renderer_extension_bindings.h
index 284f9bb..7c951ec 100755
--- a/chrome/renderer/extensions/renderer_extension_bindings.h
+++ b/chrome/renderer/extensions/renderer_extension_bindings.h
@@ -9,16 +9,23 @@
#include <string>
+class RenderThreadBase;
class WebFrame;
namespace extensions_v8 {
-// This class adds extension-related javascript bindings to a renderer.
+// This class adds extension-related javascript bindings to a renderer. It is
+// used by both web renderers and extension processes.
class RendererExtensionBindings {
public:
- static v8::Extension* Get();
- static void HandleExtensionMessage(
- WebFrame* webframe, const std::string& message, int channel_id);
+ static v8::Extension* Get(RenderThreadBase* render_thread);
+
+ // Notify any listeners that a message channel has been opened to this
+ // process.
+ static void HandleConnect(int port_id);
+
+ // Dispatch the given message sent on this channel.
+ static void HandleMessage(const std::string& message, int port_id);
};
} // namespace extensions_v8