diff options
author | zork@google.com <zork@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-15 23:43:42 +0000 |
---|---|---|
committer | zork@google.com <zork@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-15 23:43:42 +0000 |
commit | a9f4d90f8a1643ccc27aba95cf60c4531b3db7b9 (patch) | |
tree | 0f6069b618b1847b12cdba7d18e2ba8326073eed /chrome/common | |
parent | b2d85c6d595cd7b0b3807d2bb7849fee343d7394 (diff) | |
download | chromium_src-a9f4d90f8a1643ccc27aba95cf60c4531b3db7b9.zip chromium_src-a9f4d90f8a1643ccc27aba95cf60c4531b3db7b9.tar.gz chromium_src-a9f4d90f8a1643ccc27aba95cf60c4531b3db7b9.tar.bz2 |
Adding sync plugin messages, and plugin broadcasts to the renderer processes
Review URL: http://codereview.chromium.org/2411
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2246 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/chrome_plugin_api.h | 18 | ||||
-rw-r--r-- | chrome/common/plugin_messages_internal.h | 7 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 13 |
3 files changed, 37 insertions, 1 deletions
diff --git a/chrome/common/chrome_plugin_api.h b/chrome/common/chrome_plugin_api.h index 9e5301a..278787c 100644 --- a/chrome/common/chrome_plugin_api.h +++ b/chrome/common/chrome_plugin_api.h @@ -30,7 +30,7 @@ extern "C" { // The current version of the API, used by the 'version' field of CPPluginFuncs // and CPBrowserFuncs. #define CP_MAJOR_VERSION 0 -#define CP_MINOR_VERSION 6 +#define CP_MINOR_VERSION 7 #define CP_VERSION ((CP_MAJOR_VERSION << 8) | (CP_MINOR_VERSION)) #define CP_GET_MAJOR_VERSION(version) ((version & 0xff00) >> 8) @@ -374,9 +374,23 @@ typedef CPError (STDCALL *CPB_SendMessageFunc)(CPID id, const void *data, uint32 data_len); +// Asks the browser to send raw data to the other process hosting an instance of +// this plugin. This function only works from the plugin or renderer process. +// This function blocks until the message is processed. The memory should be +// freed using CPB_Free when done. +typedef CPError (STDCALL *CPB_SendSyncMessageFunc)(CPID id, + const void *data, + uint32 data_len, + void **retval, + uint32 *retval_len); + // Informs the plugin of raw data having been sent from another process. typedef void (STDCALL *CPP_OnMessageFunc)(void *data, uint32 data_len); +// Informs the plugin of raw data having been sent from another process. +typedef void (STDCALL *CPP_OnSyncMessageFunc)(void *data, uint32 data_len, + void **retval, uint32 *retval_len); + // Function table for issuing requests using via the other side's network stack. // For the plugin, this functions deal with issuing requests through the // browser. For the browser, these functions deal with allowing the plugin to @@ -419,6 +433,7 @@ typedef struct _CPPluginFuncs { CPP_OnMessageFunc on_message; CPP_HtmlDialogClosedFunc html_dialog_closed; CPP_HandleCommandFunc handle_command; + CPP_OnSyncMessageFunc on_sync_message; } CPPluginFuncs; // Function table CPB functions (functions provided by host to plugin). @@ -446,6 +461,7 @@ typedef struct _CPBrowserFuncs { CPB_GetCommandLineArgumentsFunc get_command_line_arguments; CPB_AddUICommandFunc add_ui_command; CPB_HandleCommandFunc handle_command; + CPB_SendSyncMessageFunc send_sync_message; } CPBrowserFuncs; diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h index dfcffea..7b4af2a 100644 --- a/chrome/common/plugin_messages_internal.h +++ b/chrome/common/plugin_messages_internal.h @@ -56,6 +56,12 @@ IPC_BEGIN_MESSAGES(PluginProcessHost, 4) IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_PluginMessage, std::vector<uint8> /* opaque data */) + // Allows a chrome plugin loaded in a plugin process to send arbitrary + // data to an instance of the same plugin loaded in the browser process. + IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_PluginSyncMessage, + std::vector<uint8> /* opaque data */, + std::vector<uint8> /* opaque data response */) + // Retrieve the given type of info that is associated with the given // CPBrowsingContext. Returns the result in a string. IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginDataDir, @@ -238,6 +244,7 @@ IPC_BEGIN_MESSAGES(PluginHost, 6) IPC_SYNC_MESSAGE_ROUTED0_1(PluginHostMsg_GetCPBrowsingContext, uint32 /* context */) + IPC_END_MESSAGES(PluginHost) //----------------------------------------------------------------------------- diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 66941ef..faf8beb 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -45,6 +45,12 @@ IPC_BEGIN_MESSAGES(View, 1) size_t /* max_dead_capacity */, size_t /* capacity */) + // Allows a chrome plugin loaded in the browser process to send arbitrary + // data to an instance of the same plugin loaded in a renderer process. + IPC_MESSAGE_CONTROL2(ViewMsg_PluginMessage, + std::wstring /* dll_path of plugin */, + std::vector<uint8> /* opaque data */) + // Reply in response to ViewHostMsg_ShowView or ViewHostMsg_ShowWidget. // similar to the new command, but used when the renderer created a view // first, and we need to update it @@ -653,6 +659,13 @@ IPC_BEGIN_MESSAGES(ViewHost, 2) std::wstring /* dll_path of plugin */, std::vector<uint8> /* opaque data */) + // Allows a chrome plugin loaded in a renderer process to send arbitrary + // data to an instance of the same plugin loaded in the browser process. + IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_PluginSyncMessage, + std::wstring /* dll_path of plugin */, + std::vector<uint8> /* opaque data */, + std::vector<uint8> /* opaque data */) + // Requests spellcheck for a word. IPC_SYNC_MESSAGE_ROUTED1_2(ViewHostMsg_SpellCheck, std::wstring /* word to check */, |