diff options
59 files changed, 6760 insertions, 7559 deletions
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h index 57eec01..2372acee 100644 --- a/chrome/app/chrome_command_ids.h +++ b/chrome/app/chrome_command_ids.h @@ -5,25 +5,9 @@ // This file lists all the command IDs understood by e.g. the browser. // It is used by Windows RC files, Mac NIB files, and other platforms too. -#define IDC_View 4000 -#define IDC_ViewHost 4001 -#define IDC_Plugin 4002 -#define IDC_PluginHost 4003 -#define IDC_NPObject 4004 -#define IDC_PluginProcess 4005 -#define IDC_PluginProcessHost 4006 -#define IDC_ViewAll 4007 -#define IDC_ViewNone 4008 -#define IDC_ViewHostAll 4009 -#define IDC_ViewHostNone 4010 -#define IDC_PluginAll 4011 -#define IDC_PluginNone 4012 -#define IDC_NPObjectAll 4013 -#define IDC_NPObjectNone 4014 -#define IDC_PluginHostAll 4015 -#define IDC_PluginHostNone 4016 -#define IDC_DevToolsAgent 4017 -#define IDC_DevToolsClient 4018 +#define IDC_Messages 4000 +#define IDC_MessagesAll 4007 +#define IDC_MessagesNone 4008 // NOTE: Within each of the following sections, the IDs are ordered roughly by // how they appear in the GUI/menus (left to right, top to bottom, etc.). diff --git a/chrome/app/chrome_dll.rc b/chrome/app/chrome_dll.rc index 099ef98..be65dd2 100644 --- a/chrome/app/chrome_dll.rc +++ b/chrome/app/chrome_dll.rc @@ -210,30 +210,14 @@ IDI_THROBBER_24 ICON "theme\vista_frame_throbber_24.i // Dialog // -IDD_IPC_SETTINGS DIALOGEX 0, 0, 723, 558 +IDD_IPC_SETTINGS DIALOGEX 0, 0, 182, 558 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "IPC Logging Settings" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN - CONTROL "",IDC_View,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,22,170,529 - CONTROL "",IDC_ViewHost,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,187,22,170,529 - CONTROL "",IDC_Plugin,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,367,22,170,279 - CONTROL "",IDC_PluginHost,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,546,22,170,279 - CONTROL "",IDC_NPObject,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,367,326,170,145 - CONTROL "",IDC_PluginProcess,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,546,326,170,50 - CONTROL "",IDC_PluginProcessHost,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,546,381,170,90 - CONTROL "",IDC_DevToolsAgent,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,367,480,170,71 - CONTROL "",IDC_DevToolsClient,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,546,480,170,71 - PUSHBUTTON "Check All",IDC_ViewAll,7,6,56,13 - PUSHBUTTON "Check None",IDC_ViewNone,121,7,56,13 - PUSHBUTTON "Check All",IDC_ViewHostAll,187,7,56,13 - PUSHBUTTON "Check None",IDC_ViewHostNone,301,7,56,13 - PUSHBUTTON "Check All",IDC_PluginAll,367,7,56,13 - PUSHBUTTON "Check None",IDC_PluginNone,482,7,56,13 - PUSHBUTTON "Check All",IDC_NPObjectAll,367,310,56,13 - PUSHBUTTON "Check None",IDC_NPObjectNone,481,310,56,13 - PUSHBUTTON "Check All",IDC_PluginHostAll,546,7,56,13 - PUSHBUTTON "Check None",IDC_PluginHostNone,660,7,56,13 + CONTROL "",IDC_Messages,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,22,170,529 + PUSHBUTTON "All",IDC_MessagesAll,7,6,56,13 + PUSHBUTTON "None",IDC_MessagesNone,121,7,56,13 END diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 7464ec1..50f5306 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -366,9 +366,6 @@ void AutomationProvider::OnMessageReceived(const IPC::Message& message) { IPC_MESSAGE_HANDLER_DELAY_REPLY(AutomationMsg_WindowDrag, WindowSimulateDrag) #endif // !defined(OS_MACOSX) -#if defined(OS_WIN) - IPC_MESSAGE_HANDLER(AutomationMsg_TabHWND, GetTabHWND) -#endif // defined(OS_WIN) IPC_MESSAGE_HANDLER(AutomationMsg_HandleUnused, HandleUnused) IPC_MESSAGE_HANDLER(AutomationMsg_SetProxyConfig, SetProxyConfig); IPC_MESSAGE_HANDLER(AutomationMsg_PrintAsync, PrintAsync) diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index c30fb97..797d8b08 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -238,11 +238,6 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, int flags, bool press_escape_en_route, IPC::Message* reply_message); - -#if defined(OS_WIN) - // TODO(port): Replace HWND. - void GetTabHWND(int handle, HWND* tab_hwnd); -#endif // defined(OS_WIN) void HandleUnused(const IPC::Message& message, int handle); void SetFilteredInet(const IPC::Message& message, bool enabled); void GetFilteredInetHitCount(int* hit_count); diff --git a/chrome/browser/automation/automation_provider_win.cc b/chrome/browser/automation/automation_provider_win.cc index a2640d7..7ff2bff 100644 --- a/chrome/browser/automation/automation_provider_win.cc +++ b/chrome/browser/automation/automation_provider_win.cc @@ -229,15 +229,6 @@ void AutomationProvider::WindowSimulateDrag(int handle, } } -void AutomationProvider::GetTabHWND(int handle, HWND* tab_hwnd) { - *tab_hwnd = NULL; - - if (tab_tracker_->ContainsHandle(handle)) { - NavigationController* tab = tab_tracker_->GetResource(handle); - *tab_hwnd = tab->tab_contents()->GetNativeView(); - } -} - void AutomationProvider::CreateExternalTab( const IPC::ExternalTabSettings& settings, gfx::NativeWindow* tab_container_window, gfx::NativeWindow* tab_window, diff --git a/chrome/browser/importer/firefox_importer_unittest_messages_internal.h b/chrome/browser/importer/firefox_importer_unittest_messages_internal.h index 68b2582..fd70f7f 100644 --- a/chrome/browser/importer/firefox_importer_unittest_messages_internal.h +++ b/chrome/browser/importer/firefox_importer_unittest_messages_internal.h @@ -2,15 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This header is meant to be included in multiple passes, hence no traditional -// header guard. -// See ipc_message_macros.h for explanation of the macros and passes. - #include "ipc/ipc_message_macros.h" +#define IPC_MESSAGE_START FirefoxImporterUnittestMsgStart + // Messages definitions for messages sent between the unit test binary and // a child process by FFUnitTestDecryptorProxy. -IPC_BEGIN_MESSAGES(Test) // Server->Child: Initialize the decrytor with the following paramters. IPC_MESSAGE_CONTROL2(Msg_Decryptor_Init, @@ -29,5 +26,3 @@ IPC_MESSAGE_CONTROL1(Msg_Decryptor_Response, // Server->Child: Die. IPC_MESSAGE_CONTROL0(Msg_Decryptor_Quit) - -IPC_END_MESSAGES(Test) diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc index fbe3d3d..ba1b5aa 100644 --- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc @@ -14,19 +14,11 @@ #include "ipc/ipc_channel.h" #include "ipc/ipc_descriptors.h" #include "ipc/ipc_message.h" -#include "ipc/ipc_message_utils.h" #include "ipc/ipc_switches.h" #include "testing/multiprocess_func_list.h" -// Declaration of IPC Messages used for this test. -#define MESSAGES_INTERNAL_FILE \ - "chrome/browser/importer/firefox_importer_unittest_messages_internal.h" -#include "ipc/ipc_message_macros.h" - -// Definition of IPC Messages used for this test. -#define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/browser/importer/firefox_importer_unittest_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" +#define IPC_MESSAGE_IMPL +#include "chrome/browser/importer/firefox_importer_unittest_messages_internal.h" namespace { diff --git a/chrome/browser/importer/importer_messages.cc b/chrome/browser/importer/importer_messages.cc index d20452a..8eb9000 100644 --- a/chrome/browser/importer/importer_messages.cc +++ b/chrome/browser/importer/importer_messages.cc @@ -2,10 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/importer/importer_messages.h" - #include "base/values.h" -#define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/browser/importer/importer_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" +#define IPC_MESSAGE_IMPL +#include "chrome/browser/importer/importer_messages.h"
\ No newline at end of file diff --git a/chrome/browser/importer/importer_messages.h b/chrome/browser/importer/importer_messages.h index fd7b1dc..e05aac8 100644 --- a/chrome/browser/importer/importer_messages.h +++ b/chrome/browser/importer/importer_messages.h @@ -363,8 +363,6 @@ struct ParamTraits<TemplateURL> { } // namespace IPC -#define MESSAGES_INTERNAL_FILE \ - "chrome/browser/importer/importer_messages_internal.h" -#include "ipc/ipc_message_macros.h" +#include "chrome/browser/importer/importer_messages_internal.h" #endif // CHROME_BROWSER_IMPORTER_IMPORTER_MESSAGES_H_ diff --git a/chrome/browser/importer/importer_messages_internal.h b/chrome/browser/importer/importer_messages_internal.h index 980e397b..20e7770 100644 --- a/chrome/browser/importer/importer_messages_internal.h +++ b/chrome/browser/importer/importer_messages_internal.h @@ -10,73 +10,70 @@ #include "ipc/ipc_message_macros.h" #include "webkit/glue/password_form.h" +#define IPC_MESSAGE_START ProfileImportMsgStart + //----------------------------------------------------------------------------- // ProfileImportProcess messages // These are messages sent from the browser to the profile import process. -IPC_BEGIN_MESSAGES(ProfileImportProcess) - IPC_MESSAGE_CONTROL4(ProfileImportProcessMsg_StartImport, - importer::ProfileInfo /* ProfileInfo struct */, - int /* bitmask of items to import */, - DictionaryValue /* localized strings */, - bool /* import to bookmark bar */) +IPC_MESSAGE_CONTROL4(ProfileImportProcessMsg_StartImport, + importer::ProfileInfo /* ProfileInfo struct */, + int /* bitmask of items to import */, + DictionaryValue /* localized strings */, + bool /* import to bookmark bar */) - IPC_MESSAGE_CONTROL0(ProfileImportProcessMsg_CancelImport) +IPC_MESSAGE_CONTROL0(ProfileImportProcessMsg_CancelImport) - IPC_MESSAGE_CONTROL1(ProfileImportProcessMsg_ReportImportItemFinished, - int /* ImportItem */) -IPC_END_MESSAGES(ProfileImportProcess) +IPC_MESSAGE_CONTROL1(ProfileImportProcessMsg_ReportImportItemFinished, + int /* ImportItem */) //--------------------------------------------------------------------------- // ProfileImportProcessHost messages // These are messages sent from the profile import process to the browser. -IPC_BEGIN_MESSAGES(ProfileImportProcessHost) - // These messages send information about the status of the import and - // individual import tasks. - IPC_MESSAGE_CONTROL0(ProfileImportProcessHostMsg_Import_Started) - - IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_Import_Finished, - bool /* was import successful? */, - std::string /* error message, if any */) +// These messages send information about the status of the import and +// individual import tasks. +IPC_MESSAGE_CONTROL0(ProfileImportProcessHostMsg_Import_Started) - IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_ImportItem_Started, - int /* ImportItem */) +IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_Import_Finished, + bool /* was import successful? */, + std::string /* error message, if any */) - IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_ImportItem_Finished, - int /* ImportItem */) +IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_ImportItem_Started, + int /* ImportItem */) - // These messages send data from the external importer process back to - // the process host so it can be written to the profile. - IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyHistoryImportStart, - int /* total number of history::URLRow items */) +IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_ImportItem_Finished, + int /* ImportItem */) - IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyHistoryImportGroup, - std::vector<history::URLRow>, - int /* the source of URLs as in history::VisitSource.*/ - /* To simplify IPC call, pass as an integer */) +// These messages send data from the external importer process back to +// the process host so it can be written to the profile. +IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyHistoryImportStart, + int /* total number of history::URLRow items */) - IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyHomePageImportReady, - GURL /* GURL of home page */) +IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyHistoryImportGroup, + std::vector<history::URLRow>, + int /* the source of URLs as in history::VisitSource.*/ + /* To simplify IPC call, pass as an integer */) - IPC_MESSAGE_CONTROL3(ProfileImportProcessHostMsg_NotifyBookmarksImportStart, - std::wstring /* first folder name */, - int /* options */, - int /* total number of bookmarks */) +IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyHomePageImportReady, + GURL /* GURL of home page */) - IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyBookmarksImportGroup, - std::vector<ProfileWriter::BookmarkEntry>) +IPC_MESSAGE_CONTROL3(ProfileImportProcessHostMsg_NotifyBookmarksImportStart, + std::wstring /* first folder name */, + int /* options */, + int /* total number of bookmarks */) - IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFavIconsImportStart, - int /* total number of FavIcons */) +IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyBookmarksImportGroup, + std::vector<ProfileWriter::BookmarkEntry>) - IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFavIconsImportGroup, - std::vector<history::ImportedFavIconUsage> ) +IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFavIconsImportStart, + int /* total number of FavIcons */) - IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyPasswordFormReady, - webkit_glue::PasswordForm ) +IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFavIconsImportGroup, + std::vector<history::ImportedFavIconUsage> ) - IPC_MESSAGE_CONTROL3(ProfileImportProcessHostMsg_NotifyKeywordsReady, - std::vector<TemplateURL>, - int, /* default keyword index */ - bool /* unique on host and path */) -IPC_END_MESSAGES(ProfileImportProcessHost) +IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyPasswordFormReady, + webkit_glue::PasswordForm ) +IPC_MESSAGE_CONTROL3(ProfileImportProcessHostMsg_NotifyKeywordsReady, + std::vector<TemplateURL>, + int, /* default keyword index */ + bool /* unique on host and path */) diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index 2df3ab6..eb04155 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -843,7 +843,7 @@ void RenderWidgetHost::OnMsgUpdateRect( if (dib) { if (dib->size() < size) { DLOG(WARNING) << "Transport DIB too small for given rectangle"; - process()->ReceivedBadMessage(ViewHostMsg_UpdateRect__ID); + process()->ReceivedBadMessage(ViewHostMsg_UpdateRect::ID); } else { // Scroll the backing store. if (!params.scroll_rect.IsEmpty()) { @@ -951,12 +951,12 @@ void RenderWidgetHost::ProcessWheelAck() { void RenderWidgetHost::OnMsgFocus() { // Only RenderViewHost can deal with that message. - process()->ReceivedBadMessage(ViewHostMsg_Focus__ID); + process()->ReceivedBadMessage(ViewHostMsg_Focus::ID); } void RenderWidgetHost::OnMsgBlur() { // Only RenderViewHost can deal with that message. - process()->ReceivedBadMessage(ViewHostMsg_Blur__ID); + process()->ReceivedBadMessage(ViewHostMsg_Blur::ID); } void RenderWidgetHost::OnMsgSetCursor(const WebCursor& cursor) { diff --git a/chrome/browser/ui/views/about_ipc_dialog.cc b/chrome/browser/ui/views/about_ipc_dialog.cc index 358e28f..b61f83c 100644 --- a/chrome/browser/ui/views/about_ipc_dialog.cc +++ b/chrome/browser/ui/views/about_ipc_dialog.cc @@ -59,7 +59,7 @@ enum { class RegisterLoggerFuncs { public: RegisterLoggerFuncs() { - IPC::Logging::SetLoggerFunctions(g_log_function_mapping); + IPC::Logging::set_log_function_map(&g_log_function_mapping); } }; @@ -75,45 +75,8 @@ std::set<int> disabled_messages; bool init_done = false; HWND settings_dialog = NULL; - -// Settings lists. -struct Settings { - CListViewCtrl* view; - CListViewCtrl* view_host; - CListViewCtrl* plugin; - CListViewCtrl* plugin_host; - CListViewCtrl* npobject; - CListViewCtrl* plugin_process; - CListViewCtrl* plugin_process_host; - CListViewCtrl* devtools_agent; - CListViewCtrl* devtools_client; - -} settings_views = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; - -void CreateColumn(uint32 start, uint32 end, HWND hwnd, - CListViewCtrl** control) { - DCHECK(*control == NULL); - *control = new CListViewCtrl(hwnd); - CListViewCtrl* control_ptr = *control; - control_ptr->SetViewType(LVS_REPORT); - control_ptr->SetExtendedListViewStyle(LVS_EX_CHECKBOXES); - control_ptr->ModifyStyle(0, LVS_SORTASCENDING | LVS_NOCOLUMNHEADER); - control_ptr->InsertColumn(0, L"id", LVCFMT_LEFT, 230); - - for (uint32 i = start; i < end; i++) { - std::string name; - IPC::Logging::GetMessageText(i, &name, NULL, NULL); - std::wstring wname = UTF8ToWide(name); - - int index = control_ptr->InsertItem( - LVIF_TEXT | LVIF_PARAM, 0, wname.c_str(), 0, 0, 0, i); - - control_ptr->SetItemText(index, 0, wname.c_str()); - - if (disabled_messages.find(i) == disabled_messages.end()) - control_ptr->SetCheckState(index, TRUE); - } -} +// Settings. +CListViewCtrl* messages = NULL; void OnCheck(int id, bool checked) { if (!init_done) @@ -125,58 +88,38 @@ void OnCheck(int id, bool checked) { disabled_messages.insert(id); } +void InitDialog(HWND hwnd) { + messages = new CListViewCtrl(::GetDlgItem(hwnd, IDC_Messages)); -void CheckButtons(CListViewCtrl* control, bool check) { - int count = control->GetItemCount(); - for (int i = 0; i < count; ++i) - control->SetCheckState(i, check); -} + messages->SetViewType(LVS_REPORT); + messages->SetExtendedListViewStyle(LVS_EX_CHECKBOXES); + messages->ModifyStyle(0, LVS_SORTASCENDING | LVS_NOCOLUMNHEADER); + messages->InsertColumn(0, L"id", LVCFMT_LEFT, 230); + + LogFunctionMap* log_functions = IPC::Logging::log_function_map(); + for (LogFunctionMap::iterator i = log_functions->begin(); + i != log_functions->end(); ++i) { + std::string name; + (*i->second)(&name, NULL, NULL); + if (name.empty()) + continue; // Will happen if the message file isn't included above. + std::wstring wname = UTF8ToWide(name); + + int index = messages->InsertItem( + LVIF_TEXT | LVIF_PARAM, 0, wname.c_str(), 0, 0, 0, i->first); + + messages->SetItemText(index, 0, wname.c_str()); + + if (disabled_messages.find(i->first) == disabled_messages.end()) + messages->SetCheckState(index, TRUE); + } -void InitDialog(HWND hwnd) { - CreateColumn(ViewStart, ViewEnd, ::GetDlgItem(hwnd, IDC_View), - &settings_views.view); - CreateColumn(ViewHostStart, ViewHostEnd, ::GetDlgItem(hwnd, IDC_ViewHost), - &settings_views.view_host); - CreateColumn(PluginStart, PluginEnd, ::GetDlgItem(hwnd, IDC_Plugin), - &settings_views.plugin); - CreateColumn(PluginHostStart, PluginHostEnd, - ::GetDlgItem(hwnd, IDC_PluginHost), - &settings_views.plugin_host); - CreateColumn(NPObjectStart, NPObjectEnd, ::GetDlgItem(hwnd, IDC_NPObject), - &settings_views.npobject); - CreateColumn(PluginProcessStart, PluginProcessEnd, - ::GetDlgItem(hwnd, IDC_PluginProcess), - &settings_views.plugin_process); - CreateColumn(PluginProcessHostStart, PluginProcessHostEnd, - ::GetDlgItem(hwnd, IDC_PluginProcessHost), - &settings_views.plugin_process_host); - CreateColumn(DevToolsAgentStart, DevToolsAgentEnd, - ::GetDlgItem(hwnd, IDC_DevToolsAgent), - &settings_views.devtools_agent); - CreateColumn(DevToolsClientStart, DevToolsClientEnd, - ::GetDlgItem(hwnd, IDC_DevToolsClient), - &settings_views.devtools_client); init_done = true; } void CloseDialog() { - delete settings_views.view; - delete settings_views.view_host; - delete settings_views.plugin_host; - delete settings_views.npobject; - delete settings_views.plugin_process; - delete settings_views.plugin_process_host; - delete settings_views.devtools_agent; - delete settings_views.devtools_client; - settings_views.view = NULL; - settings_views.view_host = NULL; - settings_views.plugin = NULL; - settings_views.plugin_host = NULL; - settings_views.npobject = NULL; - settings_views.plugin_process = NULL; - settings_views.plugin_process_host = NULL; - settings_views.devtools_agent = NULL; - settings_views.devtools_client = NULL; + delete messages; + messages = NULL; init_done = false; @@ -185,7 +128,7 @@ void CloseDialog() { /* The old version of this code stored the last settings in the preferences. But with this dialog, there currently isn't an easy way to get the profile - to asave in the preferences. + to save in the preferences. Profile* current_profile = profile(); if (!current_profile) return; @@ -203,38 +146,9 @@ void CloseDialog() { } void OnButtonClick(int id) { - switch (id) { - case IDC_ViewAll: - CheckButtons(settings_views.view, true); - break; - case IDC_ViewNone: - CheckButtons(settings_views.view, false); - break; - case IDC_ViewHostAll: - CheckButtons(settings_views.view_host, true); - break; - case IDC_ViewHostNone: - CheckButtons(settings_views.view_host, false); - break; - case IDC_PluginAll: - CheckButtons(settings_views.plugin, true); - break; - case IDC_PluginNone: - CheckButtons(settings_views.plugin, false); - break; - case IDC_PluginHostAll: - CheckButtons(settings_views.plugin_host, true); - break; - case IDC_PluginHostNone: - CheckButtons(settings_views.plugin_host, false); - break; - case IDC_NPObjectAll: - CheckButtons(settings_views.npobject, true); - break; - case IDC_NPObjectNone: - CheckButtons(settings_views.npobject, false); - break; - } + int count = messages->GetItemCount(); + for (int i = 0; i < count; ++i) + messages->SetCheckState(i, id == IDC_MessagesAll); } INT_PTR CALLBACK DialogProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { @@ -250,11 +164,7 @@ INT_PTR CALLBACK DialogProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { break; case WM_NOTIFY: { NMLISTVIEW* info = reinterpret_cast<NM_LISTVIEW*>(lparam); - if ((wparam == IDC_View || wparam == IDC_ViewHost || - wparam == IDC_Plugin || - wparam == IDC_PluginHost || wparam == IDC_NPObject || - wparam == IDC_PluginProcess || wparam == IDC_PluginProcessHost) && - info->hdr.code == LVN_ITEMCHANGED) { + if (wparam == IDC_Messages && info->hdr.code == LVN_ITEMCHANGED) { if (info->uChanged & LVIF_STATE) { bool checked = (info->uNewState >> 12) == 2; OnCheck(static_cast<int>(info->lParam), checked); diff --git a/chrome/common/automation_messages.cc b/chrome/common/automation_messages.cc index df6d0e2..6a5ca82 100644 --- a/chrome/common/automation_messages.cc +++ b/chrome/common/automation_messages.cc @@ -2,8 +2,5 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#define IPC_MESSAGE_IMPL #include "chrome/common/automation_messages.h" - -#define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/common/automation_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/automation_messages.h b/chrome/common/automation_messages.h index 0f8ec7c..42f1932 100644 --- a/chrome/common/automation_messages.h +++ b/chrome/common/automation_messages.h @@ -638,8 +638,6 @@ struct ParamTraits<AttachExternalTabParams> { } // namespace IPC -#define MESSAGES_INTERNAL_FILE \ - "chrome/common/automation_messages_internal.h" -#include "ipc/ipc_message_macros.h" +#include "chrome/common/automation_messages_internal.h" #endif // CHROME_COMMON_AUTOMATION_MESSAGES_H__ diff --git a/chrome/common/automation_messages_internal.h b/chrome/common/automation_messages_internal.h index 03c4aa5..5086bfc 100644 --- a/chrome/common/automation_messages_internal.h +++ b/chrome/common/automation_messages_internal.h @@ -4,1457 +4,1422 @@ // Defines the IPC messages used by the automation interface. -// This header is meant to be included in multiple passes, hence no traditional -// header guard. -// See ipc_message_macros.h for explanation of the macros and passes. - #include <string> #include <vector> -#include "base/basictypes.h" #include "base/string16.h" #include "chrome/common/content_settings.h" #include "chrome/common/navigation_types.h" #include "chrome/test/automation/autocomplete_edit_proxy.h" -#include "gfx/point.h" #include "gfx/rect.h" #include "googleurl/src/gurl.h" #include "ipc/ipc_message_macros.h" #include "net/url_request/url_request_status.h" + + // NOTE: All IPC messages have either a routing_id of 0 (for asynchronous // messages), or one that's been assigned by the proxy (for calls // which expect a response). The routing_id shouldn't be used for // any other purpose in these message types. -// NOTE: All the new IPC messages should go at the end (before IPC_END_MESSAGES) -// The IPC message IDs are part of an enum and hence the value -// assumed to be constant across the builds may change. -// The messages AutomationMsg_WindowHWND* in particular should not change -// since the PageCyclerReferenceTest depends on the correctness of the -// message IDs across the builds. - -IPC_BEGIN_MESSAGES(Automation) - - // This message is fired when the AutomationProvider is up and running - // in the app (the app is not fully up at this point). The parameter to this - // message is the version string of the automation provider. This parameter - // is defined to be the version string as returned by - // chrome::VersionInfo::Version(). - // The client can choose to use this version string to decide whether or not - // it can talk to the provider. - IPC_MESSAGE_ROUTED1(AutomationMsg_Hello, std::string) - - // This message is fired when the initial tab(s) are finished loading. - IPC_MESSAGE_ROUTED0(AutomationMsg_InitialLoadsComplete) - - // This message notifies the AutomationProvider to append a new tab the - // window with the given handle. The return value contains the index of - // the new tab, or -1 if the request failed. - // The second parameter is the url to be loaded in the new tab. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_AppendTab, int, GURL, int) - - // This message requests the (zero-based) index for the currently - // active tab in the window with the given handle. The return value contains - // the index of the active tab, or -1 if the request failed. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ActiveTabIndex, int, int) - - // This message notifies the AutomationProvider to active the tab. - // The first parameter is the handle to window resource. - // The second parameter is the (zero-based) index to be activated - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_ActivateTab, int, int, int) - - // This message requests the cookie value for given url in the - // profile of the tab identified by the second parameter. The first - // parameter is the URL string. The response contains the length of the - // cookie value string. On failure, this length = -1. - IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_GetCookies, GURL, int, - int, std::string) - - // This message notifies the AutomationProvider to set and broadcast a cookie - // with given name and value for the given url in the profile of the tab - // identified by the third parameter. The first parameter is the URL - // string, and the second parameter is the cookie name and value to be set. - // The return value is a non-negative value on success. - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetCookie, GURL, std::string, - int, int) - - // This message notifies the AutomationProvider to navigate to a specified - // url in the tab with given handle. The first parameter is the handle to - // the tab resource. The second parameter is the target url. The return - // value contains a status code which is nonnegative on success. - // See AutomationMsg_NavigationResponseValues for the return value. - // - // Deprecated in favor of - // AutomationMsg_NavigateToURLBlockUntilNavigationsComplete. - // TODO(phajdan.jr): Remove when the reference build gets updated. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_NavigateToURL, int, GURL, - AutomationMsg_NavigationResponseValues) - - // This message is used to implement the asynchronous version of - // NavigateToURL. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_NavigationAsync, - int /* tab handle */, - GURL, - bool /* result */) - - // This message notifies the AutomationProvider to navigate back in session - // history in the tab with given handle. The first parameter is the handle - // to the tab resource. - // See AutomationMsg_NavigationResponseValues for the navigation response - // values. - // - // Deprecated in favor of AutomationMsg_GoBackBlockUntilNavigationsComplete. - // TODO(phajdan.jr): Remove when the reference build gets updated. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GoBack, int, - AutomationMsg_NavigationResponseValues) - - // This message notifies the AutomationProvider to navigate forward in session - // history in the tab with given handle. The first parameter is the handle - // to the tab resource. - // See AutomationMsg_NavigationResponseValues for the navigation response - // values. - // - // Deprecated in favor of - // AutomationMsg_GoForwardBlockUntilNavigationsComplete. - // TODO(phajdan.jr): Remove when the reference build gets updated. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GoForward, int, - AutomationMsg_NavigationResponseValues) - - // This message requests the number of browser windows that the app currently - // has open. The return value is the number of windows. - IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_BrowserWindowCount, int) - - // This message requests the handle (int64 app-unique identifier) of the - // window with the given (zero-based) index. On error, the returned handle - // value is 0. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_BrowserWindow, int, int) - - // This message requests the number of tabs in the window with the given - // handle. The return value contains the number of tabs, or -1 if the - // request failed. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_TabCount, int, int) - - // This message requests the handle of the tab with the given (zero-based) - // index in the given app window. First parameter specifies the given window - // handle, second specifies the given tab_index. On error, the returned handle - // value is 0. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_Tab, int, int, int) - - // This message requests the the title of the tab with the given handle. - // The return value contains the size of the title string. On error, this - // value should be -1 and empty string. Note that the title can be empty in - // which case the size would be 0. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_TabTitle, - int, - int, - std::wstring) - - // This message requests the url of the tab with the given handle. - // The return value contains a success flag and the URL string. The URL will - // be empty on failure, and it still may be empty on success. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_TabURL, - int /* tab handle */, - bool /* success flag */, - GURL) - -#if defined(OS_WIN) - // TODO(estade): delete this unused message. - IPC_SYNC_MESSAGE_ROUTED0_0(AutomationMsg_WindowHWND) - - // This message requests the HWND of the tab that corresponds - // to the given automation handle. - // The return value contains the HWND value, which is 0 if the call fails. - // - // TODO(estade): The only test that uses this message is - // NPAPIVisiblePluginTester.SelfDeletePluginInvokeInSynchronousMouseMove. It - // can probably be done in another way, and this can be removed. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_TabHWND, - int /* tab_handle */, - HWND /* win32 Window Handle */) -#endif // defined(OS_WIN) - - // This message notifies the AutomationProxy that a handle that it has - // previously been given is now invalid. (For instance, if the handle - // represented a window which has now been closed.) The parameter - // value is the handle. - IPC_MESSAGE_ROUTED1(AutomationMsg_InvalidateHandle, int) - - // This message notifies the AutomationProvider that a handle is no - // longer being used, so it can stop paying attention to the - // associated resource. The parameter value is the handle. - IPC_MESSAGE_ROUTED1(AutomationMsg_HandleUnused, int) - - // This message tells the AutomationProvider to provide the given - // authentication data to the specified tab, in response to an HTTP/FTP - // authentication challenge. - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetAuth, - int, // tab handle - std::wstring, // username - std::wstring, // password - AutomationMsg_NavigationResponseValues) // status - - // This message tells the AutomationProvider to cancel the login in the - // specified tab. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_CancelAuth, - int, // tab handle - AutomationMsg_NavigationResponseValues) // status - - // Requests that the automation provider ask history for the most recent - // chain of redirects coming from the given URL. The response must be - // decoded by the caller manually; it contains an integer indicating the - // number of URLs, followed by that many wstrings indicating a chain of - // redirects. On failure, the count will be negative. - IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_RedirectsFrom, - int, // tab handle - GURL, // source URL - bool /* succeeded */, - std::vector<GURL> /* redirects */) - - // This message asks the AutomationProvider whether a tab is waiting for - // login info. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_NeedsAuth, - int, // tab handle - bool) // status - - // This message requests the AutomationProvider to apply a certain - // accelerator. It is completely asynchronous with the resulting accelerator - // action. - IPC_SYNC_MESSAGE_ROUTED2_0(AutomationMsg_ApplyAccelerator, - int, // window handle - int) // accelerator id like (IDC_BACK, - // IDC_FORWARD, etc) - // The list can be found at - // chrome/app/chrome_command_ids.h - - // This message requests that the AutomationProvider executes a JavaScript, - // which is sent embedded in a 'javascript:' URL. - // The javascript is executed in context of child frame whose xpath - // is passed as parameter (context_frame). The execution results in - // a serialized JSON string response. - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_DomOperation, - int, // tab handle - std::wstring, // context_frame - std::wstring, // the javascript to be executed - std::string) // the serialized json string - // containing the result of a - // javascript execution - - // Is the Download Shelf visible for the specified browser? - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ShelfVisibility, - int /* browser_handle */, - bool /* is_visible */) - - // This message requests the number of constrained windows in the tab with - // the given handle. The return value contains the number of constrained - // windows, or -1 if the request failed. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ConstrainedWindowCount, - int /* tab_handle */, - int /* constrained_window_count */) - - // This message requests the bounds of the specified View element in - // window coordinates. - // Request: - // int - the handle of the window in which the view appears - // int - the ID of the view, as specified in chrome/browser/ui/view_ids.h - // bool - whether the bounds should be returned in the screen coordinates - // (if true) or in the browser coordinates (if false). - // Response: - // bool - true if the view was found - // gfx::Rect - the bounds of the view, in window coordinates - IPC_SYNC_MESSAGE_ROUTED3_2(AutomationMsg_WindowViewBounds, int, int, - bool, bool, gfx::Rect) - - // This message sets the bounds of the window. - // Request: - // int - the handle of the window to resize - // gfx::Rect - the bounds of the window - // Response: - // bool - true if the resize was successful - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_SetWindowBounds, int, gfx::Rect, - bool) +// NOTE: All the new IPC messages should go at the end. +// The IPC message IDs need to match the reference builds. Since we know +// define the IDs based on __LINE__, to allow these IPC messages to be +// used to control an old version of Chrome we need the message IDs to +// remain the same. This means that you should not change the line number +// of any of the messages below. This will be fixed once Xcode supports +// __COUNTER__, in which case we can get rid of the __LINE__. + +#define IPC_MESSAGE_START AutomationMsgStart + +// This message is fired when the AutomationProvider is up and running +// in the app (the app is not fully up at this point). The parameter to this +// message is the version string of the automation provider. This parameter +// is defined to be the version string as returned by +// chrome::VersionInfo::Version(). +// The client can choose to use this version string to decide whether or not +// it can talk to the provider. +IPC_MESSAGE_ROUTED1(AutomationMsg_Hello, std::string) + +// This message is fired when the initial tab(s) are finished loading. +IPC_MESSAGE_ROUTED0(AutomationMsg_InitialLoadsComplete) + +// This message notifies the AutomationProvider to append a new tab the +// window with the given handle. The return value contains the index of +// the new tab, or -1 if the request failed. +// The second parameter is the url to be loaded in the new tab. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_AppendTab, int, GURL, int) + +// This message requests the (zero-based) index for the currently +// active tab in the window with the given handle. The return value contains +// the index of the active tab, or -1 if the request failed. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ActiveTabIndex, int, int) + +// This message notifies the AutomationProvider to active the tab. +// The first parameter is the handle to window resource. +// The second parameter is the (zero-based) index to be activated +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_ActivateTab, int, int, int) + +// This message requests the cookie value for given url in the +// profile of the tab identified by the second parameter. The first +// parameter is the URL string. The response contains the length of the +// cookie value string. On failure, this length = -1. +IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_GetCookies, GURL, int, + int, std::string) + +// This message notifies the AutomationProvider to set and broadcast a cookie +// with given name and value for the given url in the profile of the tab +// identified by the third parameter. The first parameter is the URL +// string, and the second parameter is the cookie name and value to be set. +// The return value is a non-negative value on success. +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetCookie, GURL, std::string, + int, int) + +// This message notifies the AutomationProvider to navigate to a specified +// url in the tab with given handle. The first parameter is the handle to +// the tab resource. The second parameter is the target url. The return +// value contains a status code which is nonnegative on success. +// See AutomationMsg_NavigationResponseValues for the return value. +// +// Deprecated in favor of +// AutomationMsg_NavigateToURLBlockUntilNavigationsComplete. +// TODO(phajdan.jr): Remove when the reference build gets updated. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_NavigateToURL, int, GURL, + AutomationMsg_NavigationResponseValues) + +// This message is used to implement the asynchronous version of +// NavigateToURL. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_NavigationAsync, + int /* tab handle */, + GURL, + bool /* result */) + +// This message notifies the AutomationProvider to navigate back in session +// history in the tab with given handle. The first parameter is the handle +// to the tab resource. +// See AutomationMsg_NavigationResponseValues for the navigation response +// values. +// +// Deprecated in favor of AutomationMsg_GoBackBlockUntilNavigationsComplete. +// TODO(phajdan.jr): Remove when the reference build gets updated. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GoBack, int, + AutomationMsg_NavigationResponseValues) + +// This message notifies the AutomationProvider to navigate forward in session +// history in the tab with given handle. The first parameter is the handle +// to the tab resource. +// See AutomationMsg_NavigationResponseValues for the navigation response +// values. +// +// Deprecated in favor of +// AutomationMsg_GoForwardBlockUntilNavigationsComplete. +// TODO(phajdan.jr): Remove when the reference build gets updated. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GoForward, int, + AutomationMsg_NavigationResponseValues) + +// This message requests the number of browser windows that the app currently +// has open. The return value is the number of windows. +IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_BrowserWindowCount, int) + +// This message requests the handle (int64 app-unique identifier) of the +// window with the given (zero-based) index. On error, the returned handle +// value is 0. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_BrowserWindow, int, int) + +// This message requests the number of tabs in the window with the given +// handle. The return value contains the number of tabs, or -1 if the +// request failed. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_TabCount, int, int) + +// This message requests the handle of the tab with the given (zero-based) +// index in the given app window. First parameter specifies the given window +// handle, second specifies the given tab_index. On error, the returned handle +// value is 0. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_Tab, int, int, int) + +// This message requests the the title of the tab with the given handle. +// The return value contains the size of the title string. On error, this +// value should be -1 and empty string. Note that the title can be empty in +// which case the size would be 0. +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_TabTitle, + int, + int, + std::wstring) + +// This message requests the url of the tab with the given handle. +// The return value contains a success flag and the URL string. The URL will +// be empty on failure, and it still may be empty on success. +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_TabURL, + int /* tab handle */, + bool /* success flag */, + GURL) + +// This message notifies the AutomationProxy that a handle that it has +// previously been given is now invalid. (For instance, if the handle +// represented a window which has now been closed.) The parameter +// value is the handle. +IPC_MESSAGE_ROUTED1(AutomationMsg_InvalidateHandle, int) + +// This message notifies the AutomationProvider that a handle is no +// longer being used, so it can stop paying attention to the +// associated resource. The parameter value is the handle. +IPC_MESSAGE_ROUTED1(AutomationMsg_HandleUnused, int) + +// This message tells the AutomationProvider to provide the given +// authentication data to the specified tab, in response to an HTTP/FTP +// authentication challenge. +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetAuth, + int, // tab handle + std::wstring, // username + std::wstring, // password + AutomationMsg_NavigationResponseValues) // status + +// This message tells the AutomationProvider to cancel the login in the +// specified tab. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_CancelAuth, + int, // tab handle + AutomationMsg_NavigationResponseValues) // status + +// Requests that the automation provider ask history for the most recent +// chain of redirects coming from the given URL. The response must be +// decoded by the caller manually; it contains an integer indicating the +// number of URLs, followed by that many wstrings indicating a chain of +// redirects. On failure, the count will be negative. +IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_RedirectsFrom, + int, // tab handle + GURL, // source URL + bool /* succeeded */, + std::vector<GURL> /* redirects */) + +// This message asks the AutomationProvider whether a tab is waiting for +// login info. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_NeedsAuth, + int, // tab handle + bool) // status + +// This message requests the AutomationProvider to apply a certain +// accelerator. It is completely asynchronous with the resulting accelerator +// action. +IPC_SYNC_MESSAGE_ROUTED2_0(AutomationMsg_ApplyAccelerator, + int, // window handle + int) // accelerator id like (IDC_BACK, + // IDC_FORWARD, etc) + // The list can be found at + // chrome/app/chrome_command_ids.h + +// This message requests that the AutomationProvider executes a JavaScript, +// which is sent embedded in a 'javascript:' URL. +// The javascript is executed in context of child frame whose xpath +// is passed as parameter (context_frame). The execution results in +// a serialized JSON string response. +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_DomOperation, + int, // tab handle + std::wstring, // context_frame + std::wstring, // the javascript to be executed + std::string) // the serialized json string + // containing the result of a + // javascript execution + +// Is the Download Shelf visible for the specified browser? +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ShelfVisibility, + int /* browser_handle */, + bool /* is_visible */) + +// This message requests the number of constrained windows in the tab with +// the given handle. The return value contains the number of constrained +// windows, or -1 if the request failed. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ConstrainedWindowCount, + int /* tab_handle */, + int /* constrained_window_count */) + +// This message requests the bounds of the specified View element in +// window coordinates. +// Request: +// int - the handle of the window in which the view appears +// int - the ID of the view, as specified in chrome/browser/ui/view_ids.h +// bool - whether the bounds should be returned in the screen coordinates +// (if true) or in the browser coordinates (if false). +// Response: +// bool - true if the view was found +// gfx::Rect - the bounds of the view, in window coordinates +IPC_SYNC_MESSAGE_ROUTED3_2(AutomationMsg_WindowViewBounds, int, int, + bool, bool, gfx::Rect) + +// This message sets the bounds of the window. +// Request: +// int - the handle of the window to resize +// gfx::Rect - the bounds of the window +// Response: +// bool - true if the resize was successful +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_SetWindowBounds, int, gfx::Rect, + bool) #if defined(OS_WIN) - // TODO(port): Port these messages. - // - // This message requests that a drag be performed in window coordinate space - // Request: - // int - the handle of the window that's the context for this drag - // std::vector<gfx::Point> - the path of the drag in window coordinate - // space; it should have at least 2 points - // (start and end) - // int - the flags which identify the mouse button(s) for the drag, as - // defined in chrome/views/event.h - // Response: - // bool - true if the drag could be performed - IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_WindowDrag, - int, std::vector<gfx::Point>, int, bool, bool) +// TODO(port): Port these messages. +// +// This message requests that a drag be performed in window coordinate space +// Request: +// int - the handle of the window that's the context for this drag +// std::vector<gfx::Point> - the path of the drag in window coordinate +// space; it should have at least 2 points +// (start and end) +// int - the flags which identify the mouse button(s) for the drag, as +// defined in chrome/views/event.h +// Response: +// bool - true if the drag could be performed +IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_WindowDrag, + int, std::vector<gfx::Point>, int, bool, bool) #endif // defined(OS_WIN) - // Similar to AutomationMsg_InitialLoadsComplete, this indicates that the - // new tab ui has completed the initial load of its data. - // Time is how many milliseconds the load took. - IPC_MESSAGE_ROUTED1(AutomationMsg_InitialNewTabUILoadComplete, - int /* time */) - - // This message starts a find within a tab corresponding to the supplied - // tab handle. The return value contains the number of matches found on the - // page within the tab specified. The parameter 'search_string' specifies - // what string to search for, 'forward' specifies whether to search in - // forward direction (1=forward, 0=back), 'match_case' specifies case - // sensitivity - // (1=case sensitive, 0=case insensitive). If an error occurs, matches_found - // will be -1. - // - // NOTE: This message has been deprecated, please use the new message - // AutomationMsg_Find below. - // - IPC_SYNC_MESSAGE_ROUTED4_2(AutomationMsg_FindInPage, // DEPRECATED. - int, /* tab_handle */ - std::wstring, /* find_request */ - int, /* forward */ - int /* match_case */, - int /* active_ordinal */, - int /* matches_found */) - - // This message sends a inspect element request for a given tab. The response - // contains the number of resources loaded by the inspector controller. - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_InspectElement, - int, /* tab_handle */ - int, /* x */ - int /* y */, - int) - - // This message requests the process ID of the tab that corresponds - // to the given automation handle. - // The return value has an integer corresponding to the PID of the tab's - // renderer, 0 if the tab currently has no renderer process, or -1 on error. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_TabProcessID, - int /* tab_handle */, - int /* process ID */) - - // This tells the browser to enable or disable the filtered network layer. - IPC_MESSAGE_ROUTED1(AutomationMsg_SetFilteredInet, - bool /* enabled */) - - // Gets the directory that downloads will occur in for the active profile. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_DownloadDirectory, - int /* tab_handle */, - FilePath /* directory */) - - // This message requests the id of the view that has the focus in the - // specified window. If no view is focused, -1 is returned. Note that the - // window should either be a ViewWindow or a Browser. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GetFocusedViewID, - int /* view_handle */, - int /* focused_view_id */) - - // This message shows/hides the window. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_SetWindowVisible, - int /* view_handle */, - bool /* visible */, - bool /* success */) - - // Gets the active status of a window. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_IsWindowActive, - int /* view_handle */, - bool /* success */, - bool /* active */) - - // Makes the specified window the active window. - IPC_SYNC_MESSAGE_ROUTED1_0(AutomationMsg_ActivateWindow, - int /* view_handle */) - - // Opens a new browser window. - // TODO(sky): remove this and replace with OpenNewBrowserWindowOfType. - // Doing this requires updating the reference build. - IPC_SYNC_MESSAGE_ROUTED1_0(AutomationMsg_OpenNewBrowserWindow, - bool /* show */ ) - - // This message requests the handle (int64 app-unique identifier) of the - // current active top window. On error, the returned handle value is 0. - IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_ActiveWindow, int) - - // This message requests the browser associated with the specified window - // handle. - // The return value contains a success flag and the handle of the browser. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_BrowserForWindow, - int /* window handle */, - bool /* success flag */, - int /* browser handle */) - - // This message requests the window associated with the specified browser - // handle. - // The return value contains a success flag and the handle of the window. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_WindowForBrowser, - int /* browser handle */, - bool /* success flag */, - int /* window handle */) - - // This message requests the AutocompleteEdit associated with the specified - // browser handle. - // The return value contains a success flag and the handle of the omnibox. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_AutocompleteEditForBrowser, - int /* browser handle */, - bool /* success flag */, - int /* AutocompleteEdit handle */) +// Similar to AutomationMsg_InitialLoadsComplete, this indicates that the +// new tab ui has completed the initial load of its data. +// Time is how many milliseconds the load took. +IPC_MESSAGE_ROUTED1(AutomationMsg_InitialNewTabUILoadComplete, + int /* time */) + +// This message starts a find within a tab corresponding to the supplied +// tab handle. The return value contains the number of matches found on the +// page within the tab specified. The parameter 'search_string' specifies +// what string to search for, 'forward' specifies whether to search in +// forward direction (1=forward, 0=back), 'match_case' specifies case +// sensitivity +// (1=case sensitive, 0=case insensitive). If an error occurs, matches_found +// will be -1. +// +// NOTE: This message has been deprecated, please use the new message +// AutomationMsg_Find below. +// +IPC_SYNC_MESSAGE_ROUTED4_2(AutomationMsg_FindInPage, // DEPRECATED. + int, /* tab_handle */ + std::wstring, /* find_request */ + int, /* forward */ + int /* match_case */, + int /* active_ordinal */, + int /* matches_found */) + +// This message sends a inspect element request for a given tab. The response +// contains the number of resources loaded by the inspector controller. +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_InspectElement, + int, /* tab_handle */ + int, /* x */ + int /* y */, + int) + +// This message requests the process ID of the tab that corresponds +// to the given automation handle. +// The return value has an integer corresponding to the PID of the tab's +// renderer, 0 if the tab currently has no renderer process, or -1 on error. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_TabProcessID, + int /* tab_handle */, + int /* process ID */) + +// This tells the browser to enable or disable the filtered network layer. +IPC_MESSAGE_ROUTED1(AutomationMsg_SetFilteredInet, + bool /* enabled */) + +// Gets the directory that downloads will occur in for the active profile. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_DownloadDirectory, + int /* tab_handle */, + FilePath /* directory */) + +// This message requests the id of the view that has the focus in the +// specified window. If no view is focused, -1 is returned. Note that the +// window should either be a ViewWindow or a Browser. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GetFocusedViewID, + int /* view_handle */, + int /* focused_view_id */) + +// This message shows/hides the window. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_SetWindowVisible, + int /* view_handle */, + bool /* visible */, + bool /* success */) + +// Gets the active status of a window. +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_IsWindowActive, + int /* view_handle */, + bool /* success */, + bool /* active */) + +// Makes the specified window the active window. +IPC_SYNC_MESSAGE_ROUTED1_0(AutomationMsg_ActivateWindow, + int /* view_handle */) + +// Opens a new browser window. +// TODO(sky): remove this and replace with OpenNewBrowserWindowOfType. +// Doing this requires updating the reference build. +IPC_SYNC_MESSAGE_ROUTED1_0(AutomationMsg_OpenNewBrowserWindow, + bool /* show */ ) + +// This message requests the handle (int64 app-unique identifier) of the +// current active top window. On error, the returned handle value is 0. +IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_ActiveWindow, int) + +// This message requests the browser associated with the specified window +// handle. +// The return value contains a success flag and the handle of the browser. +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_BrowserForWindow, + int /* window handle */, + bool /* success flag */, + int /* browser handle */) + +// This message requests the window associated with the specified browser +// handle. +// The return value contains a success flag and the handle of the window. +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_WindowForBrowser, + int /* browser handle */, + bool /* success flag */, + int /* window handle */) + +// This message requests the AutocompleteEdit associated with the specified +// browser handle. +// The return value contains a success flag and the handle of the omnibox. +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_AutocompleteEditForBrowser, + int /* browser handle */, + bool /* success flag */, + int /* AutocompleteEdit handle */) + +// This message requests that a mouse click be performed in window coordinate +// space. +// Request: +// int - the handle of the window that's the context for this click +// gfx::Point - the point to click +// int - the flags which identify the mouse button(s) for the click, as +// defined in chrome/views/event.h +IPC_MESSAGE_ROUTED3(AutomationMsg_WindowClick, int, gfx::Point, int) + +// This message requests that a key press be performed. +// Request: +// int - the handle of the window that's the context for this click +// int - the app::KeyboardCode of the key that was pressed. +// int - the flags which identify the modifiers (shift, ctrl, alt) +// associated for, as defined in chrome/views/event.h +IPC_MESSAGE_ROUTED3(AutomationMsg_WindowKeyPress, int, int, int) + +// This message notifies the AutomationProvider to create a tab which is +// hosted by an external process. +// Request: +// ExternalTabSettings - settings for external tab +IPC_SYNC_MESSAGE_ROUTED1_4(AutomationMsg_CreateExternalTab, + IPC::ExternalTabSettings /* settings*/, + gfx::NativeWindow /* Tab container window */, + gfx::NativeWindow /* Tab window */, + int /* Handle to the new tab */, + int /* Session Id of the new tab */) + +// This message notifies the AutomationProvider to navigate to a specified +// url in the external tab with given handle. The first parameter is the +// handle to the tab resource. The second parameter is the target url. +// The third parameter is the referrer. +// The return value contains a status code which is nonnegative on success. +// see AutomationMsg_NavigationResponseValues for the navigation response. +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_NavigateInExternalTab, + int, + GURL, + GURL, + AutomationMsg_NavigationResponseValues) + +// This message is an outgoing message from Chrome to an external host. +// It is a notification that the NavigationState was changed +// Request: +// -int: The flags specifying what changed +// (see TabContents::InvalidateTypes) +// Response: +// None expected +IPC_MESSAGE_ROUTED3(AutomationMsg_NavigationStateChanged, + int, // tab handle + int, // TabContents::InvalidateTypes + IPC::NavigationInfo) // title, url etc. + +// This message is an outgoing message from Chrome to an external host. +// It is a notification that the target URL has changed (the target URL +// is the URL of the link that the user is hovering on) +// Request: +// -int: The tab handle +// -std::wstring: The new target URL +// Response: +// None expected +IPC_MESSAGE_ROUTED2(AutomationMsg_UpdateTargetUrl, int, std::wstring) + +// This message notifies the AutomationProvider to show the specified html +// text in an interstitial page in the tab with given handle. The first +// parameter is the handle to the tab resource. The second parameter is the +// html text to be displayed. +// The return value contains a success flag. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_ShowInterstitialPage, + int, + std::string, + AutomationMsg_NavigationResponseValues) + +// This message notifies the AutomationProvider to hide the current +// interstitial page in the tab with given handle. The parameter is the +// handle to the tab resource. +// The return value contains a success flag. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_HideInterstitialPage, int, + bool) + +// This message requests that a tab be closed. +// Request: +// - int: handle of the tab to close +// - bool: if true the proxy blocks until the tab has completely closed, +// otherwise the proxy only blocks until it initiates the close. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_CloseTab, int, bool, bool) + +// This message requests that the browser be closed. +// Request: +// - int: handle of the browser which contains the tab +// Response: +// - bool: whether the operation was successfull. +// - bool: whether the browser process will be terminated as a result (if +// this was the last closed browser window). +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_CloseBrowser, int, bool, + bool) + +IPC_MESSAGE_ROUTED1(AutomationMsg_CloseBrowserRequestAsync, int) + +// Unused. +// Response: +// None expected +IPC_MESSAGE_ROUTED1(AutomationMsg_Unused, int) #if defined(OS_WIN) - // TODO(estade): This message is defined later on for Mac and Linux. This is - // to avoid adding a new IPC in the middle for those platforms (see comment - // at top). The message is exactly the same, so they should be remerged when - // all messages in this file have been made cross-platform (at which point we - // will need to check in new reference builds). - // - // This message requests that a mouse click be performed in window coordinate - // space. - // Request: - // int - the handle of the window that's the context for this click - // gfx::Point - the point to click - // int - the flags which identify the mouse button(s) for the click, as - // defined in chrome/views/event.h - IPC_MESSAGE_ROUTED3(AutomationMsg_WindowClick, int, gfx::Point, int) +// TODO(port): Port these messages. +// +// This message is an outgoing message from Chrome to an external host. +// It is a request to process a keyboard accelerator. +// Request: +// -int: Tab handle +// -MSG: The keyboard message +// Response: +// None expected +// TODO(sanjeevr): Ideally we need to add a response from the external +// host saying whether it processed the accelerator +IPC_MESSAGE_ROUTED2(AutomationMsg_HandleAccelerator, int, MSG) + +// This message is sent by the container of an externally hosted tab to +// reflect any accelerator keys that it did not process. This gives the +// tab a chance to handle the keys +// Request: +// - int: handle of the tab +// -MSG: The keyboard message that the container did not handle +// Response: +// None expected +IPC_MESSAGE_ROUTED2(AutomationMsg_ProcessUnhandledAccelerator, int, MSG) #endif // defined(OS_WIN) - // This message requests that a key press be performed. - // Request: - // int - the handle of the window that's the context for this click - // int - the app::KeyboardCode of the key that was pressed. - // int - the flags which identify the modifiers (shift, ctrl, alt) - // associated for, as defined in chrome/views/event.h - IPC_MESSAGE_ROUTED3(AutomationMsg_WindowKeyPress, int, int, int) - - // This message notifies the AutomationProvider to create a tab which is - // hosted by an external process. - // Request: - // ExternalTabSettings - settings for external tab - IPC_SYNC_MESSAGE_ROUTED1_4(AutomationMsg_CreateExternalTab, - IPC::ExternalTabSettings /* settings*/, - gfx::NativeWindow /* Tab container window */, - gfx::NativeWindow /* Tab window */, - int /* Handle to the new tab */, - int /* Session Id of the new tab */) - - // This message notifies the AutomationProvider to navigate to a specified - // url in the external tab with given handle. The first parameter is the - // handle to the tab resource. The second parameter is the target url. - // The third parameter is the referrer. - // The return value contains a status code which is nonnegative on success. - // see AutomationMsg_NavigationResponseValues for the navigation response. - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_NavigateInExternalTab, - int, - GURL, - GURL, - AutomationMsg_NavigationResponseValues) - - // This message is an outgoing message from Chrome to an external host. - // It is a notification that the NavigationState was changed - // Request: - // -int: The flags specifying what changed - // (see TabContents::InvalidateTypes) - // Response: - // None expected - IPC_MESSAGE_ROUTED3(AutomationMsg_NavigationStateChanged, - int, // tab handle - int, // TabContents::InvalidateTypes - IPC::NavigationInfo) // title, url etc. - - // This message is an outgoing message from Chrome to an external host. - // It is a notification that the target URL has changed (the target URL - // is the URL of the link that the user is hovering on) - // Request: - // -int: The tab handle - // -std::wstring: The new target URL - // Response: - // None expected - IPC_MESSAGE_ROUTED2(AutomationMsg_UpdateTargetUrl, int, std::wstring) - - // This message notifies the AutomationProvider to show the specified html - // text in an interstitial page in the tab with given handle. The first - // parameter is the handle to the tab resource. The second parameter is the - // html text to be displayed. - // The return value contains a success flag. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_ShowInterstitialPage, - int, - std::string, - AutomationMsg_NavigationResponseValues) - - // This message notifies the AutomationProvider to hide the current - // interstitial page in the tab with given handle. The parameter is the - // handle to the tab resource. - // The return value contains a success flag. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_HideInterstitialPage, int, - bool) - - // This message requests that a tab be closed. - // Request: - // - int: handle of the tab to close - // - bool: if true the proxy blocks until the tab has completely closed, - // otherwise the proxy only blocks until it initiates the close. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_CloseTab, int, bool, bool) - - // This message requests that the browser be closed. - // Request: - // - int: handle of the browser which contains the tab - // Response: - // - bool: whether the operation was successfull. - // - bool: whether the browser process will be terminated as a result (if - // this was the last closed browser window). - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_CloseBrowser, int, bool, - bool) - - IPC_MESSAGE_ROUTED1(AutomationMsg_CloseBrowserRequestAsync, int) - - // Unused. - // Response: - // None expected - IPC_MESSAGE_ROUTED1(AutomationMsg_Unused, int) +// Sent by the external tab to the host to notify that the user has tabbed +// out of the tab. +// Request: +// - int: Tab handle +// - bool: |reverse| set to true when shift-tabbing out of the tab, false +// otherwise. +// Response: +// None expected +IPC_MESSAGE_ROUTED2(AutomationMsg_TabbedOut, int, bool) + +// Sent by the external tab host to ask focus to be set to either the first +// or last element on the page. +// Request: +// - int: handle of the tab +// - bool: |reverse| +// true: Focus will be set to the last focusable element +// false: Focus will be set to the first focusable element +// - bool: |restore_focus_to_view| +// true: The renderer view associated with the current tab will be +// infomed that it is receiving focus. +// Response: +// None expected +IPC_MESSAGE_ROUTED3(AutomationMsg_SetInitialFocus, int, bool, bool) + +// This message is an outgoing message from Chrome to an external host. +// It is a request to open a url +// Request: +// -int: Tab handle +// -GURL: The URL to open +// -GURL: The referrer +// -int: The WindowOpenDisposition that specifies where the URL should +// be opened (new tab, new window etc). +// Response: +// None expected +IPC_MESSAGE_ROUTED4(AutomationMsg_OpenURL, int, GURL, GURL, int) + +// This message requests the provider to wait until the specified tab has +// finished restoring after session restore. +// Request: +// - int: handle of the tab +// Response: +// - bool: whether the operation was successful. +IPC_SYNC_MESSAGE_ROUTED1_0(AutomationMsg_WaitForTabToBeRestored, int) + +// This message is an outgoing message from Chrome to an external host. +// It is a notification that a navigation happened +// Request: +// -int: Tab handle +// +// Response: +// None expected +IPC_MESSAGE_ROUTED2(AutomationMsg_DidNavigate, int, IPC::NavigationInfo) + +// This message requests the different security states of the page displayed +// in the specified tab. +// Request: +// - int: handle of the tab +// Response: +// - bool: whether the operation was successful. +// - SecurityStyle: the security style of the tab. +// - int: the status of the server's ssl cert (0 means no errors or no ssl +// was used). +// - int: the insecure content state, 0 means no insecure contents. + +IPC_SYNC_MESSAGE_ROUTED1_4(AutomationMsg_GetSecurityState, + int, + bool, + SecurityStyle, + int, + int) + +// This message requests the page type of the page displayed in the specified +// tab (normal, error or interstitial). +// Request: +// - int: handle of the tab +// Response: +// - bool: whether the operation was successful. +// - PageType: the type of the page currently displayed. +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_GetPageType, int, bool, PageType) + +// This message simulates the user action on the SSL blocking page showing in +// the specified tab. This message is only effective if an interstitial page +// is showing in the tab. +// Request: +// - int: handle of the tab +// - bool: whether to proceed or abort the navigation +// Response: +// - AutomationMsg_NavigationResponseValues: result of the operation. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_ActionOnSSLBlockingPage, int, bool, + AutomationMsg_NavigationResponseValues) + +// Message to request that a browser window is brought to the front and +// activated. +// Request: +// - int: handle of the browser window. +// Response: +// - bool: True if the browser is brought to the front. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_BringBrowserToFront, int, bool) + +// Message to request whether a certain item is enabled of disabled in the +// menu in the browser window +// +// Request: +// - int: handle of the browser window. +// - int: IDC message identifier to query if enabled +// Response: +// - bool: True if the command is enabled on the menu +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_IsMenuCommandEnabled, int, int, bool) + +// This message notifies the AutomationProvider to print the tab with given +// handle. The first parameter is the handle to the tab resource. The +// return value contains a bool which is true on success. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_PrintNow, int, bool) + +// This message notifies the AutomationProvider to reload the current page in +// the tab with given handle. The first parameter is the handle to the tab +// resource. The return value contains a status code which is nonnegative on +// success. +// see AutomationMsg_NavigationResponseValues for the navigation response. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_Reload, int, + AutomationMsg_NavigationResponseValues) + +// This message requests the handle (int64 app-unique identifier) of the +// last active browser window, or the browser at index 0 if there is no last +// active browser, or it no longer exists. Returns 0 if no browser windows +// exist. +IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_LastActiveBrowserWindow, int) + +// This message notifies the AutomationProvider to save the page with given +// handle. The first parameter is the handle to the tab resource. The second +// parameter is the main HTML file name. The third parameter is the directory +// for saving resources. The fourth parameter is the saving type: 0 for HTML +// only; 1 for complete web page. +// The return value contains a bool which is true on success. +IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_SavePage, int, FilePath, FilePath, + int, bool) + +// This message requests the text currently being displayed in the +// AutocompleteEdit. The parameter is the handle to the AutocompleteEdit. +// The return value is a string indicating the text in the AutocompleteEdit. +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_AutocompleteEditGetText, + int /* autocomplete edit handle */, + bool /* the requested autocomplete edit exists */, + std::wstring /* omnibox text */) + +// This message sets the text being displayed in the AutocompleteEdit. The +// first parameter is the handle to the omnibox and the second parameter is +// the text to be displayed in the AutocompleteEdit. +// The return value has no parameters and is returned when the operation has +// completed. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_AutocompleteEditSetText, + int /* autocomplete edit handle */, + std::wstring /* text to set */, + bool /* the requested autocomplete edit exists */) + +// This message requests if a query to a autocomplete provider is still in +// progress. The first parameter in the request is the handle to the +// autocomplete edit. +// The first return value indicates if the request succeeded. +// The second return value indicates if a query is still in progress. +IPC_SYNC_MESSAGE_ROUTED1_2( \ + AutomationMsg_AutocompleteEditIsQueryInProgress, + int /* autocomplete edit handle*/, + bool /* the requested autocomplete edit exists */, + bool /* indicates if a query is in progress */) + +// This message requests a list of the autocomplete messages currently being +// displayed by the popup. The parameter in the request is a handle to the +// autocomplete edit. +// The first return value indicates if the request was successful, while +// while the second is the actual list of matches. +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_AutocompleteEditGetMatches, + int /* autocomplete edit handle*/, + bool /* the requested autocomplete edit exists */, + std::vector<AutocompleteMatchData> /* matches */) + +// This message requests the execution of a browser command in the browser +// for which the handle is specified. +// The return value contains a boolean, whether the command was dispatched. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WindowExecuteCommandAsync, + int /* automation handle */, + int /* browser command */, + bool /* success flag */) + +// This message requests the execution of a browser command in the browser +// for which the handle is specified. +// The return value contains a boolean, whether the command was dispatched +// and successful executed. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WindowExecuteCommand, + int /* automation handle */, + int /* browser command */, + bool /* success flag */) + + +// This message opens the Find window within a tab corresponding to the +// supplied tab handle. +IPC_MESSAGE_ROUTED1(AutomationMsg_OpenFindInPage, + int /* tab_handle */) + +// Posts a message from external host to chrome renderer. +IPC_MESSAGE_ROUTED4(AutomationMsg_HandleMessageFromExternalHost, + int /* automation handle */, + std::string /* message */, + std::string /* origin */, + std::string /* target */) + +// A message for an external host. +IPC_MESSAGE_ROUTED4(AutomationMsg_ForwardMessageToExternalHost, + int, /* handle */ + std::string /* message */, + std::string /* origin */, + std::string /* target */) + +// This message starts a find within a tab corresponding to the supplied +// tab handle. The parameter |request| specifies what to search for. +// If an error occurs, |matches_found| will be -1. +// +IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_Find, + int /* tab_handle */, + AutomationMsg_Find_Params /* params */, + int /* active_ordinal */, + int /* matches_found */) + +// Is the Find window fully visible (and not animating) for the specified +// tab? +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_FindWindowVisibility, + int /* tab_handle */, + bool /* is_visible */) + +// Where is the Find window located. |x| and |y| will be -1, -1 on failure. +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_FindWindowLocation, + int /* tab_handle */, + int /* x */, + int /* y */) + +// Is the Bookmark bar visible? The return value will indicate whether it is +// visible or not and whether it is being animated into (or out of its place). +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_BookmarkBarVisibility, + int /* browser_handle */, + bool, /* is_visible */ + bool /* still_animating */) + +// This message requests the number of related info bars opened. It +// returns -1 if an error occurred. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GetInfoBarCount, + int /* tab_handle */, + int /* info bar count */) + +// This message triggers the action associated with the "accept" button in +// the info-bar at the specified index. If |wait for navigation| is true, it +// won't return until a navigation has occurred. +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_ClickInfoBarAccept, + int /* tab_handle */, + int /* info bar index */, + bool /* wait for navigation */, + + /* navigation result */ + AutomationMsg_NavigationResponseValues) + +// This message retrieves the last time a navigation occurred in the specified +// tab. The value is intended to be used with WaitForNavigation. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GetLastNavigationTime, + int /* tab_handle */, + int64 /* last navigation time */) + +// This messages is used to block until a new navigation occurs (if there is +// none more recent then the time specified). +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WaitForNavigation, + int /* tab_handle */, + int64 /* last navigation time */, + + /* navigation result */ + AutomationMsg_NavigationResponseValues) + +// This messages sets an int-value preference. +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetIntPreference, + int /* browser handle */, + std::string /* pref name */, + int /* value */, + bool /* success */) + +// Queries whether an app modal dialog is currently being shown. (i.e. a +// javascript alert) and which buttons it contains. +IPC_SYNC_MESSAGE_ROUTED0_2(AutomationMsg_ShowingAppModalDialog, + bool /* showing dialog */, + int /* view::DelegateDialog::DialogButton */) + +// This message triggers the specified button for the currently showing +// modal dialog. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ClickAppModalDialogButton, + int /* view::DelegateDialog::DialogButton */, + bool /* success */) + +// This messages sets a string-value preference. +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetStringPreference, + int /* browser handle */, + std::string /* pref name */, + std::string /* pref value */, + bool) + +// This messages gets a boolean-value preference. +IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_GetBooleanPreference, + int /* browser handle */, + std::string /* pref name */, + bool /* success */, + bool /* pref value */) + +// This messages sets a boolean-value preference. +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetBooleanPreference, + int /* browser handle */, + std::string /* pref name */, + bool /* pref value */, + bool /* success */) + +// Queries the current used encoding name of the page in the specified +// web content tab. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GetPageCurrentEncoding, + int /* tab handle */, + std::string /* current used encoding name */) + +// Uses the specified encoding to override the encoding of the page in the +// specified web content tab. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_OverrideEncoding, + int /* tab handle */, + std::string /* overrided encoding name */, + bool /* success */) + +// Used to disable the dialog box that prompts the user for a path when +// saving a web page. +IPC_SYNC_MESSAGE_ROUTED1_0(AutomationMsg_SavePackageShouldPromptUser, + bool /* false if we want to not show the dialog */) + +// This message is an outgoing message from Chrome to an external host. +// It is a notification that a navigation failed +// Request: +// -int : Tab handle +// -int : The status code. +// -GURL: The URL we failed to navigate to. +// Response: +// None expected +IPC_MESSAGE_ROUTED3(AutomationMsg_NavigationFailed, int, int, GURL) #if defined(OS_WIN) - // TODO(port): Port these messages. - // - // This message is an outgoing message from Chrome to an external host. - // It is a request to process a keyboard accelerator. - // Request: - // -int: Tab handle - // -MSG: The keyboard message - // Response: - // None expected - // TODO(sanjeevr): Ideally we need to add a response from the external - // host saying whether it processed the accelerator - IPC_MESSAGE_ROUTED2(AutomationMsg_HandleAccelerator, int, MSG) - - // This message is sent by the container of an externally hosted tab to - // reflect any accelerator keys that it did not process. This gives the - // tab a chance to handle the keys - // Request: - // - int: handle of the tab - // -MSG: The keyboard message that the container did not handle - // Response: - // None expected - IPC_MESSAGE_ROUTED2(AutomationMsg_ProcessUnhandledAccelerator, int, MSG) +// This message is an outgoing message from an automation client to Chrome. +// It is used to reposition a chrome tab window. +IPC_MESSAGE_ROUTED2(AutomationMsg_TabReposition, + int /* tab handle */, + IPC::Reposition_Params /* SetWindowPos params */) #endif // defined(OS_WIN) - // Sent by the external tab to the host to notify that the user has tabbed - // out of the tab. - // Request: - // - int: Tab handle - // - bool: |reverse| set to true when shift-tabbing out of the tab, false - // otherwise. - // Response: - // None expected - IPC_MESSAGE_ROUTED2(AutomationMsg_TabbedOut, int, bool) - - // Sent by the external tab host to ask focus to be set to either the first - // or last element on the page. - // Request: - // - int: handle of the tab - // - bool: |reverse| - // true: Focus will be set to the last focusable element - // false: Focus will be set to the first focusable element - // - bool: |restore_focus_to_view| - // true: The renderer view associated with the current tab will be - // infomed that it is receiving focus. - // Response: - // None expected - IPC_MESSAGE_ROUTED3(AutomationMsg_SetInitialFocus, int, bool, bool) - - // This message is an outgoing message from Chrome to an external host. - // It is a request to open a url - // Request: - // -int: Tab handle - // -GURL: The URL to open - // -GURL: The referrer - // -int: The WindowOpenDisposition that specifies where the URL should - // be opened (new tab, new window etc). - // Response: - // None expected - IPC_MESSAGE_ROUTED4(AutomationMsg_OpenURL, int, GURL, GURL, int) - - // This message requests the provider to wait until the specified tab has - // finished restoring after session restore. - // Request: - // - int: handle of the tab - // Response: - // - bool: whether the operation was successful. - IPC_SYNC_MESSAGE_ROUTED1_0(AutomationMsg_WaitForTabToBeRestored, int) - - // This message is an outgoing message from Chrome to an external host. - // It is a notification that a navigation happened - // Request: - // -int: Tab handle - // - // Response: - // None expected - IPC_MESSAGE_ROUTED2(AutomationMsg_DidNavigate, int, IPC::NavigationInfo) - - // This message requests the different security states of the page displayed - // in the specified tab. - // Request: - // - int: handle of the tab - // Response: - // - bool: whether the operation was successful. - // - SecurityStyle: the security style of the tab. - // - int: the status of the server's ssl cert (0 means no errors or no ssl - // was used). - // - int: the insecure content state, 0 means no insecure contents. - - IPC_SYNC_MESSAGE_ROUTED1_4(AutomationMsg_GetSecurityState, - int, - bool, - SecurityStyle, - int, - int) - - // This message requests the page type of the page displayed in the specified - // tab (normal, error or interstitial). - // Request: - // - int: handle of the tab - // Response: - // - bool: whether the operation was successful. - // - PageType: the type of the page currently displayed. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_GetPageType, int, bool, PageType) - - // This message simulates the user action on the SSL blocking page showing in - // the specified tab. This message is only effective if an interstitial page - // is showing in the tab. - // Request: - // - int: handle of the tab - // - bool: whether to proceed or abort the navigation - // Response: - // - AutomationMsg_NavigationResponseValues: result of the operation. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_ActionOnSSLBlockingPage, int, bool, - AutomationMsg_NavigationResponseValues) - - // Message to request that a browser window is brought to the front and - // activated. - // Request: - // - int: handle of the browser window. - // Response: - // - bool: True if the browser is brought to the front. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_BringBrowserToFront, int, bool) - - // Message to request whether a certain item is enabled of disabled in the - // menu in the browser window - // - // Request: - // - int: handle of the browser window. - // - int: IDC message identifier to query if enabled - // Response: - // - bool: True if the command is enabled on the menu - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_IsMenuCommandEnabled, int, int, bool) - - // This message notifies the AutomationProvider to print the tab with given - // handle. The first parameter is the handle to the tab resource. The - // return value contains a bool which is true on success. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_PrintNow, int, bool) - - // This message notifies the AutomationProvider to reload the current page in - // the tab with given handle. The first parameter is the handle to the tab - // resource. The return value contains a status code which is nonnegative on - // success. - // see AutomationMsg_NavigationResponseValues for the navigation response. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_Reload, int, - AutomationMsg_NavigationResponseValues) - - // This message requests the handle (int64 app-unique identifier) of the - // last active browser window, or the browser at index 0 if there is no last - // active browser, or it no longer exists. Returns 0 if no browser windows - // exist. - IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_LastActiveBrowserWindow, int) - - // This message notifies the AutomationProvider to save the page with given - // handle. The first parameter is the handle to the tab resource. The second - // parameter is the main HTML file name. The third parameter is the directory - // for saving resources. The fourth parameter is the saving type: 0 for HTML - // only; 1 for complete web page. - // The return value contains a bool which is true on success. - IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_SavePage, int, FilePath, FilePath, - int, bool) - - // This message requests the text currently being displayed in the - // AutocompleteEdit. The parameter is the handle to the AutocompleteEdit. - // The return value is a string indicating the text in the AutocompleteEdit. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_AutocompleteEditGetText, - int /* autocomplete edit handle */, - bool /* the requested autocomplete edit exists */, - std::wstring /* omnibox text */) - - // This message sets the text being displayed in the AutocompleteEdit. The - // first parameter is the handle to the omnibox and the second parameter is - // the text to be displayed in the AutocompleteEdit. - // The return value has no parameters and is returned when the operation has - // completed. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_AutocompleteEditSetText, - int /* autocomplete edit handle */, - std::wstring /* text to set */, - bool /* the requested autocomplete edit exists */) - - // This message requests if a query to a autocomplete provider is still in - // progress. The first parameter in the request is the handle to the - // autocomplete edit. - // The first return value indicates if the request succeeded. - // The second return value indicates if a query is still in progress. - IPC_SYNC_MESSAGE_ROUTED1_2( \ - AutomationMsg_AutocompleteEditIsQueryInProgress, - int /* autocomplete edit handle*/, - bool /* the requested autocomplete edit exists */, - bool /* indicates if a query is in progress */) - - // This message requests a list of the autocomplete messages currently being - // displayed by the popup. The parameter in the request is a handle to the - // autocomplete edit. - // The first return value indicates if the request was successful, while - // while the second is the actual list of matches. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_AutocompleteEditGetMatches, - int /* autocomplete edit handle*/, - bool /* the requested autocomplete edit exists */, - std::vector<AutocompleteMatchData> /* matches */) - - // This message requests the execution of a browser command in the browser - // for which the handle is specified. - // The return value contains a boolean, whether the command was dispatched. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WindowExecuteCommandAsync, - int /* automation handle */, - int /* browser command */, - bool /* success flag */) - - // This message requests the execution of a browser command in the browser - // for which the handle is specified. - // The return value contains a boolean, whether the command was dispatched - // and successful executed. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WindowExecuteCommand, - int /* automation handle */, - int /* browser command */, - bool /* success flag */) - - - // This message opens the Find window within a tab corresponding to the - // supplied tab handle. - IPC_MESSAGE_ROUTED1(AutomationMsg_OpenFindInPage, - int /* tab_handle */) - - // Posts a message from external host to chrome renderer. - IPC_MESSAGE_ROUTED4(AutomationMsg_HandleMessageFromExternalHost, - int /* automation handle */, - std::string /* message */, - std::string /* origin */, - std::string /* target */) - - // A message for an external host. - IPC_MESSAGE_ROUTED4(AutomationMsg_ForwardMessageToExternalHost, - int, /* handle */ - std::string /* message */, - std::string /* origin */, - std::string /* target */) - - // This message starts a find within a tab corresponding to the supplied - // tab handle. The parameter |request| specifies what to search for. - // If an error occurs, |matches_found| will be -1. - // - IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_Find, - int /* tab_handle */, - AutomationMsg_Find_Params /* params */, - int /* active_ordinal */, - int /* matches_found */) - - // Is the Find window fully visible (and not animating) for the specified - // tab? - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_FindWindowVisibility, - int /* tab_handle */, - bool /* is_visible */) - - // Where is the Find window located. |x| and |y| will be -1, -1 on failure. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_FindWindowLocation, - int /* tab_handle */, - int /* x */, - int /* y */) - - // Is the Bookmark bar visible? The return value will indicate whether it is - // visible or not and whether it is being animated into (or out of its place). - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_BookmarkBarVisibility, - int /* browser_handle */, - bool, /* is_visible */ - bool /* still_animating */) - - // This message requests the number of related info bars opened. It - // returns -1 if an error occurred. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GetInfoBarCount, - int /* tab_handle */, - int /* info bar count */) - - // This message triggers the action associated with the "accept" button in - // the info-bar at the specified index. If |wait for navigation| is true, it - // won't return until a navigation has occurred. - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_ClickInfoBarAccept, - int /* tab_handle */, - int /* info bar index */, - bool /* wait for navigation */, - - /* navigation result */ - AutomationMsg_NavigationResponseValues) - - // This message retrieves the last time a navigation occurred in the specified - // tab. The value is intended to be used with WaitForNavigation. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GetLastNavigationTime, - int /* tab_handle */, - int64 /* last navigation time */) - - // This messages is used to block until a new navigation occurs (if there is - // none more recent then the time specified). - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WaitForNavigation, - int /* tab_handle */, - int64 /* last navigation time */, - - /* navigation result */ - AutomationMsg_NavigationResponseValues) - - // This messages sets an int-value preference. - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetIntPreference, - int /* browser handle */, - std::string /* pref name */, - int /* value */, - bool /* success */) - - // Queries whether an app modal dialog is currently being shown. (i.e. a - // javascript alert) and which buttons it contains. - IPC_SYNC_MESSAGE_ROUTED0_2(AutomationMsg_ShowingAppModalDialog, - bool /* showing dialog */, - int /* view::DelegateDialog::DialogButton */) - - // This message triggers the specified button for the currently showing - // modal dialog. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ClickAppModalDialogButton, - int /* view::DelegateDialog::DialogButton */, - bool /* success */) - - // This messages sets a string-value preference. - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetStringPreference, - int /* browser handle */, - std::string /* pref name */, - std::string /* pref value */, - bool) - - // This messages gets a boolean-value preference. - IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_GetBooleanPreference, - int /* browser handle */, - std::string /* pref name */, - bool /* success */, - bool /* pref value */) - - // This messages sets a boolean-value preference. - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetBooleanPreference, - int /* browser handle */, - std::string /* pref name */, - bool /* pref value */, - bool /* success */) - - // Queries the current used encoding name of the page in the specified - // web content tab. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GetPageCurrentEncoding, - int /* tab handle */, - std::string /* current used encoding name */) - - // Uses the specified encoding to override the encoding of the page in the - // specified web content tab. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_OverrideEncoding, - int /* tab handle */, - std::string /* overrided encoding name */, - bool /* success */) - - // Used to disable the dialog box that prompts the user for a path when - // saving a web page. - IPC_SYNC_MESSAGE_ROUTED1_0(AutomationMsg_SavePackageShouldPromptUser, - bool /* false if we want to not show the dialog */) - - // This message is an outgoing message from Chrome to an external host. - // It is a notification that a navigation failed - // Request: - // -int : Tab handle - // -int : The status code. - // -GURL: The URL we failed to navigate to. - // Response: - // None expected - IPC_MESSAGE_ROUTED3(AutomationMsg_NavigationFailed, int, int, GURL) +// Gets the title of the top level browser window. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_WindowTitle, + int /* automation handle */, + string16 /* title text */ ) + +// Tab load complete +IPC_MESSAGE_ROUTED2(AutomationMsg_TabLoaded, + int, // tab handle + GURL) + +// This message requests the tabstrip index of the tab with the given handle. +// The return value contains the index, which will be -1 on failure. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_TabIndex, int, int) + +// This message requests the handle (int64 app-unique identifier) of +// a valid normal browser window, i.e. normal type and non-incognito mode. +// On error, the returned handle value is 0. +IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_FindNormalBrowserWindow, int) + +// This message requests the number of normal browser windows, i.e. normal +// type and non-incognito mode that the app currently has open. The return +// value is the number of windows. +IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_NormalBrowserWindowCount, int) + +// Used to put the browser into "extension automation mode" for a given +// set of Chrome Extensions API functions for the current profile, or turn +// off automation mode. The specified tab is used as the conduit for all +// automated API functions. It must be an external tab (as in +// AutomationMsg_CreateExternalTab). +IPC_MESSAGE_ROUTED2(AutomationMsg_SetEnableExtensionAutomation, + // Tab handle. + int, + // Empty to disable automation, non-empty to enable + // automation of the specified API functions, single + // entry of "*" to enable automation of all API + // functions. + std::vector<std::string>) + +// This message tells the browser to start using the new proxy configuration +// represented by the given JSON string. The parameters used in the JSON +// string are defined in automation_constants.h. +IPC_MESSAGE_ROUTED1(AutomationMsg_SetProxyConfig, + std::string /* proxy_config_json_string */) + +// Sets Download Shelf visibility for the specified browser. +IPC_SYNC_MESSAGE_ROUTED2_0(AutomationMsg_SetShelfVisibility, + int /* browser_handle */, + bool /* is_visible */) + +// This message requests the number of blocked popups in a certain tab with +// the given handle. The return value is the number of blocked popups, or -1 +// if this request failed. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_BlockedPopupCount, + int /* tab_handle */, + int /* blocked_popup_count */) + +// This message retrieves the locale of the browser process. On success +// |chrome_locale| will contain the locale as reported by ICU. On failure +// |chrome_locale| is the empty string. +IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_GetBrowserLocale, + string16 /* chrome_locale */) #if defined(OS_WIN) - // This message is an outgoing message from an automation client to Chrome. - // It is used to reposition a chrome tab window. - IPC_MESSAGE_ROUTED2(AutomationMsg_TabReposition, - int /* tab handle */, - IPC::Reposition_Params /* SetWindowPos params */) -#endif // defined(OS_WIN) - - // Gets the title of the top level browser window. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_WindowTitle, - int /* automation handle */, - string16 /* title text */ ) - - // Tab load complete - IPC_MESSAGE_ROUTED2(AutomationMsg_TabLoaded, - int, // tab handle - GURL) - - // This message requests the tabstrip index of the tab with the given handle. - // The return value contains the index, which will be -1 on failure. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_TabIndex, int, int) - - // This message requests the handle (int64 app-unique identifier) of - // a valid normal browser window, i.e. normal type and non-incognito mode. - // On error, the returned handle value is 0. - IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_FindNormalBrowserWindow, int) - - // This message requests the number of normal browser windows, i.e. normal - // type and non-incognito mode that the app currently has open. The return - // value is the number of windows. - IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_NormalBrowserWindowCount, int) - - // Used to put the browser into "extension automation mode" for a given - // set of Chrome Extensions API functions for the current profile, or turn - // off automation mode. The specified tab is used as the conduit for all - // automated API functions. It must be an external tab (as in - // AutomationMsg_CreateExternalTab). - IPC_MESSAGE_ROUTED2(AutomationMsg_SetEnableExtensionAutomation, - // Tab handle. - int, - // Empty to disable automation, non-empty to enable - // automation of the specified API functions, single - // entry of "*" to enable automation of all API - // functions. - std::vector<std::string>) - - // This message tells the browser to start using the new proxy configuration - // represented by the given JSON string. The parameters used in the JSON - // string are defined in automation_constants.h. - IPC_MESSAGE_ROUTED1(AutomationMsg_SetProxyConfig, - std::string /* proxy_config_json_string */) - - // Sets Download Shelf visibility for the specified browser. - IPC_SYNC_MESSAGE_ROUTED2_0(AutomationMsg_SetShelfVisibility, - int /* browser_handle */, - bool /* is_visible */) - - // This message requests the number of blocked popups in a certain tab with - // the given handle. The return value is the number of blocked popups, or -1 - // if this request failed. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_BlockedPopupCount, - int /* tab_handle */, - int /* blocked_popup_count */) - - // This message retrieves the locale of the browser process. On success - // |chrome_locale| will contain the locale as reported by ICU. On failure - // |chrome_locale| is the empty string. - IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_GetBrowserLocale, - string16 /* chrome_locale */) - -#if defined(OS_WIN) - IPC_MESSAGE_ROUTED4(AutomationMsg_ForwardContextMenuToExternalHost, - int /* tab_handle */, - HANDLE /* source menu handle */, - int /* align flags */, - IPC::MiniContextMenuParams /* params */) - - IPC_MESSAGE_ROUTED2(AutomationMsg_ForwardContextMenuCommandToChrome, - int /* tab_handle */, - int /* selected_command */) +IPC_MESSAGE_ROUTED4(AutomationMsg_ForwardContextMenuToExternalHost, + int /* tab_handle */, + HANDLE /* source menu handle */, + int /* align flags */, + IPC::MiniContextMenuParams /* params */) + +IPC_MESSAGE_ROUTED2(AutomationMsg_ForwardContextMenuCommandToChrome, + int /* tab_handle */, + int /* selected_command */) #endif // OS_WIN - // A URL request to be fetched via automation - IPC_MESSAGE_ROUTED3(AutomationMsg_RequestStart, - int /* tab_handle */, - int /* request_id */, - IPC::AutomationURLRequest /* request */) - - // Read data from a URL request to be fetched via automation - IPC_MESSAGE_ROUTED3(AutomationMsg_RequestRead, - int /* tab_handle */, - int /* request_id */, - int /* bytes_to_read */) - - // Response to a AutomationMsg_RequestStart message - IPC_MESSAGE_ROUTED3(AutomationMsg_RequestStarted, - int /* tab_handle */, - int /* request_id */, - IPC::AutomationURLResponse /* response */) - - // Data read via automation - IPC_MESSAGE_ROUTED3(AutomationMsg_RequestData, - int /* tab_handle */, - int /* request_id */, - std::string /* data */) - - IPC_MESSAGE_ROUTED3(AutomationMsg_RequestEnd, - int /* tab_handle */, - int /* request_id */, - URLRequestStatus /* status */) - - IPC_MESSAGE_ROUTED1(AutomationMsg_PrintAsync, - int /* tab_handle */) - - IPC_MESSAGE_ROUTED3(AutomationMsg_SetCookieAsync, - int /* tab_handle */, - GURL /* url */, - std::string /* cookie */) - - IPC_MESSAGE_ROUTED1(AutomationMsg_SelectAll, - int /* tab handle */) - - IPC_MESSAGE_ROUTED1(AutomationMsg_Cut, - int /* tab handle */) - - IPC_MESSAGE_ROUTED1(AutomationMsg_Copy, - int /* tab handle */) - - IPC_MESSAGE_ROUTED1(AutomationMsg_Paste, - int /* tab handle */) - - IPC_MESSAGE_ROUTED1(AutomationMsg_ReloadAsync, - int /* tab handle */) - - IPC_MESSAGE_ROUTED1(AutomationMsg_StopAsync, - int /* tab handle */) - - // Returns the number of times a filter was used to service an URL request. - // See AutomationMsg_SetFilteredInet. - IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_GetFilteredInetHitCount, - int /* hit_count */) - - // Is the browser in fullscreen mode? - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_IsFullscreen, - int /* browser_handle */, - bool /* is_fullscreen */) - - // Is the fullscreen bubble visible? - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_IsFullscreenBubbleVisible, - int /* browser_handle */, - bool /* is_visible */) - -#if defined(OS_POSIX) - // See previous definition of this message for explanation of why it is - // defined twice. - IPC_MESSAGE_ROUTED3(AutomationMsg_WindowClick, int, gfx::Point, int) -#endif - - // This message notifies the AutomationProvider to navigate to a specified - // url in the tab with given handle. The first parameter is the handle to - // the tab resource. The second parameter is the target url. The third - // parameter is the number of navigations that are required for a successful - // return value. See AutomationMsg_NavigationResponseValues for the return - // value. - IPC_SYNC_MESSAGE_ROUTED3_1( - AutomationMsg_NavigateToURLBlockUntilNavigationsComplete, int, GURL, int, - AutomationMsg_NavigationResponseValues) - - // This message notifies the AutomationProvider to navigate to a specified - // navigation entry index in the external tab with given handle. The first - // parameter is the handle to the tab resource. The second parameter is the - // index of navigation entry. - // The return value contains a status code which is nonnegative on success. - // see AutomationMsg_NavigationResponseValues for the navigation response. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_NavigateExternalTabAtIndex, int, int, - AutomationMsg_NavigationResponseValues) - - // This message requests the provider to wait until the window count - // reached the specified value. - // Request: - // - int: target browser window count - // Response: - // - bool: whether the operation was successful. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_WaitForBrowserWindowCountToBecome, - int, bool) - - // This message requests the provider to wait until an application modal - // dialog is shown. - // Response: - // - bool: whether the operation was successful - IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_WaitForAppModalDialogToBeShown, bool) - - // This message notifies the AutomationProvider to navigate back in session - // history in the tab with given handle. The first parameter is the handle - // to the tab resource. The second parameter is the number of navigations the - // provider will wait for. - // See AutomationMsg_NavigationResponseValues for the navigation response - // values. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_GoBackBlockUntilNavigationsComplete, - int, int, - AutomationMsg_NavigationResponseValues) - - // This message notifies the AutomationProvider to navigate forward in session - // history in the tab with given handle. The first parameter is the handle - // to the tab resource. The second parameter is the number of navigations - // the provider will wait for. - // See AutomationMsg_NavigationResponseValues for the navigation response - // values. - IPC_SYNC_MESSAGE_ROUTED2_1( - AutomationMsg_GoForwardBlockUntilNavigationsComplete, int, int, - AutomationMsg_NavigationResponseValues) - - // This message is used by automation clients to upload histogram data to the - // browser process. - IPC_MESSAGE_ROUTED1(AutomationMsg_RecordHistograms, - std::vector<std::string> /* histogram_list */) - - IPC_MESSAGE_ROUTED2(AutomationMsg_AttachExternalTab, - int /* 'source' tab_handle */, - IPC::AttachExternalTabParams) - - // Sent when the automation client connects to an existing tab. - IPC_SYNC_MESSAGE_ROUTED3_4(AutomationMsg_ConnectExternalTab, - uint64 /* cookie */, - bool /* allow/block tab*/, - gfx::NativeWindow /* parent window */, - gfx::NativeWindow /* Tab container window */, - gfx::NativeWindow /* Tab window */, - int /* Handle to the new tab */, - int /* Session Id of the new tab */) +// A URL request to be fetched via automation +IPC_MESSAGE_ROUTED3(AutomationMsg_RequestStart, + int /* tab_handle */, + int /* request_id */, + IPC::AutomationURLRequest /* request */) + +// Read data from a URL request to be fetched via automation +IPC_MESSAGE_ROUTED3(AutomationMsg_RequestRead, + int /* tab_handle */, + int /* request_id */, + int /* bytes_to_read */) + +// Response to a AutomationMsg_RequestStart message +IPC_MESSAGE_ROUTED3(AutomationMsg_RequestStarted, + int /* tab_handle */, + int /* request_id */, + IPC::AutomationURLResponse /* response */) + +// Data read via automation +IPC_MESSAGE_ROUTED3(AutomationMsg_RequestData, + int /* tab_handle */, + int /* request_id */, + std::string /* data */) + +IPC_MESSAGE_ROUTED3(AutomationMsg_RequestEnd, + int /* tab_handle */, + int /* request_id */, + URLRequestStatus /* status */) + +IPC_MESSAGE_ROUTED1(AutomationMsg_PrintAsync, + int /* tab_handle */) + +IPC_MESSAGE_ROUTED3(AutomationMsg_SetCookieAsync, + int /* tab_handle */, + GURL /* url */, + std::string /* cookie */) + +IPC_MESSAGE_ROUTED1(AutomationMsg_SelectAll, + int /* tab handle */) + +IPC_MESSAGE_ROUTED1(AutomationMsg_Cut, + int /* tab handle */) + +IPC_MESSAGE_ROUTED1(AutomationMsg_Copy, + int /* tab handle */) + +IPC_MESSAGE_ROUTED1(AutomationMsg_Paste, + int /* tab handle */) + +IPC_MESSAGE_ROUTED1(AutomationMsg_ReloadAsync, + int /* tab handle */) + +IPC_MESSAGE_ROUTED1(AutomationMsg_StopAsync, + int /* tab handle */) + +// Returns the number of times a filter was used to service an URL request. +// See AutomationMsg_SetFilteredInet. +IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_GetFilteredInetHitCount, + int /* hit_count */) + +// Is the browser in fullscreen mode? +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_IsFullscreen, + int /* browser_handle */, + bool /* is_fullscreen */) + +// Is the fullscreen bubble visible? +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_IsFullscreenBubbleVisible, + int /* browser_handle */, + bool /* is_visible */) + +// This message notifies the AutomationProvider to navigate to a specified +// url in the tab with given handle. The first parameter is the handle to +// the tab resource. The second parameter is the target url. The third +// parameter is the number of navigations that are required for a successful +// return value. See AutomationMsg_NavigationResponseValues for the return +// value. +IPC_SYNC_MESSAGE_ROUTED3_1( + AutomationMsg_NavigateToURLBlockUntilNavigationsComplete, int, GURL, int, + AutomationMsg_NavigationResponseValues) + +// This message notifies the AutomationProvider to navigate to a specified +// navigation entry index in the external tab with given handle. The first +// parameter is the handle to the tab resource. The second parameter is the +// index of navigation entry. +// The return value contains a status code which is nonnegative on success. +// see AutomationMsg_NavigationResponseValues for the navigation response. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_NavigateExternalTabAtIndex, int, int, + AutomationMsg_NavigationResponseValues) + +// This message requests the provider to wait until the window count +// reached the specified value. +// Request: +// - int: target browser window count +// Response: +// - bool: whether the operation was successful. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_WaitForBrowserWindowCountToBecome, + int, bool) + +// This message requests the provider to wait until an application modal +// dialog is shown. +// Response: +// - bool: whether the operation was successful +IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_WaitForAppModalDialogToBeShown, bool) + +// This message notifies the AutomationProvider to navigate back in session +// history in the tab with given handle. The first parameter is the handle +// to the tab resource. The second parameter is the number of navigations the +// provider will wait for. +// See AutomationMsg_NavigationResponseValues for the navigation response +// values. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_GoBackBlockUntilNavigationsComplete, + int, int, + AutomationMsg_NavigationResponseValues) + +// This message notifies the AutomationProvider to navigate forward in session +// history in the tab with given handle. The first parameter is the handle +// to the tab resource. The second parameter is the number of navigations +// the provider will wait for. +// See AutomationMsg_NavigationResponseValues for the navigation response +// values. +IPC_SYNC_MESSAGE_ROUTED2_1( + AutomationMsg_GoForwardBlockUntilNavigationsComplete, int, int, + AutomationMsg_NavigationResponseValues) + +// This message is used by automation clients to upload histogram data to the +// browser process. +IPC_MESSAGE_ROUTED1(AutomationMsg_RecordHistograms, + std::vector<std::string> /* histogram_list */) + +IPC_MESSAGE_ROUTED2(AutomationMsg_AttachExternalTab, + int /* 'source' tab_handle */, + IPC::AttachExternalTabParams) + +// Sent when the automation client connects to an existing tab. +IPC_SYNC_MESSAGE_ROUTED3_4(AutomationMsg_ConnectExternalTab, + uint64 /* cookie */, + bool /* allow/block tab*/, + gfx::NativeWindow /* parent window */, + gfx::NativeWindow /* Tab container window */, + gfx::NativeWindow /* Tab window */, + int /* Handle to the new tab */, + int /* Session Id of the new tab */) #if defined(OS_POSIX) - // TODO(estade): this should be merged with the windows message of the same - // name. See comment for WindowClick. - IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_WindowDrag, - int, std::vector<gfx::Point>, int, bool, bool) +// TODO(estade): this should be merged with the windows message of the same +// name. See comment for WindowClick. +IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_WindowDrag, + int, std::vector<gfx::Point>, int, bool, bool) #endif // defined(OS_POSIX) - // This message gets the bounds of the window. - // Request: - // int - the handle of the window to query - // Response: - // gfx::Rect - the bounds of the window - // bool - true if the query was successful - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_GetWindowBounds, int, gfx::Rect, - bool) - - // Simulate an end of session. Normally this happens when the user - // shuts down the machine or logs off. - // Request: - // int - the handle of the browser - // Response: - // bool - true if succesful - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_TerminateSession, int, bool) - - // Returns whether the window is maximized. - // Request: - // int - the handle of the window - // Response: - // bool - true if the window is maximized - // bool - true if query is successful - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_IsWindowMaximized, int, bool, bool) - - IPC_MESSAGE_ROUTED2(AutomationMsg_SetPageFontSize, - int /* tab_handle */, - int /* The font size */) - - // Returns a metric event duration that was last recorded. Returns -1 if the - // event hasn't occurred yet. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GetMetricEventDuration, - std::string /* event_name */, - int /* duration ms */) - - // Sent by automation provider - go to history entry via automation. - IPC_MESSAGE_ROUTED2(AutomationMsg_RequestGoToHistoryEntryOffset, - int, // tab handle - int) // numbers of entries (negative or positive) - - // Silently install the extension in the given crx file. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_InstallExtension, - FilePath /* full path to crx file */, - AutomationMsg_ExtensionResponseValues) - - // Silently load the extension in the given directory. This expects an - // extension expanded into the directory, not a crx file. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_LoadExpandedExtension, - FilePath /* root directory of extension */, - AutomationMsg_ExtensionResponseValues) - - // Retrieves a list of the root directories of all enabled extensions - // that have been installed into Chrome by dropping a .crx file onto - // Chrome or an equivalent action (including loaded extensions). - // Other types of extensions are not included on the list (e.g. "component" - // or "external" extensions) since they are generally not useful for testing - // (e.g. an external extension could mess with an automated test if it's - // present on some systems only). - IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_GetEnabledExtensions, - std::vector<FilePath>) - - // This message requests the type of the window with the given handle. The - // return value contains the type (Browser::Type), or -1 if the request - // failed. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_Type, int, int) - - // Opens a new browser window of a specific type. - IPC_SYNC_MESSAGE_ROUTED2_0(AutomationMsg_OpenNewBrowserWindowOfType, - int /* Type (Browser::Type) */, - bool /* show */ ) - - // This message requests that the mouse be moved to this location, in - // window coordinate space. - // Request: - // int - the handle of the window that's the context for this click - // gfx::Point - the location to move to - IPC_MESSAGE_ROUTED2(AutomationMsg_WindowMouseMove, int, gfx::Point) - - // Called when requests should be downloaded using a host browser's - // download mechanism when chrome is being embedded. - IPC_MESSAGE_ROUTED2(AutomationMsg_DownloadRequestInHost, - int /* tab_handle */, - int /* request_id */) - - // Shuts down the session service for the browser identified by - // |browser_handle|. On success |result| is set to true. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ShutdownSessionService, - int /* browser_handle */, - bool /* result */) - - IPC_MESSAGE_ROUTED1(AutomationMsg_SaveAsAsync, - int /* tab handle */) +// This message gets the bounds of the window. +// Request: +// int - the handle of the window to query +// Response: +// gfx::Rect - the bounds of the window +// bool - true if the query was successful +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_GetWindowBounds, int, gfx::Rect, + bool) + +// Simulate an end of session. Normally this happens when the user +// shuts down the machine or logs off. +// Request: +// int - the handle of the browser +// Response: +// bool - true if succesful +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_TerminateSession, int, bool) + +// Returns whether the window is maximized. +// Request: +// int - the handle of the window +// Response: +// bool - true if the window is maximized +// bool - true if query is successful +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_IsWindowMaximized, int, bool, bool) + +IPC_MESSAGE_ROUTED2(AutomationMsg_SetPageFontSize, + int /* tab_handle */, + int /* The font size */) + +// Returns a metric event duration that was last recorded. Returns -1 if the +// event hasn't occurred yet. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_GetMetricEventDuration, + std::string /* event_name */, + int /* duration ms */) + +// Sent by automation provider - go to history entry via automation. +IPC_MESSAGE_ROUTED2(AutomationMsg_RequestGoToHistoryEntryOffset, + int, // tab handle + int) // numbers of entries (negative or positive) + +// Silently install the extension in the given crx file. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_InstallExtension, + FilePath /* full path to crx file */, + AutomationMsg_ExtensionResponseValues) + +// Silently load the extension in the given directory. This expects an +// extension expanded into the directory, not a crx file. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_LoadExpandedExtension, + FilePath /* root directory of extension */, + AutomationMsg_ExtensionResponseValues) + +// Retrieves a list of the root directories of all enabled extensions +// that have been installed into Chrome by dropping a .crx file onto +// Chrome or an equivalent action (including loaded extensions). +// Other types of extensions are not included on the list (e.g. "component" +// or "external" extensions) since they are generally not useful for testing +// (e.g. an external extension could mess with an automated test if it's +// present on some systems only). +IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_GetEnabledExtensions, + std::vector<FilePath>) + +// This message requests the type of the window with the given handle. The +// return value contains the type (Browser::Type), or -1 if the request +// failed. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_Type, int, int) + +// Opens a new browser window of a specific type. +IPC_SYNC_MESSAGE_ROUTED2_0(AutomationMsg_OpenNewBrowserWindowOfType, + int /* Type (Browser::Type) */, + bool /* show */ ) + +// This message requests that the mouse be moved to this location, in +// window coordinate space. +// Request: +// int - the handle of the window that's the context for this click +// gfx::Point - the location to move to +IPC_MESSAGE_ROUTED2(AutomationMsg_WindowMouseMove, int, gfx::Point) + +// Called when requests should be downloaded using a host browser's +// download mechanism when chrome is being embedded. +IPC_MESSAGE_ROUTED2(AutomationMsg_DownloadRequestInHost, + int /* tab_handle */, + int /* request_id */) + +// Shuts down the session service for the browser identified by +// |browser_handle|. On success |result| is set to true. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ShutdownSessionService, + int /* browser_handle */, + bool /* result */) + +IPC_MESSAGE_ROUTED1(AutomationMsg_SaveAsAsync, + int /* tab handle */) #if defined(OS_WIN) - // An incoming message from an automation host to Chrome. Signals that - // the browser containing |tab_handle| has moved. - IPC_MESSAGE_ROUTED1(AutomationMsg_BrowserMove, - int /* tab handle */) +// An incoming message from an automation host to Chrome. Signals that +// the browser containing |tab_handle| has moved. +IPC_MESSAGE_ROUTED1(AutomationMsg_BrowserMove, + int /* tab handle */) #endif - // Used to get cookies for the given URL. - IPC_MESSAGE_ROUTED3(AutomationMsg_GetCookiesFromHost, - int /* tab_handle */, - GURL /* url */, - int /* opaque_cookie_id */) - - IPC_MESSAGE_ROUTED5(AutomationMsg_GetCookiesHostResponse, - int /* tab_handle */, - bool /* success */, - GURL /* url */, - std::string /* cookies */, - int /* opaque_cookie_id */) - - // If the given host is empty, then the default content settings are - // modified. - IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_SetContentSetting, - int /* browser handle */, - std::string /* host */, - ContentSettingsType /* content type */, - ContentSetting /* setting */, - bool /* success */) +// Used to get cookies for the given URL. +IPC_MESSAGE_ROUTED3(AutomationMsg_GetCookiesFromHost, + int /* tab_handle */, + GURL /* url */, + int /* opaque_cookie_id */) + +IPC_MESSAGE_ROUTED5(AutomationMsg_GetCookiesHostResponse, + int /* tab_handle */, + bool /* success */, + GURL /* url */, + std::string /* cookies */, + int /* opaque_cookie_id */) + +// If the given host is empty, then the default content settings are +// modified. +IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_SetContentSetting, + int /* browser handle */, + std::string /* host */, + ContentSettingsType /* content type */, + ContentSetting /* setting */, + bool /* success */) #if defined(OS_CHROMEOS) - // Logs in through the browser's login wizard if available. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_LoginWithUserAndPass, - std::string /* username*/, - std::string /* password*/, - bool /* Whether successful*/) +// Logs in through the browser's login wizard if available. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_LoginWithUserAndPass, + std::string /* username*/, + std::string /* password*/, + bool /* Whether successful*/) #endif - // Return the bookmarks encoded as a JSON string. - IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_GetBookmarksAsJSON, - int /* browser_handle */, - std::string /* bookmarks as a JSON string */, - bool /* success */) - - // Wait for the bookmark model to load. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_WaitForBookmarkModelToLoad, - int /* browser_handle */, - bool /* success */) - - // Bookmark addition, modification, and removal. - // Bookmarks are indexed by their id. - IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_AddBookmarkGroup, - int /* browser_handle */, - int64 /* parent_id */, - int /* index */, - std::wstring /* title */, - bool /* success */) - IPC_SYNC_MESSAGE_ROUTED5_1(AutomationMsg_AddBookmarkURL, - int /* browser_handle */, - int64 /* parent_id */, - int /* index */, - std::wstring /* title */, - GURL /* url */, - bool /* success */) - IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_ReparentBookmark, - int /* browser_handle */, - int64 /* id */, - int64 /* new_parent_id */, - int /* index */, - bool /* success */) - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetBookmarkTitle, - int /* browser_handle */, - int64 /* id */, - std::wstring /* title */, - bool /* success */) - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetBookmarkURL, - int /* browser_handle */, - int64 /* id */, - GURL /* url */, - bool /* success */) - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_RemoveBookmark, - int /* browser_handle */, - int64 /* id */, - bool /* success */) - - // This message informs the browser process to remove the history entries - // for the specified types across all time ranges. See - // browsing_data_remover.h for a list of REMOVE_* types supported in the - // remove_mask parameter. - IPC_MESSAGE_ROUTED1(AutomationMsg_RemoveBrowsingData, int) - - // Block until the focused view id changes to something other than - // |previous_view_id|. - IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_WaitForFocusedViewIDToChange, - int /* window handle */, - int /* previous_view_id */, - bool /* success */, - int /* new_view_id */) - - // To avoid race conditions, waiting until a popup menu opens is a - // three-step process: - // 1. Call StartTrackingPopupMenus. - // 2. Call an automation method that results in opening the popup menu. - // 3. Call WaitForPopupMenuToOpen and check for success. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_StartTrackingPopupMenus, - int /* browser handle */, - bool /* success */) - IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_WaitForPopupMenuToOpen, - bool /* success */) - - // Generic pyauto pattern to help avoid future addition of - // automation messages. - IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_SendJSONRequest, - int /* browser_handle */, - std::string /* JSON request */, - std::string /* JSON response */, - bool /* success */) - - // Installs an extension from the crx file and returns its id. - // On error, |extension handle| will be 0. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_InstallExtensionAndGetHandle, - FilePath /* full path to crx file */, - bool /* with UI */, - int /* extension handle */) - - // Waits for the next extension test result. Sets |test result| as the - // received result and |message| as any accompanying message with the - // result, which could be the empty string. - IPC_SYNC_MESSAGE_ROUTED0_2(AutomationMsg_WaitForExtensionTestResult, - bool /* test result */, - std::string /* message */) - - // Uninstalls an extension. On success |success| is true. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_UninstallExtension, - int /* extension handle */, - bool /* success */) - - // Enables an extension. On success |success| is true. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_EnableExtension, - int /* extension handle */, - bool /* success */) - - // Disables an extension. On success |success| is true. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_DisableExtension, - int /* extension handle */, - bool /* success */) - - // Executes the action associated with the given extension. This executes - // the extension's page or browser action in the given browser, but does - // not open popups. On success |success| is true. - IPC_SYNC_MESSAGE_ROUTED2_1( - AutomationMsg_ExecuteExtensionActionInActiveTabAsync, - int /* extension handle */, - int /* browser handle */, - bool /* success */) - - // Moves the browser action to the given index in the browser action toolbar. - // On success |success| is true. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_MoveExtensionBrowserAction, - int /* extension handle */, - int /* index */, - bool /* success */) - - // Gets an extension property |property type|. On success |success| is true, - // and |property value| is set. - IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_GetExtensionProperty, - int /* extension handle */, - AutomationMsg_ExtensionProperty /* property type */, - bool /* success */, - std::string /* property value */) - - // Resets to the default theme. - IPC_SYNC_MESSAGE_ROUTED0_0(AutomationMsg_ResetToDefaultTheme) - - // Navigates asynchronously to a URL with a certain disposition, - // like in a new tab. - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_NavigationAsyncWithDisposition, - int /* tab handle */, - GURL, - WindowOpenDisposition, - bool /* result */) - - - // This message requests the cookie be deleted for given url in the - // profile of the tab identified by the first parameter. The second - // parameter is the cookie name. - IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_DeleteCookie, GURL, std::string, - int /* tab handle */, - bool /* result */) - - // This message triggers the collected cookies dialog for a specific tab. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ShowCollectedCookiesDialog, - int /* tab handle */, - bool /* result */) - - // This message requests the external tab identified by the tab handle - // passed in be closed. - // Request: - // -int: Tab handle - // Response: - // None expected - IPC_MESSAGE_ROUTED1(AutomationMsg_CloseExternalTab, int) - - // This message requests that the external tab identified by the tab handle - // runs unload handlers if any on the current page. - // Request: - // -int: Tab handle - // -bool: result: true->unload, false->don't unload - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_RunUnloadHandlers, int, bool) - - // This message sets the current zoom level on the tab - // Request: - // -int: Tab handle - // -int: Zoom level. Values ZOOM_OUT = -1, RESET = 0, ZOOM_IN = 1 - // Response: - // None expected - IPC_MESSAGE_ROUTED2(AutomationMsg_SetZoomLevel, int, int) - - // Waits for tab count to reach target value. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WaitForTabCountToBecome, - int /* browser handle */, - int /* target tab count */, - bool /* success */) - - // Waits for the infobar count to reach given number. - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WaitForInfoBarCount, - int /* tab handle */, - int /* target count */, - bool /* success */) - - // Waits for the autocomplete edit to receive focus. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_WaitForAutocompleteEditFocus, - int /* autocomplete edit handle */, - bool /* success */) - - // Loads all blocked plug-ins on the page. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_LoadBlockedPlugins, - int /* tab handle */, - bool /* success */) - - // Captures the entire page for the tab, including those portions not in - // view, and saves the image as a PNG in the given file location. - // Request: - // -int: Tab handle - // -FilePath: Path to save the captured image to - // Response: - // -bool: Whether the method succeeded - IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_CaptureEntirePageAsPNG, int, - FilePath, bool) - -IPC_END_MESSAGES(Automation) +// Return the bookmarks encoded as a JSON string. +IPC_SYNC_MESSAGE_ROUTED1_2(AutomationMsg_GetBookmarksAsJSON, + int /* browser_handle */, + std::string /* bookmarks as a JSON string */, + bool /* success */) + +// Wait for the bookmark model to load. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_WaitForBookmarkModelToLoad, + int /* browser_handle */, + bool /* success */) + +// Bookmark addition, modification, and removal. +// Bookmarks are indexed by their id. +IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_AddBookmarkGroup, + int /* browser_handle */, + int64 /* parent_id */, + int /* index */, + std::wstring /* title */, + bool /* success */) +IPC_SYNC_MESSAGE_ROUTED5_1(AutomationMsg_AddBookmarkURL, + int /* browser_handle */, + int64 /* parent_id */, + int /* index */, + std::wstring /* title */, + GURL /* url */, + bool /* success */) +IPC_SYNC_MESSAGE_ROUTED4_1(AutomationMsg_ReparentBookmark, + int /* browser_handle */, + int64 /* id */, + int64 /* new_parent_id */, + int /* index */, + bool /* success */) +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetBookmarkTitle, + int /* browser_handle */, + int64 /* id */, + std::wstring /* title */, + bool /* success */) +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_SetBookmarkURL, + int /* browser_handle */, + int64 /* id */, + GURL /* url */, + bool /* success */) +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_RemoveBookmark, + int /* browser_handle */, + int64 /* id */, + bool /* success */) + +// This message informs the browser process to remove the history entries +// for the specified types across all time ranges. See +// browsing_data_remover.h for a list of REMOVE_* types supported in the +// remove_mask parameter. +IPC_MESSAGE_ROUTED1(AutomationMsg_RemoveBrowsingData, int) + +// Block until the focused view id changes to something other than +// |previous_view_id|. +IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_WaitForFocusedViewIDToChange, + int /* window handle */, + int /* previous_view_id */, + bool /* success */, + int /* new_view_id */) + +// To avoid race conditions, waiting until a popup menu opens is a +// three-step process: +// 1. Call StartTrackingPopupMenus. +// 2. Call an automation method that results in opening the popup menu. +// 3. Call WaitForPopupMenuToOpen and check for success. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_StartTrackingPopupMenus, + int /* browser handle */, + bool /* success */) +IPC_SYNC_MESSAGE_ROUTED0_1(AutomationMsg_WaitForPopupMenuToOpen, + bool /* success */) + +// Generic pyauto pattern to help avoid future addition of +// automation messages. +IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_SendJSONRequest, + int /* browser_handle */, + std::string /* JSON request */, + std::string /* JSON response */, + bool /* success */) + +// Installs an extension from the crx file and returns its id. +// On error, |extension handle| will be 0. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_InstallExtensionAndGetHandle, + FilePath /* full path to crx file */, + bool /* with UI */, + int /* extension handle */) + +// Waits for the next extension test result. Sets |test result| as the +// received result and |message| as any accompanying message with the +// result, which could be the empty string. +IPC_SYNC_MESSAGE_ROUTED0_2(AutomationMsg_WaitForExtensionTestResult, + bool /* test result */, + std::string /* message */) + +// Uninstalls an extension. On success |success| is true. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_UninstallExtension, + int /* extension handle */, + bool /* success */) + +// Enables an extension. On success |success| is true. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_EnableExtension, + int /* extension handle */, + bool /* success */) + +// Disables an extension. On success |success| is true. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_DisableExtension, + int /* extension handle */, + bool /* success */) + +// Executes the action associated with the given extension. This executes +// the extension's page or browser action in the given browser, but does +// not open popups. On success |success| is true. +IPC_SYNC_MESSAGE_ROUTED2_1( + AutomationMsg_ExecuteExtensionActionInActiveTabAsync, + int /* extension handle */, + int /* browser handle */, + bool /* success */) + +// Moves the browser action to the given index in the browser action toolbar. +// On success |success| is true. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_MoveExtensionBrowserAction, + int /* extension handle */, + int /* index */, + bool /* success */) + +// Gets an extension property |property type|. On success |success| is true, +// and |property value| is set. +IPC_SYNC_MESSAGE_ROUTED2_2(AutomationMsg_GetExtensionProperty, + int /* extension handle */, + AutomationMsg_ExtensionProperty /* property type */, + bool /* success */, + std::string /* property value */) + +// Resets to the default theme. +IPC_SYNC_MESSAGE_ROUTED0_0(AutomationMsg_ResetToDefaultTheme) + +// Navigates asynchronously to a URL with a certain disposition, +// like in a new tab. +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_NavigationAsyncWithDisposition, + int /* tab handle */, + GURL, + WindowOpenDisposition, + bool /* result */) + + +// This message requests the cookie be deleted for given url in the +// profile of the tab identified by the first parameter. The second +// parameter is the cookie name. +IPC_SYNC_MESSAGE_ROUTED3_1(AutomationMsg_DeleteCookie, GURL, std::string, + int /* tab handle */, + bool /* result */) + +// This message triggers the collected cookies dialog for a specific tab. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ShowCollectedCookiesDialog, + int /* tab handle */, + bool /* result */) + +// This message requests the external tab identified by the tab handle +// passed in be closed. +// Request: +// -int: Tab handle +// Response: +// None expected +IPC_MESSAGE_ROUTED1(AutomationMsg_CloseExternalTab, int) + +// This message requests that the external tab identified by the tab handle +// runs unload handlers if any on the current page. +// Request: +// -int: Tab handle +// -bool: result: true->unload, false->don't unload +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_RunUnloadHandlers, int, bool) + +// This message sets the current zoom level on the tab +// Request: +// -int: Tab handle +// -int: Zoom level. Values ZOOM_OUT = -1, RESET = 0, ZOOM_IN = 1 +// Response: +// None expected +IPC_MESSAGE_ROUTED2(AutomationMsg_SetZoomLevel, int, int) + +// Waits for tab count to reach target value. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WaitForTabCountToBecome, + int /* browser handle */, + int /* target tab count */, + bool /* success */) + +// Waits for the infobar count to reach given number. +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WaitForInfoBarCount, + int /* tab handle */, + int /* target count */, + bool /* success */) + +// Waits for the autocomplete edit to receive focus. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_WaitForAutocompleteEditFocus, + int /* autocomplete edit handle */, + bool /* success */) + +// Loads all blocked plug-ins on the page. +IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_LoadBlockedPlugins, + int /* tab handle */, + bool /* success */) + +// Captures the entire page for the tab, including those portions not in +// view, and saves the image as a PNG in the given file location. +// Request: +// -int: Tab handle +// -FilePath: Path to save the captured image to +// Response: +// -bool: Whether the method succeeded +IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_CaptureEntirePageAsPNG, int, + FilePath, bool) diff --git a/chrome/common/devtools_messages.cc b/chrome/common/devtools_messages.cc index 8ea923e..4efa63d 100644 --- a/chrome/common/devtools_messages.cc +++ b/chrome/common/devtools_messages.cc @@ -2,8 +2,5 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#define IPC_MESSAGE_IMPL #include "chrome/common/devtools_messages.h" - -#define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/common/devtools_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/devtools_messages.h b/chrome/common/devtools_messages.h index 060c4d9..8fe7a49 100644 --- a/chrome/common/devtools_messages.h +++ b/chrome/common/devtools_messages.h @@ -8,11 +8,8 @@ #include <map> -#include "ipc/ipc_message_utils.h" - typedef std::map<std::string, std::string> DevToolsRuntimeProperties; -#define MESSAGES_INTERNAL_FILE "chrome/common/devtools_messages_internal.h" -#include "ipc/ipc_message_macros.h" +#include "chrome/common/devtools_messages_internal.h" #endif // CHROME_COMMON_DEVTOOLS_MESSAGES_H_ diff --git a/chrome/common/devtools_messages_internal.h b/chrome/common/devtools_messages_internal.h index ac8dbce..6019d60 100644 --- a/chrome/common/devtools_messages_internal.h +++ b/chrome/common/devtools_messages_internal.h @@ -2,10 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This header is meant to be included in multiple passes, hence no traditional -// header guard. -// See ipc_message_macros.h for explanation of the macros and passes. - // Developer tools consist of the following parts: // // DevToolsAgent lives in the renderer of an inspected page and provides access @@ -44,57 +40,51 @@ #include "ipc/ipc_message_macros.h" +#define IPC_MESSAGE_START DevToolsMsgStart + // These are messages sent from DevToolsAgent to DevToolsClient through the // browser. -IPC_BEGIN_MESSAGES(DevToolsClient) - - // WebKit-level transport. - IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DispatchOnInspectorFrontend, - std::string /* message */) +// WebKit-level transport. +IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DispatchOnInspectorFrontend, + std::string /* message */) - // Legacy debugger output message. - IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DebuggerOutput, - std::string /* message */) +// Legacy debugger output message. +IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DebuggerOutput, + std::string /* message */) - // Legacy APU dispatch message. - IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DispatchToAPU, - std::string /* message */) - -IPC_END_MESSAGES(DevToolsClient) +// Legacy APU dispatch message. +IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DispatchToAPU, + std::string /* message */) //----------------------------------------------------------------------------- // These are messages sent from DevToolsClient to DevToolsAgent through the // browser. -IPC_BEGIN_MESSAGES(DevToolsAgent) - - // Tells agent that there is a client host connected to it. - IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_Attach, - DevToolsRuntimeProperties /* properties */) - - // Tells agent that there is no longer a client host connected to it. - IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_Detach) - - // Tells agent that the front-end has been loaded - IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_FrontendLoaded) - - // WebKit-level transport. - IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DispatchOnInspectorBackend, - std::string /* message */) - - // Send debugger command to the debugger agent. Debugger commands should - // be handled on IO thread(while all other devtools messages are handled in - // the render thread) to allow executing the commands when v8 is on a - // breakpoint. - IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DebuggerCommand, - std::string /* command */) - - // Inspect element with the given coordinates. - IPC_MESSAGE_CONTROL2(DevToolsAgentMsg_InspectElement, - int /* x */, - int /* y */) - - // Enables/disables the apu agent. - IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_SetApuAgentEnabled, bool /* enabled */) - -IPC_END_MESSAGES(DevToolsAgent) +// Tells agent that there is a client host connected to it. +IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_Attach, + DevToolsRuntimeProperties /* properties */) + +// Tells agent that there is no longer a client host connected to it. +IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_Detach) + +// Tells agent that the front-end has been loaded +IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_FrontendLoaded) + +// WebKit-level transport. +IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DispatchOnInspectorBackend, + std::string /* message */) + +// Send debugger command to the debugger agent. Debugger commands should +// be handled on IO thread(while all other devtools messages are handled in +// the render thread) to allow executing the commands when v8 is on a +// breakpoint. +IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DebuggerCommand, + std::string /* command */) + +// Inspect element with the given coordinates. +IPC_MESSAGE_CONTROL2(DevToolsAgentMsg_InspectElement, + int /* x */, + int /* y */) + +// Enables/disables the apu agent. +IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_SetApuAgentEnabled, bool /* enabled */) diff --git a/chrome/common/gpu_messages.cc b/chrome/common/gpu_messages.cc index bd850a1..9d5c32e 100644 --- a/chrome/common/gpu_messages.cc +++ b/chrome/common/gpu_messages.cc @@ -2,19 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/gpu_messages.h" - #include "chrome/common/gpu_create_command_buffer_config.h" #include "chrome/common/gpu_info.h" #include "chrome/common/dx_diag_node.h" #include "gfx/rect.h" #include "gfx/size.h" #include "ipc/ipc_channel_handle.h" -#include "ipc/ipc_message_utils.h" -#define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/common/gpu_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" +#define IPC_MESSAGE_IMPL +#include "chrome/common/gpu_messages.h" #if defined(OS_MACOSX) diff --git a/chrome/common/gpu_messages.h b/chrome/common/gpu_messages.h index f932c99..387d2b1 100644 --- a/chrome/common/gpu_messages.h +++ b/chrome/common/gpu_messages.h @@ -13,8 +13,6 @@ #include "gfx/native_widget_types.h" #include "gpu/command_buffer/common/command_buffer.h" -#define MESSAGES_INTERNAL_FILE \ - "chrome/common/gpu_messages_internal.h" -#include "ipc/ipc_message_macros.h" +#include "chrome/common/gpu_messages_internal.h" #endif // CHROME_COMMON_GPU_MESSAGES_H_ diff --git a/chrome/common/gpu_messages_internal.h b/chrome/common/gpu_messages_internal.h index e4badaa..57a8917 100644 --- a/chrome/common/gpu_messages_internal.h +++ b/chrome/common/gpu_messages_internal.h @@ -2,13 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This header is meant to be included in multiple passes, hence no traditional -// header guard. It is included by backing_store_messages_internal.h -// See ipc_message_macros.h for explanation of the macros and passes. - -// This file needs to be included again, even though we're actually included -// from it via utility_messages.h. - #include <vector> #include <string> @@ -16,6 +9,8 @@ #include "chrome/common/gpu_video_common.h" #include "ipc/ipc_message_macros.h" +#define IPC_MESSAGE_START GpuMsgStart + namespace gfx { class Size; } @@ -30,322 +25,301 @@ class GPUInfo; //------------------------------------------------------------------------------ // GPU Messages // These are messages from the browser to the GPU process. -IPC_BEGIN_MESSAGES(Gpu) - - // Tells the GPU process to create a new channel for communication with a - // given renderer. The channel name is returned in a - // GpuHostMsg_ChannelEstablished message. The renderer ID is passed so that - // the GPU process reuses an existing channel to that process if it exists. - // This ID is a unique opaque identifier generated by the browser process. - IPC_MESSAGE_CONTROL1(GpuMsg_EstablishChannel, - int /* renderer_id */) - - // Provides a synchronization point to guarantee that the processing of - // previous asynchronous messages (i.e., GpuMsg_EstablishChannel) has - // completed. (This message can't be synchronous because the - // GpuProcessHost uses an IPC::ChannelProxy, which sends all messages - // asynchronously.) Results in a GpuHostMsg_SynchronizeReply. - IPC_MESSAGE_CONTROL0(GpuMsg_Synchronize) - - // Tells the GPU process to create a context for collecting graphics card - // information. - IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo) +// Tells the GPU process to create a new channel for communication with a +// given renderer. The channel name is returned in a +// GpuHostMsg_ChannelEstablished message. The renderer ID is passed so that +// the GPU process reuses an existing channel to that process if it exists. +// This ID is a unique opaque identifier generated by the browser process. +IPC_MESSAGE_CONTROL1(GpuMsg_EstablishChannel, + int /* renderer_id */) + +// Provides a synchronization point to guarantee that the processing of +// previous asynchronous messages (i.e., GpuMsg_EstablishChannel) has +// completed. (This message can't be synchronous because the +// GpuProcessHost uses an IPC::ChannelProxy, which sends all messages +// asynchronously.) Results in a GpuHostMsg_SynchronizeReply. +IPC_MESSAGE_CONTROL0(GpuMsg_Synchronize) + +// Tells the GPU process to create a context for collecting graphics card +// information. +IPC_MESSAGE_CONTROL0(GpuMsg_CollectGraphicsInfo) #if defined(OS_MACOSX) - // Tells the GPU process that the browser process handled the swap - // buffers request with the given number. Note that it is possible - // for the browser process to coalesce frames; it is not guaranteed - // that every GpuHostMsg_AcceleratedSurfaceBuffersSwapped message - // will result in a buffer swap on the browser side. - IPC_MESSAGE_CONTROL3(GpuMsg_AcceleratedSurfaceBuffersSwappedACK, - int /* renderer_id */, - int32 /* route_id */, - uint64 /* swap_buffers_count */) +// Tells the GPU process that the browser process handled the swap +// buffers request with the given number. Note that it is possible +// for the browser process to coalesce frames; it is not guaranteed +// that every GpuHostMsg_AcceleratedSurfaceBuffersSwapped message +// will result in a buffer swap on the browser side. +IPC_MESSAGE_CONTROL3(GpuMsg_AcceleratedSurfaceBuffersSwappedACK, + int /* renderer_id */, + int32 /* route_id */, + uint64 /* swap_buffers_count */) #endif - // Tells the GPU process to crash. - IPC_MESSAGE_CONTROL0(GpuMsg_Crash) - - // Tells the GPU process to hang. - IPC_MESSAGE_CONTROL0(GpuMsg_Hang) +// Tells the GPU process to crash. +IPC_MESSAGE_CONTROL0(GpuMsg_Crash) -IPC_END_MESSAGES(Gpu) +// Tells the GPU process to hang. +IPC_MESSAGE_CONTROL0(GpuMsg_Hang) //------------------------------------------------------------------------------ // GPU Host Messages // These are messages from the GPU process to the browser. -IPC_BEGIN_MESSAGES(GpuHost) +// Response to a GpuHostMsg_EstablishChannel message. +IPC_MESSAGE_CONTROL2(GpuHostMsg_ChannelEstablished, + IPC::ChannelHandle, /* channel_handle */ + GPUInfo /* GPU logging stats */) - // Response to a GpuHostMsg_EstablishChannel message. - IPC_MESSAGE_CONTROL2(GpuHostMsg_ChannelEstablished, - IPC::ChannelHandle, /* channel_handle */ - GPUInfo /* GPU logging stats */) +// Response to a GpuMsg_Synchronize message. +IPC_MESSAGE_CONTROL0(GpuHostMsg_SynchronizeReply) - // Response to a GpuMsg_Synchronize message. - IPC_MESSAGE_CONTROL0(GpuHostMsg_SynchronizeReply) - - // Response to a GpuMsg_CollectGraphicsInfo. - IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected, - GPUInfo /* GPU logging stats */) +// Response to a GpuMsg_CollectGraphicsInfo. +IPC_MESSAGE_CONTROL1(GpuHostMsg_GraphicsInfoCollected, + GPUInfo /* GPU logging stats */) #if defined(OS_LINUX) - // Get the XID for a view ID. - IPC_SYNC_MESSAGE_CONTROL1_1(GpuHostMsg_GetViewXID, - gfx::NativeViewId, /* view */ - unsigned long /* xid */) +// Get the XID for a view ID. +IPC_SYNC_MESSAGE_CONTROL1_1(GpuHostMsg_GetViewXID, + gfx::NativeViewId, /* view */ + unsigned long /* xid */) - // Release the lock on the window. - // If the associated view has been destroyed, destroy the window. - IPC_MESSAGE_CONTROL1(GpuHostMsg_ReleaseXID, - unsigned long /* xid */) +// Release the lock on the window. +// If the associated view has been destroyed, destroy the window. +IPC_MESSAGE_CONTROL1(GpuHostMsg_ReleaseXID, + unsigned long /* xid */) - IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_ResizeXID, - unsigned long, /* xid */ - gfx::Size, /* size */ - bool /* success */) +IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_ResizeXID, + unsigned long, /* xid */ + gfx::Size, /* size */ + bool /* success */) #elif defined(OS_MACOSX) - // This message, used on Mac OS X 10.6 and later (where IOSurface is - // supported), is sent from the GPU process to the browser to indicate that a - // new backing store was allocated for the given "window" (fake - // PluginWindowHandle). The renderer ID and render view ID are needed in - // order to uniquely identify the RenderWidgetHostView on the browser side. - IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceSetIOSurface, - GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params) - - // This message notifies the browser process that the renderer - // swapped the buffers associated with the given "window", which - // should cause the browser to redraw the compositor's contents. - IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, - GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) +// This message, used on Mac OS X 10.6 and later (where IOSurface is +// supported), is sent from the GPU process to the browser to indicate that a +// new backing store was allocated for the given "window" (fake +// PluginWindowHandle). The renderer ID and render view ID are needed in +// order to uniquely identify the RenderWidgetHostView on the browser side. +IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceSetIOSurface, + GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params) + +// This message notifies the browser process that the renderer +// swapped the buffers associated with the given "window", which +// should cause the browser to redraw the compositor's contents. +IPC_MESSAGE_CONTROL1(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, + GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) #elif defined(OS_WIN) - // Get the HWND for the compositor window and if necessary, create it - IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_GetCompositorHostWindow, - int32, /* renderer_id */ - int32, /* render_view_id */ - gfx::PluginWindowHandle /* compositor_host_id */) - - IPC_MESSAGE_CONTROL2(GpuHostMsg_ScheduleComposite, - int32, /* renderer_id */ - int32 /* render_view_id */) +// Get the HWND for the compositor window and if necessary, create it +IPC_SYNC_MESSAGE_CONTROL2_1(GpuHostMsg_GetCompositorHostWindow, + int32, /* renderer_id */ + int32, /* render_view_id */ + gfx::PluginWindowHandle /* compositor_host_id */) + +IPC_MESSAGE_CONTROL2(GpuHostMsg_ScheduleComposite, + int32, /* renderer_id */ + int32 /* render_view_id */) #endif -IPC_END_MESSAGES(GpuHost) - //------------------------------------------------------------------------------ // GPU Channel Messages // These are messages from a renderer process to the GPU process. -IPC_BEGIN_MESSAGES(GpuChannel) - - // Tells the GPU process to create a new command buffer that renders directly - // to a native view. The |render_view_id| is currently needed only on Mac OS - // X in order to identify the window on the browser side into which the - // rendering results go. A corresponding GpuCommandBufferStub is created. - IPC_SYNC_MESSAGE_CONTROL3_1(GpuChannelMsg_CreateViewCommandBuffer, - gfx::NativeViewId, /* view */ - int32, /* render_view_id */ - GPUCreateCommandBufferConfig, /* init_params */ - int32 /* route_id */) - - // Tells the GPU process to create a new command buffer that renders to an - // offscreen frame buffer. If parent_route_id is not zero, the texture backing - // the frame buffer is mapped into the corresponding parent command buffer's - // namespace, with the name of parent_texture_id. This ID is in the parent's - // namespace. - IPC_SYNC_MESSAGE_CONTROL4_1(GpuChannelMsg_CreateOffscreenCommandBuffer, - int32, /* parent_route_id */ - gfx::Size, /* size */ - GPUCreateCommandBufferConfig, /* init_params */ - uint32, /* parent_texture_id */ - int32 /* route_id */) - - // The CommandBufferProxy sends this to the GpuCommandBufferStub in its - // destructor, so that the stub deletes the actual CommandBufferService - // object that it's hosting. - // TODO(apatrick): Implement this. - IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyCommandBuffer, - int32 /* instance_id */) - - // Create hardware video decoder && associate it with the output |decoder_id|; - // We need this to be control message because we had to map the GpuChannel and - // |decoder_id|. - IPC_MESSAGE_CONTROL2(GpuChannelMsg_CreateVideoDecoder, - int32, /* context_route_id */ - int32) /* decoder_id */ - - // Release all resource of the hardware video decoder which was assocaited - // with the input |decoder_id|. - // TODO(hclam): This message needs to be asynchronous. - IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyVideoDecoder, - int32 /* decoder_id */) - -IPC_END_MESSAGES(GpuChannel) +// Tells the GPU process to create a new command buffer that renders directly +// to a native view. The |render_view_id| is currently needed only on Mac OS +// X in order to identify the window on the browser side into which the +// rendering results go. A corresponding GpuCommandBufferStub is created. +IPC_SYNC_MESSAGE_CONTROL3_1(GpuChannelMsg_CreateViewCommandBuffer, + gfx::NativeViewId, /* view */ + int32, /* render_view_id */ + GPUCreateCommandBufferConfig, /* init_params */ + int32 /* route_id */) + +// Tells the GPU process to create a new command buffer that renders to an +// offscreen frame buffer. If parent_route_id is not zero, the texture backing +// the frame buffer is mapped into the corresponding parent command buffer's +// namespace, with the name of parent_texture_id. This ID is in the parent's +// namespace. +IPC_SYNC_MESSAGE_CONTROL4_1(GpuChannelMsg_CreateOffscreenCommandBuffer, + int32, /* parent_route_id */ + gfx::Size, /* size */ + GPUCreateCommandBufferConfig, /* init_params */ + uint32, /* parent_texture_id */ + int32 /* route_id */) + +// The CommandBufferProxy sends this to the GpuCommandBufferStub in its +// destructor, so that the stub deletes the actual CommandBufferService +// object that it's hosting. +// TODO(apatrick): Implement this. +IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyCommandBuffer, + int32 /* instance_id */) + +// Create hardware video decoder && associate it with the output |decoder_id|; +// We need this to be control message because we had to map the GpuChannel and +// |decoder_id|. +IPC_MESSAGE_CONTROL2(GpuChannelMsg_CreateVideoDecoder, + int32, /* context_route_id */ + int32) /* decoder_id */ + +// Release all resource of the hardware video decoder which was assocaited +// with the input |decoder_id|. +// TODO(hclam): This message needs to be asynchronous. +IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyVideoDecoder, + int32 /* decoder_id */) //------------------------------------------------------------------------------ // GPU Command Buffer Messages // These are messages between a renderer process to the GPU process relating to // a single OpenGL context. -IPC_BEGIN_MESSAGES(GpuCommandBuffer) - // Initialize a command buffer with the given number of command entries. - // Returns the shared memory handle for the command buffer mapped to the - // calling process. - IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_Initialize, - int32 /* size */, - base::SharedMemoryHandle /* ring_buffer */) - - // Get the current state of the command buffer. - IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetState, - gpu::CommandBuffer::State /* state */) - - // Get the current state of the command buffer asynchronously. State is - // returned via UpdateState message. - IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_AsyncGetState) - - // Synchronize the put and get offsets of both processes. Caller passes its - // current put offset. Current state (including get offset) is returned. - IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_Flush, - int32 /* put_offset */, - gpu::CommandBuffer::State /* state */) - - // Asynchronously synchronize the put and get offsets of both processes. - // Caller passes its current put offset. Current state (including get offset) - // is returned via an UpdateState message. - IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_AsyncFlush, - int32 /* put_offset */) - - // Return the current state of the command buffer following a request via - // an AsyncGetState or AsyncFlush message. (This message is sent from the - // GPU process to the renderer process.) - IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_UpdateState, - gpu::CommandBuffer::State /* state */) - - // Indicates that a SwapBuffers call has been issued. - IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_SwapBuffers) - - // Create a shared memory transfer buffer. Returns an id that can be used to - // identify the transfer buffer from a comment. - IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_CreateTransferBuffer, - int32 /* size */, - int32 /* id */) - - // Destroy a previously created transfer buffer. - IPC_SYNC_MESSAGE_ROUTED1_0(GpuCommandBufferMsg_DestroyTransferBuffer, - int32 /* id */) - - // Get the shared memory handle for a transfer buffer mapped to the callers - // process. - IPC_SYNC_MESSAGE_ROUTED1_2(GpuCommandBufferMsg_GetTransferBuffer, - int32 /* id */, - base::SharedMemoryHandle /* transfer_buffer */, - uint32 /* size */) - - // Send from command buffer stub to proxy when window is invalid and must be - // repainted. - IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_NotifyRepaint) - - // Tells the GPU process to resize an offscreen frame buffer. - IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ResizeOffscreenFrameBuffer, - gfx::Size /* size */) +// Initialize a command buffer with the given number of command entries. +// Returns the shared memory handle for the command buffer mapped to the +// calling process. +IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_Initialize, + int32 /* size */, + base::SharedMemoryHandle /* ring_buffer */) + +// Get the current state of the command buffer. +IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetState, + gpu::CommandBuffer::State /* state */) + +// Get the current state of the command buffer asynchronously. State is +// returned via UpdateState message. +IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_AsyncGetState) + +// Synchronize the put and get offsets of both processes. Caller passes its +// current put offset. Current state (including get offset) is returned. +IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_Flush, + int32 /* put_offset */, + gpu::CommandBuffer::State /* state */) + +// Asynchronously synchronize the put and get offsets of both processes. +// Caller passes its current put offset. Current state (including get offset) +// is returned via an UpdateState message. +IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_AsyncFlush, + int32 /* put_offset */) + +// Return the current state of the command buffer following a request via +// an AsyncGetState or AsyncFlush message. (This message is sent from the +// GPU process to the renderer process.) +IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_UpdateState, + gpu::CommandBuffer::State /* state */) + +// Indicates that a SwapBuffers call has been issued. +IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_SwapBuffers) + +// Create a shared memory transfer buffer. Returns an id that can be used to +// identify the transfer buffer from a comment. +IPC_SYNC_MESSAGE_ROUTED1_1(GpuCommandBufferMsg_CreateTransferBuffer, + int32 /* size */, + int32 /* id */) + +// Destroy a previously created transfer buffer. +IPC_SYNC_MESSAGE_ROUTED1_0(GpuCommandBufferMsg_DestroyTransferBuffer, + int32 /* id */) + +// Get the shared memory handle for a transfer buffer mapped to the callers +// process. +IPC_SYNC_MESSAGE_ROUTED1_2(GpuCommandBufferMsg_GetTransferBuffer, + int32 /* id */, + base::SharedMemoryHandle /* transfer_buffer */, + uint32 /* size */) + +// Send from command buffer stub to proxy when window is invalid and must be +// repainted. +IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_NotifyRepaint) + +// Tells the GPU process to resize an offscreen frame buffer. +IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ResizeOffscreenFrameBuffer, + gfx::Size /* size */) #if defined(OS_MACOSX) - // On Mac OS X the GPU plugin must be offscreen, because there is no - // true cross-process window hierarchy. For this reason we must send - // resize events explicitly to the command buffer stub so it can - // reallocate its backing store and send the new one back to the - // browser. This message is currently used only on 10.6 and later. - IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetWindowSize, - gfx::Size /* size */) +// On Mac OS X the GPU plugin must be offscreen, because there is no +// true cross-process window hierarchy. For this reason we must send +// resize events explicitly to the command buffer stub so it can +// reallocate its backing store and send the new one back to the +// browser. This message is currently used only on 10.6 and later. +IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetWindowSize, + gfx::Size /* size */) #endif -IPC_END_MESSAGES(GpuCommandBuffer) - //------------------------------------------------------------------------------ // GPU Video Decoder Messages // These messages are sent from Renderer process to GPU process. -IPC_BEGIN_MESSAGES(GpuVideoDecoder) - // Initialize and configure GpuVideoDecoder asynchronously. - IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_Initialize, - GpuVideoDecoderInitParam) - - // Destroy and release GpuVideoDecoder asynchronously. - IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Destroy) +// Initialize and configure GpuVideoDecoder asynchronously. +IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_Initialize, + GpuVideoDecoderInitParam) - // Start decoder flushing operation. - IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Flush) +// Destroy and release GpuVideoDecoder asynchronously. +IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Destroy) - // Tell the decoder to start prerolling. - IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Preroll) +// Start decoder flushing operation. +IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Flush) - // Send input buffer to GpuVideoDecoder. - IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_EmptyThisBuffer, - GpuVideoDecoderInputBufferParam) +// Tell the decoder to start prerolling. +IPC_MESSAGE_ROUTED0(GpuVideoDecoderMsg_Preroll) - // Ask the GPU process to produce a video frame with the ID. - IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_ProduceVideoFrame, - int32) /* Video Frame ID */ +// Send input buffer to GpuVideoDecoder. +IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_EmptyThisBuffer, + GpuVideoDecoderInputBufferParam) - // Sent from Renderer process to the GPU process to notify that textures are - // generated for a video frame. - IPC_MESSAGE_ROUTED2(GpuVideoDecoderMsg_VideoFrameAllocated, - int32, /* Video Frame ID */ - std::vector<uint32>) /* Textures for video frame */ +// Ask the GPU process to produce a video frame with the ID. +IPC_MESSAGE_ROUTED1(GpuVideoDecoderMsg_ProduceVideoFrame, + int32) /* Video Frame ID */ -IPC_END_MESSAGES(GpuVideoDecoder) +// Sent from Renderer process to the GPU process to notify that textures are +// generated for a video frame. +IPC_MESSAGE_ROUTED2(GpuVideoDecoderMsg_VideoFrameAllocated, + int32, /* Video Frame ID */ + std::vector<uint32>) /* Textures for video frame */ //------------------------------------------------------------------------------ // GPU Video Decoder Host Messages // These messages are sent from GPU process to Renderer process. -IPC_BEGIN_MESSAGES(GpuVideoDecoderHost) - // Inform GpuVideoDecoderHost that a GpuVideoDecoder is created. - IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_CreateVideoDecoderDone, - int32) /* decoder_id */ - - // Confirm GpuVideoDecoder had been initialized or failed to initialize. - // TODO(hclam): Change this to Done instead of ACK. - IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_InitializeACK, - GpuVideoDecoderInitDoneParam) - - // Confrim GpuVideoDecoder had been destroyed properly. - // TODO(hclam): Change this to Done instead of ACK. - IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_DestroyACK) - - // Confirm decoder had been flushed. - // TODO(hclam): Change this to Done instead of ACK. - IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_FlushACK) - - // Confirm preroll operation is done. - IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_PrerollDone) - - // GpuVideoDecoder has consumed input buffer from transfer buffer. - // TODO(hclam): Change this to Done instead of ACK. - IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_EmptyThisBufferACK) - - // GpuVideoDecoder require new input buffer. - IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_EmptyThisBufferDone) - - // GpuVideoDecoder reports that a video frame is ready to be consumed. - IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_ConsumeVideoFrame, - int32, /* Video Frame ID */ - int64, /* Timestamp in microseconds */ - int64, /* Duration in microseconds */ - int32) /* Flags */ - - // Allocate video frames for output of the hardware video decoder. - IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_AllocateVideoFrames, - int32, /* Number of video frames to generate */ - uint32, /* Width of the video frame */ - uint32, /* Height of the video frame */ - int32 /* Format of the video frame */) - - // Release all video frames allocated for a hardware video decoder. - IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_ReleaseAllVideoFrames) - - // GpuVideoDecoder report output format change. - IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_MediaFormatChange, - GpuVideoDecoderFormatChangeParam) - - // GpuVideoDecoder report error. - IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_ErrorNotification, - GpuVideoDecoderErrorInfoParam) - -IPC_END_MESSAGES(GpuVideoDecoderHost) +// Inform GpuVideoDecoderHost that a GpuVideoDecoder is created. +IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_CreateVideoDecoderDone, + int32) /* decoder_id */ + +// Confirm GpuVideoDecoder had been initialized or failed to initialize. +// TODO(hclam): Change this to Done instead of ACK. +IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_InitializeACK, + GpuVideoDecoderInitDoneParam) + +// Confrim GpuVideoDecoder had been destroyed properly. +// TODO(hclam): Change this to Done instead of ACK. +IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_DestroyACK) + +// Confirm decoder had been flushed. +// TODO(hclam): Change this to Done instead of ACK. +IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_FlushACK) + +// Confirm preroll operation is done. +IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_PrerollDone) + +// GpuVideoDecoder has consumed input buffer from transfer buffer. +// TODO(hclam): Change this to Done instead of ACK. +IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_EmptyThisBufferACK) + +// GpuVideoDecoder require new input buffer. +IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_EmptyThisBufferDone) + +// GpuVideoDecoder reports that a video frame is ready to be consumed. +IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_ConsumeVideoFrame, + int32, /* Video Frame ID */ + int64, /* Timestamp in microseconds */ + int64, /* Duration in microseconds */ + int32) /* Flags */ + +// Allocate video frames for output of the hardware video decoder. +IPC_MESSAGE_ROUTED4(GpuVideoDecoderHostMsg_AllocateVideoFrames, + int32, /* Number of video frames to generate */ + uint32, /* Width of the video frame */ + uint32, /* Height of the video frame */ + int32 /* Format of the video frame */) + +// Release all video frames allocated for a hardware video decoder. +IPC_MESSAGE_ROUTED0(GpuVideoDecoderHostMsg_ReleaseAllVideoFrames) + +// GpuVideoDecoder report output format change. +IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_MediaFormatChange, + GpuVideoDecoderFormatChangeParam) + +// GpuVideoDecoder report error. +IPC_MESSAGE_ROUTED1(GpuVideoDecoderHostMsg_ErrorNotification, + GpuVideoDecoderErrorInfoParam) diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index e5d442c..c607f21 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -238,7 +238,7 @@ void InitChromeLogging(const CommandLine& command_line, "Attempted to initialize logging when it was already initialized."; #if defined(OS_POSIX) && defined(IPC_MESSAGE_LOG_ENABLED) - IPC::Logging::SetLoggerFunctions(g_log_function_mapping); + IPC::Logging::set_log_function_map(&g_log_function_mapping); #endif FilePath log_path = GetLogFileName(); diff --git a/chrome/common/nacl_messages.cc b/chrome/common/nacl_messages.cc index 291ed5a..1b2aff9 100644 --- a/chrome/common/nacl_messages.cc +++ b/chrome/common/nacl_messages.cc @@ -2,8 +2,5 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#define IPC_MESSAGE_IMPL #include "chrome/common/nacl_messages.h" - -#define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/common/nacl_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/nacl_messages.h b/chrome/common/nacl_messages.h index 11abf19..6c7c771 100644 --- a/chrome/common/nacl_messages.h +++ b/chrome/common/nacl_messages.h @@ -8,11 +8,6 @@ #define CHROME_COMMON_NACL_MESSAGES_H_ #pragma once -#include "base/basictypes.h" -#include "ipc/ipc_message_utils.h" - -#define MESSAGES_INTERNAL_FILE "chrome/common/nacl_messages_internal.h" -#include "ipc/ipc_message_macros.h" +#include "chrome/common/nacl_messages_internal.h" #endif // CHROME_COMMON_NACL_MESSAGES_H_ - diff --git a/chrome/common/nacl_messages_internal.h b/chrome/common/nacl_messages_internal.h index e302118..ea96a03 100644 --- a/chrome/common/nacl_messages_internal.h +++ b/chrome/common/nacl_messages_internal.h @@ -6,25 +6,24 @@ #include "chrome/common/nacl_types.h" #include "ipc/ipc_message_macros.h" +#define IPC_MESSAGE_START NaClMsgStart + //----------------------------------------------------------------------------- // NaClProcess messages // These are messages sent from the browser to the NaCl process. -IPC_BEGIN_MESSAGES(NaClProcess) - // Tells the NaCl process to start. - IPC_MESSAGE_CONTROL1(NaClProcessMsg_Start, - std::vector<nacl::FileDescriptor> /* sockets */) - - // Tells the NaCl broker to launch a NaCl loader process. - IPC_MESSAGE_CONTROL1(NaClProcessMsg_LaunchLoaderThroughBroker, - std::wstring /* channel ID for the loader */) +// Tells the NaCl process to start. +IPC_MESSAGE_CONTROL1(NaClProcessMsg_Start, + std::vector<nacl::FileDescriptor> /* sockets */) - // Notify the browser process that the loader was launched successfully. - IPC_MESSAGE_CONTROL2(NaClProcessMsg_LoaderLaunched, - std::wstring, /* channel ID for the loader */ - base::ProcessHandle /* loader process handle */) +// Tells the NaCl broker to launch a NaCl loader process. +IPC_MESSAGE_CONTROL1(NaClProcessMsg_LaunchLoaderThroughBroker, + std::wstring /* channel ID for the loader */) - // Notify the broker that all loader processes have been terminated and it - // should shutdown. - IPC_MESSAGE_CONTROL0(NaClProcessMsg_StopBroker) -IPC_END_MESSAGES(NaClProcess) +// Notify the browser process that the loader was launched successfully. +IPC_MESSAGE_CONTROL2(NaClProcessMsg_LoaderLaunched, + std::wstring, /* channel ID for the loader */ + base::ProcessHandle /* loader process handle */) +// Notify the broker that all loader processes have been terminated and it +// should shutdown. +IPC_MESSAGE_CONTROL0(NaClProcessMsg_StopBroker) diff --git a/chrome/common/plugin_messages.cc b/chrome/common/plugin_messages.cc index 0434197..d9117ff 100644 --- a/chrome/common/plugin_messages.cc +++ b/chrome/common/plugin_messages.cc @@ -2,14 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/plugin_messages.h" - #include "base/utf_string_conversions.h" #include "ipc/ipc_channel_handle.h" -#define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/common/plugin_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" +#define IPC_MESSAGE_IMPL +#include "chrome/common/plugin_messages.h" PluginMsg_Init_Params::PluginMsg_Init_Params() : containing_window(0), diff --git a/chrome/common/plugin_messages.h b/chrome/common/plugin_messages.h index 3935fa8..4753c9d6 100644 --- a/chrome/common/plugin_messages.h +++ b/chrome/common/plugin_messages.h @@ -236,8 +236,6 @@ struct ParamTraits<PluginMsg_UpdateGeometry_Param> { } // namespace IPC - -#define MESSAGES_INTERNAL_FILE "chrome/common/plugin_messages_internal.h" -#include "ipc/ipc_message_macros.h" +#include "chrome/common/plugin_messages_internal.h" #endif // CHROME_COMMON_PLUGIN_MESSAGES_H_ diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h index 7ebfd58..54ba2eb 100644 --- a/chrome/common/plugin_messages_internal.h +++ b/chrome/common/plugin_messages_internal.h @@ -12,523 +12,511 @@ #include "base/file_descriptor_posix.h" #endif +#define IPC_MESSAGE_START PluginMsgStart + //----------------------------------------------------------------------------- // PluginProcess messages // These are messages sent from the browser to the plugin process. -IPC_BEGIN_MESSAGES(PluginProcess) - // Tells the plugin process to create a new channel for communication with a - // given renderer. The channel name is returned in a - // PluginProcessHostMsg_ChannelCreated message. The renderer ID is passed so - // that the plugin process reuses an existing channel to that process if it - // exists. This ID is a unique opaque identifier generated by the browser - // process. - IPC_MESSAGE_CONTROL2(PluginProcessMsg_CreateChannel, - int /* renderer_id */, - bool /* off_the_record */) - - // Allows a chrome plugin loaded in the browser process to send arbitrary - // data to an instance of the same plugin loaded in a plugin process. - IPC_MESSAGE_CONTROL1(PluginProcessMsg_PluginMessage, - std::vector<uint8> /* opaque data */) - - // Tells the plugin process to notify every connected renderer of the pending - // shutdown, so we don't mistake it for a crash. - IPC_MESSAGE_CONTROL0(PluginProcessMsg_NotifyRenderersOfPendingShutdown) - - // The following messages are used by all child processes, even though they - // are listed under PluginProcess. It seems overkill to define ChildProcess. - // Tells the child process it should stop. - IPC_MESSAGE_CONTROL0(PluginProcessMsg_AskBeforeShutdown) - - // Sent in response to PluginProcessHostMsg_ShutdownRequest to tell the child - // process that it's safe to shutdown. - IPC_MESSAGE_CONTROL0(PluginProcessMsg_Shutdown) +// Tells the plugin process to create a new channel for communication with a +// given renderer. The channel name is returned in a +// PluginProcessHostMsg_ChannelCreated message. The renderer ID is passed so +// that the plugin process reuses an existing channel to that process if it +// exists. This ID is a unique opaque identifier generated by the browser +// process. +IPC_MESSAGE_CONTROL2(PluginProcessMsg_CreateChannel, + int /* renderer_id */, + bool /* off_the_record */) + +// Allows a chrome plugin loaded in the browser process to send arbitrary +// data to an instance of the same plugin loaded in a plugin process. +IPC_MESSAGE_CONTROL1(PluginProcessMsg_PluginMessage, + std::vector<uint8> /* opaque data */) + +// Tells the plugin process to notify every connected renderer of the pending +// shutdown, so we don't mistake it for a crash. +IPC_MESSAGE_CONTROL0(PluginProcessMsg_NotifyRenderersOfPendingShutdown) + +// The following messages are used by all child processes, even though they +// are listed under PluginProcess. It seems overkill to define ChildProcess. +// Tells the child process it should stop. +IPC_MESSAGE_CONTROL0(PluginProcessMsg_AskBeforeShutdown) + +// Sent in response to PluginProcessHostMsg_ShutdownRequest to tell the child +// process that it's safe to shutdown. +IPC_MESSAGE_CONTROL0(PluginProcessMsg_Shutdown) #if defined(IPC_MESSAGE_LOG_ENABLED) - // Tell the child process to begin or end IPC message logging. - // Like above, this is used by all ChildProcesses. - IPC_MESSAGE_CONTROL1(PluginProcessMsg_SetIPCLoggingEnabled, - bool /* on or off */) +// Tell the child process to begin or end IPC message logging. +// Like above, this is used by all ChildProcesses. +IPC_MESSAGE_CONTROL1(PluginProcessMsg_SetIPCLoggingEnabled, + bool /* on or off */) #endif -IPC_END_MESSAGES(PluginProcess) - //----------------------------------------------------------------------------- // PluginProcessHost messages // These are messages sent from the plugin process to the browser process. -IPC_BEGIN_MESSAGES(PluginProcessHost) - // Response to a PluginProcessMsg_CreateChannel message. - IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_ChannelCreated, - IPC::ChannelHandle /* channel_handle */) - - IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginFinderUrl, - std::string /* plugin finder URL */) - - IPC_MESSAGE_CONTROL0(PluginProcessHostMsg_ShutdownRequest) - - // 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_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 */) - - // Used to get cookies for the given URL. The request_context is a - // CPBrowsingContext, but is passed as int32 to avoid compilation errors. - IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_GetCookies, - int32 /* request_context */, - GURL /* url */, - std::string /* cookies */) - - // Used by the plugin process to verify that its renderer |renderer_id| has - // permission to access the given |files|. - IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_AccessFiles, - int /* renderer_id */, - std::vector<std::string> /* files */, - bool /* allowed */) - - // Get the list of proxies to use for |url|, as a semicolon delimited list - // of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also ViewHostMsg_ResolveProxy - // which does the same thing. - IPC_SYNC_MESSAGE_CONTROL1_2(PluginProcessHostMsg_ResolveProxy, - GURL /* url */, - int /* network error */, - std::string /* proxy list */) +// Response to a PluginProcessMsg_CreateChannel message. +IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_ChannelCreated, + IPC::ChannelHandle /* channel_handle */) + +IPC_SYNC_MESSAGE_CONTROL0_1(PluginProcessHostMsg_GetPluginFinderUrl, + std::string /* plugin finder URL */) + +IPC_MESSAGE_CONTROL0(PluginProcessHostMsg_ShutdownRequest) + +// 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_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 */) + +// Used to get cookies for the given URL. The request_context is a +// CPBrowsingContext, but is passed as int32 to avoid compilation errors. +IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_GetCookies, + int32 /* request_context */, + GURL /* url */, + std::string /* cookies */) + +// Used by the plugin process to verify that its renderer |renderer_id| has +// permission to access the given |files|. +IPC_SYNC_MESSAGE_CONTROL2_1(PluginProcessHostMsg_AccessFiles, + int /* renderer_id */, + std::vector<std::string> /* files */, + bool /* allowed */) + +// Get the list of proxies to use for |url|, as a semicolon delimited list +// of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also ViewHostMsg_ResolveProxy +// which does the same thing. +IPC_SYNC_MESSAGE_CONTROL1_2(PluginProcessHostMsg_ResolveProxy, + GURL /* url */, + int /* network error */, + std::string /* proxy list */) #if defined(OS_WIN) - // Creates a child window of the given parent window on the UI thread. - IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_CreateWindow, - HWND /* parent */, - HWND /* child */) - - // Destroys the given window's parent on the UI thread. - IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginWindowDestroyed, - HWND /* window */, - HWND /* parent */) - - IPC_MESSAGE_ROUTED3(PluginProcessHostMsg_DownloadUrl, - std::string /* URL */, - int /* process id */, - HWND /* caller window */) +// Creates a child window of the given parent window on the UI thread. +IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_CreateWindow, + HWND /* parent */, + HWND /* child */) + +// Destroys the given window's parent on the UI thread. +IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginWindowDestroyed, + HWND /* window */, + HWND /* parent */) + +IPC_MESSAGE_ROUTED3(PluginProcessHostMsg_DownloadUrl, + std::string /* URL */, + int /* process id */, + HWND /* caller window */) #endif #if defined(USE_X11) - // On X11, the mapping between NativeViewId and X window ids - // is known only to the browser. This message lets the plugin process - // ask about a NativeViewId that was provided by the renderer. - // It will get 0 back if it's a bogus input. - IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_MapNativeViewId, - gfx::NativeViewId /* input: native view id */, - gfx::PluginWindowHandle /* output: X window id */) +// On X11, the mapping between NativeViewId and X window ids +// is known only to the browser. This message lets the plugin process +// ask about a NativeViewId that was provided by the renderer. +// It will get 0 back if it's a bogus input. +IPC_SYNC_MESSAGE_CONTROL1_1(PluginProcessHostMsg_MapNativeViewId, + gfx::NativeViewId /* input: native view id */, + gfx::PluginWindowHandle /* output: X window id */) #endif #if defined(OS_MACOSX) - // On Mac OS X, we need the browser to keep track of plugin windows so - // that it can add and remove them from stacking groups, hide and show the - // menu bar, etc. We pass the window rect for convenience so that the - // browser can easily tell if the window is fullscreen. - - // Notifies the browser that the plugin has selected a window (i.e., brought - // it to the front and wants it to have keyboard focus). - IPC_MESSAGE_CONTROL3(PluginProcessHostMsg_PluginSelectWindow, - uint32 /* window ID */, - gfx::Rect /* window rect */, - bool /* modal */) - - // Notifies the browser that the plugin has shown a window. - IPC_MESSAGE_CONTROL3(PluginProcessHostMsg_PluginShowWindow, - uint32 /* window ID */, - gfx::Rect /* window rect */, - bool /* modal */) - - // Notifies the browser that the plugin has hidden a window. - IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginHideWindow, - uint32 /* window ID */, - gfx::Rect /* window rect */) - - // Notifies the browser that a plugin instance has requested a cursor - // visibility change. - IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_PluginSetCursorVisibility, - bool /* cursor visibility */) +// On Mac OS X, we need the browser to keep track of plugin windows so +// that it can add and remove them from stacking groups, hide and show the +// menu bar, etc. We pass the window rect for convenience so that the +// browser can easily tell if the window is fullscreen. + +// Notifies the browser that the plugin has selected a window (i.e., brought +// it to the front and wants it to have keyboard focus). +IPC_MESSAGE_CONTROL3(PluginProcessHostMsg_PluginSelectWindow, + uint32 /* window ID */, + gfx::Rect /* window rect */, + bool /* modal */) + +// Notifies the browser that the plugin has shown a window. +IPC_MESSAGE_CONTROL3(PluginProcessHostMsg_PluginShowWindow, + uint32 /* window ID */, + gfx::Rect /* window rect */, + bool /* modal */) + +// Notifies the browser that the plugin has hidden a window. +IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_PluginHideWindow, + uint32 /* window ID */, + gfx::Rect /* window rect */) + +// Notifies the browser that a plugin instance has requested a cursor +// visibility change. +IPC_MESSAGE_CONTROL1(PluginProcessHostMsg_PluginSetCursorVisibility, + bool /* cursor visibility */) #endif -IPC_END_MESSAGES(PluginProcessHost) - //----------------------------------------------------------------------------- // Plugin messages // These are messages sent from the renderer process to the plugin process. -IPC_BEGIN_MESSAGES(Plugin) - // Tells the plugin process to create a new plugin instance with the given - // id. A corresponding WebPluginDelegateStub is created which hosts the - // WebPluginDelegateImpl. - IPC_SYNC_MESSAGE_CONTROL1_1(PluginMsg_CreateInstance, - std::string /* mime_type */, - int /* instance_id */) - - // The WebPluginDelegateProxy sends this to the WebPluginDelegateStub in its - // destructor, so that the stub deletes the actual WebPluginDelegateImpl - // object that it's hosting. - IPC_SYNC_MESSAGE_CONTROL1_0(PluginMsg_DestroyInstance, - int /* instance_id */) - - IPC_SYNC_MESSAGE_CONTROL0_1(PluginMsg_GenerateRouteID, - int /* id */) - - // The messages below all map to WebPluginDelegate methods. - IPC_SYNC_MESSAGE_ROUTED1_1(PluginMsg_Init, - PluginMsg_Init_Params, - bool /* result */) - - // Used to synchronously request a paint for windowless plugins. - IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_Paint, - gfx::Rect /* damaged_rect */) - - // Sent by the renderer after it paints from its backing store so that the - // plugin knows it can send more invalidates. - IPC_MESSAGE_ROUTED0(PluginMsg_DidPaint) - - IPC_SYNC_MESSAGE_ROUTED0_2(PluginMsg_Print, - base::SharedMemoryHandle /* shared_memory*/, - uint32 /* size */) - - IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_GetPluginScriptableObject, - int /* route_id */) - - IPC_MESSAGE_ROUTED3(PluginMsg_DidFinishLoadWithReason, - GURL /* url */, - int /* reason */, - int /* notify_id */) - - // Updates the plugin location. - IPC_MESSAGE_ROUTED1(PluginMsg_UpdateGeometry, - PluginMsg_UpdateGeometry_Param) - - // A synchronous version of above. - IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_UpdateGeometrySync, - PluginMsg_UpdateGeometry_Param) - - IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_SetFocus, - bool /* focused */) - - IPC_SYNC_MESSAGE_ROUTED1_2(PluginMsg_HandleInputEvent, - IPC::WebInputEventPointer /* event */, - bool /* handled */, - WebCursor /* cursor type*/) - - IPC_MESSAGE_ROUTED1(PluginMsg_SetContentAreaFocus, - bool /* has_focus */) +// Tells the plugin process to create a new plugin instance with the given +// id. A corresponding WebPluginDelegateStub is created which hosts the +// WebPluginDelegateImpl. +IPC_SYNC_MESSAGE_CONTROL1_1(PluginMsg_CreateInstance, + std::string /* mime_type */, + int /* instance_id */) + +// The WebPluginDelegateProxy sends this to the WebPluginDelegateStub in its +// destructor, so that the stub deletes the actual WebPluginDelegateImpl +// object that it's hosting. +IPC_SYNC_MESSAGE_CONTROL1_0(PluginMsg_DestroyInstance, + int /* instance_id */) + +IPC_SYNC_MESSAGE_CONTROL0_1(PluginMsg_GenerateRouteID, + int /* id */) + +// The messages below all map to WebPluginDelegate methods. +IPC_SYNC_MESSAGE_ROUTED1_1(PluginMsg_Init, + PluginMsg_Init_Params, + bool /* result */) + +// Used to synchronously request a paint for windowless plugins. +IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_Paint, + gfx::Rect /* damaged_rect */) + +// Sent by the renderer after it paints from its backing store so that the +// plugin knows it can send more invalidates. +IPC_MESSAGE_ROUTED0(PluginMsg_DidPaint) + +IPC_SYNC_MESSAGE_ROUTED0_2(PluginMsg_Print, + base::SharedMemoryHandle /* shared_memory*/, + uint32 /* size */) + +IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_GetPluginScriptableObject, + int /* route_id */) + +IPC_MESSAGE_ROUTED3(PluginMsg_DidFinishLoadWithReason, + GURL /* url */, + int /* reason */, + int /* notify_id */) + +// Updates the plugin location. +IPC_MESSAGE_ROUTED1(PluginMsg_UpdateGeometry, + PluginMsg_UpdateGeometry_Param) + +// A synchronous version of above. +IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_UpdateGeometrySync, + PluginMsg_UpdateGeometry_Param) + +IPC_SYNC_MESSAGE_ROUTED1_0(PluginMsg_SetFocus, + bool /* focused */) + +IPC_SYNC_MESSAGE_ROUTED1_2(PluginMsg_HandleInputEvent, + IPC::WebInputEventPointer /* event */, + bool /* handled */, + WebCursor /* cursor type*/) + +IPC_MESSAGE_ROUTED1(PluginMsg_SetContentAreaFocus, + bool /* has_focus */) #if defined(OS_MACOSX) - IPC_MESSAGE_ROUTED1(PluginMsg_SetWindowFocus, - bool /* has_focus */) +IPC_MESSAGE_ROUTED1(PluginMsg_SetWindowFocus, + bool /* has_focus */) - IPC_MESSAGE_ROUTED0(PluginMsg_ContainerHidden) +IPC_MESSAGE_ROUTED0(PluginMsg_ContainerHidden) - IPC_MESSAGE_ROUTED3(PluginMsg_ContainerShown, - gfx::Rect /* window_frame */, - gfx::Rect /* view_frame */, - bool /* has_focus */) +IPC_MESSAGE_ROUTED3(PluginMsg_ContainerShown, + gfx::Rect /* window_frame */, + gfx::Rect /* view_frame */, + bool /* has_focus */) - IPC_MESSAGE_ROUTED2(PluginMsg_WindowFrameChanged, - gfx::Rect /* window_frame */, - gfx::Rect /* view_frame */) +IPC_MESSAGE_ROUTED2(PluginMsg_WindowFrameChanged, + gfx::Rect /* window_frame */, + gfx::Rect /* view_frame */) - IPC_MESSAGE_ROUTED1(PluginMsg_ImeCompositionConfirmed, - string16 /* text */) +IPC_MESSAGE_ROUTED1(PluginMsg_ImeCompositionConfirmed, + string16 /* text */) #endif - IPC_SYNC_MESSAGE_ROUTED3_0(PluginMsg_WillSendRequest, - unsigned long /* id */, - GURL /* url */, - int /* http_status_code */) +IPC_SYNC_MESSAGE_ROUTED3_0(PluginMsg_WillSendRequest, + unsigned long /* id */, + GURL /* url */, + int /* http_status_code */) - IPC_MESSAGE_ROUTED1(PluginMsg_DidReceiveResponse, - PluginMsg_DidReceiveResponseParams) +IPC_MESSAGE_ROUTED1(PluginMsg_DidReceiveResponse, + PluginMsg_DidReceiveResponseParams) - IPC_MESSAGE_ROUTED3(PluginMsg_DidReceiveData, - unsigned long /* id */, - std::vector<char> /* buffer */, - int /* data_offset */) +IPC_MESSAGE_ROUTED3(PluginMsg_DidReceiveData, + unsigned long /* id */, + std::vector<char> /* buffer */, + int /* data_offset */) - IPC_MESSAGE_ROUTED1(PluginMsg_DidFinishLoading, - unsigned long /* id */) +IPC_MESSAGE_ROUTED1(PluginMsg_DidFinishLoading, + unsigned long /* id */) - IPC_MESSAGE_ROUTED1(PluginMsg_DidFail, - unsigned long /* id */) +IPC_MESSAGE_ROUTED1(PluginMsg_DidFail, + unsigned long /* id */) - IPC_MESSAGE_ROUTED4(PluginMsg_SendJavaScriptStream, - GURL /* url */, - std::string /* result */, - bool /* success */, - int /* notify_id */) +IPC_MESSAGE_ROUTED4(PluginMsg_SendJavaScriptStream, + GURL /* url */, + std::string /* result */, + bool /* success */, + int /* notify_id */) - IPC_MESSAGE_ROUTED2(PluginMsg_DidReceiveManualResponse, - GURL /* url */, - PluginMsg_DidReceiveResponseParams) +IPC_MESSAGE_ROUTED2(PluginMsg_DidReceiveManualResponse, + GURL /* url */, + PluginMsg_DidReceiveResponseParams) - IPC_MESSAGE_ROUTED1(PluginMsg_DidReceiveManualData, - std::vector<char> /* buffer */) +IPC_MESSAGE_ROUTED1(PluginMsg_DidReceiveManualData, + std::vector<char> /* buffer */) - IPC_MESSAGE_ROUTED0(PluginMsg_DidFinishManualLoading) +IPC_MESSAGE_ROUTED0(PluginMsg_DidFinishManualLoading) - IPC_MESSAGE_ROUTED0(PluginMsg_DidManualLoadFail) +IPC_MESSAGE_ROUTED0(PluginMsg_DidManualLoadFail) - IPC_MESSAGE_ROUTED0(PluginMsg_InstallMissingPlugin) +IPC_MESSAGE_ROUTED0(PluginMsg_InstallMissingPlugin) - IPC_MESSAGE_ROUTED3(PluginMsg_HandleURLRequestReply, - unsigned long /* resource_id */, - GURL /* url */, - int /* notify_id */) +IPC_MESSAGE_ROUTED3(PluginMsg_HandleURLRequestReply, + unsigned long /* resource_id */, + GURL /* url */, + int /* notify_id */) - IPC_MESSAGE_ROUTED2(PluginMsg_HTTPRangeRequestReply, - unsigned long /* resource_id */, - int /* range_request_id */) +IPC_MESSAGE_ROUTED2(PluginMsg_HTTPRangeRequestReply, + unsigned long /* resource_id */, + int /* range_request_id */) - IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_CreateCommandBuffer, - int /* route_id */) +IPC_SYNC_MESSAGE_ROUTED0_1(PluginMsg_CreateCommandBuffer, + int /* route_id */) - IPC_MESSAGE_ROUTED0(PluginMsg_DestroyCommandBuffer) +IPC_MESSAGE_ROUTED0(PluginMsg_DestroyCommandBuffer) - IPC_MESSAGE_CONTROL1(PluginMsg_SignalModalDialogEvent, - gfx::NativeViewId /* containing_window */) +IPC_MESSAGE_CONTROL1(PluginMsg_SignalModalDialogEvent, + gfx::NativeViewId /* containing_window */) - IPC_MESSAGE_CONTROL1(PluginMsg_ResetModalDialogEvent, - gfx::NativeViewId /* containing_window */) +IPC_MESSAGE_CONTROL1(PluginMsg_ResetModalDialogEvent, + gfx::NativeViewId /* containing_window */) #if defined(OS_MACOSX) - // This message, used only on 10.6 and later, transmits the "fake" - // window handle allocated by the browser on behalf of the renderer - // to the GPU plugin. - IPC_MESSAGE_ROUTED1(PluginMsg_SetFakeAcceleratedSurfaceWindowHandle, - gfx::PluginWindowHandle /* window */) +// This message, used only on 10.6 and later, transmits the "fake" +// window handle allocated by the browser on behalf of the renderer +// to the GPU plugin. +IPC_MESSAGE_ROUTED1(PluginMsg_SetFakeAcceleratedSurfaceWindowHandle, + gfx::PluginWindowHandle /* window */) #endif - IPC_MESSAGE_CONTROL3(PluginMsg_ClearSiteData, - uint64, /* flags */ - std::string, /* domain */ - base::Time /* begin_time */) - -IPC_END_MESSAGES(Plugin) +IPC_MESSAGE_CONTROL3(PluginMsg_ClearSiteData, + uint64, /* flags */ + std::string, /* domain */ + base::Time /* begin_time */) //----------------------------------------------------------------------------- // PluginHost messages // These are messages sent from the plugin process to the renderer process. // They all map to the corresponding WebPlugin methods. -IPC_BEGIN_MESSAGES(PluginHost) - // Sends the plugin window information to the renderer. - // The window parameter is a handle to the window if the plugin is a windowed - // plugin. It is NULL for windowless plugins. - IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindow, - gfx::PluginWindowHandle /* window */) +// Sends the plugin window information to the renderer. +// The window parameter is a handle to the window if the plugin is a windowed +// plugin. It is NULL for windowless plugins. +IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindow, + gfx::PluginWindowHandle /* window */) #if defined(OS_WIN) - // The modal_loop_pump_messages_event parameter is an event handle which is - // passed in for windowless plugins and is used to indicate if messages - // are to be pumped in sync calls to the plugin process. Currently used - // in HandleEvent calls. - IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindowlessPumpEvent, - HANDLE /* modal_loop_pump_messages_event */) +// The modal_loop_pump_messages_event parameter is an event handle which is +// passed in for windowless plugins and is used to indicate if messages +// are to be pumped in sync calls to the plugin process. Currently used +// in HandleEvent calls. +IPC_SYNC_MESSAGE_ROUTED1_0(PluginHostMsg_SetWindowlessPumpEvent, + HANDLE /* modal_loop_pump_messages_event */) #endif - IPC_MESSAGE_ROUTED1(PluginHostMsg_URLRequest, - PluginHostMsg_URLRequest_Params) +IPC_MESSAGE_ROUTED1(PluginHostMsg_URLRequest, + PluginHostMsg_URLRequest_Params) - IPC_MESSAGE_ROUTED1(PluginHostMsg_CancelResource, - int /* id */) +IPC_MESSAGE_ROUTED1(PluginHostMsg_CancelResource, + int /* id */) - IPC_MESSAGE_ROUTED1(PluginHostMsg_InvalidateRect, - gfx::Rect /* rect */) +IPC_MESSAGE_ROUTED1(PluginHostMsg_InvalidateRect, + gfx::Rect /* rect */) - IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetWindowScriptNPObject, - int /* route id */, - bool /* success */) +IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetWindowScriptNPObject, + int /* route id */, + bool /* success */) - IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetPluginElement, - int /* route id */, - bool /* success */) +IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_GetPluginElement, + int /* route id */, + bool /* success */) - IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie, - GURL /* url */, - GURL /* first_party_for_cookies */, - std::string /* cookie */) +IPC_MESSAGE_ROUTED3(PluginHostMsg_SetCookie, + GURL /* url */, + GURL /* first_party_for_cookies */, + std::string /* cookie */) - IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_GetCookies, - GURL /* url */, - GURL /* first_party_for_cookies */, - std::string /* cookies */) +IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_GetCookies, + GURL /* url */, + GURL /* first_party_for_cookies */, + std::string /* cookies */) - // Asks the browser to show a modal HTML dialog. The dialog is passed the - // given arguments as a JSON string, and returns its result as a JSON string - // through json_retval. - IPC_SYNC_MESSAGE_ROUTED4_1(PluginHostMsg_ShowModalHTMLDialog, - GURL /* url */, - int /* width */, - int /* height */, - std::string /* json_arguments */, - std::string /* json_retval */) +// Asks the browser to show a modal HTML dialog. The dialog is passed the +// given arguments as a JSON string, and returns its result as a JSON string +// through json_retval. +IPC_SYNC_MESSAGE_ROUTED4_1(PluginHostMsg_ShowModalHTMLDialog, + GURL /* url */, + int /* width */, + int /* height */, + std::string /* json_arguments */, + std::string /* json_retval */) - IPC_SYNC_MESSAGE_ROUTED2_2(PluginHostMsg_GetDragData, - NPVariant_Param /* event */, - bool /* add_data */, - std::vector<NPVariant_Param> /* result_values */, - bool /* result_success */) +IPC_SYNC_MESSAGE_ROUTED2_2(PluginHostMsg_GetDragData, + NPVariant_Param /* event */, + bool /* add_data */, + std::vector<NPVariant_Param> /* result_values */, + bool /* result_success */) - IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_SetDropEffect, - NPVariant_Param /* event */, - int /* effect */, - bool /* result_success */) +IPC_SYNC_MESSAGE_ROUTED2_1(PluginHostMsg_SetDropEffect, + NPVariant_Param /* event */, + int /* effect */, + bool /* result_success */) - IPC_MESSAGE_ROUTED1(PluginHostMsg_MissingPluginStatus, - int /* status */) +IPC_MESSAGE_ROUTED1(PluginHostMsg_MissingPluginStatus, + int /* status */) - IPC_SYNC_MESSAGE_ROUTED0_1(PluginHostMsg_GetCPBrowsingContext, - uint32 /* context */) +IPC_SYNC_MESSAGE_ROUTED0_1(PluginHostMsg_GetCPBrowsingContext, + uint32 /* context */) - IPC_MESSAGE_ROUTED0(PluginHostMsg_CancelDocumentLoad) +IPC_MESSAGE_ROUTED0(PluginHostMsg_CancelDocumentLoad) - IPC_MESSAGE_ROUTED3(PluginHostMsg_InitiateHTTPRangeRequest, - std::string /* url */, - std::string /* range_info */, - int /* range_request_id */) +IPC_MESSAGE_ROUTED3(PluginHostMsg_InitiateHTTPRangeRequest, + std::string /* url */, + std::string /* range_info */, + int /* range_request_id */) - IPC_MESSAGE_ROUTED2(PluginHostMsg_DeferResourceLoading, - unsigned long /* resource_id */, - bool /* defer */) +IPC_MESSAGE_ROUTED2(PluginHostMsg_DeferResourceLoading, + unsigned long /* resource_id */, + bool /* defer */) - IPC_SYNC_MESSAGE_CONTROL1_0(PluginHostMsg_SetException, - std::string /* message */) +IPC_SYNC_MESSAGE_CONTROL1_0(PluginHostMsg_SetException, + std::string /* message */) - IPC_MESSAGE_CONTROL0(PluginHostMsg_PluginShuttingDown) +IPC_MESSAGE_CONTROL0(PluginHostMsg_PluginShuttingDown) #if defined(OS_MACOSX) - IPC_MESSAGE_ROUTED1(PluginHostMsg_UpdateGeometry_ACK, - int /* ack_key */) - - IPC_MESSAGE_ROUTED1(PluginHostMsg_SetImeEnabled, - bool /* enabled */) - - // This message, used in Mac OS X 10.5 and earlier, is sent from the plug-in - // process to the renderer process to indicate that the plug-in allocated a - // new TransportDIB that holds the GPU's rendered image. This information is - // then forwarded to the browser process via a similar message. - IPC_MESSAGE_ROUTED4(PluginHostMsg_AcceleratedSurfaceSetTransportDIB, - gfx::PluginWindowHandle /* window */, - int32 /* width */, - int32 /* height */, - TransportDIB::Handle /* handle to the TransportDIB */) - - // Synthesize a fake window handle for the plug-in to identify the instance - // to the browser, allowing mapping to a surface for hardware accelleration - // of plug-in content. The browser generates the handle which is then set on - // the plug-in. |opaque| indicates whether the content should be treated as - // opaque. - IPC_MESSAGE_ROUTED1(PluginHostMsg_BindFakePluginWindowHandle, - bool /* opaque */) - - // This message, used only on 10.6 and later, is sent from the plug-in process - // to the renderer process to indicate that the plugin allocated a new - // IOSurface object of the given width and height. This information is then - // forwarded on to the browser process. - // - // NOTE: the original intent was to pass a mach port as the IOSurface - // identifier but it looks like that will be a lot of work. For now we pass an - // ID from IOSurfaceGetID. - IPC_MESSAGE_ROUTED4(PluginHostMsg_AcceleratedSurfaceSetIOSurface, - gfx::PluginWindowHandle /* window */, - int32 /* width */, - int32 /* height */, - uint64 /* surface_id */) - - - // On the Mac, shared memory can't be allocated in the sandbox, so - // the TransportDIB used by the plug-in for rendering has to be allocated - // and managed by the browser. This is a synchronous message, use with care. - IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_AllocTransportDIB, - size_t /* requested memory size */, - TransportDIB::Handle /* output: DIB handle */) - - // Since the browser keeps handles to the allocated transport DIBs, this - // message is sent to tell the browser that it may release them when the - // renderer is finished with them. - IPC_MESSAGE_ROUTED1(PluginHostMsg_FreeTransportDIB, - TransportDIB::Id /* DIB id */) - - // This message notifies the renderer process (and from there the - // browser process) that the plug-in swapped the buffers associated - // with the given "window", which should cause the browser to redraw - // the various plug-ins' contents. - IPC_MESSAGE_ROUTED2(PluginHostMsg_AcceleratedSurfaceBuffersSwapped, - gfx::PluginWindowHandle /* window */, - uint64 /* surface_id */) +IPC_MESSAGE_ROUTED1(PluginHostMsg_UpdateGeometry_ACK, + int /* ack_key */) + +IPC_MESSAGE_ROUTED1(PluginHostMsg_SetImeEnabled, + bool /* enabled */) + +// This message, used in Mac OS X 10.5 and earlier, is sent from the plug-in +// process to the renderer process to indicate that the plug-in allocated a +// new TransportDIB that holds the GPU's rendered image. This information is +// then forwarded to the browser process via a similar message. +IPC_MESSAGE_ROUTED4(PluginHostMsg_AcceleratedSurfaceSetTransportDIB, + gfx::PluginWindowHandle /* window */, + int32 /* width */, + int32 /* height */, + TransportDIB::Handle /* handle to the TransportDIB */) + +// Synthesize a fake window handle for the plug-in to identify the instance +// to the browser, allowing mapping to a surface for hardware accelleration +// of plug-in content. The browser generates the handle which is then set on +// the plug-in. |opaque| indicates whether the content should be treated as +// opaque. +IPC_MESSAGE_ROUTED1(PluginHostMsg_BindFakePluginWindowHandle, + bool /* opaque */) + +// This message, used only on 10.6 and later, is sent from the plug-in process +// to the renderer process to indicate that the plugin allocated a new +// IOSurface object of the given width and height. This information is then +// forwarded on to the browser process. +// +// NOTE: the original intent was to pass a mach port as the IOSurface +// identifier but it looks like that will be a lot of work. For now we pass an +// ID from IOSurfaceGetID. +IPC_MESSAGE_ROUTED4(PluginHostMsg_AcceleratedSurfaceSetIOSurface, + gfx::PluginWindowHandle /* window */, + int32 /* width */, + int32 /* height */, + uint64 /* surface_id */) + + +// On the Mac, shared memory can't be allocated in the sandbox, so +// the TransportDIB used by the plug-in for rendering has to be allocated +// and managed by the browser. This is a synchronous message, use with care. +IPC_SYNC_MESSAGE_ROUTED1_1(PluginHostMsg_AllocTransportDIB, + size_t /* requested memory size */, + TransportDIB::Handle /* output: DIB handle */) + +// Since the browser keeps handles to the allocated transport DIBs, this +// message is sent to tell the browser that it may release them when the +// renderer is finished with them. +IPC_MESSAGE_ROUTED1(PluginHostMsg_FreeTransportDIB, + TransportDIB::Id /* DIB id */) + +// This message notifies the renderer process (and from there the +// browser process) that the plug-in swapped the buffers associated +// with the given "window", which should cause the browser to redraw +// the various plug-ins' contents. +IPC_MESSAGE_ROUTED2(PluginHostMsg_AcceleratedSurfaceBuffersSwapped, + gfx::PluginWindowHandle /* window */, + uint64 /* surface_id */) #endif - IPC_MESSAGE_CONTROL1(PluginHostMsg_ClearSiteDataResult, - bool /* success */) +IPC_MESSAGE_CONTROL1(PluginHostMsg_ClearSiteDataResult, + bool /* success */) - IPC_MESSAGE_ROUTED2(PluginHostMsg_URLRedirectResponse, - bool /* allow */, - int /* resource_id */) +IPC_MESSAGE_ROUTED2(PluginHostMsg_URLRedirectResponse, + bool /* allow */, + int /* resource_id */) -IPC_END_MESSAGES(PluginHost) //----------------------------------------------------------------------------- // NPObject messages // These are messages used to marshall NPObjects. They are sent both from the // plugin to the renderer and from the renderer to the plugin. -IPC_BEGIN_MESSAGES(NPObject) - IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Release) - - IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasMethod, - NPIdentifier_Param /* name */, - bool /* result */) - - IPC_SYNC_MESSAGE_ROUTED3_2(NPObjectMsg_Invoke, - bool /* is_default */, - NPIdentifier_Param /* method */, - std::vector<NPVariant_Param> /* args */, - NPVariant_Param /* result_param */, - bool /* result */) - - IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasProperty, - NPIdentifier_Param /* name */, - bool /* result */) - - IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_GetProperty, - NPIdentifier_Param /* name */, - NPVariant_Param /* property */, - bool /* result */) - - IPC_SYNC_MESSAGE_ROUTED2_1(NPObjectMsg_SetProperty, - NPIdentifier_Param /* name */, - NPVariant_Param /* property */, - bool /* result */) - - IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_RemoveProperty, - NPIdentifier_Param /* name */, - bool /* result */) - - IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Invalidate) - - IPC_SYNC_MESSAGE_ROUTED0_2(NPObjectMsg_Enumeration, - std::vector<NPIdentifier_Param> /* value */, - bool /* result */) - - IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_Construct, - std::vector<NPVariant_Param> /* args */, - NPVariant_Param /* result_param */, - bool /* result */) - - IPC_SYNC_MESSAGE_ROUTED2_2(NPObjectMsg_Evaluate, - std::string /* script */, - bool /* popups_allowed */, - NPVariant_Param /* result_param */, - bool /* result */) - -IPC_END_MESSAGES(NPObject) +IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Release) + +IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasMethod, + NPIdentifier_Param /* name */, + bool /* result */) + +IPC_SYNC_MESSAGE_ROUTED3_2(NPObjectMsg_Invoke, + bool /* is_default */, + NPIdentifier_Param /* method */, + std::vector<NPVariant_Param> /* args */, + NPVariant_Param /* result_param */, + bool /* result */) + +IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasProperty, + NPIdentifier_Param /* name */, + bool /* result */) + +IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_GetProperty, + NPIdentifier_Param /* name */, + NPVariant_Param /* property */, + bool /* result */) + +IPC_SYNC_MESSAGE_ROUTED2_1(NPObjectMsg_SetProperty, + NPIdentifier_Param /* name */, + NPVariant_Param /* property */, + bool /* result */) + +IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_RemoveProperty, + NPIdentifier_Param /* name */, + bool /* result */) + +IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Invalidate) + +IPC_SYNC_MESSAGE_ROUTED0_2(NPObjectMsg_Enumeration, + std::vector<NPIdentifier_Param> /* value */, + bool /* result */) + +IPC_SYNC_MESSAGE_ROUTED1_2(NPObjectMsg_Construct, + std::vector<NPVariant_Param> /* args */, + NPVariant_Param /* result_param */, + bool /* result */) + +IPC_SYNC_MESSAGE_ROUTED2_2(NPObjectMsg_Evaluate, + std::string /* script */, + bool /* popups_allowed */, + NPVariant_Param /* result_param */, + bool /* result */) diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc index be20600..04472bf 100644 --- a/chrome/common/render_messages.cc +++ b/chrome/common/render_messages.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/render_messages.h" - #include "base/values.h" #include "chrome/common/edit_command.h" #include "chrome/common/extensions/extension_extent.h" @@ -23,33 +21,24 @@ #include "net/base/upload_data.h" #include "net/http/http_response_headers.h" #include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" -#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" -#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h" -#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" #include "third_party/skia/include/core/SkBitmap.h" #include "webkit/appcache/appcache_interfaces.h" #include "webkit/blob/blob_data.h" -#include "webkit/glue/context_menu.h" -#include "webkit/glue/form_data.h" #include "webkit/glue/form_field.h" #include "webkit/glue/password_form.h" -#include "webkit/glue/password_form_dom_manager.h" #include "webkit/glue/plugins/webplugin.h" -#include "webkit/glue/plugins/webplugininfo.h" #include "webkit/glue/resource_loader_bridge.h" #include "webkit/glue/webaccessibility.h" #include "webkit/glue/webcookie.h" #include "webkit/glue/webcursor.h" -#include "webkit/glue/webdropdata.h" #include "webkit/glue/webmenuitem.h" #if defined(OS_MACOSX) #include "chrome/common/font_descriptor_mac.h" #endif -#define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/common/render_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" +#define IPC_MESSAGE_IMPL +#include "chrome/common/render_messages.h" namespace IPC { diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index fb68afa..0d3eb80 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -640,7 +640,6 @@ struct ParamTraits<speech_input::SpeechInputResultItem> { } // namespace IPC -#define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" -#include "ipc/ipc_message_macros.h" +#include "chrome/common/render_messages_internal.h" #endif // CHROME_COMMON_RENDER_MESSAGES_H_ diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 084f9a5..29c4a7f 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -2,10 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This header is meant to be included in multiple passes, hence no traditional -// header guard. -// See ipc_message_macros.h for explanation of the macros and passes. - #include <map> #include <string> #include <vector> @@ -28,6 +24,14 @@ #include "ipc/ipc_message_macros.h" #include "media/audio/audio_buffers_state.h" #include "third_party/WebKit/WebKit/chromium/public/WebExceptionCode.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" +#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h" +#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" +#include "webkit/glue/context_menu.h" +#include "webkit/glue/form_data.h" +#include "webkit/glue/password_form_dom_manager.h" +#include "webkit/glue/plugins/webplugininfo.h" +#include "webkit/glue/webdropdata.h" #if defined(OS_POSIX) #include "base/file_descriptor_posix.h" @@ -69,3014 +73,3009 @@ namespace file_util { struct FileInfo; } +#define IPC_MESSAGE_START ViewMsgStart + //----------------------------------------------------------------------------- // RenderView messages // These are messages sent from the browser to the renderer process. -IPC_BEGIN_MESSAGES(View) - // Used typically when recovering from a crash. The new rendering process - // sets its global "next page id" counter to the given value. - IPC_MESSAGE_CONTROL1(ViewMsg_SetNextPageID, - int32 /* next_page_id */) - - // Sends System Colors corresponding to a set of CSS color keywords - // down the pipe. - // This message must be sent to the renderer immediately on launch - // before creating any new views. - // The message can also be sent during a renderer's lifetime if system colors - // are updated. - // TODO(jeremy): Possibly change IPC format once we have this all hooked up. - IPC_MESSAGE_ROUTED1(ViewMsg_SetCSSColors, - std::vector<CSSColors::CSSColorMapping>) - - // Tells the renderer to create a new view. - // This message is slightly different, the view it takes (via - // ViewMsg_New_Params) is the view to create, the message itself is sent as a - // non-view control message. - IPC_MESSAGE_CONTROL1(ViewMsg_New, - ViewMsg_New_Params) - - // Tells the renderer to set its maximum cache size to the supplied value. - IPC_MESSAGE_CONTROL3(ViewMsg_SetCacheCapacities, - size_t /* min_dead_capacity */, - size_t /* max_dead_capacity */, - size_t /* capacity */) - - // Tells the renderer to cleat the cache. - IPC_MESSAGE_CONTROL0(ViewMsg_ClearCache) - - // 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. - IPC_MESSAGE_ROUTED1(ViewMsg_CreatingNew_ACK, - gfx::NativeViewId /* parent_hwnd */) - - // Sends updated preferences to the renderer. - IPC_MESSAGE_ROUTED1(ViewMsg_SetRendererPrefs, - RendererPreferences) - - // Tells the renderer to perform the given action on the media player - // located at the given point. - IPC_MESSAGE_ROUTED2(ViewMsg_MediaPlayerActionAt, - gfx::Point, /* location */ - WebKit::WebMediaPlayerAction) - - // Tells the render view to close. - IPC_MESSAGE_ROUTED0(ViewMsg_Close) - - // Tells the render view to change its size. A ViewHostMsg_PaintRect message - // is generated in response provided new_size is not empty and not equal to - // the view's current size. The generated ViewHostMsg_PaintRect message will - // have the IS_RESIZE_ACK flag set. It also receives the resizer rect so that - // we don't have to fetch it every time WebKit asks for it. - IPC_MESSAGE_ROUTED2(ViewMsg_Resize, - gfx::Size /* new_size */, - gfx::Rect /* resizer_rect */) - - // Sent to inform the view that it was hidden. This allows it to reduce its - // resource utilization. - IPC_MESSAGE_ROUTED0(ViewMsg_WasHidden) - - // Tells the render view that it is no longer hidden (see WasHidden), and the - // render view is expected to respond with a full repaint if needs_repainting - // is true. In that case, the generated ViewHostMsg_PaintRect message will - // have the IS_RESTORE_ACK flag set. If needs_repainting is false, then this - // message does not trigger a message in response. - IPC_MESSAGE_ROUTED1(ViewMsg_WasRestored, - bool /* needs_repainting */) - - // Tells the render view to capture a thumbnail image of the page. The - // render view responds with a ViewHostMsg_Thumbnail. - IPC_MESSAGE_ROUTED0(ViewMsg_CaptureThumbnail) - - // Tells the render view to capture a thumbnail image of the page. The - // render view responds with a ViewHostMsg_Snapshot. - IPC_MESSAGE_ROUTED0(ViewMsg_CaptureSnapshot) - - // Tells the render view to switch the CSS to print media type, renders every - // requested pages and switch back the CSS to display media type. - IPC_MESSAGE_ROUTED0(ViewMsg_PrintPages) - - // Tells the render view that printing is done so it can clean up. - IPC_MESSAGE_ROUTED2(ViewMsg_PrintingDone, - int /* document_cookie */, - bool /* success */) - - // Tells the render view to switch the CSS to print media type, renders every - // requested pages for print preview. - IPC_MESSAGE_ROUTED0(ViewMsg_PrintPreview) - - // Sends back to the browser the rendered "printed page" for preview that was - // requested by a ViewMsg_PrintPage message or from scripted printing. The - // memory handle in this message is already valid in the browser process. - IPC_MESSAGE_ROUTED2(ViewHostMsg_PagesReadyForPreview, - int /* document cookie */, - int /* fd in browser */) - - // Tells the renderer to dump as much memory as it can, perhaps because we - // have memory pressure or the renderer is (or will be) paged out. This - // should only result in purging objects we can recalculate, e.g. caches or - // JS garbage, not in purging irreplaceable objects. - IPC_MESSAGE_CONTROL0(ViewMsg_PurgeMemory) - - // Sent to render the view into the supplied transport DIB, resize - // the web widget to match the |page_size|, scale it by the - // appropriate scale to make it fit the |desired_size|, and return - // it. In response to this message, the host generates a - // ViewHostMsg_PaintAtSize_ACK message. Note that the DIB *must* be - // the right size to receive an RGBA image at the |desired_size|. - // |tag| is sent along with ViewHostMsg_PaintAtSize_ACK unmodified to - // identify the PaintAtSize message the ACK belongs to. - IPC_MESSAGE_ROUTED4(ViewMsg_PaintAtSize, - TransportDIB::Handle /* dib_handle */, - int /* tag */, - gfx::Size /* page_size */, - gfx::Size /* desired_size */) - - // Tells the render view that a ViewHostMsg_UpdateRect message was processed. - // This signals the render view that it can send another UpdateRect message. - IPC_MESSAGE_ROUTED0(ViewMsg_UpdateRect_ACK) - - // Message payload includes: - // 1. A blob that should be cast to WebInputEvent - // 2. An optional boolean value indicating if a RawKeyDown event is associated - // to a keyboard shortcut of the browser. - IPC_MESSAGE_ROUTED0(ViewMsg_HandleInputEvent) - - // This message notifies the renderer that the next key event is bound to one - // or more pre-defined edit commands. If the next key event is not handled - // by webkit, the specified edit commands shall be executed against current - // focused frame. - // Parameters - // * edit_commands (see chrome/common/edit_command_types.h) - // Contains one or more edit commands. - // See third_party/WebKit/WebCore/editing/EditorCommand.cpp for detailed - // definition of webkit edit commands. - // - // This message must be sent just before sending a key event. - IPC_MESSAGE_ROUTED1(ViewMsg_SetEditCommandsForNextKeyEvent, - std::vector<EditCommand> /* edit_commands */) - - // Message payload is the name/value of a WebCore edit command to execute. - IPC_MESSAGE_ROUTED2(ViewMsg_ExecuteEditCommand, - std::string, /* name */ - std::string /* value */) - - IPC_MESSAGE_ROUTED0(ViewMsg_MouseCaptureLost) - - // TODO(darin): figure out how this meshes with RestoreFocus - IPC_MESSAGE_ROUTED1(ViewMsg_SetFocus, bool /* enable */) - - // Tells the renderer to focus the first (last if reverse is true) focusable - // node. - IPC_MESSAGE_ROUTED1(ViewMsg_SetInitialFocus, bool /* reverse */) - - // Tells the renderer to scroll the currently focused node into view only if - // the currently focused node is a Text node (textfield, text area or content - // editable divs). - IPC_MESSAGE_ROUTED0(ViewMsg_ScrollFocusedEditableNodeIntoView) - - // Tells the renderer to perform the specified navigation, interrupting any - // existing navigation. - IPC_MESSAGE_ROUTED1(ViewMsg_Navigate, ViewMsg_Navigate_Params) - - IPC_MESSAGE_ROUTED0(ViewMsg_Stop) - - // Tells the renderer to reload the current focused frame - IPC_MESSAGE_ROUTED0(ViewMsg_ReloadFrame) - - // This message notifies the renderer that the user has closed the FindInPage - // window (and what action to take regarding the selection). - IPC_MESSAGE_ROUTED1(ViewMsg_StopFinding, - ViewMsg_StopFinding_Params /* action */) - - // These messages are typically generated from context menus and request the - // renderer to apply the specified operation to the current selection. - IPC_MESSAGE_ROUTED0(ViewMsg_Undo) - IPC_MESSAGE_ROUTED0(ViewMsg_Redo) - IPC_MESSAGE_ROUTED0(ViewMsg_Cut) - IPC_MESSAGE_ROUTED0(ViewMsg_Copy) +// Used typically when recovering from a crash. The new rendering process +// sets its global "next page id" counter to the given value. +IPC_MESSAGE_CONTROL1(ViewMsg_SetNextPageID, + int32 /* next_page_id */) + +// Sends System Colors corresponding to a set of CSS color keywords +// down the pipe. +// This message must be sent to the renderer immediately on launch +// before creating any new views. +// The message can also be sent during a renderer's lifetime if system colors +// are updated. +// TODO(jeremy): Possibly change IPC format once we have this all hooked up. +IPC_MESSAGE_ROUTED1(ViewMsg_SetCSSColors, + std::vector<CSSColors::CSSColorMapping>) + +// Tells the renderer to create a new view. +// This message is slightly different, the view it takes (via +// ViewMsg_New_Params) is the view to create, the message itself is sent as a +// non-view control message. +IPC_MESSAGE_CONTROL1(ViewMsg_New, + ViewMsg_New_Params) + +// Tells the renderer to set its maximum cache size to the supplied value. +IPC_MESSAGE_CONTROL3(ViewMsg_SetCacheCapacities, + size_t /* min_dead_capacity */, + size_t /* max_dead_capacity */, + size_t /* capacity */) + +// Tells the renderer to cleat the cache. +IPC_MESSAGE_CONTROL0(ViewMsg_ClearCache) + +// 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. +IPC_MESSAGE_ROUTED1(ViewMsg_CreatingNew_ACK, + gfx::NativeViewId /* parent_hwnd */) + +// Sends updated preferences to the renderer. +IPC_MESSAGE_ROUTED1(ViewMsg_SetRendererPrefs, + RendererPreferences) + +// Tells the renderer to perform the given action on the media player +// located at the given point. +IPC_MESSAGE_ROUTED2(ViewMsg_MediaPlayerActionAt, + gfx::Point, /* location */ + WebKit::WebMediaPlayerAction) + +// Tells the render view to close. +IPC_MESSAGE_ROUTED0(ViewMsg_Close) + +// Tells the render view to change its size. A ViewHostMsg_PaintRect message +// is generated in response provided new_size is not empty and not equal to +// the view's current size. The generated ViewHostMsg_PaintRect message will +// have the IS_RESIZE_ACK flag set. It also receives the resizer rect so that +// we don't have to fetch it every time WebKit asks for it. +IPC_MESSAGE_ROUTED2(ViewMsg_Resize, + gfx::Size /* new_size */, + gfx::Rect /* resizer_rect */) + +// Sent to inform the view that it was hidden. This allows it to reduce its +// resource utilization. +IPC_MESSAGE_ROUTED0(ViewMsg_WasHidden) + +// Tells the render view that it is no longer hidden (see WasHidden), and the +// render view is expected to respond with a full repaint if needs_repainting +// is true. In that case, the generated ViewHostMsg_PaintRect message will +// have the IS_RESTORE_ACK flag set. If needs_repainting is false, then this +// message does not trigger a message in response. +IPC_MESSAGE_ROUTED1(ViewMsg_WasRestored, + bool /* needs_repainting */) + +// Tells the render view to capture a thumbnail image of the page. The +// render view responds with a ViewHostMsg_Thumbnail. +IPC_MESSAGE_ROUTED0(ViewMsg_CaptureThumbnail) + +// Tells the render view to capture a thumbnail image of the page. The +// render view responds with a ViewHostMsg_Snapshot. +IPC_MESSAGE_ROUTED0(ViewMsg_CaptureSnapshot) + +// Tells the render view to switch the CSS to print media type, renders every +// requested pages and switch back the CSS to display media type. +IPC_MESSAGE_ROUTED0(ViewMsg_PrintPages) + +// Tells the render view that printing is done so it can clean up. +IPC_MESSAGE_ROUTED2(ViewMsg_PrintingDone, + int /* document_cookie */, + bool /* success */) + +// Tells the render view to switch the CSS to print media type, renders every +// requested pages for print preview. +IPC_MESSAGE_ROUTED0(ViewMsg_PrintPreview) + +// Sends back to the browser the rendered "printed page" for preview that was +// requested by a ViewMsg_PrintPage message or from scripted printing. The +// memory handle in this message is already valid in the browser process. +IPC_MESSAGE_ROUTED2(ViewHostMsg_PagesReadyForPreview, + int /* document cookie */, + int /* fd in browser */) + +// Tells the renderer to dump as much memory as it can, perhaps because we +// have memory pressure or the renderer is (or will be) paged out. This +// should only result in purging objects we can recalculate, e.g. caches or +// JS garbage, not in purging irreplaceable objects. +IPC_MESSAGE_CONTROL0(ViewMsg_PurgeMemory) + +// Sent to render the view into the supplied transport DIB, resize +// the web widget to match the |page_size|, scale it by the +// appropriate scale to make it fit the |desired_size|, and return +// it. In response to this message, the host generates a +// ViewHostMsg_PaintAtSize_ACK message. Note that the DIB *must* be +// the right size to receive an RGBA image at the |desired_size|. +// |tag| is sent along with ViewHostMsg_PaintAtSize_ACK unmodified to +// identify the PaintAtSize message the ACK belongs to. +IPC_MESSAGE_ROUTED4(ViewMsg_PaintAtSize, + TransportDIB::Handle /* dib_handle */, + int /* tag */, + gfx::Size /* page_size */, + gfx::Size /* desired_size */) + +// Tells the render view that a ViewHostMsg_UpdateRect message was processed. +// This signals the render view that it can send another UpdateRect message. +IPC_MESSAGE_ROUTED0(ViewMsg_UpdateRect_ACK) + +// Message payload includes: +// 1. A blob that should be cast to WebInputEvent +// 2. An optional boolean value indicating if a RawKeyDown event is associated +// to a keyboard shortcut of the browser. +IPC_MESSAGE_ROUTED0(ViewMsg_HandleInputEvent) + +// This message notifies the renderer that the next key event is bound to one +// or more pre-defined edit commands. If the next key event is not handled +// by webkit, the specified edit commands shall be executed against current +// focused frame. +// Parameters +// * edit_commands (see chrome/common/edit_command_types.h) +// Contains one or more edit commands. +// See third_party/WebKit/WebCore/editing/EditorCommand.cpp for detailed +// definition of webkit edit commands. +// +// This message must be sent just before sending a key event. +IPC_MESSAGE_ROUTED1(ViewMsg_SetEditCommandsForNextKeyEvent, + std::vector<EditCommand> /* edit_commands */) + +// Message payload is the name/value of a WebCore edit command to execute. +IPC_MESSAGE_ROUTED2(ViewMsg_ExecuteEditCommand, + std::string, /* name */ + std::string /* value */) + +IPC_MESSAGE_ROUTED0(ViewMsg_MouseCaptureLost) + +// TODO(darin): figure out how this meshes with RestoreFocus +IPC_MESSAGE_ROUTED1(ViewMsg_SetFocus, bool /* enable */) + +// Tells the renderer to focus the first (last if reverse is true) focusable +// node. +IPC_MESSAGE_ROUTED1(ViewMsg_SetInitialFocus, bool /* reverse */) + +// Tells the renderer to scroll the currently focused node into view only if +// the currently focused node is a Text node (textfield, text area or content +// editable divs). +IPC_MESSAGE_ROUTED0(ViewMsg_ScrollFocusedEditableNodeIntoView) + +// Tells the renderer to perform the specified navigation, interrupting any +// existing navigation. +IPC_MESSAGE_ROUTED1(ViewMsg_Navigate, ViewMsg_Navigate_Params) + +IPC_MESSAGE_ROUTED0(ViewMsg_Stop) + +// Tells the renderer to reload the current focused frame +IPC_MESSAGE_ROUTED0(ViewMsg_ReloadFrame) + +// This message notifies the renderer that the user has closed the FindInPage +// window (and what action to take regarding the selection). +IPC_MESSAGE_ROUTED1(ViewMsg_StopFinding, + ViewMsg_StopFinding_Params /* action */) + +// These messages are typically generated from context menus and request the +// renderer to apply the specified operation to the current selection. +IPC_MESSAGE_ROUTED0(ViewMsg_Undo) +IPC_MESSAGE_ROUTED0(ViewMsg_Redo) +IPC_MESSAGE_ROUTED0(ViewMsg_Cut) +IPC_MESSAGE_ROUTED0(ViewMsg_Copy) #if defined(OS_MACOSX) - IPC_MESSAGE_ROUTED0(ViewMsg_CopyToFindPboard) +IPC_MESSAGE_ROUTED0(ViewMsg_CopyToFindPboard) #endif - IPC_MESSAGE_ROUTED0(ViewMsg_Paste) - // Replaces the selected region or a word around the cursor with the - // specified string. - IPC_MESSAGE_ROUTED1(ViewMsg_Replace, string16) - IPC_MESSAGE_ROUTED0(ViewMsg_ToggleSpellCheck) - IPC_MESSAGE_ROUTED0(ViewMsg_Delete) - IPC_MESSAGE_ROUTED0(ViewMsg_SelectAll) - IPC_MESSAGE_ROUTED1(ViewMsg_ToggleSpellPanel, bool) - - // This message tells the renderer to advance to the next misspelling. It is - // sent when the user clicks the "Find Next" button on the spelling panel. - IPC_MESSAGE_ROUTED0(ViewMsg_AdvanceToNextMisspelling) - - // Copies the image at location x, y to the clipboard (if there indeed is an - // image at that location). - IPC_MESSAGE_ROUTED2(ViewMsg_CopyImageAt, - int /* x */, - int /* y */) - - // History system notification that the visited link database has been - // replaced. It has one SharedMemoryHandle argument consisting of the table - // handle. This handle is valid in the context of the renderer - IPC_MESSAGE_CONTROL1(ViewMsg_VisitedLink_NewTable, base::SharedMemoryHandle) - - // History system notification that a link has been added and the link - // coloring state for the given hash must be re-calculated. - IPC_MESSAGE_CONTROL1(ViewMsg_VisitedLink_Add, std::vector<uint64>) - - // History system notification that one or more history items have been - // deleted, which at this point means that all link coloring state must be - // re-calculated. - IPC_MESSAGE_CONTROL0(ViewMsg_VisitedLink_Reset) - - // Notification that the user scripts have been updated. It has one - // SharedMemoryHandle argument consisting of the pickled script data. This - // handle is valid in the context of the renderer. - IPC_MESSAGE_CONTROL1(ViewMsg_UserScripts_UpdatedScripts, - base::SharedMemoryHandle) - - // Sent when the user wants to search for a word on the page (find in page). - IPC_MESSAGE_ROUTED3(ViewMsg_Find, - int /* request_id */, - string16 /* search_text */, - WebKit::WebFindOptions) - - // Send from the renderer to the browser to return the script running result. - IPC_MESSAGE_ROUTED2(ViewMsg_ExecuteCodeFinished, - int, /* request id */ - bool /* whether the script ran successfully */) - - // Sent when the headers are available for a resource request. - IPC_MESSAGE_ROUTED2(ViewMsg_Resource_ReceivedResponse, - int /* request_id */, - ResourceResponseHead) - - // Sent when cached metadata from a resource request is ready. - IPC_MESSAGE_ROUTED2(ViewMsg_Resource_ReceivedCachedMetadata, - int /* request_id */, - std::vector<char> /* data */) - - // Sent as upload progress is being made. - IPC_MESSAGE_ROUTED3(ViewMsg_Resource_UploadProgress, - int /* request_id */, - int64 /* position */, - int64 /* size */) - - // Sent when the request has been redirected. The receiver is expected to - // respond with either a FollowRedirect message (if the redirect is to be - // followed) or a CancelRequest message (if it should not be followed). - IPC_MESSAGE_ROUTED3(ViewMsg_Resource_ReceivedRedirect, - int /* request_id */, - GURL /* new_url */, - ResourceResponseHead) - - // Sent when some data from a resource request is ready. The handle should - // already be mapped into the process that receives this message. - IPC_MESSAGE_ROUTED3(ViewMsg_Resource_DataReceived, - int /* request_id */, - base::SharedMemoryHandle /* data */, - int /* data_len */) - - // Sent when some data from a resource request has been downloaded to - // file. This is only called in the 'download_to_file' case and replaces - // ViewMsg_Resource_DataReceived in the call sequence in that case. - IPC_MESSAGE_ROUTED2(ViewMsg_Resource_DataDownloaded, - int /* request_id */, - int /* data_len */) - - // Sent when the request has been completed. - IPC_MESSAGE_ROUTED4(ViewMsg_Resource_RequestComplete, - int /* request_id */, - URLRequestStatus /* status */, - std::string /* security info */, - base::Time /* completion_time */) - - // Sent when user prompting is required before a ViewHostMsg_GetCookies - // message can complete. This message indicates that the renderer should - // pump messages while waiting for cookies. - IPC_MESSAGE_CONTROL0(ViewMsg_SignalCookiePromptEvent) - - // Request for the renderer to evaluate an xpath to a frame and execute a - // javascript: url in that frame's context. The message is completely - // asynchronous and no corresponding response message is sent back. - // - // frame_xpath contains the modified xpath notation to identify an inner - // subframe (starting from the root frame). It is a concatenation of - // number of smaller xpaths delimited by '\n'. Each chunk in the string can - // be evaluated to a frame in its parent-frame's context. - // - // Example: /html/body/iframe/\n/html/body/div/iframe/\n/frameset/frame[0] - // can be broken into 3 xpaths - // /html/body/iframe evaluates to an iframe within the root frame - // /html/body/div/iframe evaluates to an iframe within the level-1 iframe - // /frameset/frame[0] evaluates to first frame within the level-2 iframe - // - // jscript_url is the string containing the javascript: url to be executed - // in the target frame's context. The string should start with "javascript:" - // and continue with a valid JS text. - // - // If the fourth parameter is true the result is sent back to the renderer - // using the message ViewHostMsg_ScriptEvalResponse. - // ViewHostMsg_ScriptEvalResponse is passed the ID parameter so that the - // client can uniquely identify the request. - IPC_MESSAGE_ROUTED4(ViewMsg_ScriptEvalRequest, - string16, /* frame_xpath */ - string16, /* jscript_url */ - int, /* ID */ - bool /* If true, result is sent back. */) - - // Request for the renderer to evaluate an xpath to a frame and insert css - // into that frame's document. See ViewMsg_ScriptEvalRequest for details on - // allowed xpath expressions. - IPC_MESSAGE_ROUTED3(ViewMsg_CSSInsertRequest, - std::wstring, /* frame_xpath */ - std::string, /* css string */ - std::string /* element id */) - - // Log a message to the console of the target frame - IPC_MESSAGE_ROUTED3(ViewMsg_AddMessageToConsole, - string16 /* frame_xpath */, - string16 /* message */, - WebKit::WebConsoleMessage::Level /* message_level */) - - // RenderViewHostDelegate::RenderViewCreated method sends this message to a - // new renderer to notify it that it will host developer tools UI and should - // set up all neccessary bindings and create DevToolsClient instance that - // will handle communication with inspected page DevToolsAgent. - IPC_MESSAGE_ROUTED0(ViewMsg_SetupDevToolsClient) - - // Change the zoom level for the current main frame. If the level actually - // changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser - // telling it what url got zoomed and what its current zoom level is. - IPC_MESSAGE_ROUTED1(ViewMsg_Zoom, - PageZoom::Function /* function */) - - // Set the zoom level for the current main frame. If the level actually - // changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser - // telling it what url got zoomed and what its current zoom level is. - IPC_MESSAGE_ROUTED1(ViewMsg_SetZoomLevel, - double /* zoom_level */) - - // Set the zoom level for a particular url that the renderer is in the - // process of loading. This will be stored, to be used if the load commits - // and ignored otherwise. - IPC_MESSAGE_ROUTED2(ViewMsg_SetZoomLevelForLoadingURL, - GURL /* url */, - double /* zoom_level */) - - // Set the zoom level for a particular url, so all render views - // displaying this url can update their zoom levels to match. - IPC_MESSAGE_CONTROL2(ViewMsg_SetZoomLevelForCurrentURL, - GURL /* url */, - double /* zoom_level */) - - // Set the content settings for a particular url that the renderer is in the - // process of loading. This will be stored, to be used if the load commits - // and ignored otherwise. - IPC_MESSAGE_ROUTED2(ViewMsg_SetContentSettingsForLoadingURL, - GURL /* url */, - ContentSettings /* content_settings */) - - // Set the content settings for a particular url, so all render views - // displaying this host url update their content settings to match. - IPC_MESSAGE_CONTROL2(ViewMsg_SetContentSettingsForCurrentURL, - GURL /* url */, - ContentSettings /* content_settings */) - - // Change encoding of page in the renderer. - IPC_MESSAGE_ROUTED1(ViewMsg_SetPageEncoding, - std::string /*new encoding name*/) - - // Reset encoding of page in the renderer back to default. - IPC_MESSAGE_ROUTED0(ViewMsg_ResetPageEncodingToDefault) - - // Requests the renderer to reserve a range of page ids. - IPC_MESSAGE_ROUTED1(ViewMsg_ReservePageIDRange, - int /* size_of_range */) - - // Fill a form with data and optionally submit it - IPC_MESSAGE_ROUTED1(ViewMsg_FormFill, - webkit_glue::FormData /* form */) - - // Fill a password form and prepare field autocomplete for multiple - // matching logins. - IPC_MESSAGE_ROUTED1(ViewMsg_FillPasswordForm, - webkit_glue::PasswordFormFillData) - - // D&d drop target messages. - IPC_MESSAGE_ROUTED4(ViewMsg_DragTargetDragEnter, - WebDropData /* drop_data */, - gfx::Point /* client_pt */, - gfx::Point /* screen_pt */, - WebKit::WebDragOperationsMask /* ops_allowed */) - IPC_MESSAGE_ROUTED3(ViewMsg_DragTargetDragOver, - gfx::Point /* client_pt */, - gfx::Point /* screen_pt */, - WebKit::WebDragOperationsMask /* ops_allowed */) - IPC_MESSAGE_ROUTED0(ViewMsg_DragTargetDragLeave) - IPC_MESSAGE_ROUTED2(ViewMsg_DragTargetDrop, - gfx::Point /* client_pt */, - gfx::Point /* screen_pt */) - - // Notifies the renderer of updates in mouse position of an in-progress - // drag. if |ended| is true, then the user has ended the drag operation. - IPC_MESSAGE_ROUTED4(ViewMsg_DragSourceEndedOrMoved, - gfx::Point /* client_pt */, - gfx::Point /* screen_pt */, - bool /* ended */, - WebKit::WebDragOperation /* drag_operation */) - - // Notifies the renderer that the system DoDragDrop call has ended. - IPC_MESSAGE_ROUTED0(ViewMsg_DragSourceSystemDragEnded) - - // Used to tell a render view whether it should expose various bindings - // that allow JS content extended privileges. See BindingsPolicy for valid - // flag values. - IPC_MESSAGE_ROUTED1(ViewMsg_AllowBindings, - int /* enabled_bindings_flags */) - - // Tell the renderer to add a property to the DOMUI binding object. This - // only works if we allowed DOMUI bindings. - IPC_MESSAGE_ROUTED2(ViewMsg_SetDOMUIProperty, - std::string /* property_name */, - std::string /* property_value_json */) - - // This message starts/stop monitoring the input method status of the focused - // edit control of a renderer process. - // Parameters - // * is_active (bool) - // Indicates if an input method is active in the browser process. - // The possible actions when a renderer process receives this message are - // listed below: - // Value Action - // true Start sending IPC message ViewHostMsg_ImeUpdateTextInputState - // to notify the input method status of the focused edit control. - // false Stop sending IPC message ViewHostMsg_ImeUpdateTextInputState. - IPC_MESSAGE_ROUTED1(ViewMsg_SetInputMethodActive, - bool /* is_active */) - - // This message sends a string being composed with an input method. - IPC_MESSAGE_ROUTED4( - ViewMsg_ImeSetComposition, - string16, /* text */ - std::vector<WebKit::WebCompositionUnderline>, /* underlines */ - int, /* selectiont_start */ - int /* selection_end */) - - // This message confirms an ongoing composition. - IPC_MESSAGE_ROUTED0(ViewMsg_ImeConfirmComposition) - - // This passes a set of webkit preferences down to the renderer. - IPC_MESSAGE_ROUTED1(ViewMsg_UpdateWebPreferences, WebPreferences) - - // Used to notify the render-view that the browser has received a reply for - // the Find operation and is interested in receiving the next one. This is - // used to prevent the renderer from spamming the browser process with - // results. - IPC_MESSAGE_ROUTED0(ViewMsg_FindReplyACK) - - // Used to notify the render-view that we have received a target URL. Used - // to prevent target URLs spamming the browser. - IPC_MESSAGE_ROUTED0(ViewMsg_UpdateTargetURL_ACK) - - // Sets the alternate error page URL (link doctor) for the renderer process. - IPC_MESSAGE_ROUTED1(ViewMsg_SetAltErrorPageURL, GURL) - - // Install the first missing pluign. - IPC_MESSAGE_ROUTED0(ViewMsg_InstallMissingPlugin) - - // Tells the renderer to empty its plugin list cache, optional reloading - // pages containing plugins. - IPC_MESSAGE_CONTROL1(ViewMsg_PurgePluginListCache, - bool /* reload_pages */) - - // Tells the render view to load all blocked plugins. - IPC_MESSAGE_ROUTED0(ViewMsg_LoadBlockedPlugins) - - IPC_MESSAGE_ROUTED1(ViewMsg_RunFileChooserResponse, - std::vector<FilePath> /* selected files */) - - // Used to instruct the RenderView to go into "view source" mode. - IPC_MESSAGE_ROUTED0(ViewMsg_EnableViewSourceMode) - - // Get all savable resource links from current webpage, include main - // frame and sub-frame. - IPC_MESSAGE_ROUTED1(ViewMsg_GetAllSavableResourceLinksForCurrentPage, - GURL /* url of page which is needed to save */) - - // Get html data by serializing all frames of current page with lists - // which contain all resource links that have local copy. - IPC_MESSAGE_ROUTED3(ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks, - std::vector<GURL> /* urls that have local copy */, - std::vector<FilePath> /* paths of local copy */, - FilePath /* local directory path */) - - // Requests application info for the page. The renderer responds back with - // ViewHostMsg_DidGetApplicationInfo. - IPC_MESSAGE_ROUTED1(ViewMsg_GetApplicationInfo, int32 /*page_id*/) - - // Requests the renderer to download the specified favicon image encode it as - // PNG and send the PNG data back ala ViewHostMsg_DidDownloadFavIcon. - IPC_MESSAGE_ROUTED3(ViewMsg_DownloadFavIcon, - int /* identifier for the request */, - GURL /* URL of the image */, - int /* Size of the image. Normally 0, but set if you have - a preferred image size to request, such as when - downloading the favicon */) - - // When a renderer sends a ViewHostMsg_Focus to the browser process, - // the browser has the option of sending a ViewMsg_CantFocus back to - // the renderer. - IPC_MESSAGE_ROUTED0(ViewMsg_CantFocus) - - // Instructs the renderer to invoke the frame's shouldClose method, which - // runs the onbeforeunload event handler. Expects the result to be returned - // via ViewHostMsg_ShouldClose. - IPC_MESSAGE_ROUTED0(ViewMsg_ShouldClose) - - // Instructs the renderer to close the current page, including running the - // onunload event handler. See the struct in render_messages.h for more. - // - // Expects a ClosePage_ACK message when finished, where the parameters are - // echoed back. - IPC_MESSAGE_ROUTED1(ViewMsg_ClosePage, - ViewMsg_ClosePage_Params) - - // Asks the renderer to send back stats on the WebCore cache broken down by - // resource types. - IPC_MESSAGE_CONTROL0(ViewMsg_GetCacheResourceStats) - - // Asks the renderer to send back Histograms. - IPC_MESSAGE_CONTROL1(ViewMsg_GetRendererHistograms, - int /* sequence number of Renderer Histograms. */) +IPC_MESSAGE_ROUTED0(ViewMsg_Paste) +// Replaces the selected region or a word around the cursor with the +// specified string. +IPC_MESSAGE_ROUTED1(ViewMsg_Replace, string16) +IPC_MESSAGE_ROUTED0(ViewMsg_ToggleSpellCheck) +IPC_MESSAGE_ROUTED0(ViewMsg_Delete) +IPC_MESSAGE_ROUTED0(ViewMsg_SelectAll) +IPC_MESSAGE_ROUTED1(ViewMsg_ToggleSpellPanel, bool) + +// This message tells the renderer to advance to the next misspelling. It is +// sent when the user clicks the "Find Next" button on the spelling panel. +IPC_MESSAGE_ROUTED0(ViewMsg_AdvanceToNextMisspelling) + +// Copies the image at location x, y to the clipboard (if there indeed is an +// image at that location). +IPC_MESSAGE_ROUTED2(ViewMsg_CopyImageAt, + int /* x */, + int /* y */) + +// History system notification that the visited link database has been +// replaced. It has one SharedMemoryHandle argument consisting of the table +// handle. This handle is valid in the context of the renderer +IPC_MESSAGE_CONTROL1(ViewMsg_VisitedLink_NewTable, base::SharedMemoryHandle) + +// History system notification that a link has been added and the link +// coloring state for the given hash must be re-calculated. +IPC_MESSAGE_CONTROL1(ViewMsg_VisitedLink_Add, std::vector<uint64>) + +// History system notification that one or more history items have been +// deleted, which at this point means that all link coloring state must be +// re-calculated. +IPC_MESSAGE_CONTROL0(ViewMsg_VisitedLink_Reset) + +// Notification that the user scripts have been updated. It has one +// SharedMemoryHandle argument consisting of the pickled script data. This +// handle is valid in the context of the renderer. +IPC_MESSAGE_CONTROL1(ViewMsg_UserScripts_UpdatedScripts, + base::SharedMemoryHandle) + +// Sent when the user wants to search for a word on the page (find in page). +IPC_MESSAGE_ROUTED3(ViewMsg_Find, + int /* request_id */, + string16 /* search_text */, + WebKit::WebFindOptions) + +// Send from the renderer to the browser to return the script running result. +IPC_MESSAGE_ROUTED2(ViewMsg_ExecuteCodeFinished, + int, /* request id */ + bool /* whether the script ran successfully */) + +// Sent when the headers are available for a resource request. +IPC_MESSAGE_ROUTED2(ViewMsg_Resource_ReceivedResponse, + int /* request_id */, + ResourceResponseHead) + +// Sent when cached metadata from a resource request is ready. +IPC_MESSAGE_ROUTED2(ViewMsg_Resource_ReceivedCachedMetadata, + int /* request_id */, + std::vector<char> /* data */) + +// Sent as upload progress is being made. +IPC_MESSAGE_ROUTED3(ViewMsg_Resource_UploadProgress, + int /* request_id */, + int64 /* position */, + int64 /* size */) + +// Sent when the request has been redirected. The receiver is expected to +// respond with either a FollowRedirect message (if the redirect is to be +// followed) or a CancelRequest message (if it should not be followed). +IPC_MESSAGE_ROUTED3(ViewMsg_Resource_ReceivedRedirect, + int /* request_id */, + GURL /* new_url */, + ResourceResponseHead) + +// Sent when some data from a resource request is ready. The handle should +// already be mapped into the process that receives this message. +IPC_MESSAGE_ROUTED3(ViewMsg_Resource_DataReceived, + int /* request_id */, + base::SharedMemoryHandle /* data */, + int /* data_len */) + +// Sent when some data from a resource request has been downloaded to +// file. This is only called in the 'download_to_file' case and replaces +// ViewMsg_Resource_DataReceived in the call sequence in that case. +IPC_MESSAGE_ROUTED2(ViewMsg_Resource_DataDownloaded, + int /* request_id */, + int /* data_len */) + +// Sent when the request has been completed. +IPC_MESSAGE_ROUTED4(ViewMsg_Resource_RequestComplete, + int /* request_id */, + URLRequestStatus /* status */, + std::string /* security info */, + base::Time /* completion_time */) + +// Sent when user prompting is required before a ViewHostMsg_GetCookies +// message can complete. This message indicates that the renderer should +// pump messages while waiting for cookies. +IPC_MESSAGE_CONTROL0(ViewMsg_SignalCookiePromptEvent) + +// Request for the renderer to evaluate an xpath to a frame and execute a +// javascript: url in that frame's context. The message is completely +// asynchronous and no corresponding response message is sent back. +// +// frame_xpath contains the modified xpath notation to identify an inner +// subframe (starting from the root frame). It is a concatenation of +// number of smaller xpaths delimited by '\n'. Each chunk in the string can +// be evaluated to a frame in its parent-frame's context. +// +// Example: /html/body/iframe/\n/html/body/div/iframe/\n/frameset/frame[0] +// can be broken into 3 xpaths +// /html/body/iframe evaluates to an iframe within the root frame +// /html/body/div/iframe evaluates to an iframe within the level-1 iframe +// /frameset/frame[0] evaluates to first frame within the level-2 iframe +// +// jscript_url is the string containing the javascript: url to be executed +// in the target frame's context. The string should start with "javascript:" +// and continue with a valid JS text. +// +// If the fourth parameter is true the result is sent back to the renderer +// using the message ViewHostMsg_ScriptEvalResponse. +// ViewHostMsg_ScriptEvalResponse is passed the ID parameter so that the +// client can uniquely identify the request. +IPC_MESSAGE_ROUTED4(ViewMsg_ScriptEvalRequest, + string16, /* frame_xpath */ + string16, /* jscript_url */ + int, /* ID */ + bool /* If true, result is sent back. */) + +// Request for the renderer to evaluate an xpath to a frame and insert css +// into that frame's document. See ViewMsg_ScriptEvalRequest for details on +// allowed xpath expressions. +IPC_MESSAGE_ROUTED3(ViewMsg_CSSInsertRequest, + std::wstring, /* frame_xpath */ + std::string, /* css string */ + std::string /* element id */) + +// Log a message to the console of the target frame +IPC_MESSAGE_ROUTED3(ViewMsg_AddMessageToConsole, + string16 /* frame_xpath */, + string16 /* message */, + WebKit::WebConsoleMessage::Level /* message_level */) + +// RenderViewHostDelegate::RenderViewCreated method sends this message to a +// new renderer to notify it that it will host developer tools UI and should +// set up all neccessary bindings and create DevToolsClient instance that +// will handle communication with inspected page DevToolsAgent. +IPC_MESSAGE_ROUTED0(ViewMsg_SetupDevToolsClient) + +// Change the zoom level for the current main frame. If the level actually +// changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser +// telling it what url got zoomed and what its current zoom level is. +IPC_MESSAGE_ROUTED1(ViewMsg_Zoom, + PageZoom::Function /* function */) + +// Set the zoom level for the current main frame. If the level actually +// changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser +// telling it what url got zoomed and what its current zoom level is. +IPC_MESSAGE_ROUTED1(ViewMsg_SetZoomLevel, + double /* zoom_level */) + +// Set the zoom level for a particular url that the renderer is in the +// process of loading. This will be stored, to be used if the load commits +// and ignored otherwise. +IPC_MESSAGE_ROUTED2(ViewMsg_SetZoomLevelForLoadingURL, + GURL /* url */, + double /* zoom_level */) + +// Set the zoom level for a particular url, so all render views +// displaying this url can update their zoom levels to match. +IPC_MESSAGE_CONTROL2(ViewMsg_SetZoomLevelForCurrentURL, + GURL /* url */, + double /* zoom_level */) + +// Set the content settings for a particular url that the renderer is in the +// process of loading. This will be stored, to be used if the load commits +// and ignored otherwise. +IPC_MESSAGE_ROUTED2(ViewMsg_SetContentSettingsForLoadingURL, + GURL /* url */, + ContentSettings /* content_settings */) + +// Set the content settings for a particular url, so all render views +// displaying this host url update their content settings to match. +IPC_MESSAGE_CONTROL2(ViewMsg_SetContentSettingsForCurrentURL, + GURL /* url */, + ContentSettings /* content_settings */) + +// Change encoding of page in the renderer. +IPC_MESSAGE_ROUTED1(ViewMsg_SetPageEncoding, + std::string /*new encoding name*/) + +// Reset encoding of page in the renderer back to default. +IPC_MESSAGE_ROUTED0(ViewMsg_ResetPageEncodingToDefault) + +// Requests the renderer to reserve a range of page ids. +IPC_MESSAGE_ROUTED1(ViewMsg_ReservePageIDRange, + int /* size_of_range */) + +// Fill a form with data and optionally submit it +IPC_MESSAGE_ROUTED1(ViewMsg_FormFill, + webkit_glue::FormData /* form */) + +// Fill a password form and prepare field autocomplete for multiple +// matching logins. +IPC_MESSAGE_ROUTED1(ViewMsg_FillPasswordForm, + webkit_glue::PasswordFormFillData) + +// D&d drop target messages. +IPC_MESSAGE_ROUTED4(ViewMsg_DragTargetDragEnter, + WebDropData /* drop_data */, + gfx::Point /* client_pt */, + gfx::Point /* screen_pt */, + WebKit::WebDragOperationsMask /* ops_allowed */) +IPC_MESSAGE_ROUTED3(ViewMsg_DragTargetDragOver, + gfx::Point /* client_pt */, + gfx::Point /* screen_pt */, + WebKit::WebDragOperationsMask /* ops_allowed */) +IPC_MESSAGE_ROUTED0(ViewMsg_DragTargetDragLeave) +IPC_MESSAGE_ROUTED2(ViewMsg_DragTargetDrop, + gfx::Point /* client_pt */, + gfx::Point /* screen_pt */) + +// Notifies the renderer of updates in mouse position of an in-progress +// drag. if |ended| is true, then the user has ended the drag operation. +IPC_MESSAGE_ROUTED4(ViewMsg_DragSourceEndedOrMoved, + gfx::Point /* client_pt */, + gfx::Point /* screen_pt */, + bool /* ended */, + WebKit::WebDragOperation /* drag_operation */) + +// Notifies the renderer that the system DoDragDrop call has ended. +IPC_MESSAGE_ROUTED0(ViewMsg_DragSourceSystemDragEnded) + +// Used to tell a render view whether it should expose various bindings +// that allow JS content extended privileges. See BindingsPolicy for valid +// flag values. +IPC_MESSAGE_ROUTED1(ViewMsg_AllowBindings, + int /* enabled_bindings_flags */) + +// Tell the renderer to add a property to the DOMUI binding object. This +// only works if we allowed DOMUI bindings. +IPC_MESSAGE_ROUTED2(ViewMsg_SetDOMUIProperty, + std::string /* property_name */, + std::string /* property_value_json */) + +// This message starts/stop monitoring the input method status of the focused +// edit control of a renderer process. +// Parameters +// * is_active (bool) +// Indicates if an input method is active in the browser process. +// The possible actions when a renderer process receives this message are +// listed below: +// Value Action +// true Start sending IPC message ViewHostMsg_ImeUpdateTextInputState +// to notify the input method status of the focused edit control. +// false Stop sending IPC message ViewHostMsg_ImeUpdateTextInputState. +IPC_MESSAGE_ROUTED1(ViewMsg_SetInputMethodActive, + bool /* is_active */) + +// This message sends a string being composed with an input method. +IPC_MESSAGE_ROUTED4( + ViewMsg_ImeSetComposition, + string16, /* text */ + std::vector<WebKit::WebCompositionUnderline>, /* underlines */ + int, /* selectiont_start */ + int /* selection_end */) + +// This message confirms an ongoing composition. +IPC_MESSAGE_ROUTED0(ViewMsg_ImeConfirmComposition) + +// This passes a set of webkit preferences down to the renderer. +IPC_MESSAGE_ROUTED1(ViewMsg_UpdateWebPreferences, WebPreferences) + +// Used to notify the render-view that the browser has received a reply for +// the Find operation and is interested in receiving the next one. This is +// used to prevent the renderer from spamming the browser process with +// results. +IPC_MESSAGE_ROUTED0(ViewMsg_FindReplyACK) + +// Used to notify the render-view that we have received a target URL. Used +// to prevent target URLs spamming the browser. +IPC_MESSAGE_ROUTED0(ViewMsg_UpdateTargetURL_ACK) + +// Sets the alternate error page URL (link doctor) for the renderer process. +IPC_MESSAGE_ROUTED1(ViewMsg_SetAltErrorPageURL, GURL) + +// Install the first missing pluign. +IPC_MESSAGE_ROUTED0(ViewMsg_InstallMissingPlugin) + +// Tells the renderer to empty its plugin list cache, optional reloading +// pages containing plugins. +IPC_MESSAGE_CONTROL1(ViewMsg_PurgePluginListCache, + bool /* reload_pages */) + +// Tells the render view to load all blocked plugins. +IPC_MESSAGE_ROUTED0(ViewMsg_LoadBlockedPlugins) + +IPC_MESSAGE_ROUTED1(ViewMsg_RunFileChooserResponse, + std::vector<FilePath> /* selected files */) + +// Used to instruct the RenderView to go into "view source" mode. +IPC_MESSAGE_ROUTED0(ViewMsg_EnableViewSourceMode) + +// Get all savable resource links from current webpage, include main +// frame and sub-frame. +IPC_MESSAGE_ROUTED1(ViewMsg_GetAllSavableResourceLinksForCurrentPage, + GURL /* url of page which is needed to save */) + +// Get html data by serializing all frames of current page with lists +// which contain all resource links that have local copy. +IPC_MESSAGE_ROUTED3(ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks, + std::vector<GURL> /* urls that have local copy */, + std::vector<FilePath> /* paths of local copy */, + FilePath /* local directory path */) + +// Requests application info for the page. The renderer responds back with +// ViewHostMsg_DidGetApplicationInfo. +IPC_MESSAGE_ROUTED1(ViewMsg_GetApplicationInfo, int32 /*page_id*/) + +// Requests the renderer to download the specified favicon image encode it as +// PNG and send the PNG data back ala ViewHostMsg_DidDownloadFavIcon. +IPC_MESSAGE_ROUTED3(ViewMsg_DownloadFavIcon, + int /* identifier for the request */, + GURL /* URL of the image */, + int /* Size of the image. Normally 0, but set if you have + a preferred image size to request, such as when + downloading the favicon */) + +// When a renderer sends a ViewHostMsg_Focus to the browser process, +// the browser has the option of sending a ViewMsg_CantFocus back to +// the renderer. +IPC_MESSAGE_ROUTED0(ViewMsg_CantFocus) + +// Instructs the renderer to invoke the frame's shouldClose method, which +// runs the onbeforeunload event handler. Expects the result to be returned +// via ViewHostMsg_ShouldClose. +IPC_MESSAGE_ROUTED0(ViewMsg_ShouldClose) + +// Instructs the renderer to close the current page, including running the +// onunload event handler. See the struct in render_messages.h for more. +// +// Expects a ClosePage_ACK message when finished, where the parameters are +// echoed back. +IPC_MESSAGE_ROUTED1(ViewMsg_ClosePage, + ViewMsg_ClosePage_Params) + +// Asks the renderer to send back stats on the WebCore cache broken down by +// resource types. +IPC_MESSAGE_CONTROL0(ViewMsg_GetCacheResourceStats) + +// Asks the renderer to send back Histograms. +IPC_MESSAGE_CONTROL1(ViewMsg_GetRendererHistograms, + int /* sequence number of Renderer Histograms. */) #if defined(USE_TCMALLOC) - // Asks the renderer to send back tcmalloc stats. - IPC_MESSAGE_CONTROL0(ViewMsg_GetRendererTcmalloc) +// Asks the renderer to send back tcmalloc stats. +IPC_MESSAGE_CONTROL0(ViewMsg_GetRendererTcmalloc) #endif - // Asks the renderer to send back V8 heap stats. - IPC_MESSAGE_CONTROL0(ViewMsg_GetV8HeapStats) - - // Notifies the renderer about ui theme changes - IPC_MESSAGE_ROUTED0(ViewMsg_ThemeChanged) - - // Notifies the renderer that a paint is to be generated for the rectangle - // passed in. - IPC_MESSAGE_ROUTED1(ViewMsg_Repaint, - gfx::Size /* The view size to be repainted */) - - // Posts a message to the renderer. - IPC_MESSAGE_ROUTED3(ViewMsg_HandleMessageFromExternalHost, - std::string /* The message */, - std::string /* The origin */, - std::string /* The target*/) - - // Sent to the renderer when a popup window should no longer count against - // the current popup count (either because it's not a popup or because it was - // a generated by a user action or because a constrained popup got turned - // into a full window). - IPC_MESSAGE_ROUTED0(ViewMsg_DisassociateFromPopupCount) - - // The browser sends this to a renderer process in response to a - // ViewHostMsg_EstablishGpuChannel message. - IPC_MESSAGE_CONTROL2(ViewMsg_GpuChannelEstablished, - IPC::ChannelHandle /* handle to channel */, - GPUInfo /* stats about GPU process*/) - - // Notifies the renderer of the appcache that has been selected for a - // a particular host. This is sent in reply to AppCacheMsg_SelectCache. - IPC_MESSAGE_CONTROL2(AppCacheMsg_CacheSelected, - int /* host_id */, - appcache::AppCacheInfo) - - // Notifies the renderer of an AppCache status change. - IPC_MESSAGE_CONTROL2(AppCacheMsg_StatusChanged, - std::vector<int> /* host_ids */, - appcache::Status) - - // Notifies the renderer of an AppCache event other than the - // progress event which has a seperate message. - IPC_MESSAGE_CONTROL2(AppCacheMsg_EventRaised, - std::vector<int> /* host_ids */, - appcache::EventID) - - // Notifies the renderer of an AppCache progress event. - IPC_MESSAGE_CONTROL4(AppCacheMsg_ProgressEventRaised, - std::vector<int> /* host_ids */, - GURL /* url being processed */, - int /* total */, - int /* complete */) - - // Notifies the renderer of an AppCache error event. - IPC_MESSAGE_CONTROL2(AppCacheMsg_ErrorEventRaised, - std::vector<int> /* host_ids */, - std::string /* error_message */) - - // Notifies the renderer of an AppCache logging message. - IPC_MESSAGE_CONTROL3(AppCacheMsg_LogMessage, - int /* host_id */, - int /* log_level */, - std::string /* message */) - - // Notifies the renderer of the fact that AppCache access was blocked. - IPC_MESSAGE_CONTROL2(AppCacheMsg_ContentBlocked, - int /* host_id */, - GURL /* manifest_url */) - - // Reply to the ViewHostMsg_QueryFormFieldAutoFill message with the - // AutoFill suggestions. - IPC_MESSAGE_ROUTED5(ViewMsg_AutoFillSuggestionsReturned, - int /* id of the request message */, - std::vector<string16> /* names */, - std::vector<string16> /* labels */, - std::vector<string16> /* icons */, - std::vector<int> /* unique_ids */) - - // Reply to the ViewHostMsg_FillAutoFillFormData message with the - // AutoFill form data. - IPC_MESSAGE_ROUTED2(ViewMsg_AutoFillFormDataFilled, - int /* id of the request message */, - webkit_glue::FormData /* form data */) - - // Sent by the Browser process to alert a window about whether a it should - // allow a scripted window.close(). The renderer assumes every new window is a - // blocked popup until notified otherwise. - IPC_MESSAGE_ROUTED1(ViewMsg_AllowScriptToClose, - bool /* script_can_close */) - - // Sent by AudioRendererHost to renderer to request an audio packet. - IPC_MESSAGE_ROUTED2(ViewMsg_RequestAudioPacket, - int /* stream id */, - AudioBuffersState) - - // Tell the renderer process that the audio stream has been created, renderer - // process would be given a ShareMemoryHandle that it should write to from - // then on. - IPC_MESSAGE_ROUTED3(ViewMsg_NotifyAudioStreamCreated, - int /* stream id */, - base::SharedMemoryHandle /* handle */, - uint32 /* length */) - - // Tell the renderer process that a low latency audio stream has been created, - // renderer process would be given a SyncSocket that it should write to from - // then on. +// Asks the renderer to send back V8 heap stats. +IPC_MESSAGE_CONTROL0(ViewMsg_GetV8HeapStats) + +// Notifies the renderer about ui theme changes +IPC_MESSAGE_ROUTED0(ViewMsg_ThemeChanged) + +// Notifies the renderer that a paint is to be generated for the rectangle +// passed in. +IPC_MESSAGE_ROUTED1(ViewMsg_Repaint, + gfx::Size /* The view size to be repainted */) + +// Posts a message to the renderer. +IPC_MESSAGE_ROUTED3(ViewMsg_HandleMessageFromExternalHost, + std::string /* The message */, + std::string /* The origin */, + std::string /* The target*/) + +// Sent to the renderer when a popup window should no longer count against +// the current popup count (either because it's not a popup or because it was +// a generated by a user action or because a constrained popup got turned +// into a full window). +IPC_MESSAGE_ROUTED0(ViewMsg_DisassociateFromPopupCount) + +// The browser sends this to a renderer process in response to a +// ViewHostMsg_EstablishGpuChannel message. +IPC_MESSAGE_CONTROL2(ViewMsg_GpuChannelEstablished, + IPC::ChannelHandle /* handle to channel */, + GPUInfo /* stats about GPU process*/) + +// Notifies the renderer of the appcache that has been selected for a +// a particular host. This is sent in reply to AppCacheMsg_SelectCache. +IPC_MESSAGE_CONTROL2(AppCacheMsg_CacheSelected, + int /* host_id */, + appcache::AppCacheInfo) + +// Notifies the renderer of an AppCache status change. +IPC_MESSAGE_CONTROL2(AppCacheMsg_StatusChanged, + std::vector<int> /* host_ids */, + appcache::Status) + +// Notifies the renderer of an AppCache event other than the +// progress event which has a seperate message. +IPC_MESSAGE_CONTROL2(AppCacheMsg_EventRaised, + std::vector<int> /* host_ids */, + appcache::EventID) + +// Notifies the renderer of an AppCache progress event. +IPC_MESSAGE_CONTROL4(AppCacheMsg_ProgressEventRaised, + std::vector<int> /* host_ids */, + GURL /* url being processed */, + int /* total */, + int /* complete */) + +// Notifies the renderer of an AppCache error event. +IPC_MESSAGE_CONTROL2(AppCacheMsg_ErrorEventRaised, + std::vector<int> /* host_ids */, + std::string /* error_message */) + +// Notifies the renderer of an AppCache logging message. +IPC_MESSAGE_CONTROL3(AppCacheMsg_LogMessage, + int /* host_id */, + int /* log_level */, + std::string /* message */) + +// Notifies the renderer of the fact that AppCache access was blocked. +IPC_MESSAGE_CONTROL2(AppCacheMsg_ContentBlocked, + int /* host_id */, + GURL /* manifest_url */) + +// Reply to the ViewHostMsg_QueryFormFieldAutoFill message with the +// AutoFill suggestions. +IPC_MESSAGE_ROUTED5(ViewMsg_AutoFillSuggestionsReturned, + int /* id of the request message */, + std::vector<string16> /* names */, + std::vector<string16> /* labels */, + std::vector<string16> /* icons */, + std::vector<int> /* unique_ids */) + +// Reply to the ViewHostMsg_FillAutoFillFormData message with the +// AutoFill form data. +IPC_MESSAGE_ROUTED2(ViewMsg_AutoFillFormDataFilled, + int /* id of the request message */, + webkit_glue::FormData /* form data */) + +// Sent by the Browser process to alert a window about whether a it should +// allow a scripted window.close(). The renderer assumes every new window is a +// blocked popup until notified otherwise. +IPC_MESSAGE_ROUTED1(ViewMsg_AllowScriptToClose, + bool /* script_can_close */) + +// Sent by AudioRendererHost to renderer to request an audio packet. +IPC_MESSAGE_ROUTED2(ViewMsg_RequestAudioPacket, + int /* stream id */, + AudioBuffersState) + +// Tell the renderer process that the audio stream has been created, renderer +// process would be given a ShareMemoryHandle that it should write to from +// then on. +IPC_MESSAGE_ROUTED3(ViewMsg_NotifyAudioStreamCreated, + int /* stream id */, + base::SharedMemoryHandle /* handle */, + uint32 /* length */) + +// Tell the renderer process that a low latency audio stream has been created, +// renderer process would be given a SyncSocket that it should write to from +// then on. #if defined(OS_WIN) - IPC_MESSAGE_ROUTED4(ViewMsg_NotifyLowLatencyAudioStreamCreated, - int /* stream id */, - base::SharedMemoryHandle /* handle */, - base::SyncSocket::Handle /* socket handle */, - uint32 /* length */) +IPC_MESSAGE_ROUTED4(ViewMsg_NotifyLowLatencyAudioStreamCreated, + int /* stream id */, + base::SharedMemoryHandle /* handle */, + base::SyncSocket::Handle /* socket handle */, + uint32 /* length */) #else - IPC_MESSAGE_ROUTED4(ViewMsg_NotifyLowLatencyAudioStreamCreated, - int /* stream id */, - base::SharedMemoryHandle /* handle */, - base::FileDescriptor /* socket handle */, - uint32 /* length */) +IPC_MESSAGE_ROUTED4(ViewMsg_NotifyLowLatencyAudioStreamCreated, + int /* stream id */, + base::SharedMemoryHandle /* handle */, + base::FileDescriptor /* socket handle */, + uint32 /* length */) #endif - // Notification message sent from AudioRendererHost to renderer for state - // update after the renderer has requested a Create/Start/Close. - IPC_MESSAGE_ROUTED2(ViewMsg_NotifyAudioStreamStateChanged, - int /* stream id */, - ViewMsg_AudioStreamState_Params /* new state */) - - IPC_MESSAGE_ROUTED2(ViewMsg_NotifyAudioStreamVolume, - int /* stream id */, - double /* volume */) - - // Notification that a move or resize renderer's containing window has - // started. - IPC_MESSAGE_ROUTED0(ViewMsg_MoveOrResizeStarted) - - // The browser sends this message in response to all extension api calls. - IPC_MESSAGE_ROUTED4(ViewMsg_ExtensionResponse, - int /* request_id */, - bool /* success */, - std::string /* response */, - std::string /* error */) - - // This message is optionally routed. If used as a control message, it - // will call a javascript function in every registered context in the - // target process. If routed, it will be restricted to the contexts that - // are part of the target RenderView. - // If |extension_id| is non-empty, the function will be invoked only in - // contexts owned by the extension. |args| is a list of primitive Value types - // that are passed to the function. - IPC_MESSAGE_ROUTED4(ViewMsg_ExtensionMessageInvoke, - std::string /* extension_id */, - std::string /* function_name */, - ListValue /* args */, - GURL /* event URL */) - - // Tell the renderer process all known extension function names. - IPC_MESSAGE_CONTROL1(ViewMsg_Extension_SetFunctionNames, - std::vector<std::string>) - - // Tell the renderer process which permissions the given extension has. See - // Extension::Permissions for which elements correspond to which permissions. - IPC_MESSAGE_CONTROL2(ViewMsg_Extension_SetAPIPermissions, - std::string /* extension_id */, - std::set<std::string> /* permissions */) - - // Tell the renderer process which host permissions the given extension has. - IPC_MESSAGE_CONTROL2( - ViewMsg_Extension_SetHostPermissions, - GURL /* source extension's origin */, - std::vector<URLPattern> /* URLPatterns the extension can access */) - - // Tell the renderer process all known page action ids for a particular - // extension. - IPC_MESSAGE_CONTROL2(ViewMsg_Extension_UpdatePageActions, - std::string /* extension_id */, - std::vector<std::string> /* page_action_ids */) - - // Changes the text direction of the currently selected input field (if any). - IPC_MESSAGE_ROUTED1(ViewMsg_SetTextDirection, - WebKit::WebTextDirection /* direction */) - - // Tells the renderer to clear the focused node (if any). - IPC_MESSAGE_ROUTED0(ViewMsg_ClearFocusedNode) - - // Make the RenderView transparent and render it onto a custom background. The - // background will be tiled in both directions if it is not large enough. - IPC_MESSAGE_ROUTED1(ViewMsg_SetBackground, - SkBitmap /* background */) - - // Reply to ViewHostMsg_RequestMove, ViewHostMsg_ShowView, and - // ViewHostMsg_ShowWidget to inform the renderer that the browser has - // processed the move. The browser may have ignored the move, but it finished - // processing. This is used because the renderer keeps a temporary cache of - // the widget position while these asynchronous operations are in progress. - IPC_MESSAGE_ROUTED0(ViewMsg_Move_ACK) - - // Used to instruct the RenderView to send back updates to the preferred size. - IPC_MESSAGE_ROUTED1(ViewMsg_EnablePreferredSizeChangedMode, int /*flags*/) - - IPC_MESSAGE_ROUTED4(ViewMsg_SearchBoxChange, - string16 /*value*/, - bool /*verbatim*/, - int /*selection_start*/, - int /*selection_end*/) - IPC_MESSAGE_ROUTED2(ViewMsg_SearchBoxSubmit, - string16 /*value*/, - bool /*verbatim*/) - IPC_MESSAGE_ROUTED0(ViewMsg_SearchBoxCancel) - IPC_MESSAGE_ROUTED1(ViewMsg_SearchBoxResize, - gfx::Rect /*search_box_bounds*/) - IPC_MESSAGE_ROUTED2(ViewMsg_DetermineIfPageSupportsInstant, - string16 /*value*/, - bool /* verbatim */) - - // Used to tell the renderer not to add scrollbars with height and - // width below a threshold. - IPC_MESSAGE_ROUTED1(ViewMsg_DisableScrollbarsForSmallWindows, - gfx::Size /* disable_scrollbar_size_limit */) - - // Used to inform the renderer that the browser has displayed its - // requested notification. - IPC_MESSAGE_ROUTED1(ViewMsg_PostDisplayToNotificationObject, - int /* notification_id */) - - // Used to inform the renderer that the browser has encountered an error - // trying to display a notification. - IPC_MESSAGE_ROUTED2(ViewMsg_PostErrorToNotificationObject, - int /* notification_id */, - string16 /* message */) - - // Informs the renderer that the one if its notifications has closed. - IPC_MESSAGE_ROUTED2(ViewMsg_PostCloseToNotificationObject, - int /* notification_id */, - bool /* by_user */) - - // Informs the renderer that one of its notifications was clicked on. - IPC_MESSAGE_ROUTED1(ViewMsg_PostClickToNotificationObject, - int /* notification_id */) - - // Informs the renderer that the one if its notifications has closed. - IPC_MESSAGE_ROUTED1(ViewMsg_PermissionRequestDone, - int /* request_id */) - - // Activate/deactivate the RenderView (i.e., set its controls' tint - // accordingly, etc.). - IPC_MESSAGE_ROUTED1(ViewMsg_SetActive, - bool /* active */) +// Notification message sent from AudioRendererHost to renderer for state +// update after the renderer has requested a Create/Start/Close. +IPC_MESSAGE_ROUTED2(ViewMsg_NotifyAudioStreamStateChanged, + int /* stream id */, + ViewMsg_AudioStreamState_Params /* new state */) + +IPC_MESSAGE_ROUTED2(ViewMsg_NotifyAudioStreamVolume, + int /* stream id */, + double /* volume */) + +// Notification that a move or resize renderer's containing window has +// started. +IPC_MESSAGE_ROUTED0(ViewMsg_MoveOrResizeStarted) + +// The browser sends this message in response to all extension api calls. +IPC_MESSAGE_ROUTED4(ViewMsg_ExtensionResponse, + int /* request_id */, + bool /* success */, + std::string /* response */, + std::string /* error */) + +// This message is optionally routed. If used as a control message, it +// will call a javascript function in every registered context in the +// target process. If routed, it will be restricted to the contexts that +// are part of the target RenderView. +// If |extension_id| is non-empty, the function will be invoked only in +// contexts owned by the extension. |args| is a list of primitive Value types +// that are passed to the function. +IPC_MESSAGE_ROUTED4(ViewMsg_ExtensionMessageInvoke, + std::string /* extension_id */, + std::string /* function_name */, + ListValue /* args */, + GURL /* event URL */) + +// Tell the renderer process all known extension function names. +IPC_MESSAGE_CONTROL1(ViewMsg_Extension_SetFunctionNames, + std::vector<std::string>) + +// Tell the renderer process which permissions the given extension has. See +// Extension::Permissions for which elements correspond to which permissions. +IPC_MESSAGE_CONTROL2(ViewMsg_Extension_SetAPIPermissions, + std::string /* extension_id */, + std::set<std::string> /* permissions */) + +// Tell the renderer process which host permissions the given extension has. +IPC_MESSAGE_CONTROL2( + ViewMsg_Extension_SetHostPermissions, + GURL /* source extension's origin */, + std::vector<URLPattern> /* URLPatterns the extension can access */) + +// Tell the renderer process all known page action ids for a particular +// extension. +IPC_MESSAGE_CONTROL2(ViewMsg_Extension_UpdatePageActions, + std::string /* extension_id */, + std::vector<std::string> /* page_action_ids */) + +// Changes the text direction of the currently selected input field (if any). +IPC_MESSAGE_ROUTED1(ViewMsg_SetTextDirection, + WebKit::WebTextDirection /* direction */) + +// Tells the renderer to clear the focused node (if any). +IPC_MESSAGE_ROUTED0(ViewMsg_ClearFocusedNode) + +// Make the RenderView transparent and render it onto a custom background. The +// background will be tiled in both directions if it is not large enough. +IPC_MESSAGE_ROUTED1(ViewMsg_SetBackground, + SkBitmap /* background */) + +// Reply to ViewHostMsg_RequestMove, ViewHostMsg_ShowView, and +// ViewHostMsg_ShowWidget to inform the renderer that the browser has +// processed the move. The browser may have ignored the move, but it finished +// processing. This is used because the renderer keeps a temporary cache of +// the widget position while these asynchronous operations are in progress. +IPC_MESSAGE_ROUTED0(ViewMsg_Move_ACK) + +// Used to instruct the RenderView to send back updates to the preferred size. +IPC_MESSAGE_ROUTED1(ViewMsg_EnablePreferredSizeChangedMode, int /*flags*/) + +IPC_MESSAGE_ROUTED4(ViewMsg_SearchBoxChange, + string16 /*value*/, + bool /*verbatim*/, + int /*selection_start*/, + int /*selection_end*/) +IPC_MESSAGE_ROUTED2(ViewMsg_SearchBoxSubmit, + string16 /*value*/, + bool /*verbatim*/) +IPC_MESSAGE_ROUTED0(ViewMsg_SearchBoxCancel) +IPC_MESSAGE_ROUTED1(ViewMsg_SearchBoxResize, + gfx::Rect /*search_box_bounds*/) +IPC_MESSAGE_ROUTED2(ViewMsg_DetermineIfPageSupportsInstant, + string16 /*value*/, + bool /* verbatim */) + +// Used to tell the renderer not to add scrollbars with height and +// width below a threshold. +IPC_MESSAGE_ROUTED1(ViewMsg_DisableScrollbarsForSmallWindows, + gfx::Size /* disable_scrollbar_size_limit */) + +// Used to inform the renderer that the browser has displayed its +// requested notification. +IPC_MESSAGE_ROUTED1(ViewMsg_PostDisplayToNotificationObject, + int /* notification_id */) + +// Used to inform the renderer that the browser has encountered an error +// trying to display a notification. +IPC_MESSAGE_ROUTED2(ViewMsg_PostErrorToNotificationObject, + int /* notification_id */, + string16 /* message */) + +// Informs the renderer that the one if its notifications has closed. +IPC_MESSAGE_ROUTED2(ViewMsg_PostCloseToNotificationObject, + int /* notification_id */, + bool /* by_user */) + +// Informs the renderer that one of its notifications was clicked on. +IPC_MESSAGE_ROUTED1(ViewMsg_PostClickToNotificationObject, + int /* notification_id */) + +// Informs the renderer that the one if its notifications has closed. +IPC_MESSAGE_ROUTED1(ViewMsg_PermissionRequestDone, + int /* request_id */) + +// Activate/deactivate the RenderView (i.e., set its controls' tint +// accordingly, etc.). +IPC_MESSAGE_ROUTED1(ViewMsg_SetActive, + bool /* active */) #if defined(OS_MACOSX) - // Let the RenderView know its window has changed visibility. - IPC_MESSAGE_ROUTED1(ViewMsg_SetWindowVisibility, - bool /* visibile */) - - // Let the RenderView know its window's frame has changed. - IPC_MESSAGE_ROUTED2(ViewMsg_WindowFrameChanged, - gfx::Rect /* window frame */, - gfx::Rect /* content view frame */) - - // Tell the renderer that text has been retured from plugin IME. - IPC_MESSAGE_ROUTED2(ViewMsg_PluginImeCompositionConfirmed, - string16 /* text */, - int /* plugin_id */) +// Let the RenderView know its window has changed visibility. +IPC_MESSAGE_ROUTED1(ViewMsg_SetWindowVisibility, + bool /* visibile */) + +// Let the RenderView know its window's frame has changed. +IPC_MESSAGE_ROUTED2(ViewMsg_WindowFrameChanged, + gfx::Rect /* window frame */, + gfx::Rect /* content view frame */) + +// Tell the renderer that text has been retured from plugin IME. +IPC_MESSAGE_ROUTED2(ViewMsg_PluginImeCompositionConfirmed, + string16 /* text */, + int /* plugin_id */) #endif - // Response message to ViewHostMsg_CreateShared/DedicatedWorker. - // Sent when the worker has started. - IPC_MESSAGE_ROUTED0(ViewMsg_WorkerCreated) - - // Tell the renderer which browser window it's being attached to. - IPC_MESSAGE_ROUTED1(ViewMsg_UpdateBrowserWindowId, - int /* id of browser window */) - - // Tell the renderer which type this view is. - IPC_MESSAGE_ROUTED1(ViewMsg_NotifyRenderViewType, - ViewType::Type /* view_type */) - - // Notification that renderer should run some JavaScript code. - IPC_MESSAGE_ROUTED1(ViewMsg_ExecuteCode, - ViewMsg_ExecuteCode_Params) - - // Notifies the child process of the new database size - IPC_MESSAGE_CONTROL4(ViewMsg_DatabaseUpdateSize, - string16 /* the origin */, - string16 /* the database name */, - int64 /* the new database size */, - int64 /* space available to origin */) - - // Asks the child process to close a database immediately - IPC_MESSAGE_CONTROL2(ViewMsg_DatabaseCloseImmediately, - string16 /* the origin */, - string16 /* the database name */) - - // Storage events are broadcast to renderer processes. - IPC_MESSAGE_CONTROL1(ViewMsg_DOMStorageEvent, - ViewMsg_DOMStorageEvent_Params) - - // IDBCallback message handlers. - IPC_MESSAGE_CONTROL1(ViewMsg_IDBCallbacksSuccessNull, - int32 /* response_id */) - IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBCursor, - int32 /* response_id */, - int32 /* cursor_id */) - IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBDatabase, - int32 /* response_id */, - int32 /* idb_database_id */) - IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIndexedDBKey, - int32 /* response_id */, - IndexedDBKey /* indexed_db_key */) - IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBIndex, - int32 /* response_id */, - int32 /* idb_index_id */) - IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBObjectStore, - int32 /* response_id */, - int32 /* idb_object_store_id */) - IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBTransaction, - int32 /* response_id */, - int32 /* idb_transaction_id */) - IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessSerializedScriptValue, - int32 /* response_id */, - SerializedScriptValue /* serialized_script_value */) - IPC_MESSAGE_CONTROL3(ViewMsg_IDBCallbacksError, - int32 /* response_id */, - int /* code */, - string16 /* message */) - - // IDBTransactionCallback message handlers. - IPC_MESSAGE_CONTROL1(ViewMsg_IDBTransactionCallbacksAbort, - int32 /* transaction_id */) - IPC_MESSAGE_CONTROL1(ViewMsg_IDBTransactionCallbacksComplete, - int32 /* transaction_id */) - IPC_MESSAGE_CONTROL1(ViewMsg_IDBTransactionCallbacksTimeout, - int32 /* transaction_id */) +// Response message to ViewHostMsg_CreateShared/DedicatedWorker. +// Sent when the worker has started. +IPC_MESSAGE_ROUTED0(ViewMsg_WorkerCreated) + +// Tell the renderer which browser window it's being attached to. +IPC_MESSAGE_ROUTED1(ViewMsg_UpdateBrowserWindowId, + int /* id of browser window */) + +// Tell the renderer which type this view is. +IPC_MESSAGE_ROUTED1(ViewMsg_NotifyRenderViewType, + ViewType::Type /* view_type */) + +// Notification that renderer should run some JavaScript code. +IPC_MESSAGE_ROUTED1(ViewMsg_ExecuteCode, + ViewMsg_ExecuteCode_Params) + +// Notifies the child process of the new database size +IPC_MESSAGE_CONTROL4(ViewMsg_DatabaseUpdateSize, + string16 /* the origin */, + string16 /* the database name */, + int64 /* the new database size */, + int64 /* space available to origin */) + +// Asks the child process to close a database immediately +IPC_MESSAGE_CONTROL2(ViewMsg_DatabaseCloseImmediately, + string16 /* the origin */, + string16 /* the database name */) + +// Storage events are broadcast to renderer processes. +IPC_MESSAGE_CONTROL1(ViewMsg_DOMStorageEvent, + ViewMsg_DOMStorageEvent_Params) + +// IDBCallback message handlers. +IPC_MESSAGE_CONTROL1(ViewMsg_IDBCallbacksSuccessNull, + int32 /* response_id */) +IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBCursor, + int32 /* response_id */, + int32 /* cursor_id */) +IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBDatabase, + int32 /* response_id */, + int32 /* idb_database_id */) +IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIndexedDBKey, + int32 /* response_id */, + IndexedDBKey /* indexed_db_key */) +IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBIndex, + int32 /* response_id */, + int32 /* idb_index_id */) +IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBObjectStore, + int32 /* response_id */, + int32 /* idb_object_store_id */) +IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBTransaction, + int32 /* response_id */, + int32 /* idb_transaction_id */) +IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessSerializedScriptValue, + int32 /* response_id */, + SerializedScriptValue /* serialized_script_value */) +IPC_MESSAGE_CONTROL3(ViewMsg_IDBCallbacksError, + int32 /* response_id */, + int /* code */, + string16 /* message */) + +// IDBTransactionCallback message handlers. +IPC_MESSAGE_CONTROL1(ViewMsg_IDBTransactionCallbacksAbort, + int32 /* transaction_id */) +IPC_MESSAGE_CONTROL1(ViewMsg_IDBTransactionCallbacksComplete, + int32 /* transaction_id */) +IPC_MESSAGE_CONTROL1(ViewMsg_IDBTransactionCallbacksTimeout, + int32 /* transaction_id */) #if defined(IPC_MESSAGE_LOG_ENABLED) - // Tell the renderer process to begin or end IPC message logging. - IPC_MESSAGE_CONTROL1(ViewMsg_SetIPCLoggingEnabled, - bool /* on or off */) +// Tell the renderer process to begin or end IPC message logging. +IPC_MESSAGE_CONTROL1(ViewMsg_SetIPCLoggingEnabled, + bool /* on or off */) #endif - // Socket Stream messages: - // These are messages from the browser to the SocketStreamHandle on - // a renderer. - - // A |socket_id| is assigned by ViewHostMsg_SocketStream_Connect. - // The Socket Stream is connected. The SocketStreamHandle should keep track - // of how much it has pending (how much it has requested to be sent) and - // shouldn't go over |max_pending_send_allowed| bytes. - IPC_MESSAGE_CONTROL2(ViewMsg_SocketStream_Connected, - int /* socket_id */, - int /* max_pending_send_allowed */) - - // |data| is received on the Socket Stream. - IPC_MESSAGE_CONTROL2(ViewMsg_SocketStream_ReceivedData, - int /* socket_id */, - std::vector<char> /* data */) - - // |amount_sent| bytes of data requested by - // ViewHostMsg_SocketStream_SendData has been sent on the Socket Stream. - IPC_MESSAGE_CONTROL2(ViewMsg_SocketStream_SentData, - int /* socket_id */, - int /* amount_sent */) - - // The Socket Stream is closed. - IPC_MESSAGE_CONTROL1(ViewMsg_SocketStream_Closed, - int /* socket_id */) - - // SpellChecker messages. - - // Passes some initialization params to the renderer's spellchecker. This can - // be called directly after startup or in (async) response to a - // RequestDictionary ViewHost message. - IPC_MESSAGE_CONTROL4(ViewMsg_SpellChecker_Init, - IPC::PlatformFileForTransit /* bdict_file */, - std::vector<std::string> /* custom_dict_words */, - std::string /* language */, - bool /* auto spell correct */) - - // A word has been added to the custom dictionary; update the local custom - // word list. - IPC_MESSAGE_CONTROL1(ViewMsg_SpellChecker_WordAdded, - std::string /* word */) - - // Toggle the auto spell correct functionality. - IPC_MESSAGE_CONTROL1(ViewMsg_SpellChecker_EnableAutoSpellCorrect, - bool /* enable */) - - // Executes custom context menu action that was provided from WebKit. - IPC_MESSAGE_ROUTED1(ViewMsg_CustomContextMenuAction, - unsigned /* action */) - - // Tells the renderer to translate the page contents from one language to - // another. - IPC_MESSAGE_ROUTED4(ViewMsg_TranslatePage, - int /* page id */, - std::string, /* the script injected in the page */ - std::string, /* BCP 47/RFC 5646 language code the page - is in */ - std::string /* BCP 47/RFC 5646 language code to translate - to */) - - // Tells the renderer to revert the text of translated page to its original - // contents. - IPC_MESSAGE_ROUTED1(ViewMsg_RevertTranslation, - int /* page id */) - - // Reply in response to ViewHostMsg_Geolocation_RequestPermission. - IPC_MESSAGE_ROUTED2(ViewMsg_Geolocation_PermissionSet, - int /* bridge_id */, - bool /* is_allowed */) - - // Sent after ViewHostMsg_Geolocation_StartUpdating iff the user has granted - // permission and we have a position available or an error occurs (such as - // permission denied, position unavailable, etc.) - IPC_MESSAGE_ROUTED1(ViewMsg_Geolocation_PositionUpdated, - Geoposition /* geoposition */) - - // Sent on process startup to indicate whether this process is running in - // incognito mode. - IPC_MESSAGE_CONTROL1(ViewMsg_SetIsIncognitoProcess, - bool /* is_incognito_processs */) - - // Notification that the list of extensions has been updated. - IPC_MESSAGE_CONTROL1(ViewMsg_ExtensionsUpdated, - ViewMsg_ExtensionsUpdated_Params) - - // Enable accessibility in the renderer process. - IPC_MESSAGE_ROUTED0(ViewMsg_EnableAccessibility) - - // Relay a request from assistive technology to set focus to a given node. - IPC_MESSAGE_ROUTED1(ViewMsg_SetAccessibilityFocus, - int /* object id */) - - // Relay a request from assistive technology to perform the default action - // on a given node. - IPC_MESSAGE_ROUTED1(ViewMsg_AccessibilityDoDefaultAction, - int /* object id */) - - // Tells the render view that a ViewHostMsg_AccessibilityNotifications - // message was processed and it can send addition notifications. - IPC_MESSAGE_ROUTED0(ViewMsg_AccessibilityNotifications_ACK) - - // Relay a speech recognition result, either partial or final. - IPC_MESSAGE_ROUTED2(ViewMsg_SpeechInput_SetRecognitionResult, - int /* request id */, - speech_input::SpeechInputResultArray /* result */) - - // Indicate that speech recognizer has stopped recording and started - // recognition. - IPC_MESSAGE_ROUTED1(ViewMsg_SpeechInput_RecordingComplete, - int /* request id */) - - // Indicate that speech recognizer has completed recognition. This will be - // the last message sent in response to a - // ViewHostMsg_SpeechInput_StartRecognition. - IPC_MESSAGE_ROUTED1(ViewMsg_SpeechInput_RecognitionComplete, - int /* request id */) - - // Notification that the device's orientation has changed. - IPC_MESSAGE_ROUTED1(ViewMsg_DeviceOrientationUpdated, - ViewMsg_DeviceOrientationUpdated_Params) - - // WebFrameClient::openFileSystem response messages. - IPC_MESSAGE_CONTROL4(ViewMsg_OpenFileSystemRequest_Complete, - int /* request_id */, - bool /* accepted */, - std::string /* name */, - FilePath /* root_path */) - - // WebFileSystem response messages. - IPC_MESSAGE_CONTROL1(ViewMsg_FileSystem_DidSucceed, - int /* request_id */) - IPC_MESSAGE_CONTROL2(ViewMsg_FileSystem_DidReadMetadata, - int /* request_id */, - base::PlatformFileInfo) - IPC_MESSAGE_CONTROL3(ViewMsg_FileSystem_DidReadDirectory, - int /* request_id */, - std::vector<base::FileUtilProxy::Entry> /* entries */, - bool /* has_more */) - - IPC_MESSAGE_CONTROL3(ViewMsg_FileSystem_DidWrite, - int /* request_id */, - int64 /* byte count */, - bool /* complete */) - IPC_MESSAGE_CONTROL2(ViewMsg_FileSystem_DidFail, - int /* request_id */, - base::PlatformFileError /* error_code */) - - // The response to ViewHostMsg_AsyncOpenFile. - IPC_MESSAGE_ROUTED3(ViewMsg_AsyncOpenFile_ACK, - base::PlatformFileError /* error_code */, - IPC::PlatformFileForTransit /* file descriptor */, - int /* message_id */) - - // A classification model for client-side phishing detection. - // The given file contains an encoded safe_browsing::ClientSideModel - // protocol buffer. - IPC_MESSAGE_CONTROL1(ViewMsg_SetPhishingModel, - IPC::PlatformFileForTransit /* model_file */) - - // External popup menus. - IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem, - int /* selected index, -1 means no selection */) - - // Indicate whether speech input API is enabled or not. - IPC_MESSAGE_CONTROL1(ViewMsg_SpeechInput_SetFeatureEnabled, - bool /* enabled */) - -IPC_END_MESSAGES(View) - +// Socket Stream messages: +// These are messages from the browser to the SocketStreamHandle on +// a renderer. + +// A |socket_id| is assigned by ViewHostMsg_SocketStream_Connect. +// The Socket Stream is connected. The SocketStreamHandle should keep track +// of how much it has pending (how much it has requested to be sent) and +// shouldn't go over |max_pending_send_allowed| bytes. +IPC_MESSAGE_CONTROL2(ViewMsg_SocketStream_Connected, + int /* socket_id */, + int /* max_pending_send_allowed */) + +// |data| is received on the Socket Stream. +IPC_MESSAGE_CONTROL2(ViewMsg_SocketStream_ReceivedData, + int /* socket_id */, + std::vector<char> /* data */) + +// |amount_sent| bytes of data requested by +// ViewHostMsg_SocketStream_SendData has been sent on the Socket Stream. +IPC_MESSAGE_CONTROL2(ViewMsg_SocketStream_SentData, + int /* socket_id */, + int /* amount_sent */) + +// The Socket Stream is closed. +IPC_MESSAGE_CONTROL1(ViewMsg_SocketStream_Closed, + int /* socket_id */) + +// SpellChecker messages. + +// Passes some initialization params to the renderer's spellchecker. This can +// be called directly after startup or in (async) response to a +// RequestDictionary ViewHost message. +IPC_MESSAGE_CONTROL4(ViewMsg_SpellChecker_Init, + IPC::PlatformFileForTransit /* bdict_file */, + std::vector<std::string> /* custom_dict_words */, + std::string /* language */, + bool /* auto spell correct */) + +// A word has been added to the custom dictionary; update the local custom +// word list. +IPC_MESSAGE_CONTROL1(ViewMsg_SpellChecker_WordAdded, + std::string /* word */) + +// Toggle the auto spell correct functionality. +IPC_MESSAGE_CONTROL1(ViewMsg_SpellChecker_EnableAutoSpellCorrect, + bool /* enable */) + +// Executes custom context menu action that was provided from WebKit. +IPC_MESSAGE_ROUTED1(ViewMsg_CustomContextMenuAction, + unsigned /* action */) + +// Tells the renderer to translate the page contents from one language to +// another. +IPC_MESSAGE_ROUTED4(ViewMsg_TranslatePage, + int /* page id */, + std::string, /* the script injected in the page */ + std::string, /* BCP 47/RFC 5646 language code the page + is in */ + std::string /* BCP 47/RFC 5646 language code to translate + to */) + +// Tells the renderer to revert the text of translated page to its original +// contents. +IPC_MESSAGE_ROUTED1(ViewMsg_RevertTranslation, + int /* page id */) + +// Reply in response to ViewHostMsg_Geolocation_RequestPermission. +IPC_MESSAGE_ROUTED2(ViewMsg_Geolocation_PermissionSet, + int /* bridge_id */, + bool /* is_allowed */) + +// Sent after ViewHostMsg_Geolocation_StartUpdating iff the user has granted +// permission and we have a position available or an error occurs (such as +// permission denied, position unavailable, etc.) +IPC_MESSAGE_ROUTED1(ViewMsg_Geolocation_PositionUpdated, + Geoposition /* geoposition */) + +// Sent on process startup to indicate whether this process is running in +// incognito mode. +IPC_MESSAGE_CONTROL1(ViewMsg_SetIsIncognitoProcess, + bool /* is_incognito_processs */) + +// Notification that the list of extensions has been updated. +IPC_MESSAGE_CONTROL1(ViewMsg_ExtensionsUpdated, + ViewMsg_ExtensionsUpdated_Params) + +// Enable accessibility in the renderer process. +IPC_MESSAGE_ROUTED0(ViewMsg_EnableAccessibility) + +// Relay a request from assistive technology to set focus to a given node. +IPC_MESSAGE_ROUTED1(ViewMsg_SetAccessibilityFocus, + int /* object id */) + +// Relay a request from assistive technology to perform the default action +// on a given node. +IPC_MESSAGE_ROUTED1(ViewMsg_AccessibilityDoDefaultAction, + int /* object id */) + +// Tells the render view that a ViewHostMsg_AccessibilityNotifications +// message was processed and it can send addition notifications. +IPC_MESSAGE_ROUTED0(ViewMsg_AccessibilityNotifications_ACK) + +// Relay a speech recognition result, either partial or final. +IPC_MESSAGE_ROUTED2(ViewMsg_SpeechInput_SetRecognitionResult, + int /* request id */, + speech_input::SpeechInputResultArray /* result */) + +// Indicate that speech recognizer has stopped recording and started +// recognition. +IPC_MESSAGE_ROUTED1(ViewMsg_SpeechInput_RecordingComplete, + int /* request id */) + +// Indicate that speech recognizer has completed recognition. This will be +// the last message sent in response to a +// ViewHostMsg_SpeechInput_StartRecognition. +IPC_MESSAGE_ROUTED1(ViewMsg_SpeechInput_RecognitionComplete, + int /* request id */) + +// Notification that the device's orientation has changed. +IPC_MESSAGE_ROUTED1(ViewMsg_DeviceOrientationUpdated, + ViewMsg_DeviceOrientationUpdated_Params) + +// WebFrameClient::openFileSystem response messages. +IPC_MESSAGE_CONTROL4(ViewMsg_OpenFileSystemRequest_Complete, + int /* request_id */, + bool /* accepted */, + std::string /* name */, + FilePath /* root_path */) + +// WebFileSystem response messages. +IPC_MESSAGE_CONTROL1(ViewMsg_FileSystem_DidSucceed, + int /* request_id */) +IPC_MESSAGE_CONTROL2(ViewMsg_FileSystem_DidReadMetadata, + int /* request_id */, + base::PlatformFileInfo) +IPC_MESSAGE_CONTROL3(ViewMsg_FileSystem_DidReadDirectory, + int /* request_id */, + std::vector<base::FileUtilProxy::Entry> /* entries */, + bool /* has_more */) + +IPC_MESSAGE_CONTROL3(ViewMsg_FileSystem_DidWrite, + int /* request_id */, + int64 /* byte count */, + bool /* complete */) +IPC_MESSAGE_CONTROL2(ViewMsg_FileSystem_DidFail, + int /* request_id */, + base::PlatformFileError /* error_code */) + +// The response to ViewHostMsg_AsyncOpenFile. +IPC_MESSAGE_ROUTED3(ViewMsg_AsyncOpenFile_ACK, + base::PlatformFileError /* error_code */, + IPC::PlatformFileForTransit /* file descriptor */, + int /* message_id */) + +// A classification model for client-side phishing detection. +// The given file contains an encoded safe_browsing::ClientSideModel +// protocol buffer. +IPC_MESSAGE_CONTROL1(ViewMsg_SetPhishingModel, + IPC::PlatformFileForTransit /* model_file */) + +// External popup menus. +IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem, + int /* selected index, -1 means no selection */) + +// Indicate whether speech input API is enabled or not. +IPC_MESSAGE_CONTROL1(ViewMsg_SpeechInput_SetFeatureEnabled, + bool /* enabled */) //----------------------------------------------------------------------------- // TabContents messages // These are messages sent from the renderer to the browser process. -IPC_BEGIN_MESSAGES(ViewHost) - // Sent by the renderer when it is creating a new window. The browser creates - // a tab for it and responds with a ViewMsg_CreatingNew_ACK. If route_id is - // MSG_ROUTING_NONE, the view couldn't be created. - IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_CreateWindow, - ViewHostMsg_CreateWindow_Params, - int /* route_id */, - int64 /* cloned_session_storage_namespace_id */) - - // Similar to ViewHostMsg_CreateWindow, except used for sub-widgets, like - // <select> dropdowns. This message is sent to the TabContents that - // contains the widget being created. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_CreateWidget, - int /* opener_id */, - WebKit::WebPopupType /* popup type */, - int /* route_id */) - - // Similar to ViewHostMsg_CreateWidget except the widget is a full screen - // window. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_CreateFullscreenWidget, - int /* opener_id */, - WebKit::WebPopupType /* popup type */, - int /* route_id */) - - // These three messages are sent to the parent RenderViewHost to display the - // page/widget that was created by - // CreateWindow/CreateWidget/CreateFullscreenWidget. routing_id - // refers to the id that was returned from the Create message above. - // The initial_position parameter is a rectangle in screen coordinates. - // - // FUTURE: there will probably be flags here to control if the result is - // in a new window. - IPC_MESSAGE_ROUTED4(ViewHostMsg_ShowView, - int /* route_id */, - WindowOpenDisposition /* disposition */, - gfx::Rect /* initial_pos */, - bool /* opened_by_user_gesture */) - - IPC_MESSAGE_ROUTED2(ViewHostMsg_ShowWidget, - int /* route_id */, - gfx::Rect /* initial_pos */) - - // Message to show a full screen widget. - IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowFullscreenWidget, - int /* route_id */) - - // Message to show a popup menu using native cocoa controls (Mac only). - IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowPopup, - ViewHostMsg_ShowPopup_Params) - - // This message is sent after ViewHostMsg_ShowView to cause the RenderView - // to run in a modal fashion until it is closed. - IPC_SYNC_MESSAGE_ROUTED0_0(ViewHostMsg_RunModal) - - IPC_MESSAGE_CONTROL1(ViewHostMsg_UpdatedCacheStats, - WebKit::WebCache::UsageStats /* stats */) - - // Indicates the renderer is ready in response to a ViewMsg_New or - // a ViewMsg_CreatingNew_ACK. - IPC_MESSAGE_ROUTED0(ViewHostMsg_RenderViewReady) - - // Indicates the renderer process is gone. This actually is sent by the - // browser process to itself, but keeps the interface cleaner. - IPC_MESSAGE_ROUTED0(ViewHostMsg_RenderViewGone) - - // Sent by the renderer process to request that the browser close the view. - // This corresponds to the window.close() API, and the browser may ignore - // this message. Otherwise, the browser will generates a ViewMsg_Close - // message to close the view. - IPC_MESSAGE_ROUTED0(ViewHostMsg_Close) - - // Sent by the renderer process to request that the browser move the view. - // This corresponds to the window.resizeTo() and window.moveTo() APIs, and - // the browser may ignore this message. - IPC_MESSAGE_ROUTED1(ViewHostMsg_RequestMove, - gfx::Rect /* position */) - - // Notifies the browser that a frame in the view has changed. This message - // has a lot of parameters and is packed/unpacked by functions defined in - // render_messages.h. - IPC_MESSAGE_ROUTED1(ViewHostMsg_FrameNavigate, - ViewHostMsg_FrameNavigate_Params) - - // Notifies the browser that we have session history information. - // page_id: unique ID that allows us to distinguish between history entries. - IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateState, - int32 /* page_id */, - std::string /* state */) - - // Notifies the browser that a document has been loaded in a frame. - IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentLoadedInFrame, - int64 /* frame_id */) - - // Notifies the browser that a frame finished loading. - IPC_MESSAGE_ROUTED1(ViewHostMsg_DidFinishLoad, - int64 /* frame_id */) - - // Changes the title for the page in the UI when the page is navigated or the - // title changes. - // TODO(darin): use a UTF-8 string to reduce data size - IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateTitle, int32, std::wstring) - - // Changes the icon url for the page in the UI. - IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateIconURL, int32, GURL) - - // Change the encoding name of the page in UI when the page has detected - // proper encoding name. - IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateEncoding, - std::string /* new encoding name */) - - // Notifies the browser that we want to show a destination url for a potential - // action (e.g. when the user is hovering over a link). - IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateTargetURL, int32, GURL) - - // Sent when the renderer starts loading the page. This corresponds to - // WebKit's notion of the throbber starting. Note that sometimes you may get - // duplicates of these during a single load. - IPC_MESSAGE_ROUTED0(ViewHostMsg_DidStartLoading) - - // Sent when the renderer is done loading a page. This corresponds to WebKit's - // notion of the throbber stopping. - IPC_MESSAGE_ROUTED0(ViewHostMsg_DidStopLoading) - - // Sent when the document element is available for the toplevel frame. This - // happens after the page starts loading, but before all resources are - // finished. - IPC_MESSAGE_ROUTED0(ViewHostMsg_DocumentAvailableInMainFrame) - - // Sent when after the onload handler has been invoked for the document - // in the toplevel frame. - IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentOnLoadCompletedInMainFrame, - int32 /* page_id */) - - // Sent when the renderer loads a resource from its memory cache. - // The security info is non empty if the resource was originally loaded over - // a secure connection. - // Note: May only be sent once per URL per frame per committed load. - IPC_MESSAGE_ROUTED4(ViewHostMsg_DidLoadResourceFromMemoryCache, - GURL /* url */, - std::string /* frame_origin */, - std::string /* main_frame_origin */, - std::string /* security info */) - - // Sent when the renderer displays insecure content in a secure page. - IPC_MESSAGE_ROUTED0(ViewHostMsg_DidDisplayInsecureContent) - - // Sent when the renderer runs insecure content in a secure origin. - IPC_MESSAGE_ROUTED1(ViewHostMsg_DidRunInsecureContent, - std::string /* security_origin */) - - // Sent when the renderer starts a provisional load for a frame. - IPC_MESSAGE_ROUTED3(ViewHostMsg_DidStartProvisionalLoadForFrame, - int64 /* frame_id */, - bool /* true if it is the main frame */, - GURL /* url */) - - // Sent when the renderer fails a provisional load with an error. - IPC_MESSAGE_ROUTED5(ViewHostMsg_DidFailProvisionalLoadWithError, - int64 /* frame_id */, - bool /* true if it is the main frame */, - int /* error_code */, - GURL /* url */, - bool /* true if the failure is the result of - navigating to a POST again and we're going to - show the POST interstitial */) - - // Tells the render view that a ViewHostMsg_PaintAtSize message was - // processed, and the DIB is ready for use. |tag| has the same value that - // the tag sent along with ViewMsg_PaintAtSize. - IPC_MESSAGE_ROUTED2(ViewHostMsg_PaintAtSize_ACK, - int /* tag */, - gfx::Size /* size */) - - // Sent to update part of the view. In response to this message, the host - // generates a ViewMsg_UpdateRect_ACK message. - IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateRect, - ViewHostMsg_UpdateRect_Params) - - // Sent by the renderer when accelerated compositing is enabled or disabled to - // notify the browser whether or not is should do painting. - IPC_MESSAGE_ROUTED1(ViewHostMsg_DidActivateAcceleratedCompositing, - bool /* true if the accelerated compositor is actve */) - - // Acknowledges receipt of a ViewMsg_HandleInputEvent message. - // Payload is a WebInputEvent::Type which is the type of the event, followed - // by an optional WebInputEvent which is provided only if the event was not - // processed. - IPC_MESSAGE_ROUTED0(ViewHostMsg_HandleInputEvent_ACK) - - IPC_MESSAGE_ROUTED0(ViewHostMsg_Focus) - IPC_MESSAGE_ROUTED0(ViewHostMsg_Blur) - - // Message sent from renderer to the browser when focus changes inside the - // webpage. The parameter says whether the newly focused element needs - // keyboard input (true for textfields, text areas and content editable divs). - IPC_MESSAGE_ROUTED1(ViewHostMsg_FocusedNodeChanged, - bool /* is_editable_node */) - - // Returns the window location of the given window. - // TODO(shess): Provide a mapping from reply_msg->routing_id() to - // HWND so that we can eliminate the NativeViewId parameter. - IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetWindowRect, - gfx::NativeViewId /* window */, - gfx::Rect /* Out: Window location */) - - IPC_MESSAGE_ROUTED1(ViewHostMsg_SetCursor, WebCursor) - // Result of string search in the page. - // Response to ViewMsg_Find with the results of the requested find-in-page - // search, the number of matches found and the selection rect (in screen - // coordinates) for the string found. If |final_update| is false, it signals - // that this is not the last Find_Reply message - more will be sent as the - // scoping effort continues. - IPC_MESSAGE_ROUTED5(ViewHostMsg_Find_Reply, - int /* request_id */, - int /* number of matches */, - gfx::Rect /* selection_rect */, - int /* active_match_ordinal */, - bool /* final_update */) - - // Makes a resource request via the browser. - IPC_MESSAGE_ROUTED2(ViewHostMsg_RequestResource, - int /* request_id */, - ViewHostMsg_Resource_Request) - - // Cancels a resource request with the ID given as the parameter. - IPC_MESSAGE_ROUTED1(ViewHostMsg_CancelRequest, - int /* request_id */) - - // Follows a redirect that occured for the resource request with the ID given - // as the parameter. - IPC_MESSAGE_ROUTED3(ViewHostMsg_FollowRedirect, - int /* request_id */, - bool /* has_new_first_party_for_cookies */, - GURL /* new_first_party_for_cookies */) - - // Makes a synchronous resource request via the browser. - IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_SyncLoad, - int /* request_id */, - ViewHostMsg_Resource_Request, - SyncLoadResult) - - // Used to set a cookie. The cookie is set asynchronously, but will be - // available to a subsequent ViewHostMsg_GetCookies request. - IPC_MESSAGE_ROUTED3(ViewHostMsg_SetCookie, - GURL /* url */, - GURL /* first_party_for_cookies */, - std::string /* cookie */) - - // Used to get cookies for the given URL. This may block waiting for a - // previous SetCookie message to be processed. - IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetCookies, - GURL /* url */, - GURL /* first_party_for_cookies */, - std::string /* cookies */) - - // Used to get raw cookie information for the given URL. This may block - // waiting for a previous SetCookie message to be processed. - IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetRawCookies, - GURL /* url */, - GURL /* first_party_for_cookies */, - std::vector<webkit_glue::WebCookie> - /* raw_cookies */) - - // Used to delete cookie for the given URL and name - IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_DeleteCookie, - GURL /* url */, - std::string /* cookie_name */) - - // Used to check if cookies are enabled for the given URL. This may block - // waiting for a previous SetCookie message to be processed. - IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_CookiesEnabled, - GURL /* url */, - GURL /* first_party_for_cookies */, - bool /* cookies_enabled */) - - // Used to get the list of plugins - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetPlugins, - bool /* refresh*/, - std::vector<WebPluginInfo> /* plugins */) - - // Return information about a plugin for the given URL and MIME - // type. If there is no matching plugin, |found| is false. If - // |enabled| in the WebPluginInfo struct is false, the plug-in is - // treated as if it was not installed at all. - // - // If |setting| is set to CONTENT_SETTING_BLOCK, the plug-in is - // blocked by the content settings for |policy_url|. It still - // appears in navigator.plugins in Javascript though, and can be - // loaded via click-to-play. - // - // If |setting| is set to CONTENT_SETTING_ALLOW, the domain is - // explicitly white-listed for the plug-in, or the user has chosen - // not to block nonsandboxed plugins. - // - // If |setting| is set to CONTENT_SETTING_DEFAULT, the plug-in is - // neither blocked nor white-listed, which means that it's allowed - // by default and can still be blocked if it's non-sandboxed. - // - // |actual_mime_type| is the actual mime type supported by the - // plugin found that match the URL given (one for each item in - // |info|). - IPC_SYNC_MESSAGE_CONTROL3_4(ViewHostMsg_GetPluginInfo, - GURL /* url */, - GURL /* policy_url */, - std::string /* mime_type */, - bool /* found */, - WebPluginInfo /* plugin info */, - ContentSetting /* setting */, - std::string /* actual_mime_type */) - - // Requests spellcheck for a word. - IPC_SYNC_MESSAGE_ROUTED2_2(ViewHostMsg_SpellCheck, - string16 /* word to check */, - int /* document tag*/, - int /* misspell location */, - int /* misspell length */) - - // Asks the browser for a unique document tag. - IPC_SYNC_MESSAGE_ROUTED0_1(ViewHostMsg_GetDocumentTag, - int /* the tag */) - - - // This message tells the spellchecker that a document, identified by an int - // tag, has been closed and all of the ignored words for that document can be - // forgotten. - IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentWithTagClosed, - int /* the tag */) - - // Tells the browser to display or not display the SpellingPanel - IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowSpellingPanel, - bool /* if true, then show it, otherwise hide it*/) - - // Tells the browser to update the spelling panel with the given word. - IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateSpellingPanelWithMisspelledWord, - string16 /* the word to update the panel with */) - - // Tells the browser that content in the current page was blocked due to the - // user's content settings. - IPC_MESSAGE_ROUTED2(ViewHostMsg_ContentBlocked, - ContentSettingsType, /* type of blocked content */ - std::string /* resource identifier */) - - // Tells the browser that a specific Appcache manifest in the current page - // was accessed. - IPC_MESSAGE_ROUTED2(ViewHostMsg_AppCacheAccessed, - GURL /* manifest url */, - bool /* blocked by policy */) - - // Tells the browser that a specific Web database in the current page was - // accessed. - IPC_MESSAGE_ROUTED5(ViewHostMsg_WebDatabaseAccessed, - GURL /* origin url */, - string16 /* database name */, - string16 /* database display name */, - unsigned long /* estimated size */, - bool /* blocked by policy */) - - // Initiates a download based on user actions like 'ALT+click'. - IPC_MESSAGE_ROUTED2(ViewHostMsg_DownloadUrl, - GURL /* url */, - GURL /* referrer */) - - // Used to go to the session history entry at the given offset (ie, -1 will - // return the "back" item). - IPC_MESSAGE_ROUTED1(ViewHostMsg_GoToEntryAtOffset, - int /* offset (from current) of history item to get */) - - IPC_SYNC_MESSAGE_ROUTED4_2(ViewHostMsg_RunJavaScriptMessage, - std::wstring /* in - alert message */, - std::wstring /* in - default prompt */, - GURL /* in - originating page URL */, - int /* in - dialog flags */, - bool /* out - success */, - std::wstring /* out - prompt field */) - - // Provides the contents for the given page that was loaded recently. - IPC_MESSAGE_ROUTED5(ViewHostMsg_PageContents, - GURL /* URL of the page */, - int32 /* page id */, - string16 /* page contents */, - std::string /* page ISO639_1 language code */, - bool /* whether the page can be translated */) - - // Used to get the extension message bundle. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetExtensionMessageBundle, - std::string /* extension id */, - SubstitutionMap /* message bundle */) - - // Specifies the URL as the first parameter (a wstring) and thumbnail as - // binary data as the second parameter. - IPC_MESSAGE_ROUTED3(ViewHostMsg_Thumbnail, - GURL /* url */, - ThumbnailScore /* score */, - SkBitmap /* bitmap */) - - // Send a snapshot of the tab contents to the render host. - IPC_MESSAGE_ROUTED1(ViewHostMsg_Snapshot, - SkBitmap /* bitmap */) - - // Notification that the url for the favicon of a site has been determined. - IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateFavIconURL, - int32 /* page_id */, - GURL /* url of the favicon */) - - // Used to tell the parent that the user right clicked on an area of the - // content area, and a context menu should be shown for it. The params - // object contains information about the node(s) that were selected when the - // user right clicked. - IPC_MESSAGE_ROUTED1(ViewHostMsg_ContextMenu, ContextMenuParams) - - // Requests that the given URL be opened in the specified manner. - IPC_MESSAGE_ROUTED3(ViewHostMsg_OpenURL, - GURL /* url */, - GURL /* referrer */, - WindowOpenDisposition /* disposition */) - - // Notifies that the preferred size of the content changed. - IPC_MESSAGE_ROUTED1(ViewHostMsg_DidContentsPreferredSizeChange, - gfx::Size /* pref_size */) - - // Following message is used to communicate the values received by the - // callback binding the JS to Cpp. - // An instance of browser that has an automation host listening to it can - // have a javascript send a native value (string, number, boolean) to the - // listener in Cpp. (DomAutomationController) - IPC_MESSAGE_ROUTED2(ViewHostMsg_DomOperationResponse, - std::string /* json_string */, - int /* automation_id */) - - // A message from HTML-based UI. When (trusted) Javascript calls - // send(message, args), this message is sent to the browser. - IPC_MESSAGE_ROUTED3(ViewHostMsg_DOMUISend, - GURL /* source_url */, - std::string /* message */, - std::string /* args (as a JSON string) */) - - // A message for an external host. - IPC_MESSAGE_ROUTED3(ViewHostMsg_ForwardMessageToExternalHost, - std::string /* message */, - std::string /* origin */, - std::string /* target */) - - // A renderer sends this to the browser process when it wants to - // create a plugin. The browser will create the plugin process if - // necessary, and will return a handle to the channel on success. - // On error an empty string is returned. - IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_OpenChannelToPlugin, - GURL /* url */, - std::string /* mime_type */, - IPC::ChannelHandle /* channel_handle */, - WebPluginInfo /* info */) - - // A renderer sends this to the browser process when it wants to - // create a pepper plugin. The browser will create the plugin process if - // necessary, and will return a handle to the channel on success. - // On error an empty string is returned. - IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_OpenChannelToPepperPlugin, - FilePath /* path */, - base::ProcessHandle /* plugin_process_handle */, - IPC::ChannelHandle /* handle to channel */) - - // A renderer sends this to the browser process when it wants to - // create connect to the GPU. The browser will create the GPU process if - // necessary, and will return a handle to the channel via - // a GpuChannelEstablished message. - IPC_MESSAGE_CONTROL0(ViewHostMsg_EstablishGpuChannel) - - // A renderer sends this to the browser process to provide a synchronization - // point for GPU operations, in particular to make sure the GPU channel has - // been established. - IPC_SYNC_MESSAGE_CONTROL0_0(ViewHostMsg_SynchronizeGpu) - - // A renderer sends this to the browser process when it wants to start - // a new instance of the Native Client process. The browser will launch - // the process and return a handle to an IMC channel. - IPC_SYNC_MESSAGE_CONTROL2_3(ViewHostMsg_LaunchNaCl, - std::wstring /* url for the NaCl module */, - int /* socket count */, - std::vector<nacl::FileDescriptor> - /* imc channel handles */, - base::ProcessHandle /* NaCl process handle */, - base::ProcessId /* NaCl process id */) +// Sent by the renderer when it is creating a new window. The browser creates +// a tab for it and responds with a ViewMsg_CreatingNew_ACK. If route_id is +// MSG_ROUTING_NONE, the view couldn't be created. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_CreateWindow, + ViewHostMsg_CreateWindow_Params, + int /* route_id */, + int64 /* cloned_session_storage_namespace_id */) + +// Similar to ViewHostMsg_CreateWindow, except used for sub-widgets, like +// <select> dropdowns. This message is sent to the TabContents that +// contains the widget being created. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_CreateWidget, + int /* opener_id */, + WebKit::WebPopupType /* popup type */, + int /* route_id */) + +// Similar to ViewHostMsg_CreateWidget except the widget is a full screen +// window. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_CreateFullscreenWidget, + int /* opener_id */, + WebKit::WebPopupType /* popup type */, + int /* route_id */) + +// These three messages are sent to the parent RenderViewHost to display the +// page/widget that was created by +// CreateWindow/CreateWidget/CreateFullscreenWidget. routing_id +// refers to the id that was returned from the Create message above. +// The initial_position parameter is a rectangle in screen coordinates. +// +// FUTURE: there will probably be flags here to control if the result is +// in a new window. +IPC_MESSAGE_ROUTED4(ViewHostMsg_ShowView, + int /* route_id */, + WindowOpenDisposition /* disposition */, + gfx::Rect /* initial_pos */, + bool /* opened_by_user_gesture */) + +IPC_MESSAGE_ROUTED2(ViewHostMsg_ShowWidget, + int /* route_id */, + gfx::Rect /* initial_pos */) + +// Message to show a full screen widget. +IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowFullscreenWidget, + int /* route_id */) + +// Message to show a popup menu using native cocoa controls (Mac only). +IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowPopup, + ViewHostMsg_ShowPopup_Params) + +// This message is sent after ViewHostMsg_ShowView to cause the RenderView +// to run in a modal fashion until it is closed. +IPC_SYNC_MESSAGE_ROUTED0_0(ViewHostMsg_RunModal) + +IPC_MESSAGE_CONTROL1(ViewHostMsg_UpdatedCacheStats, + WebKit::WebCache::UsageStats /* stats */) + +// Indicates the renderer is ready in response to a ViewMsg_New or +// a ViewMsg_CreatingNew_ACK. +IPC_MESSAGE_ROUTED0(ViewHostMsg_RenderViewReady) + +// Indicates the renderer process is gone. This actually is sent by the +// browser process to itself, but keeps the interface cleaner. +IPC_MESSAGE_ROUTED0(ViewHostMsg_RenderViewGone) + +// Sent by the renderer process to request that the browser close the view. +// This corresponds to the window.close() API, and the browser may ignore +// this message. Otherwise, the browser will generates a ViewMsg_Close +// message to close the view. +IPC_MESSAGE_ROUTED0(ViewHostMsg_Close) + +// Sent by the renderer process to request that the browser move the view. +// This corresponds to the window.resizeTo() and window.moveTo() APIs, and +// the browser may ignore this message. +IPC_MESSAGE_ROUTED1(ViewHostMsg_RequestMove, + gfx::Rect /* position */) + +// Notifies the browser that a frame in the view has changed. This message +// has a lot of parameters and is packed/unpacked by functions defined in +// render_messages.h. +IPC_MESSAGE_ROUTED1(ViewHostMsg_FrameNavigate, + ViewHostMsg_FrameNavigate_Params) + +// Notifies the browser that we have session history information. +// page_id: unique ID that allows us to distinguish between history entries. +IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateState, + int32 /* page_id */, + std::string /* state */) + +// Notifies the browser that a document has been loaded in a frame. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentLoadedInFrame, + int64 /* frame_id */) + +// Notifies the browser that a frame finished loading. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DidFinishLoad, + int64 /* frame_id */) + +// Changes the title for the page in the UI when the page is navigated or the +// title changes. +// TODO(darin): use a UTF-8 string to reduce data size +IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateTitle, int32, std::wstring) + +// Changes the icon url for the page in the UI. +IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateIconURL, int32, GURL) + +// Change the encoding name of the page in UI when the page has detected +// proper encoding name. +IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateEncoding, + std::string /* new encoding name */) + +// Notifies the browser that we want to show a destination url for a potential +// action (e.g. when the user is hovering over a link). +IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateTargetURL, int32, GURL) + +// Sent when the renderer starts loading the page. This corresponds to +// WebKit's notion of the throbber starting. Note that sometimes you may get +// duplicates of these during a single load. +IPC_MESSAGE_ROUTED0(ViewHostMsg_DidStartLoading) + +// Sent when the renderer is done loading a page. This corresponds to WebKit's +// notion of the throbber stopping. +IPC_MESSAGE_ROUTED0(ViewHostMsg_DidStopLoading) + +// Sent when the document element is available for the toplevel frame. This +// happens after the page starts loading, but before all resources are +// finished. +IPC_MESSAGE_ROUTED0(ViewHostMsg_DocumentAvailableInMainFrame) + +// Sent when after the onload handler has been invoked for the document +// in the toplevel frame. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentOnLoadCompletedInMainFrame, + int32 /* page_id */) + +// Sent when the renderer loads a resource from its memory cache. +// The security info is non empty if the resource was originally loaded over +// a secure connection. +// Note: May only be sent once per URL per frame per committed load. +IPC_MESSAGE_ROUTED4(ViewHostMsg_DidLoadResourceFromMemoryCache, + GURL /* url */, + std::string /* frame_origin */, + std::string /* main_frame_origin */, + std::string /* security info */) + +// Sent when the renderer displays insecure content in a secure page. +IPC_MESSAGE_ROUTED0(ViewHostMsg_DidDisplayInsecureContent) + +// Sent when the renderer runs insecure content in a secure origin. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DidRunInsecureContent, + std::string /* security_origin */) + +// Sent when the renderer starts a provisional load for a frame. +IPC_MESSAGE_ROUTED3(ViewHostMsg_DidStartProvisionalLoadForFrame, + int64 /* frame_id */, + bool /* true if it is the main frame */, + GURL /* url */) + +// Sent when the renderer fails a provisional load with an error. +IPC_MESSAGE_ROUTED5(ViewHostMsg_DidFailProvisionalLoadWithError, + int64 /* frame_id */, + bool /* true if it is the main frame */, + int /* error_code */, + GURL /* url */, + bool /* true if the failure is the result of + navigating to a POST again and we're going to + show the POST interstitial */) + +// Tells the render view that a ViewHostMsg_PaintAtSize message was +// processed, and the DIB is ready for use. |tag| has the same value that +// the tag sent along with ViewMsg_PaintAtSize. +IPC_MESSAGE_ROUTED2(ViewHostMsg_PaintAtSize_ACK, + int /* tag */, + gfx::Size /* size */) + +// Sent to update part of the view. In response to this message, the host +// generates a ViewMsg_UpdateRect_ACK message. +IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateRect, + ViewHostMsg_UpdateRect_Params) + +// Sent by the renderer when accelerated compositing is enabled or disabled to +// notify the browser whether or not is should do painting. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DidActivateAcceleratedCompositing, + bool /* true if the accelerated compositor is actve */) + +// Acknowledges receipt of a ViewMsg_HandleInputEvent message. +// Payload is a WebInputEvent::Type which is the type of the event, followed +// by an optional WebInputEvent which is provided only if the event was not +// processed. +IPC_MESSAGE_ROUTED0(ViewHostMsg_HandleInputEvent_ACK) + +IPC_MESSAGE_ROUTED0(ViewHostMsg_Focus) +IPC_MESSAGE_ROUTED0(ViewHostMsg_Blur) + +// Message sent from renderer to the browser when focus changes inside the +// webpage. The parameter says whether the newly focused element needs +// keyboard input (true for textfields, text areas and content editable divs). +IPC_MESSAGE_ROUTED1(ViewHostMsg_FocusedNodeChanged, + bool /* is_editable_node */) + +// Returns the window location of the given window. +// TODO(shess): Provide a mapping from reply_msg->routing_id() to +// HWND so that we can eliminate the NativeViewId parameter. +IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetWindowRect, + gfx::NativeViewId /* window */, + gfx::Rect /* Out: Window location */) + +IPC_MESSAGE_ROUTED1(ViewHostMsg_SetCursor, WebCursor) +// Result of string search in the page. +// Response to ViewMsg_Find with the results of the requested find-in-page +// search, the number of matches found and the selection rect (in screen +// coordinates) for the string found. If |final_update| is false, it signals +// that this is not the last Find_Reply message - more will be sent as the +// scoping effort continues. +IPC_MESSAGE_ROUTED5(ViewHostMsg_Find_Reply, + int /* request_id */, + int /* number of matches */, + gfx::Rect /* selection_rect */, + int /* active_match_ordinal */, + bool /* final_update */) + +// Makes a resource request via the browser. +IPC_MESSAGE_ROUTED2(ViewHostMsg_RequestResource, + int /* request_id */, + ViewHostMsg_Resource_Request) + +// Cancels a resource request with the ID given as the parameter. +IPC_MESSAGE_ROUTED1(ViewHostMsg_CancelRequest, + int /* request_id */) + +// Follows a redirect that occured for the resource request with the ID given +// as the parameter. +IPC_MESSAGE_ROUTED3(ViewHostMsg_FollowRedirect, + int /* request_id */, + bool /* has_new_first_party_for_cookies */, + GURL /* new_first_party_for_cookies */) + +// Makes a synchronous resource request via the browser. +IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_SyncLoad, + int /* request_id */, + ViewHostMsg_Resource_Request, + SyncLoadResult) + +// Used to set a cookie. The cookie is set asynchronously, but will be +// available to a subsequent ViewHostMsg_GetCookies request. +IPC_MESSAGE_ROUTED3(ViewHostMsg_SetCookie, + GURL /* url */, + GURL /* first_party_for_cookies */, + std::string /* cookie */) + +// Used to get cookies for the given URL. This may block waiting for a +// previous SetCookie message to be processed. +IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetCookies, + GURL /* url */, + GURL /* first_party_for_cookies */, + std::string /* cookies */) + +// Used to get raw cookie information for the given URL. This may block +// waiting for a previous SetCookie message to be processed. +IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_GetRawCookies, + GURL /* url */, + GURL /* first_party_for_cookies */, + std::vector<webkit_glue::WebCookie> + /* raw_cookies */) + +// Used to delete cookie for the given URL and name +IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_DeleteCookie, + GURL /* url */, + std::string /* cookie_name */) + +// Used to check if cookies are enabled for the given URL. This may block +// waiting for a previous SetCookie message to be processed. +IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_CookiesEnabled, + GURL /* url */, + GURL /* first_party_for_cookies */, + bool /* cookies_enabled */) + +// Used to get the list of plugins +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetPlugins, + bool /* refresh*/, + std::vector<WebPluginInfo> /* plugins */) + +// Return information about a plugin for the given URL and MIME +// type. If there is no matching plugin, |found| is false. If +// |enabled| in the WebPluginInfo struct is false, the plug-in is +// treated as if it was not installed at all. +// +// If |setting| is set to CONTENT_SETTING_BLOCK, the plug-in is +// blocked by the content settings for |policy_url|. It still +// appears in navigator.plugins in Javascript though, and can be +// loaded via click-to-play. +// +// If |setting| is set to CONTENT_SETTING_ALLOW, the domain is +// explicitly white-listed for the plug-in, or the user has chosen +// not to block nonsandboxed plugins. +// +// If |setting| is set to CONTENT_SETTING_DEFAULT, the plug-in is +// neither blocked nor white-listed, which means that it's allowed +// by default and can still be blocked if it's non-sandboxed. +// +// |actual_mime_type| is the actual mime type supported by the +// plugin found that match the URL given (one for each item in +// |info|). +IPC_SYNC_MESSAGE_CONTROL3_4(ViewHostMsg_GetPluginInfo, + GURL /* url */, + GURL /* policy_url */, + std::string /* mime_type */, + bool /* found */, + WebPluginInfo /* plugin info */, + ContentSetting /* setting */, + std::string /* actual_mime_type */) + +// Requests spellcheck for a word. +IPC_SYNC_MESSAGE_ROUTED2_2(ViewHostMsg_SpellCheck, + string16 /* word to check */, + int /* document tag*/, + int /* misspell location */, + int /* misspell length */) + +// Asks the browser for a unique document tag. +IPC_SYNC_MESSAGE_ROUTED0_1(ViewHostMsg_GetDocumentTag, + int /* the tag */) + + +// This message tells the spellchecker that a document, identified by an int +// tag, has been closed and all of the ignored words for that document can be +// forgotten. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DocumentWithTagClosed, + int /* the tag */) + +// Tells the browser to display or not display the SpellingPanel +IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowSpellingPanel, + bool /* if true, then show it, otherwise hide it*/) + +// Tells the browser to update the spelling panel with the given word. +IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateSpellingPanelWithMisspelledWord, + string16 /* the word to update the panel with */) + +// Tells the browser that content in the current page was blocked due to the +// user's content settings. +IPC_MESSAGE_ROUTED2(ViewHostMsg_ContentBlocked, + ContentSettingsType, /* type of blocked content */ + std::string /* resource identifier */) + +// Tells the browser that a specific Appcache manifest in the current page +// was accessed. +IPC_MESSAGE_ROUTED2(ViewHostMsg_AppCacheAccessed, + GURL /* manifest url */, + bool /* blocked by policy */) + +// Tells the browser that a specific Web database in the current page was +// accessed. +IPC_MESSAGE_ROUTED5(ViewHostMsg_WebDatabaseAccessed, + GURL /* origin url */, + string16 /* database name */, + string16 /* database display name */, + unsigned long /* estimated size */, + bool /* blocked by policy */) + +// Initiates a download based on user actions like 'ALT+click'. +IPC_MESSAGE_ROUTED2(ViewHostMsg_DownloadUrl, + GURL /* url */, + GURL /* referrer */) + +// Used to go to the session history entry at the given offset (ie, -1 will +// return the "back" item). +IPC_MESSAGE_ROUTED1(ViewHostMsg_GoToEntryAtOffset, + int /* offset (from current) of history item to get */) + +IPC_SYNC_MESSAGE_ROUTED4_2(ViewHostMsg_RunJavaScriptMessage, + std::wstring /* in - alert message */, + std::wstring /* in - default prompt */, + GURL /* in - originating page URL */, + int /* in - dialog flags */, + bool /* out - success */, + std::wstring /* out - prompt field */) + +// Provides the contents for the given page that was loaded recently. +IPC_MESSAGE_ROUTED5(ViewHostMsg_PageContents, + GURL /* URL of the page */, + int32 /* page id */, + string16 /* page contents */, + std::string /* page ISO639_1 language code */, + bool /* whether the page can be translated */) + +// Used to get the extension message bundle. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetExtensionMessageBundle, + std::string /* extension id */, + SubstitutionMap /* message bundle */) + +// Specifies the URL as the first parameter (a wstring) and thumbnail as +// binary data as the second parameter. +IPC_MESSAGE_ROUTED3(ViewHostMsg_Thumbnail, + GURL /* url */, + ThumbnailScore /* score */, + SkBitmap /* bitmap */) + +// Send a snapshot of the tab contents to the render host. +IPC_MESSAGE_ROUTED1(ViewHostMsg_Snapshot, + SkBitmap /* bitmap */) + +// Notification that the url for the favicon of a site has been determined. +IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateFavIconURL, + int32 /* page_id */, + GURL /* url of the favicon */) + +// Used to tell the parent that the user right clicked on an area of the +// content area, and a context menu should be shown for it. The params +// object contains information about the node(s) that were selected when the +// user right clicked. +IPC_MESSAGE_ROUTED1(ViewHostMsg_ContextMenu, ContextMenuParams) + +// Requests that the given URL be opened in the specified manner. +IPC_MESSAGE_ROUTED3(ViewHostMsg_OpenURL, + GURL /* url */, + GURL /* referrer */, + WindowOpenDisposition /* disposition */) + +// Notifies that the preferred size of the content changed. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DidContentsPreferredSizeChange, + gfx::Size /* pref_size */) + +// Following message is used to communicate the values received by the +// callback binding the JS to Cpp. +// An instance of browser that has an automation host listening to it can +// have a javascript send a native value (string, number, boolean) to the +// listener in Cpp. (DomAutomationController) +IPC_MESSAGE_ROUTED2(ViewHostMsg_DomOperationResponse, + std::string /* json_string */, + int /* automation_id */) + +// A message from HTML-based UI. When (trusted) Javascript calls +// send(message, args), this message is sent to the browser. +IPC_MESSAGE_ROUTED3(ViewHostMsg_DOMUISend, + GURL /* source_url */, + std::string /* message */, + std::string /* args (as a JSON string) */) + +// A message for an external host. +IPC_MESSAGE_ROUTED3(ViewHostMsg_ForwardMessageToExternalHost, + std::string /* message */, + std::string /* origin */, + std::string /* target */) + +// A renderer sends this to the browser process when it wants to +// create a plugin. The browser will create the plugin process if +// necessary, and will return a handle to the channel on success. +// On error an empty string is returned. +IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_OpenChannelToPlugin, + GURL /* url */, + std::string /* mime_type */, + IPC::ChannelHandle /* channel_handle */, + WebPluginInfo /* info */) + +// A renderer sends this to the browser process when it wants to +// create a pepper plugin. The browser will create the plugin process if +// necessary, and will return a handle to the channel on success. +// On error an empty string is returned. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_OpenChannelToPepperPlugin, + FilePath /* path */, + base::ProcessHandle /* plugin_process_handle */, + IPC::ChannelHandle /* handle to channel */) + +// A renderer sends this to the browser process when it wants to +// create connect to the GPU. The browser will create the GPU process if +// necessary, and will return a handle to the channel via +// a GpuChannelEstablished message. +IPC_MESSAGE_CONTROL0(ViewHostMsg_EstablishGpuChannel) + +// A renderer sends this to the browser process to provide a synchronization +// point for GPU operations, in particular to make sure the GPU channel has +// been established. +IPC_SYNC_MESSAGE_CONTROL0_0(ViewHostMsg_SynchronizeGpu) + +// A renderer sends this to the browser process when it wants to start +// a new instance of the Native Client process. The browser will launch +// the process and return a handle to an IMC channel. +IPC_SYNC_MESSAGE_CONTROL2_3(ViewHostMsg_LaunchNaCl, + std::wstring /* url for the NaCl module */, + int /* socket count */, + std::vector<nacl::FileDescriptor> + /* imc channel handles */, + base::ProcessHandle /* NaCl process handle */, + base::ProcessId /* NaCl process id */) #if defined(USE_X11) - // A renderer sends this when it needs a browser-side widget for - // hosting a windowed plugin. id is the XID of the plugin window, for which - // the container is created. - IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_CreatePluginContainer, - gfx::PluginWindowHandle /* id */) - - // Destroy a plugin container previously created using CreatePluginContainer. - // id is the XID of the plugin window corresponding to the container that is - // to be destroyed. - IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_DestroyPluginContainer, - gfx::PluginWindowHandle /* id */) +// A renderer sends this when it needs a browser-side widget for +// hosting a windowed plugin. id is the XID of the plugin window, for which +// the container is created. +IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_CreatePluginContainer, + gfx::PluginWindowHandle /* id */) + +// Destroy a plugin container previously created using CreatePluginContainer. +// id is the XID of the plugin window corresponding to the container that is +// to be destroyed. +IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_DestroyPluginContainer, + gfx::PluginWindowHandle /* id */) #endif - // Clipboard IPC messages - - // This message is used when the object list does not contain a bitmap. - IPC_MESSAGE_CONTROL1(ViewHostMsg_ClipboardWriteObjectsAsync, - Clipboard::ObjectMap /* objects */) - // This message is used when the object list contains a bitmap. - // It is synchronized so that the renderer knows when it is safe to - // free the shared memory used to transfer the bitmap. - IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_ClipboardWriteObjectsSync, - Clipboard::ObjectMap /* objects */, - base::SharedMemoryHandle /* bitmap handle */) - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_ClipboardIsFormatAvailable, - std::string /* format */, - Clipboard::Buffer /* buffer */, - bool /* result */) - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_ClipboardReadText, - Clipboard::Buffer /* buffer */, - string16 /* result */) - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_ClipboardReadAsciiText, - Clipboard::Buffer /* buffer */, - std::string /* result */) - IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ClipboardReadHTML, - Clipboard::Buffer /* buffer */, - string16 /* markup */, - GURL /* url */) - - IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_ClipboardReadAvailableTypes, - Clipboard::Buffer /* buffer */, - bool /* result */, - std::vector<string16> /* types */, - bool /* contains filenames */) - IPC_SYNC_MESSAGE_CONTROL2_3(ViewHostMsg_ClipboardReadData, - Clipboard::Buffer /* buffer */, - string16 /* type */, - bool /* succeeded */, - string16 /* data */, - string16 /* metadata */) - IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ClipboardReadFilenames, - Clipboard::Buffer /* buffer */, - bool /* result */, - std::vector<string16> /* filenames */) +// Clipboard IPC messages + +// This message is used when the object list does not contain a bitmap. +IPC_MESSAGE_CONTROL1(ViewHostMsg_ClipboardWriteObjectsAsync, + Clipboard::ObjectMap /* objects */) +// This message is used when the object list contains a bitmap. +// It is synchronized so that the renderer knows when it is safe to +// free the shared memory used to transfer the bitmap. +IPC_SYNC_MESSAGE_CONTROL2_0(ViewHostMsg_ClipboardWriteObjectsSync, + Clipboard::ObjectMap /* objects */, + base::SharedMemoryHandle /* bitmap handle */) +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_ClipboardIsFormatAvailable, + std::string /* format */, + Clipboard::Buffer /* buffer */, + bool /* result */) +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_ClipboardReadText, + Clipboard::Buffer /* buffer */, + string16 /* result */) +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_ClipboardReadAsciiText, + Clipboard::Buffer /* buffer */, + std::string /* result */) +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ClipboardReadHTML, + Clipboard::Buffer /* buffer */, + string16 /* markup */, + GURL /* url */) + +IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_ClipboardReadAvailableTypes, + Clipboard::Buffer /* buffer */, + bool /* result */, + std::vector<string16> /* types */, + bool /* contains filenames */) +IPC_SYNC_MESSAGE_CONTROL2_3(ViewHostMsg_ClipboardReadData, + Clipboard::Buffer /* buffer */, + string16 /* type */, + bool /* succeeded */, + string16 /* data */, + string16 /* metadata */) +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ClipboardReadFilenames, + Clipboard::Buffer /* buffer */, + bool /* result */, + std::vector<string16> /* filenames */) #if defined(OS_MACOSX) - IPC_MESSAGE_CONTROL1(ViewHostMsg_ClipboardFindPboardWriteStringAsync, - string16 /* text */) - - // Request that the browser load a font into shared memory for us. - IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_LoadFont, - FontDescriptor /* font to load */, - uint32 /* buffer size */, - base::SharedMemoryHandle /* font data */) +IPC_MESSAGE_CONTROL1(ViewHostMsg_ClipboardFindPboardWriteStringAsync, + string16 /* text */) + +// Request that the browser load a font into shared memory for us. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_LoadFont, + FontDescriptor /* font to load */, + uint32 /* buffer size */, + base::SharedMemoryHandle /* font data */) #endif #if defined(OS_WIN) - // Request that the given font be loaded by the browser so it's cached by the - // OS. Please see ChildProcessHost::PreCacheFont for details. - IPC_SYNC_MESSAGE_CONTROL1_0(ViewHostMsg_PreCacheFont, - LOGFONT /* font data */) +// Request that the given font be loaded by the browser so it's cached by the +// OS. Please see ChildProcessHost::PreCacheFont for details. +IPC_SYNC_MESSAGE_CONTROL1_0(ViewHostMsg_PreCacheFont, + LOGFONT /* font data */) #endif // defined(OS_WIN) - // Returns WebScreenInfo corresponding to the view. - // TODO(shess): Provide a mapping from reply_msg->routing_id() to - // HWND so that we can eliminate the NativeViewId parameter. - IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetScreenInfo, - gfx::NativeViewId /* view */, - WebKit::WebScreenInfo /* results */) - - // Send the tooltip text for the current mouse position to the browser. - IPC_MESSAGE_ROUTED2(ViewHostMsg_SetTooltipText, - std::wstring /* tooltip text string */, - WebKit::WebTextDirection /* text direction hint */) - - // Notification that the text selection has changed. - IPC_MESSAGE_ROUTED1(ViewHostMsg_SelectionChanged, - std::string /* currently selected text */) - - // Asks the browser to display the file chooser. The result is returned in a - // ViewHost_RunFileChooserResponse message. - IPC_MESSAGE_ROUTED1(ViewHostMsg_RunFileChooser, - ViewHostMsg_RunFileChooser_Params) - - // Notification that forms have been seen that are candidates for - // filling/submitting by the AutoFillManager. - IPC_MESSAGE_ROUTED1(ViewHostMsg_FormsSeen, - std::vector<webkit_glue::FormData> /* forms */) - - // Notification that password forms have been seen that are candidates for - // filling/submitting by the password manager. - IPC_MESSAGE_ROUTED1(ViewHostMsg_PasswordFormsFound, - std::vector<webkit_glue::PasswordForm> /* forms */) - - // Notification that initial layout has occurred and the following password - // forms are visible on the page (e.g. not set to display:none.) - IPC_MESSAGE_ROUTED1(ViewHostMsg_PasswordFormsVisible, - std::vector<webkit_glue::PasswordForm> /* forms */) - - // Notification that a form has been submitted. The user hit the button. - IPC_MESSAGE_ROUTED1(ViewHostMsg_FormSubmitted, - webkit_glue::FormData /* form */) - - // Used to tell the parent the user started dragging in the content area. The - // WebDropData struct contains contextual information about the pieces of the - // page the user dragged. The parent uses this notification to initiate a - // drag session at the OS level. - IPC_MESSAGE_ROUTED4(ViewHostMsg_StartDragging, - WebDropData /* drop_data */, - WebKit::WebDragOperationsMask /* ops_allowed */, - SkBitmap /* image */, - gfx::Point /* image_offset */) - - // The page wants to update the mouse cursor during a drag & drop operation. - // |is_drop_target| is true if the mouse is over a valid drop target. - IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateDragCursor, - WebKit::WebDragOperation /* drag_operation */) - - // Tells the browser to move the focus to the next (previous if reverse is - // true) focusable element. - IPC_MESSAGE_ROUTED1(ViewHostMsg_TakeFocus, bool /* reverse */) - - // Notification that the page has an OpenSearch description document - // associated with it. - IPC_MESSAGE_ROUTED3(ViewHostMsg_PageHasOSDD, - int32 /* page_id */, - GURL /* url of OS description document */, - ViewHostMsg_PageHasOSDD_Type) - - // Find out if the given url's security origin is installed as a search - // provider. - IPC_SYNC_MESSAGE_ROUTED2_1( - ViewHostMsg_GetSearchProviderInstallState, - GURL /* page url */, - GURL /* inquiry url */, - ViewHostMsg_GetSearchProviderInstallState_Params /* install */) - - // Required for updating text input state. - IPC_MESSAGE_ROUTED2(ViewHostMsg_ImeUpdateTextInputState, - WebKit::WebTextInputType, /* text_input_type */ - gfx::Rect /* caret_rect */) - - // Required for cancelling an ongoing input method composition. - IPC_MESSAGE_ROUTED0(ViewHostMsg_ImeCancelComposition) - - // Tells the browser that the renderer is done calculating the number of - // rendered pages according to the specified settings. - IPC_MESSAGE_ROUTED2(ViewHostMsg_DidGetPrintedPagesCount, - int /* rendered document cookie */, - int /* number of rendered pages */) - - // Sends back to the browser the rendered "printed page" that was requested by - // a ViewMsg_PrintPage message or from scripted printing. The memory handle in - // this message is already valid in the browser process. - IPC_MESSAGE_ROUTED1(ViewHostMsg_DidPrintPage, - ViewHostMsg_DidPrintPage_Params /* page content */) - - // The renderer wants to know the default print settings. - IPC_SYNC_MESSAGE_ROUTED0_1(ViewHostMsg_GetDefaultPrintSettings, - ViewMsg_Print_Params /* default_settings */) - - // It's the renderer that controls the printing process when it is generated - // by javascript. This step is about showing UI to the user to select the - // final print settings. The output parameter is the same as - // ViewMsg_PrintPages which is executed implicitly. - IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_ScriptedPrint, - ViewHostMsg_ScriptedPrint_Params, - ViewMsg_PrintPages_Params - /* settings chosen by the user*/) - - // WebKit and JavaScript error messages to log to the console - // or debugger UI. - IPC_MESSAGE_ROUTED3(ViewHostMsg_AddMessageToConsole, - std::wstring, /* msg */ - int32, /* line number */ - std::wstring /* source id */) - - // Stores new inspector setting in the profile. - IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateInspectorSetting, - std::string, /* key */ - std::string /* value */) - - // Wraps an IPC message that's destined to the DevToolsClient on - // DevToolsAgent->browser hop. - IPC_MESSAGE_ROUTED1(ViewHostMsg_ForwardToDevToolsClient, - IPC::Message /* one of DevToolsClientMsg_XXX types */) - - // Wraps an IPC message that's destined to the DevToolsAgent on - // DevToolsClient->browser hop. - IPC_MESSAGE_ROUTED1(ViewHostMsg_ForwardToDevToolsAgent, - IPC::Message /* one of DevToolsAgentMsg_XXX types */) - - // Activates (brings to the front) corresponding dev tools window. - IPC_MESSAGE_ROUTED0(ViewHostMsg_ActivateDevToolsWindow) - - // Closes dev tools window that is inspecting current render_view_host. - IPC_MESSAGE_ROUTED0(ViewHostMsg_CloseDevToolsWindow) - - // Attaches dev tools window that is inspecting current render_view_host. - IPC_MESSAGE_ROUTED0(ViewHostMsg_RequestDockDevToolsWindow) - - // Detaches dev tools window that is inspecting current render_view_host. - IPC_MESSAGE_ROUTED0(ViewHostMsg_RequestUndockDevToolsWindow) - - // Updates runtime features store in devtools manager in order to support - // cross-navigation instrumentation. - IPC_MESSAGE_ROUTED2(ViewHostMsg_DevToolsRuntimePropertyChanged, - std::string /* name */, - std::string /* value */) - - // Send back a string to be recorded by UserMetrics. - IPC_MESSAGE_CONTROL1(ViewHostMsg_UserMetricsRecordAction, - std::string /* action */) - - // Send back histograms as vector of pickled-histogram strings. - IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererHistograms, - int, /* sequence number of Renderer Histograms. */ - std::vector<std::string>) +// Returns WebScreenInfo corresponding to the view. +// TODO(shess): Provide a mapping from reply_msg->routing_id() to +// HWND so that we can eliminate the NativeViewId parameter. +IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetScreenInfo, + gfx::NativeViewId /* view */, + WebKit::WebScreenInfo /* results */) + +// Send the tooltip text for the current mouse position to the browser. +IPC_MESSAGE_ROUTED2(ViewHostMsg_SetTooltipText, + std::wstring /* tooltip text string */, + WebKit::WebTextDirection /* text direction hint */) + +// Notification that the text selection has changed. +IPC_MESSAGE_ROUTED1(ViewHostMsg_SelectionChanged, + std::string /* currently selected text */) + +// Asks the browser to display the file chooser. The result is returned in a +// ViewHost_RunFileChooserResponse message. +IPC_MESSAGE_ROUTED1(ViewHostMsg_RunFileChooser, + ViewHostMsg_RunFileChooser_Params) + +// Notification that forms have been seen that are candidates for +// filling/submitting by the AutoFillManager. +IPC_MESSAGE_ROUTED1(ViewHostMsg_FormsSeen, + std::vector<webkit_glue::FormData> /* forms */) + +// Notification that password forms have been seen that are candidates for +// filling/submitting by the password manager. +IPC_MESSAGE_ROUTED1(ViewHostMsg_PasswordFormsFound, + std::vector<webkit_glue::PasswordForm> /* forms */) + +// Notification that initial layout has occurred and the following password +// forms are visible on the page (e.g. not set to display:none.) +IPC_MESSAGE_ROUTED1(ViewHostMsg_PasswordFormsVisible, + std::vector<webkit_glue::PasswordForm> /* forms */) + +// Notification that a form has been submitted. The user hit the button. +IPC_MESSAGE_ROUTED1(ViewHostMsg_FormSubmitted, + webkit_glue::FormData /* form */) + +// Used to tell the parent the user started dragging in the content area. The +// WebDropData struct contains contextual information about the pieces of the +// page the user dragged. The parent uses this notification to initiate a +// drag session at the OS level. +IPC_MESSAGE_ROUTED4(ViewHostMsg_StartDragging, + WebDropData /* drop_data */, + WebKit::WebDragOperationsMask /* ops_allowed */, + SkBitmap /* image */, + gfx::Point /* image_offset */) + +// The page wants to update the mouse cursor during a drag & drop operation. +// |is_drop_target| is true if the mouse is over a valid drop target. +IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateDragCursor, + WebKit::WebDragOperation /* drag_operation */) + +// Tells the browser to move the focus to the next (previous if reverse is +// true) focusable element. +IPC_MESSAGE_ROUTED1(ViewHostMsg_TakeFocus, bool /* reverse */) + +// Notification that the page has an OpenSearch description document +// associated with it. +IPC_MESSAGE_ROUTED3(ViewHostMsg_PageHasOSDD, + int32 /* page_id */, + GURL /* url of OS description document */, + ViewHostMsg_PageHasOSDD_Type) + +// Find out if the given url's security origin is installed as a search +// provider. +IPC_SYNC_MESSAGE_ROUTED2_1( + ViewHostMsg_GetSearchProviderInstallState, + GURL /* page url */, + GURL /* inquiry url */, + ViewHostMsg_GetSearchProviderInstallState_Params /* install */) + +// Required for updating text input state. +IPC_MESSAGE_ROUTED2(ViewHostMsg_ImeUpdateTextInputState, + WebKit::WebTextInputType, /* text_input_type */ + gfx::Rect /* caret_rect */) + +// Required for cancelling an ongoing input method composition. +IPC_MESSAGE_ROUTED0(ViewHostMsg_ImeCancelComposition) + +// Tells the browser that the renderer is done calculating the number of +// rendered pages according to the specified settings. +IPC_MESSAGE_ROUTED2(ViewHostMsg_DidGetPrintedPagesCount, + int /* rendered document cookie */, + int /* number of rendered pages */) + +// Sends back to the browser the rendered "printed page" that was requested by +// a ViewMsg_PrintPage message or from scripted printing. The memory handle in +// this message is already valid in the browser process. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DidPrintPage, + ViewHostMsg_DidPrintPage_Params /* page content */) + +// The renderer wants to know the default print settings. +IPC_SYNC_MESSAGE_ROUTED0_1(ViewHostMsg_GetDefaultPrintSettings, + ViewMsg_Print_Params /* default_settings */) + +// It's the renderer that controls the printing process when it is generated +// by javascript. This step is about showing UI to the user to select the +// final print settings. The output parameter is the same as +// ViewMsg_PrintPages which is executed implicitly. +IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_ScriptedPrint, + ViewHostMsg_ScriptedPrint_Params, + ViewMsg_PrintPages_Params + /* settings chosen by the user*/) + +// WebKit and JavaScript error messages to log to the console +// or debugger UI. +IPC_MESSAGE_ROUTED3(ViewHostMsg_AddMessageToConsole, + std::wstring, /* msg */ + int32, /* line number */ + std::wstring /* source id */) + +// Stores new inspector setting in the profile. +IPC_MESSAGE_ROUTED2(ViewHostMsg_UpdateInspectorSetting, + std::string, /* key */ + std::string /* value */) + +// Wraps an IPC message that's destined to the DevToolsClient on +// DevToolsAgent->browser hop. +IPC_MESSAGE_ROUTED1(ViewHostMsg_ForwardToDevToolsClient, + IPC::Message /* one of DevToolsClientMsg_XXX types */) + +// Wraps an IPC message that's destined to the DevToolsAgent on +// DevToolsClient->browser hop. +IPC_MESSAGE_ROUTED1(ViewHostMsg_ForwardToDevToolsAgent, + IPC::Message /* one of DevToolsAgentMsg_XXX types */) + +// Activates (brings to the front) corresponding dev tools window. +IPC_MESSAGE_ROUTED0(ViewHostMsg_ActivateDevToolsWindow) + +// Closes dev tools window that is inspecting current render_view_host. +IPC_MESSAGE_ROUTED0(ViewHostMsg_CloseDevToolsWindow) + +// Attaches dev tools window that is inspecting current render_view_host. +IPC_MESSAGE_ROUTED0(ViewHostMsg_RequestDockDevToolsWindow) + +// Detaches dev tools window that is inspecting current render_view_host. +IPC_MESSAGE_ROUTED0(ViewHostMsg_RequestUndockDevToolsWindow) + +// Updates runtime features store in devtools manager in order to support +// cross-navigation instrumentation. +IPC_MESSAGE_ROUTED2(ViewHostMsg_DevToolsRuntimePropertyChanged, + std::string /* name */, + std::string /* value */) + +// Send back a string to be recorded by UserMetrics. +IPC_MESSAGE_CONTROL1(ViewHostMsg_UserMetricsRecordAction, + std::string /* action */) + +// Send back histograms as vector of pickled-histogram strings. +IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererHistograms, + int, /* sequence number of Renderer Histograms. */ + std::vector<std::string>) #if defined USE_TCMALLOC - // Send back tcmalloc stats output. - IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererTcmalloc, - int /* pid */, - std::string /* tcmalloc debug output */) +// Send back tcmalloc stats output. +IPC_MESSAGE_CONTROL2(ViewHostMsg_RendererTcmalloc, + int /* pid */, + std::string /* tcmalloc debug output */) #endif - // Sends back stats about the V8 heap. - IPC_MESSAGE_CONTROL2(ViewHostMsg_V8HeapStats, - int /* size of heap (allocated from the OS) */, - int /* bytes in use */) - - // Request for a DNS prefetch of the names in the array. - // NameList is typedef'ed std::vector<std::string> - IPC_MESSAGE_CONTROL1(ViewHostMsg_DnsPrefetch, - std::vector<std::string> /* hostnames */) - - // Notifies when default plugin updates status of the missing plugin. - IPC_MESSAGE_ROUTED1(ViewHostMsg_MissingPluginStatus, - int /* status */) - - // Sent by the renderer process to indicate that a plugin instance has - // crashed. - IPC_MESSAGE_ROUTED1(ViewHostMsg_CrashedPlugin, - FilePath /* plugin_path */) - - // Notifies when a plugin couldn't be loaded because it's outdated. - IPC_MESSAGE_ROUTED2(ViewHostMsg_DisabledOutdatedPlugin, - string16, /* name */ - GURL /* update_url */) - - // Displays a JavaScript out-of-memory message in the infobar. - IPC_MESSAGE_ROUTED0(ViewHostMsg_JSOutOfMemory) - - // Displays a box to confirm that the user wants to navigate away from the - // page. Replies true if yes, false otherwise, the reply string is ignored, - // but is included so that we can use OnJavaScriptMessageBoxClosed. - IPC_SYNC_MESSAGE_ROUTED2_2(ViewHostMsg_RunBeforeUnloadConfirm, - GURL, /* in - originating frame URL */ - std::wstring /* in - alert message */, - bool /* out - success */, - std::wstring /* out - This is ignored.*/) - - IPC_MESSAGE_ROUTED3(ViewHostMsg_SendCurrentPageAllSavableResourceLinks, - std::vector<GURL> /* all savable resource links */, - std::vector<GURL> /* all referrers of resource links */, - std::vector<GURL> /* all frame links */) - - IPC_MESSAGE_ROUTED3(ViewHostMsg_SendSerializedHtmlData, - GURL /* frame's url */, - std::string /* data buffer */, - int32 /* complete status */) - - IPC_SYNC_MESSAGE_ROUTED4_1(ViewHostMsg_ShowModalHTMLDialog, - GURL /* url */, - int /* width */, - int /* height */, - std::string /* json_arguments */, - std::string /* json_retval */) - - IPC_MESSAGE_ROUTED2(ViewHostMsg_DidGetApplicationInfo, - int32 /* page_id */, - WebApplicationInfo) - - // Sent by the renderer to implement chrome.app.installApplication(). - IPC_MESSAGE_ROUTED1(ViewHostMsg_InstallApplication, - WebApplicationInfo) - - // Provides the result from running OnMsgShouldClose. |proceed| matches the - // return value of the the frame's shouldClose method (which includes the - // onbeforeunload handler): true if the user decided to proceed with leaving - // the page. - IPC_MESSAGE_ROUTED1(ViewHostMsg_ShouldClose_ACK, - bool /* proceed */) - - // Indicates that the current page has been closed, after a ClosePage - // message. The parameters are just echoed from the ClosePage request. - IPC_MESSAGE_ROUTED1(ViewHostMsg_ClosePage_ACK, - ViewMsg_ClosePage_Params) - - IPC_MESSAGE_ROUTED4(ViewHostMsg_DidDownloadFavIcon, - int /* Identifier of the request */, - GURL /* URL of the image */, - bool /* true if there was a network error */, - SkBitmap /* image_data */) - - // Sent to query MIME information. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetMimeTypeFromExtension, - FilePath::StringType /* extension */, - std::string /* mime_type */) - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetMimeTypeFromFile, - FilePath /* file_path */, - std::string /* mime_type */) - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetPreferredExtensionForMimeType, - std::string /* mime_type */, - FilePath::StringType /* extension */) - - // Get the CPBrowsingContext associated with the renderer sending this - // message. - IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GetCPBrowsingContext, - uint32 /* context */) - - // Sent when the renderer process is done processing a DataReceived - // message. - IPC_MESSAGE_ROUTED1(ViewHostMsg_DataReceived_ACK, - int /* request_id */) - - IPC_MESSAGE_CONTROL1(ViewHostMsg_RevealFolderInOS, - FilePath /* path */) - - // Sent when the renderer has processed a DataDownloaded message. - IPC_MESSAGE_ROUTED1(ViewHostMsg_DataDownloaded_ACK, - int /* request_id */) - - // Sent when the renderer process deletes a resource loader. - IPC_MESSAGE_CONTROL1(ViewHostMsg_ReleaseDownloadedFile, - int /* request_id */) - - // Sent when a provisional load on the main frame redirects. - IPC_MESSAGE_ROUTED3(ViewHostMsg_DidRedirectProvisionalLoad, - int /* page_id */, - GURL /* last url */, - GURL /* url redirected to */) - - // Sent by the renderer process to acknowledge receipt of a - // UploadProgress message. - IPC_MESSAGE_ROUTED1(ViewHostMsg_UploadProgress_ACK, - int /* request_id */) - - // Sent when the renderer changes the zoom level for a particular url, so the - // browser can update its records. If remember is true, then url is used to - // update the zoom level for all pages in that site. Otherwise, the render - // view's id is used so that only the menu is updated. - IPC_MESSAGE_ROUTED3(ViewHostMsg_DidZoomURL, - double /* zoom_level */, - bool /* remember */, - GURL /* url */) +// Sends back stats about the V8 heap. +IPC_MESSAGE_CONTROL2(ViewHostMsg_V8HeapStats, + int /* size of heap (allocated from the OS) */, + int /* bytes in use */) + +// Request for a DNS prefetch of the names in the array. +// NameList is typedef'ed std::vector<std::string> +IPC_MESSAGE_CONTROL1(ViewHostMsg_DnsPrefetch, + std::vector<std::string> /* hostnames */) + +// Notifies when default plugin updates status of the missing plugin. +IPC_MESSAGE_ROUTED1(ViewHostMsg_MissingPluginStatus, + int /* status */) + +// Sent by the renderer process to indicate that a plugin instance has +// crashed. +IPC_MESSAGE_ROUTED1(ViewHostMsg_CrashedPlugin, + FilePath /* plugin_path */) + +// Notifies when a plugin couldn't be loaded because it's outdated. +IPC_MESSAGE_ROUTED2(ViewHostMsg_DisabledOutdatedPlugin, + string16, /* name */ + GURL /* update_url */) + +// Displays a JavaScript out-of-memory message in the infobar. +IPC_MESSAGE_ROUTED0(ViewHostMsg_JSOutOfMemory) + +// Displays a box to confirm that the user wants to navigate away from the +// page. Replies true if yes, false otherwise, the reply string is ignored, +// but is included so that we can use OnJavaScriptMessageBoxClosed. +IPC_SYNC_MESSAGE_ROUTED2_2(ViewHostMsg_RunBeforeUnloadConfirm, + GURL, /* in - originating frame URL */ + std::wstring /* in - alert message */, + bool /* out - success */, + std::wstring /* out - This is ignored.*/) + +IPC_MESSAGE_ROUTED3(ViewHostMsg_SendCurrentPageAllSavableResourceLinks, + std::vector<GURL> /* all savable resource links */, + std::vector<GURL> /* all referrers of resource links */, + std::vector<GURL> /* all frame links */) + +IPC_MESSAGE_ROUTED3(ViewHostMsg_SendSerializedHtmlData, + GURL /* frame's url */, + std::string /* data buffer */, + int32 /* complete status */) + +IPC_SYNC_MESSAGE_ROUTED4_1(ViewHostMsg_ShowModalHTMLDialog, + GURL /* url */, + int /* width */, + int /* height */, + std::string /* json_arguments */, + std::string /* json_retval */) + +IPC_MESSAGE_ROUTED2(ViewHostMsg_DidGetApplicationInfo, + int32 /* page_id */, + WebApplicationInfo) + +// Sent by the renderer to implement chrome.app.installApplication(). +IPC_MESSAGE_ROUTED1(ViewHostMsg_InstallApplication, + WebApplicationInfo) + +// Provides the result from running OnMsgShouldClose. |proceed| matches the +// return value of the the frame's shouldClose method (which includes the +// onbeforeunload handler): true if the user decided to proceed with leaving +// the page. +IPC_MESSAGE_ROUTED1(ViewHostMsg_ShouldClose_ACK, + bool /* proceed */) + +// Indicates that the current page has been closed, after a ClosePage +// message. The parameters are just echoed from the ClosePage request. +IPC_MESSAGE_ROUTED1(ViewHostMsg_ClosePage_ACK, + ViewMsg_ClosePage_Params) + +IPC_MESSAGE_ROUTED4(ViewHostMsg_DidDownloadFavIcon, + int /* Identifier of the request */, + GURL /* URL of the image */, + bool /* true if there was a network error */, + SkBitmap /* image_data */) + +// Sent to query MIME information. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetMimeTypeFromExtension, + FilePath::StringType /* extension */, + std::string /* mime_type */) +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetMimeTypeFromFile, + FilePath /* file_path */, + std::string /* mime_type */) +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetPreferredExtensionForMimeType, + std::string /* mime_type */, + FilePath::StringType /* extension */) + +// Get the CPBrowsingContext associated with the renderer sending this +// message. +IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GetCPBrowsingContext, + uint32 /* context */) + +// Sent when the renderer process is done processing a DataReceived +// message. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DataReceived_ACK, + int /* request_id */) + +IPC_MESSAGE_CONTROL1(ViewHostMsg_RevealFolderInOS, + FilePath /* path */) + +// Sent when the renderer has processed a DataDownloaded message. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DataDownloaded_ACK, + int /* request_id */) + +// Sent when the renderer process deletes a resource loader. +IPC_MESSAGE_CONTROL1(ViewHostMsg_ReleaseDownloadedFile, + int /* request_id */) + +// Sent when a provisional load on the main frame redirects. +IPC_MESSAGE_ROUTED3(ViewHostMsg_DidRedirectProvisionalLoad, + int /* page_id */, + GURL /* last url */, + GURL /* url redirected to */) + +// Sent by the renderer process to acknowledge receipt of a +// UploadProgress message. +IPC_MESSAGE_ROUTED1(ViewHostMsg_UploadProgress_ACK, + int /* request_id */) + +// Sent when the renderer changes the zoom level for a particular url, so the +// browser can update its records. If remember is true, then url is used to +// update the zoom level for all pages in that site. Otherwise, the render +// view's id is used so that only the menu is updated. +IPC_MESSAGE_ROUTED3(ViewHostMsg_DidZoomURL, + double /* zoom_level */, + bool /* remember */, + GURL /* url */) #if defined(OS_WIN) - // Duplicates a shared memory handle from the renderer to the browser. Then - // the renderer can flush the handle. - IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_DuplicateSection, - base::SharedMemoryHandle /* renderer handle */, - base::SharedMemoryHandle /* browser handle */) +// Duplicates a shared memory handle from the renderer to the browser. Then +// the renderer can flush the handle. +IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_DuplicateSection, + base::SharedMemoryHandle /* renderer handle */, + base::SharedMemoryHandle /* browser handle */) #endif #if defined(USE_X11) - // Asks the browser to create a temporary file for the renderer to fill - // in resulting NativeMetafile in printing. - IPC_SYNC_MESSAGE_CONTROL0_2(ViewHostMsg_AllocateTempFileForPrinting, - base::FileDescriptor /* temp file fd */, - int /* fd in browser*/) - IPC_MESSAGE_CONTROL1(ViewHostMsg_TempFileForPrintingWritten, - int /* fd in browser */) +// Asks the browser to create a temporary file for the renderer to fill +// in resulting NativeMetafile in printing. +IPC_SYNC_MESSAGE_CONTROL0_2(ViewHostMsg_AllocateTempFileForPrinting, + base::FileDescriptor /* temp file fd */, + int /* fd in browser*/) +IPC_MESSAGE_CONTROL1(ViewHostMsg_TempFileForPrintingWritten, + int /* fd in browser */) #endif #if defined(OS_MACOSX) - // Asks the browser to create a block of shared memory for the renderer to - // pass NativeMetafile data to the browser. - IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_AllocatePDFTransport, - uint32 /* buffer size */, - base::SharedMemoryHandle /* browser handle */) +// Asks the browser to create a block of shared memory for the renderer to +// pass NativeMetafile data to the browser. +IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_AllocatePDFTransport, + uint32 /* buffer size */, + base::SharedMemoryHandle /* browser handle */) #endif #if defined(OS_POSIX) - // Asks the browser to create a block of shared memory for the renderer to - // fill in and pass back to the browser. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_AllocateSharedMemoryBuffer, - uint32 /* buffer size */, - base::SharedMemoryHandle /* browser handle */) +// Asks the browser to create a block of shared memory for the renderer to +// fill in and pass back to the browser. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_AllocateSharedMemoryBuffer, + uint32 /* buffer size */, + base::SharedMemoryHandle /* browser handle */) #endif - // Provide the browser process with information about the WebCore resource - // cache. - IPC_MESSAGE_CONTROL1(ViewHostMsg_ResourceTypeStats, - WebKit::WebCache::ResourceTypeStats) - - // Notify the browser that this render process can or can't be suddenly - // terminated. - IPC_MESSAGE_CONTROL1(ViewHostMsg_SuddenTerminationChanged, - bool /* enabled */) - - // Returns the window location of the window this widget is embeded. - // TODO(shess): Provide a mapping from reply_msg->routing_id() to - // HWND so that we can eliminate the NativeViewId parameter. - IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetRootWindowRect, - gfx::NativeViewId /* window */, - gfx::Rect /* Out: Window location */) - - // Informs the browser of a new appcache host. - IPC_MESSAGE_CONTROL1(AppCacheMsg_RegisterHost, - int /* host_id */) - - // Informs the browser of an appcache host being destroyed. - IPC_MESSAGE_CONTROL1(AppCacheMsg_UnregisterHost, - int /* host_id */) - - // Initiates the cache selection algorithm for the given host. - // This is sent prior to any subresource loads. An AppCacheMsg_CacheSelected - // message will be sent in response. - // 'host_id' indentifies a specific document or worker - // 'document_url' the url of the main resource - // 'appcache_document_was_loaded_from' the id of the appcache the main - // resource was loaded from or kNoCacheId - // 'opt_manifest_url' the manifest url specified in the <html> tag if any - IPC_MESSAGE_CONTROL4(AppCacheMsg_SelectCache, - int /* host_id */, - GURL /* document_url */, - int64 /* appcache_document_was_loaded_from */, - GURL /* opt_manifest_url */) - - // Initiates worker specific cache selection algorithm for the given host. - IPC_MESSAGE_CONTROL3(AppCacheMsg_SelectCacheForWorker, - int /* host_id */, - int /* parent_process_id */, - int /* parent_host_id */) - IPC_MESSAGE_CONTROL2(AppCacheMsg_SelectCacheForSharedWorker, - int /* host_id */, - int64 /* appcache_id */) - - // Informs the browser of a 'foreign' entry in an appcache. - IPC_MESSAGE_CONTROL3(AppCacheMsg_MarkAsForeignEntry, - int /* host_id */, - GURL /* document_url */, - int64 /* appcache_document_was_loaded_from */) - - // Returns the status of the appcache associated with host_id. - IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_GetStatus, - int /* host_id */, - appcache::Status) - - // Initiates an update of the appcache associated with host_id. - IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_StartUpdate, - int /* host_id */, - bool /* success */) - - // Swaps a new pending appcache, if there is one, into use for host_id. - IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_SwapCache, - int /* host_id */, - bool /* success */) - - // Gets resource list from appcache synchronously. - IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_GetResourceList, - int /* host_id in*/, - std::vector<appcache::AppCacheResourceInfo> - /* resources out */) - - // Queries the browser for AutoFill suggestions for a form input field. - IPC_MESSAGE_ROUTED3(ViewHostMsg_QueryFormFieldAutoFill, - int /* id of this message */, - webkit_glue::FormData /* the form */, - webkit_glue::FormField /* the form field */) - - // Sent when the popup with AutoFill suggestions for a form is shown. - IPC_MESSAGE_ROUTED0(ViewHostMsg_DidShowAutoFillSuggestions) - - // Instructs the browser to fill in the values for a form using AutoFill - // profile data. - IPC_MESSAGE_ROUTED4(ViewHostMsg_FillAutoFillFormData, - int /* id of this message */, - webkit_glue::FormData /* the form */, - webkit_glue::FormField /* the form field */, - int /* profile unique ID */) - - // Sent when a form is previewed or filled with AutoFill suggestions. - IPC_MESSAGE_ROUTED0(ViewHostMsg_DidFillAutoFillFormData) - - // Instructs the browser to remove the specified Autocomplete entry from the - // database. - IPC_MESSAGE_ROUTED2(ViewHostMsg_RemoveAutocompleteEntry, - string16 /* field name */, - string16 /* value */) - - // Instructs the browser to show the AutoFill dialog. - IPC_MESSAGE_ROUTED0(ViewHostMsg_ShowAutoFillDialog) - - // Get the list of proxies to use for |url|, as a semicolon delimited list - // of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also - // PluginProcessHostMsg_ResolveProxy which does the same thing. - IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ResolveProxy, - GURL /* url */, - int /* network error */, - std::string /* proxy list */) - - // Request that got sent to browser for creating an audio output stream - IPC_MESSAGE_ROUTED3(ViewHostMsg_CreateAudioStream, - int /* stream_id */, - ViewHostMsg_Audio_CreateStream_Params, - bool /* low-latency */) - - // Tell the browser the audio buffer prepared for stream - // (render_view_id, stream_id) is filled and is ready to be consumed. - IPC_MESSAGE_ROUTED2(ViewHostMsg_NotifyAudioPacketReady, - int /* stream_id */, - uint32 /* packet size */) - - // Start buffering and play the audio stream specified by - // (render_view_id, stream_id). - IPC_MESSAGE_ROUTED1(ViewHostMsg_PlayAudioStream, - int /* stream_id */) - - // Pause the audio stream specified by (render_view_id, stream_id). - IPC_MESSAGE_ROUTED1(ViewHostMsg_PauseAudioStream, - int /* stream_id */) - - // Discard all buffered audio data for the specified audio stream. - IPC_MESSAGE_ROUTED1(ViewHostMsg_FlushAudioStream, - int /* stream_id */) - - // Close an audio stream specified by (render_view_id, stream_id). - IPC_MESSAGE_ROUTED1(ViewHostMsg_CloseAudioStream, - int /* stream_id */) - - // Get audio volume of the stream specified by (render_view_id, stream_id). - IPC_MESSAGE_ROUTED1(ViewHostMsg_GetAudioVolume, - int /* stream_id */) - - // Set audio volume of the stream specified by (render_view_id, stream_id). - // TODO(hclam): change this to vector if we have channel numbers other than 2. - IPC_MESSAGE_ROUTED2(ViewHostMsg_SetAudioVolume, - int /* stream_id */, - double /* volume */) - - // A renderer sends this message when an extension process starts an API - // request. The browser will always respond with a ViewMsg_ExtensionResponse. - IPC_MESSAGE_ROUTED1(ViewHostMsg_ExtensionRequest, - ViewHostMsg_DomMessage_Params) - - // Notify the browser that the given extension added a listener to an event. - IPC_MESSAGE_CONTROL2(ViewHostMsg_ExtensionAddListener, - std::string /* extension_id */, - std::string /* name */) - - // Notify the browser that the given extension removed a listener from an - // event. - IPC_MESSAGE_CONTROL2(ViewHostMsg_ExtensionRemoveListener, - std::string /* extension_id */, - std::string /* name */) +// Provide the browser process with information about the WebCore resource +// cache. +IPC_MESSAGE_CONTROL1(ViewHostMsg_ResourceTypeStats, + WebKit::WebCache::ResourceTypeStats) + +// Notify the browser that this render process can or can't be suddenly +// terminated. +IPC_MESSAGE_CONTROL1(ViewHostMsg_SuddenTerminationChanged, + bool /* enabled */) + +// Returns the window location of the window this widget is embeded. +// TODO(shess): Provide a mapping from reply_msg->routing_id() to +// HWND so that we can eliminate the NativeViewId parameter. +IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetRootWindowRect, + gfx::NativeViewId /* window */, + gfx::Rect /* Out: Window location */) + +// Informs the browser of a new appcache host. +IPC_MESSAGE_CONTROL1(AppCacheMsg_RegisterHost, + int /* host_id */) + +// Informs the browser of an appcache host being destroyed. +IPC_MESSAGE_CONTROL1(AppCacheMsg_UnregisterHost, + int /* host_id */) + +// Initiates the cache selection algorithm for the given host. +// This is sent prior to any subresource loads. An AppCacheMsg_CacheSelected +// message will be sent in response. +// 'host_id' indentifies a specific document or worker +// 'document_url' the url of the main resource +// 'appcache_document_was_loaded_from' the id of the appcache the main +// resource was loaded from or kNoCacheId +// 'opt_manifest_url' the manifest url specified in the <html> tag if any +IPC_MESSAGE_CONTROL4(AppCacheMsg_SelectCache, + int /* host_id */, + GURL /* document_url */, + int64 /* appcache_document_was_loaded_from */, + GURL /* opt_manifest_url */) + +// Initiates worker specific cache selection algorithm for the given host. +IPC_MESSAGE_CONTROL3(AppCacheMsg_SelectCacheForWorker, + int /* host_id */, + int /* parent_process_id */, + int /* parent_host_id */) +IPC_MESSAGE_CONTROL2(AppCacheMsg_SelectCacheForSharedWorker, + int /* host_id */, + int64 /* appcache_id */) + +// Informs the browser of a 'foreign' entry in an appcache. +IPC_MESSAGE_CONTROL3(AppCacheMsg_MarkAsForeignEntry, + int /* host_id */, + GURL /* document_url */, + int64 /* appcache_document_was_loaded_from */) + +// Returns the status of the appcache associated with host_id. +IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_GetStatus, + int /* host_id */, + appcache::Status) + +// Initiates an update of the appcache associated with host_id. +IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_StartUpdate, + int /* host_id */, + bool /* success */) + +// Swaps a new pending appcache, if there is one, into use for host_id. +IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_SwapCache, + int /* host_id */, + bool /* success */) + +// Gets resource list from appcache synchronously. +IPC_SYNC_MESSAGE_CONTROL1_1(AppCacheMsg_GetResourceList, + int /* host_id in*/, + std::vector<appcache::AppCacheResourceInfo> + /* resources out */) + +// Queries the browser for AutoFill suggestions for a form input field. +IPC_MESSAGE_ROUTED3(ViewHostMsg_QueryFormFieldAutoFill, + int /* id of this message */, + webkit_glue::FormData /* the form */, + webkit_glue::FormField /* the form field */) + +// Sent when the popup with AutoFill suggestions for a form is shown. +IPC_MESSAGE_ROUTED0(ViewHostMsg_DidShowAutoFillSuggestions) + +// Instructs the browser to fill in the values for a form using AutoFill +// profile data. +IPC_MESSAGE_ROUTED4(ViewHostMsg_FillAutoFillFormData, + int /* id of this message */, + webkit_glue::FormData /* the form */, + webkit_glue::FormField /* the form field */, + int /* profile unique ID */) + +// Sent when a form is previewed or filled with AutoFill suggestions. +IPC_MESSAGE_ROUTED0(ViewHostMsg_DidFillAutoFillFormData) + +// Instructs the browser to remove the specified Autocomplete entry from the +// database. +IPC_MESSAGE_ROUTED2(ViewHostMsg_RemoveAutocompleteEntry, + string16 /* field name */, + string16 /* value */) + +// Instructs the browser to show the AutoFill dialog. +IPC_MESSAGE_ROUTED0(ViewHostMsg_ShowAutoFillDialog) + +// Get the list of proxies to use for |url|, as a semicolon delimited list +// of "<TYPE> <HOST>:<PORT>" | "DIRECT". See also +// PluginProcessHostMsg_ResolveProxy which does the same thing. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_ResolveProxy, + GURL /* url */, + int /* network error */, + std::string /* proxy list */) + +// Request that got sent to browser for creating an audio output stream +IPC_MESSAGE_ROUTED3(ViewHostMsg_CreateAudioStream, + int /* stream_id */, + ViewHostMsg_Audio_CreateStream_Params, + bool /* low-latency */) + +// Tell the browser the audio buffer prepared for stream +// (render_view_id, stream_id) is filled and is ready to be consumed. +IPC_MESSAGE_ROUTED2(ViewHostMsg_NotifyAudioPacketReady, + int /* stream_id */, + uint32 /* packet size */) + +// Start buffering and play the audio stream specified by +// (render_view_id, stream_id). +IPC_MESSAGE_ROUTED1(ViewHostMsg_PlayAudioStream, + int /* stream_id */) + +// Pause the audio stream specified by (render_view_id, stream_id). +IPC_MESSAGE_ROUTED1(ViewHostMsg_PauseAudioStream, + int /* stream_id */) + +// Discard all buffered audio data for the specified audio stream. +IPC_MESSAGE_ROUTED1(ViewHostMsg_FlushAudioStream, + int /* stream_id */) + +// Close an audio stream specified by (render_view_id, stream_id). +IPC_MESSAGE_ROUTED1(ViewHostMsg_CloseAudioStream, + int /* stream_id */) + +// Get audio volume of the stream specified by (render_view_id, stream_id). +IPC_MESSAGE_ROUTED1(ViewHostMsg_GetAudioVolume, + int /* stream_id */) + +// Set audio volume of the stream specified by (render_view_id, stream_id). +// TODO(hclam): change this to vector if we have channel numbers other than 2. +IPC_MESSAGE_ROUTED2(ViewHostMsg_SetAudioVolume, + int /* stream_id */, + double /* volume */) + +// A renderer sends this message when an extension process starts an API +// request. The browser will always respond with a ViewMsg_ExtensionResponse. +IPC_MESSAGE_ROUTED1(ViewHostMsg_ExtensionRequest, + ViewHostMsg_DomMessage_Params) + +// Notify the browser that the given extension added a listener to an event. +IPC_MESSAGE_CONTROL2(ViewHostMsg_ExtensionAddListener, + std::string /* extension_id */, + std::string /* name */) + +// Notify the browser that the given extension removed a listener from an +// event. +IPC_MESSAGE_CONTROL2(ViewHostMsg_ExtensionRemoveListener, + std::string /* extension_id */, + std::string /* name */) #if defined(OS_MACOSX) - // On OSX, we cannot allocated shared memory from within the sandbox, so - // this call exists for the renderer to ask the browser to allocate memory - // on its behalf. We return a file descriptor to the POSIX shared memory. - // If the |cache_in_browser| flag is |true|, then a copy of the shmem is kept - // by the browser, and it is the caller's repsonsibility to send a - // ViewHostMsg_FreeTransportDIB message in order to release the cached shmem. - // In all cases, the caller is responsible for deleting the resulting - // TransportDIB. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_AllocTransportDIB, - size_t, /* bytes requested */ - bool, /* cache in the browser */ - TransportDIB::Handle /* DIB */) - - // Since the browser keeps handles to the allocated transport DIBs, this - // message is sent to tell the browser that it may release them when the - // renderer is finished with them. - IPC_MESSAGE_CONTROL1(ViewHostMsg_FreeTransportDIB, - TransportDIB::Id /* DIB id */) - - // Instructs the browser to start or stop plugin IME. - IPC_MESSAGE_ROUTED2(ViewHostMsg_SetPluginImeEnabled, - bool, /* enabled */ - int /* plugin_id */) - - //--------------------------------------------------------------------------- - // Messages related to accelerated plugins - - // This is sent from the renderer to the browser to allocate a fake - // PluginWindowHandle on the browser side which is used to identify - // the plugin to the browser later when backing store is allocated - // or reallocated. |opaque| indicates whether the plugin's output is - // considered to be opaque, as opposed to translucent. This message - // is reused for rendering the accelerated compositor's output. - // |root| indicates whether the output is supposed to cover the - // entire window. - IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_AllocateFakePluginWindowHandle, - bool /* opaque */, - bool /* root */, - gfx::PluginWindowHandle /* id */) - - // Destroys a fake window handle previously allocated using - // AllocateFakePluginWindowHandle. - IPC_MESSAGE_ROUTED1(ViewHostMsg_DestroyFakePluginWindowHandle, - gfx::PluginWindowHandle /* id */) - - // This message, used on Mac OS X 10.5 and earlier (no IOSurface support), - // is sent from the renderer to the browser on behalf of the plug-in - // to indicate that a new backing store was allocated for that plug-in - // instance. - IPC_MESSAGE_ROUTED4(ViewHostMsg_AcceleratedSurfaceSetTransportDIB, - gfx::PluginWindowHandle /* window */, - int32 /* width */, - int32 /* height */, - TransportDIB::Handle /* handle for the DIB */) - - // This message, used on Mac OS X 10.6 and later (where IOSurface is - // supported), is sent from the renderer to the browser on behalf of the - // plug-in to indicate that a new backing store was allocated for that - // plug-in instance. - // - // NOTE: the original intent was to pass a mach port as the IOSurface - // identifier but it looks like that will be a lot of work. For now we pass an - // ID from IOSurfaceGetID. - IPC_MESSAGE_ROUTED4(ViewHostMsg_AcceleratedSurfaceSetIOSurface, - gfx::PluginWindowHandle /* window */, - int32 /* width */, - int32 /* height */, - uint64 /* surface_id */) - - // This message notifies the browser process that the plug-in - // swapped the buffers associated with the given "window", which - // should cause the browser to redraw the various plug-ins' - // contents. - IPC_MESSAGE_ROUTED2(ViewHostMsg_AcceleratedSurfaceBuffersSwapped, - gfx::PluginWindowHandle /* window */, - uint64 /* surface_id */) +// On OSX, we cannot allocated shared memory from within the sandbox, so +// this call exists for the renderer to ask the browser to allocate memory +// on its behalf. We return a file descriptor to the POSIX shared memory. +// If the |cache_in_browser| flag is |true|, then a copy of the shmem is kept +// by the browser, and it is the caller's repsonsibility to send a +// ViewHostMsg_FreeTransportDIB message in order to release the cached shmem. +// In all cases, the caller is responsible for deleting the resulting +// TransportDIB. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_AllocTransportDIB, + size_t, /* bytes requested */ + bool, /* cache in the browser */ + TransportDIB::Handle /* DIB */) + +// Since the browser keeps handles to the allocated transport DIBs, this +// message is sent to tell the browser that it may release them when the +// renderer is finished with them. +IPC_MESSAGE_CONTROL1(ViewHostMsg_FreeTransportDIB, + TransportDIB::Id /* DIB id */) + +// Instructs the browser to start or stop plugin IME. +IPC_MESSAGE_ROUTED2(ViewHostMsg_SetPluginImeEnabled, + bool, /* enabled */ + int /* plugin_id */) + +//--------------------------------------------------------------------------- +// Messages related to accelerated plugins + +// This is sent from the renderer to the browser to allocate a fake +// PluginWindowHandle on the browser side which is used to identify +// the plugin to the browser later when backing store is allocated +// or reallocated. |opaque| indicates whether the plugin's output is +// considered to be opaque, as opposed to translucent. This message +// is reused for rendering the accelerated compositor's output. +// |root| indicates whether the output is supposed to cover the +// entire window. +IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_AllocateFakePluginWindowHandle, + bool /* opaque */, + bool /* root */, + gfx::PluginWindowHandle /* id */) + +// Destroys a fake window handle previously allocated using +// AllocateFakePluginWindowHandle. +IPC_MESSAGE_ROUTED1(ViewHostMsg_DestroyFakePluginWindowHandle, + gfx::PluginWindowHandle /* id */) + +// This message, used on Mac OS X 10.5 and earlier (no IOSurface support), +// is sent from the renderer to the browser on behalf of the plug-in +// to indicate that a new backing store was allocated for that plug-in +// instance. +IPC_MESSAGE_ROUTED4(ViewHostMsg_AcceleratedSurfaceSetTransportDIB, + gfx::PluginWindowHandle /* window */, + int32 /* width */, + int32 /* height */, + TransportDIB::Handle /* handle for the DIB */) + +// This message, used on Mac OS X 10.6 and later (where IOSurface is +// supported), is sent from the renderer to the browser on behalf of the +// plug-in to indicate that a new backing store was allocated for that +// plug-in instance. +// +// NOTE: the original intent was to pass a mach port as the IOSurface +// identifier but it looks like that will be a lot of work. For now we pass an +// ID from IOSurfaceGetID. +IPC_MESSAGE_ROUTED4(ViewHostMsg_AcceleratedSurfaceSetIOSurface, + gfx::PluginWindowHandle /* window */, + int32 /* width */, + int32 /* height */, + uint64 /* surface_id */) + +// This message notifies the browser process that the plug-in +// swapped the buffers associated with the given "window", which +// should cause the browser to redraw the various plug-ins' +// contents. +IPC_MESSAGE_ROUTED2(ViewHostMsg_AcceleratedSurfaceBuffersSwapped, + gfx::PluginWindowHandle /* window */, + uint64 /* surface_id */) #endif - // A renderer sends this to the browser process when it wants to create a - // worker. The browser will create the worker process if necessary, and - // will return the route id on success. On error returns MSG_ROUTING_NONE. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_CreateWorker, - ViewHostMsg_CreateWorker_Params, - int /* route_id */) - - // This message is sent to the browser to see if an instance of this shared - // worker already exists. If so, it returns exists == true. If a - // non-empty name is passed, also validates that the url matches the url of - // the existing worker. If a matching worker is found, the passed-in - // document_id is associated with that worker, to ensure that the worker - // stays alive until the document is detached. - // The route_id returned can be used to forward messages to the worker via - // ForwardToWorker if it exists, otherwise it should be passed in to any - // future call to CreateWorker to avoid creating duplicate workers. - IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_LookupSharedWorker, - ViewHostMsg_CreateWorker_Params, - bool /* exists */, - int /* route_id */, - bool /* url_mismatch */) - - // A renderer sends this to the browser process when a document has been - // detached. The browser will use this to constrain the lifecycle of worker - // processes (SharedWorkers are shut down when their last associated document - // is detached). - IPC_MESSAGE_CONTROL1(ViewHostMsg_DocumentDetached, - uint64 /* document_id */) - - // A message sent to the browser on behalf of a renderer which wants to show - // a desktop notification. - IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowDesktopNotification, - ViewHostMsg_ShowNotification_Params) - IPC_MESSAGE_ROUTED1(ViewHostMsg_CancelDesktopNotification, - int /* notification_id */ ) - IPC_MESSAGE_ROUTED2(ViewHostMsg_RequestNotificationPermission, - GURL /* origin */, - int /* callback_context */) - IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_CheckNotificationPermission, - GURL /* source page */, - int /* permission_result */) - - // Sent if the worker object has sent a ViewHostMsg_CreateDedicatedWorker - // message and not received a ViewMsg_WorkerCreated reply, but in the - // mean time it's destroyed. This tells the browser to not create the queued - // worker. - IPC_MESSAGE_CONTROL1(ViewHostMsg_CancelCreateDedicatedWorker, - int /* route_id */) - - // Wraps an IPC message that's destined to the worker on the renderer->browser - // hop. - IPC_MESSAGE_CONTROL1(ViewHostMsg_ForwardToWorker, - IPC::Message /* message */) - - // Open a channel to all listening contexts owned by the extension with - // the given ID. This always returns a valid port ID which can be used for - // sending messages. If an error occurred, the opener will be notified - // asynchronously. - IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_OpenChannelToExtension, - int /* routing_id */, - std::string /* source_extension_id */, - std::string /* target_extension_id */, - std::string /* channel_name */, - int /* port_id */) - - // Get a port handle to the given tab. The handle can be used for sending - // messages to the extension. - IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_OpenChannelToTab, - int /* routing_id */, - int /* tab_id */, - std::string /* extension_id */, - std::string /* channel_name */, - int /* port_id */) - - // Send a message to an extension process. The handle is the value returned - // by ViewHostMsg_OpenChannelTo*. - IPC_MESSAGE_ROUTED2(ViewHostMsg_ExtensionPostMessage, - int /* port_id */, - std::string /* message */) - - // Send a message to an extension process. The handle is the value returned - // by ViewHostMsg_OpenChannelTo*. - IPC_MESSAGE_CONTROL1(ViewHostMsg_ExtensionCloseChannel, - int /* port_id */) - - // Sent to notify the browser about renderer accessibility notifications. - // The browser responds with a ViewMsg_AccessibilityNotifications_ACK. - IPC_MESSAGE_ROUTED1( - ViewHostMsg_AccessibilityNotifications, - std::vector<ViewHostMsg_AccessibilityNotification_Params>) - - // Message sent from the renderer to the browser to request that the browser - // close all sockets. Used for debugging/testing. - IPC_MESSAGE_CONTROL0(ViewHostMsg_CloseCurrentConnections) - - // Message sent from the renderer to the browser to request that the browser - // enable or disable the cache. Used for debugging/testing. - IPC_MESSAGE_CONTROL1(ViewHostMsg_SetCacheMode, - bool /* enabled */) - - // Message sent from the renderer to the browser to request that the browser - // clear the cache. Used for debugging/testing. - IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_ClearCache, - int /* result */) - - // Message sent from the renderer to the browser to request that the browser - // enable or disable spdy. Used for debugging/testing/benchmarking. - IPC_MESSAGE_CONTROL1(ViewHostMsg_EnableSpdy, - bool /* enable */) - - // Message sent from the renderer to the browser to request that the browser - // cache |data| associated with |url|. - IPC_MESSAGE_CONTROL3(ViewHostMsg_DidGenerateCacheableMetadata, - GURL /* url */, - double /* expected_response_time */, - std::vector<char> /* data */) - - // Get the storage area id for a particular origin within a namespace. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DOMStorageStorageAreaId, - int64 /* namespace_id */, - string16 /* origin */, - int64 /* storage_area_id */) - - // Get the length of a storage area. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_DOMStorageLength, - int64 /* storage_area_id */, - unsigned /* length */) - - // Get a the ith key within a storage area. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DOMStorageKey, - int64 /* storage_area_id */, - unsigned /* index */, - NullableString16 /* key */) - - // Get a value based on a key from a storage area. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DOMStorageGetItem, - int64 /* storage_area_id */, - string16 /* key */, - NullableString16 /* value */) - - // Set a value that's associated with a key in a storage area. - IPC_SYNC_MESSAGE_ROUTED4_2(ViewHostMsg_DOMStorageSetItem, - int64 /* storage_area_id */, - string16 /* key */, - string16 /* value */, - GURL /* url */, - WebKit::WebStorageArea::Result /* result */, - NullableString16 /* old_value */) - - // Remove the value associated with a key in a storage area. - IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_DOMStorageRemoveItem, - int64 /* storage_area_id */, - string16 /* key */, - GURL /* url */, - NullableString16 /* old_value */) - - // Clear the storage area. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DOMStorageClear, - int64 /* storage_area_id */, - GURL /* url */, - bool /* something_cleared */) - - // WebIDBCursor::direction() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBCursorDirection, - int32, /* idb_cursor_id */ - int32 /* direction */) - - // WebIDBCursor::key() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBCursorKey, - int32, /* idb_cursor_id */ - IndexedDBKey) - - // WebIDBCursor::value() message. - IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_IDBCursorValue, - int32, /* idb_cursor_id */ - SerializedScriptValue, /* script_value */ - IndexedDBKey /* key */) - - // WebIDBCursor::update() message. - IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBCursorUpdate, - int32, /* idb_cursor_id */ - int32, /* response_id */ - SerializedScriptValue, /* value */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBCursor::continue() message. - IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBCursorContinue, - int32, /* idb_cursor_id */ - int32, /* response_id */ - IndexedDBKey, /* key */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBCursor::remove() message. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_IDBCursorDelete, - int32, /* idb_cursor_id */ - int32, /* response_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBFactory::open() message. - IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBFactoryOpen, - ViewHostMsg_IDBFactoryOpen_Params) - - // WebIDBDatabase::name() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseName, - int32, /* idb_database_id */ - string16 /* name */) - - // WebIDBDatabase::version() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseVersion, - int32, /* idb_database_id */ - string16 /* vesion */) - - // WebIDBDatabase::objectStoreNames() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseObjectStoreNames, - int32, /* idb_database_id */ - std::vector<string16> /* objectStoreNames */) - - // WebIDBDatabase::createObjectStore() message. - IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_IDBDatabaseCreateObjectStore, - ViewHostMsg_IDBDatabaseCreateObjectStore_Params, - int32, /* object_store_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBDatabase::removeObjectStore() message. - IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBDatabaseDeleteObjectStore, - int32, /* idb_database_id */ - string16, /* name */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBDatabase::setVersion() message. - IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBDatabaseSetVersion, - int32, /* idb_database_id */ - int32, /* response_id */ - string16, /* version */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBDatabase::transaction() message. - // TODO: make this message async. Have the renderer create a - // temporary ID and keep a map in the browser process of real - // IDs to temporary IDs. We can then update the transaction - // to its real ID asynchronously. - IPC_SYNC_MESSAGE_CONTROL4_2(ViewHostMsg_IDBDatabaseTransaction, - int32, /* idb_database_id */ - std::vector<string16>, /* object_stores */ - int32, /* mode */ - int32, /* timeout */ - int32, /* idb_transaction_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBDatabase::~WebIDBDatabase() message. - IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBDatabaseDestroyed, - int32 /* idb_database_id */) - - // WebIDBIndex::name() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexName, - int32, /* idb_index_id */ - string16 /* name */) - - // WebIDBIndex::storeName() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexStoreName, - int32, /* idb_index_id */ - string16 /* store_name */) - - // WebIDBIndex::keyPath() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexKeyPath, - int32, /* idb_index_id */ - NullableString16 /* key_path */) - - // WebIDBIndex::unique() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexUnique, - int32, /* idb_unique_id */ - bool /* unique */) - - // WebIDBIndex::openObjectCursor() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexOpenObjectCursor, - ViewHostMsg_IDBIndexOpenCursor_Params, - WebKit::WebExceptionCode /* ec */) - - // WebIDBIndex::openKeyCursor() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexOpenKeyCursor, - ViewHostMsg_IDBIndexOpenCursor_Params, - WebKit::WebExceptionCode /* ec */) - - // WebIDBIndex::getObject() message. - IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBIndexGetObject, - int32, /* idb_index_id */ - int32, /* response_id */ - IndexedDBKey, /* key */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBIndex::getKey() message. - IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBIndexGetKey, - int32, /* idb_index_id */ - int32, /* response_id */ - IndexedDBKey, /* key */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBIndex::~WebIDBIndex() message. - IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBIndexDestroyed, - int32 /* idb_index_id */) - - // WebIDBObjectStore::name() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreName, - int32, /* idb_object_store_id */ - string16 /* name */) - - // WebIDBObjectStore::keyPath() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreKeyPath, - int32, /* idb_object_store_id */ - NullableString16 /* keyPath */) - - // WebIDBObjectStore::indexNames() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreIndexNames, - int32, /* idb_object_store_id */ - std::vector<string16> /* index_names */) - - // WebIDBObjectStore::get() message. - IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBObjectStoreGet, - int32, /* idb_object_store_id */ - int32, /* response_id */ - IndexedDBKey, /* key */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBObjectStore::put() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStorePut, - ViewHostMsg_IDBObjectStorePut_Params, - WebKit::WebExceptionCode /* ec */) - - // WebIDBObjectStore::delete() message. - IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBObjectStoreDelete, - int32, /* idb_object_store_id */ - int32, /* response_id */ - IndexedDBKey, /* key */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBObjectStore::createIndex() message. - IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_IDBObjectStoreCreateIndex, - ViewHostMsg_IDBObjectStoreCreateIndex_Params, - int32, /* index_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBObjectStore::index() message. - IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_IDBObjectStoreIndex, - int32, /* idb_object_store_id */ - string16, /* name */ - int32, /* idb_index_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBObjectStore::deleteIndex() message. - IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBObjectStoreDeleteIndex, - int32, /* idb_object_store_id */ - string16, /* name */ - int32, /* transaction_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBObjectStore::openCursor() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreOpenCursor, - ViewHostMsg_IDBObjectStoreOpenCursor_Params, - WebKit::WebExceptionCode /* ec */) - - // WebIDBObjectStore::~WebIDBObjectStore() message. - IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBObjectStoreDestroyed, - int32 /* idb_object_store_id */) - - // WebIDBDatabase::~WebIDBCursor() message. - IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBCursorDestroyed, - int32 /* idb_cursor_id */) - - // IDBTransaction::ObjectStore message. - IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_IDBTransactionObjectStore, - int32, /* transaction_id */ - string16, /* name */ - int32, /* object_store_id */ - WebKit::WebExceptionCode /* ec */) - - // WebIDBTransaction::mode() message. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBTransactionMode, - int32, /* idb_transaction_id */ - int /* mode */) - - // WebIDBTransaction::abort() message. - IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionAbort, - int32 /* idb_transaction_id */) - - // IDBTransaction::DidCompleteTaskEvents() message. - IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionDidCompleteTaskEvents, - int32 /* idb_transaction_id */) - - // WebIDBTransaction::~WebIDBTransaction() message. - IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionDestroyed, - int32 /* idb_transaction_id */) - - // Get file size in bytes. Set result to -1 if failed to get the file size. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetFileSize, - FilePath /* path */, - int64 /* result */) - - // Get file modification time in seconds. Set result to 0 if failed to get the - // file modification time. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetFileModificationTime, - FilePath /* path */, - base::Time /* result */) - - // Open the file. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_OpenFile, - FilePath /* path */, - int /* mode */, - IPC::PlatformFileForTransit /* result */) - - // Opens a file asynchronously. The response returns a file descriptor - // and an error code from base/platform_file.h. - IPC_MESSAGE_ROUTED3(ViewHostMsg_AsyncOpenFile, - FilePath /* file path */, - int /* flags */, - int /* message_id */) - - // Sent by the renderer process to acknowledge receipt of a - // ViewMsg_CSSInsertRequest message and css has been inserted into the frame. - IPC_MESSAGE_ROUTED0(ViewHostMsg_OnCSSInserted) - - // Sent by the renderer process to check whether access to web databases is - // granted by content settings. This may block and trigger a cookie prompt. - IPC_SYNC_MESSAGE_ROUTED4_1(ViewHostMsg_AllowDatabase, - std::string /* origin_url */, - string16 /* database name */, - string16 /* database display name */, - unsigned long /* estimated size */, - bool /* result */) - - // Asks the browser process to open a DB file with the given name. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DatabaseOpenFile, - string16 /* vfs file name */, - int /* desired flags */, - IPC::PlatformFileForTransit /* file_handle */) - - // Asks the browser process to delete a DB file - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DatabaseDeleteFile, - string16 /* vfs file name */, - bool /* whether or not to sync the directory */, - int /* SQLite error code */) - - // Asks the browser process to return the attributes of a DB file - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_DatabaseGetFileAttributes, - string16 /* vfs file name */, - int32 /* the attributes for the given DB file */) - - // Asks the browser process to return the size of a DB file - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_DatabaseGetFileSize, - string16 /* vfs file name */, - int64 /* the size of the given DB file */) - - // Notifies the browser process that a new database has been opened - IPC_MESSAGE_CONTROL4(ViewHostMsg_DatabaseOpened, - string16 /* origin identifier */, - string16 /* database name */, - string16 /* database description */, - int64 /* estimated size */) - - // Notifies the browser process that a database might have been modified - IPC_MESSAGE_CONTROL2(ViewHostMsg_DatabaseModified, - string16 /* origin identifier */, - string16 /* database name */) - - // Notifies the browser process that a database is about to close - IPC_MESSAGE_CONTROL2(ViewHostMsg_DatabaseClosed, - string16 /* origin identifier */, - string16 /* database name */) - - // Notifies the browser of the language (ISO 639_1 code language, such as fr, - // en, zh...) of the current page. - IPC_MESSAGE_ROUTED1(ViewHostMsg_PageLanguageDetermined, - std::string /* the language */) - - // Notifies the browser that a page has been translated. - IPC_MESSAGE_ROUTED4(ViewHostMsg_PageTranslated, - int, /* page id */ - std::string /* the original language */, - std::string /* the translated language */, - TranslateErrors::Type /* the error type if available */) - - //--------------------------------------------------------------------------- - // Socket Stream messages: - // These are messages from the SocketStreamHandle to the browser. - - // Open new Socket Stream for the |socket_url| identified by |socket_id| - // in the renderer process. - // The browser starts connecting asynchronously. - // Once Socket Stream connection is established, the browser will send - // ViewMsg_SocketStream_Connected back. - IPC_MESSAGE_CONTROL2(ViewHostMsg_SocketStream_Connect, - GURL /* socket_url */, - int /* socket_id */) - - // Request to send data on the Socket Stream. - // SocketStreamHandle can send data at most |max_pending_send_allowed| bytes, - // which is given by ViewMsg_SocketStream_Connected at any time. - // The number of pending bytes can be tracked by size of |data| sent - // and |amount_sent| parameter of ViewMsg_SocketStream_DataSent. - // That is, the following constraints is applied: - // (accumulated total of |data|) - (accumulated total of |amount_sent|) - // <= |max_pending_send_allowed| - // If the SocketStreamHandle ever tries to exceed the - // |max_pending_send_allowed|, the connection will be closed. - IPC_MESSAGE_CONTROL2(ViewHostMsg_SocketStream_SendData, - int /* socket_id */, - std::vector<char> /* data */) - - // Request to close the Socket Stream. - // The browser will send ViewMsg_SocketStream_Closed back when the Socket - // Stream is completely closed. - IPC_MESSAGE_CONTROL1(ViewHostMsg_SocketStream_Close, - int /* socket_id */) - - //--------------------------------------------------------------------------- - // Request for cryptographic operation messages: - // These are messages from the renderer to the browser to perform a - // cryptographic operation. - - // Asks the browser process to generate a keypair for grabbing a client - // certificate from a CA (<keygen> tag), and returns the signed public - // key and challenge string. - IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_Keygen, - uint32 /* key size index */, - std::string /* challenge string */, - GURL /* URL of requestor */, - std::string /* signed public key and challenge */) - - // The renderer has tried to spell check a word, but couldn't because no - // dictionary was available to load. Request that the browser find an - // appropriate dictionary and return it. - IPC_MESSAGE_CONTROL0(ViewHostMsg_SpellChecker_RequestDictionary) - - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_SpellChecker_PlatformCheckSpelling, - string16 /* word */, - int /* document tag */, - bool /* correct */) - - IPC_SYNC_MESSAGE_CONTROL1_1( - ViewHostMsg_SpellChecker_PlatformFillSuggestionList, - string16 /* word */, - std::vector<string16> /* suggestions */) - - //--------------------------------------------------------------------------- - // Geolocation services messages - - // A GeolocationServiceBridgeImpl in the renderer process has been created. - // This is used to lazily initialize the host dispatchers and related - // Geolocation infrastructure in the browser process. - IPC_MESSAGE_CONTROL1(ViewHostMsg_Geolocation_RegisterDispatcher, - int /* render_view_id */) - - // A GeolocationServiceBridgeImpl has been destroyed. - // This is used to let the Geolocation infrastructure do its cleanup. - IPC_MESSAGE_CONTROL1(ViewHostMsg_Geolocation_UnregisterDispatcher, - int /* render_view_id */) - - // The |render_view_id| and |bridge_id| representing |host| is requesting - // permission to access geolocation position. - // This will be replied by ViewMsg_Geolocation_PermissionSet. - IPC_MESSAGE_CONTROL3(ViewHostMsg_Geolocation_RequestPermission, - int /* render_view_id */, - int /* bridge_id */, - GURL /* GURL of the frame requesting geolocation */) - - // The |render_view_id| and |bridge_id| representing |GURL| is cancelling its - // previous permission request to access geolocation position. - IPC_MESSAGE_CONTROL3(ViewHostMsg_Geolocation_CancelPermissionRequest, - int /* render_view_id */, - int /* bridge_id */, - GURL /* GURL of the frame */) - - // The |render_view_id| and |bridge_id| requests Geolocation service to start - // updating. - // This is an asynchronous call, and the browser process may eventually reply - // with the updated geoposition, or an error (access denied, location - // unavailable, etc.) - IPC_MESSAGE_CONTROL4(ViewHostMsg_Geolocation_StartUpdating, - int /* render_view_id */, - int /* bridge_id */, - GURL /* GURL of the frame requesting geolocation */, - bool /* enable_high_accuracy */) - - // The |render_view_id| and |bridge_id| requests Geolocation service to stop - // updating. - // Note that the geolocation service may continue to fetch geolocation data - // for other origins. - IPC_MESSAGE_CONTROL2(ViewHostMsg_Geolocation_StopUpdating, - int /* render_view_id */, - int /* bridge_id */) - - // The |render_view_id| and |bridge_id| requests Geolocation service to - // suspend. - // Note that the geolocation service may continue to fetch geolocation data - // for other origins. - IPC_MESSAGE_CONTROL2(ViewHostMsg_Geolocation_Suspend, - int /* render_view_id */, - int /* bridge_id */) - - // The |render_view_id| and |bridge_id| requests Geolocation service to - // resume. - IPC_MESSAGE_CONTROL2(ViewHostMsg_Geolocation_Resume, - int /* render_view_id */, - int /* bridge_id */) - - // Updates the minimum/maximum allowed zoom percent for this tab from the - // default values. If |remember| is true, then the zoom setting is applied to - // other pages in the site and is saved, otherwise it only applies to this - // tab. - IPC_MESSAGE_ROUTED3(ViewHostMsg_UpdateZoomLimits, - int /* minimum_percent */, - int /* maximum_percent */, - bool /* remember */) - - // Requests the speech input service to start speech recognition on behalf of - // the given |render_view_id|. - IPC_MESSAGE_CONTROL5(ViewHostMsg_SpeechInput_StartRecognition, - int /* render_view_id */, - int /* request_id */, - gfx::Rect /* element_rect */, - std::string /* language */, - std::string /* grammar */) - - // Requests the speech input service to cancel speech recognition on behalf of - // the given |render_view_id|. If speech recognition is not happening nor or - // is happening on behalf of some other render view, this call does nothing. - IPC_MESSAGE_CONTROL2(ViewHostMsg_SpeechInput_CancelRecognition, - int /* render_view_id */, - int /* request id */) - - // Requests the speech input service to stop audio recording on behalf of - // the given |render_view_id|. Any audio recorded so far will be fed to the - // speech recognizer. If speech recognition is not happening nor or is - // happening on behalf of some other render view, this call does nothing. - IPC_MESSAGE_CONTROL2(ViewHostMsg_SpeechInput_StopRecording, - int /* render_view_id */, - int /* request id */) - - //--------------------------------------------------------------------------- - // Device orientation services messages: - - // A RenderView requests to start receiving device orientation updates. - IPC_MESSAGE_CONTROL1(ViewHostMsg_DeviceOrientation_StartUpdating, - int /* render_view_id */) - - // A RenderView requests to stop receiving device orientation updates. - IPC_MESSAGE_CONTROL1(ViewHostMsg_DeviceOrientation_StopUpdating, - int /* render_view_id */) - - //--------------------------------------------------------------------------- - // FileSystem API messages - // These are messages sent from the renderer to the browser process. - - // WebFrameClient::openFileSystem() message. - IPC_MESSAGE_CONTROL5(ViewHostMsg_OpenFileSystemRequest, - int /* request_id */, - GURL /* origin_url */, - fileapi::FileSystemType /* type */, - int64 /* requested_size */, - bool /* create */) - - // WebFileSystem::move() message. - IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Move, - int /* request_id */, - FilePath /* src path */, - FilePath /* dest path */) - - // WebFileSystem::copy() message. - IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Copy, - int /* request_id */, - FilePath /* src path */, - FilePath /* dest path */) - - // WebFileSystem::remove() message. - IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Remove, - int /* request_id */, - FilePath /* path */, - bool /* recursive */) - - // WebFileSystem::readMetadata() message. - IPC_MESSAGE_CONTROL2(ViewHostMsg_FileSystem_ReadMetadata, - int /* request_id */, - FilePath /* path */) - - // WebFileSystem::create() message. - IPC_MESSAGE_CONTROL5(ViewHostMsg_FileSystem_Create, - int /* request_id */, - FilePath /* path */, - bool /* exclusive */, - bool /* is_directory */, - bool /* recursive */) - - // WebFileSystem::exists() messages. - IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Exists, - int /* request_id */, - FilePath /* path */, - bool /* is_directory */) - - // WebFileSystem::readDirectory() message. - IPC_MESSAGE_CONTROL2(ViewHostMsg_FileSystem_ReadDirectory, - int /* request_id */, - FilePath /* path */) - - // WebFileWriter::write() message. - IPC_MESSAGE_CONTROL4(ViewHostMsg_FileSystem_Write, - int /* request id */, - FilePath /* file path */, - GURL /* blob URL */, - int64 /* position */) - - // WebFileWriter::truncate() message. - IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Truncate, - int /* request id */, - FilePath /* file path */, - int64 /* length */) - - // Pepper's Touch() message. - IPC_MESSAGE_CONTROL4(ViewHostMsg_FileSystem_TouchFile, - int /* request_id */, - FilePath /* path */, - base::Time /* last_access_time */, - base::Time /* last_modified_time */) - - // WebFileWriter::cancel() message. - IPC_MESSAGE_CONTROL2(ViewHostMsg_FileSystem_CancelWrite, - int /* request id */, - int /* id of request to cancel */) - - //--------------------------------------------------------------------------- - // Blob messages: - - // Registers a blob URL referring to the specified blob data. - IPC_MESSAGE_CONTROL2(ViewHostMsg_RegisterBlobUrl, - GURL /* url */, - scoped_refptr<webkit_blob::BlobData> /* blob_data */) - - // Registers a blob URL referring to the blob data identified by the specified - // source URL. - IPC_MESSAGE_CONTROL2(ViewHostMsg_RegisterBlobUrlFrom, - GURL /* url */, - GURL /* src_url */) - - // Unregister a blob URL. - IPC_MESSAGE_CONTROL1(ViewHostMsg_UnregisterBlobUrl, GURL /* url */) - - // Suggest results ----------------------------------------------------------- - - IPC_MESSAGE_ROUTED2(ViewHostMsg_SetSuggestions, - int32 /* page_id */, - std::vector<std::string> /* suggestions */) - - IPC_MESSAGE_ROUTED2(ViewHostMsg_InstantSupportDetermined, - int32 /* page_id */, - bool /* result */) - - // Client-Side Phishing Detector --------------------------------------------- - // Inform the browser that the current URL is phishing according to the - // client-side phishing detector. - IPC_MESSAGE_ROUTED3(ViewHostMsg_DetectedPhishingSite, - GURL /* phishing_url */, - double /* phishing_score */, - SkBitmap /* thumbnail */) - - // Response from ViewMsg_ScriptEvalRequest. The ID is the parameter supplied - // to ViewMsg_ScriptEvalRequest. The result has the value returned by the - // script as it's only element, one of Null, Boolean, Integer, Real, Date, or - // String. - IPC_MESSAGE_ROUTED2(ViewHostMsg_ScriptEvalResponse, - int /* id */, - ListValue /* result */) - - // Updates the content restrictions, i.e. to disable print/copy. - IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateContentRestrictions, - int /* restrictions */) - - // Trusted Pepper Filesystem messages ---------------------------------------- - - // Open the file. - IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_PepperOpenFile, - FilePath /* path */, - int /* flags */, - base::PlatformFileError /* error_code */, - IPC::PlatformFileForTransit /* result */) - - // Rename the file. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_PepperRenameFile, - FilePath /* path_from */, - FilePath /* path_to */, - base::PlatformFileError /* error_code */) - - // Delete the file. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_PepperDeleteFileOrDir, - FilePath /* path */, - bool /* recursive */, - base::PlatformFileError /* error_code */) - - // Create the directory. - IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_PepperCreateDir, - FilePath /* path */, - base::PlatformFileError /* error_code */) - - // Query the file's info. - IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_PepperQueryFile, - FilePath /* path */, - base::PlatformFileInfo, /* info */ - base::PlatformFileError /* error_code */) - - // Get the directory's contents. - IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_PepperGetDirContents, - FilePath /* path */, - PepperDirContents, /* contents */ - base::PlatformFileError /* error_code */) - -IPC_END_MESSAGES(ViewHost) +// A renderer sends this to the browser process when it wants to create a +// worker. The browser will create the worker process if necessary, and +// will return the route id on success. On error returns MSG_ROUTING_NONE. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_CreateWorker, + ViewHostMsg_CreateWorker_Params, + int /* route_id */) + +// This message is sent to the browser to see if an instance of this shared +// worker already exists. If so, it returns exists == true. If a +// non-empty name is passed, also validates that the url matches the url of +// the existing worker. If a matching worker is found, the passed-in +// document_id is associated with that worker, to ensure that the worker +// stays alive until the document is detached. +// The route_id returned can be used to forward messages to the worker via +// ForwardToWorker if it exists, otherwise it should be passed in to any +// future call to CreateWorker to avoid creating duplicate workers. +IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_LookupSharedWorker, + ViewHostMsg_CreateWorker_Params, + bool /* exists */, + int /* route_id */, + bool /* url_mismatch */) + +// A renderer sends this to the browser process when a document has been +// detached. The browser will use this to constrain the lifecycle of worker +// processes (SharedWorkers are shut down when their last associated document +// is detached). +IPC_MESSAGE_CONTROL1(ViewHostMsg_DocumentDetached, + uint64 /* document_id */) + +// A message sent to the browser on behalf of a renderer which wants to show +// a desktop notification. +IPC_MESSAGE_ROUTED1(ViewHostMsg_ShowDesktopNotification, + ViewHostMsg_ShowNotification_Params) +IPC_MESSAGE_ROUTED1(ViewHostMsg_CancelDesktopNotification, + int /* notification_id */ ) +IPC_MESSAGE_ROUTED2(ViewHostMsg_RequestNotificationPermission, + GURL /* origin */, + int /* callback_context */) +IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_CheckNotificationPermission, + GURL /* source page */, + int /* permission_result */) + +// Sent if the worker object has sent a ViewHostMsg_CreateDedicatedWorker +// message and not received a ViewMsg_WorkerCreated reply, but in the +// mean time it's destroyed. This tells the browser to not create the queued +// worker. +IPC_MESSAGE_CONTROL1(ViewHostMsg_CancelCreateDedicatedWorker, + int /* route_id */) + +// Wraps an IPC message that's destined to the worker on the renderer->browser +// hop. +IPC_MESSAGE_CONTROL1(ViewHostMsg_ForwardToWorker, + IPC::Message /* message */) + +// Open a channel to all listening contexts owned by the extension with +// the given ID. This always returns a valid port ID which can be used for +// sending messages. If an error occurred, the opener will be notified +// asynchronously. +IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_OpenChannelToExtension, + int /* routing_id */, + std::string /* source_extension_id */, + std::string /* target_extension_id */, + std::string /* channel_name */, + int /* port_id */) + +// Get a port handle to the given tab. The handle can be used for sending +// messages to the extension. +IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_OpenChannelToTab, + int /* routing_id */, + int /* tab_id */, + std::string /* extension_id */, + std::string /* channel_name */, + int /* port_id */) + +// Send a message to an extension process. The handle is the value returned +// by ViewHostMsg_OpenChannelTo*. +IPC_MESSAGE_ROUTED2(ViewHostMsg_ExtensionPostMessage, + int /* port_id */, + std::string /* message */) + +// Send a message to an extension process. The handle is the value returned +// by ViewHostMsg_OpenChannelTo*. +IPC_MESSAGE_CONTROL1(ViewHostMsg_ExtensionCloseChannel, + int /* port_id */) + +// Sent to notify the browser about renderer accessibility notifications. +// The browser responds with a ViewMsg_AccessibilityNotifications_ACK. +IPC_MESSAGE_ROUTED1( + ViewHostMsg_AccessibilityNotifications, + std::vector<ViewHostMsg_AccessibilityNotification_Params>) + +// Message sent from the renderer to the browser to request that the browser +// close all sockets. Used for debugging/testing. +IPC_MESSAGE_CONTROL0(ViewHostMsg_CloseCurrentConnections) + +// Message sent from the renderer to the browser to request that the browser +// enable or disable the cache. Used for debugging/testing. +IPC_MESSAGE_CONTROL1(ViewHostMsg_SetCacheMode, + bool /* enabled */) + +// Message sent from the renderer to the browser to request that the browser +// clear the cache. Used for debugging/testing. +IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_ClearCache, + int /* result */) + +// Message sent from the renderer to the browser to request that the browser +// enable or disable spdy. Used for debugging/testing/benchmarking. +IPC_MESSAGE_CONTROL1(ViewHostMsg_EnableSpdy, + bool /* enable */) + +// Message sent from the renderer to the browser to request that the browser +// cache |data| associated with |url|. +IPC_MESSAGE_CONTROL3(ViewHostMsg_DidGenerateCacheableMetadata, + GURL /* url */, + double /* expected_response_time */, + std::vector<char> /* data */) + +// Get the storage area id for a particular origin within a namespace. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DOMStorageStorageAreaId, + int64 /* namespace_id */, + string16 /* origin */, + int64 /* storage_area_id */) + +// Get the length of a storage area. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_DOMStorageLength, + int64 /* storage_area_id */, + unsigned /* length */) + +// Get a the ith key within a storage area. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DOMStorageKey, + int64 /* storage_area_id */, + unsigned /* index */, + NullableString16 /* key */) + +// Get a value based on a key from a storage area. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DOMStorageGetItem, + int64 /* storage_area_id */, + string16 /* key */, + NullableString16 /* value */) + +// Set a value that's associated with a key in a storage area. +IPC_SYNC_MESSAGE_ROUTED4_2(ViewHostMsg_DOMStorageSetItem, + int64 /* storage_area_id */, + string16 /* key */, + string16 /* value */, + GURL /* url */, + WebKit::WebStorageArea::Result /* result */, + NullableString16 /* old_value */) + +// Remove the value associated with a key in a storage area. +IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_DOMStorageRemoveItem, + int64 /* storage_area_id */, + string16 /* key */, + GURL /* url */, + NullableString16 /* old_value */) + +// Clear the storage area. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DOMStorageClear, + int64 /* storage_area_id */, + GURL /* url */, + bool /* something_cleared */) + +// WebIDBCursor::direction() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBCursorDirection, + int32, /* idb_cursor_id */ + int32 /* direction */) + +// WebIDBCursor::key() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBCursorKey, + int32, /* idb_cursor_id */ + IndexedDBKey) + +// WebIDBCursor::value() message. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_IDBCursorValue, + int32, /* idb_cursor_id */ + SerializedScriptValue, /* script_value */ + IndexedDBKey /* key */) + +// WebIDBCursor::update() message. +IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBCursorUpdate, + int32, /* idb_cursor_id */ + int32, /* response_id */ + SerializedScriptValue, /* value */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBCursor::continue() message. +IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBCursorContinue, + int32, /* idb_cursor_id */ + int32, /* response_id */ + IndexedDBKey, /* key */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBCursor::remove() message. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_IDBCursorDelete, + int32, /* idb_cursor_id */ + int32, /* response_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBFactory::open() message. +IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBFactoryOpen, + ViewHostMsg_IDBFactoryOpen_Params) + +// WebIDBDatabase::name() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseName, + int32, /* idb_database_id */ + string16 /* name */) + +// WebIDBDatabase::version() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseVersion, + int32, /* idb_database_id */ + string16 /* vesion */) + +// WebIDBDatabase::objectStoreNames() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBDatabaseObjectStoreNames, + int32, /* idb_database_id */ + std::vector<string16> /* objectStoreNames */) + +// WebIDBDatabase::createObjectStore() message. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_IDBDatabaseCreateObjectStore, + ViewHostMsg_IDBDatabaseCreateObjectStore_Params, + int32, /* object_store_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBDatabase::removeObjectStore() message. +IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBDatabaseDeleteObjectStore, + int32, /* idb_database_id */ + string16, /* name */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBDatabase::setVersion() message. +IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBDatabaseSetVersion, + int32, /* idb_database_id */ + int32, /* response_id */ + string16, /* version */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBDatabase::transaction() message. +// TODO: make this message async. Have the renderer create a +// temporary ID and keep a map in the browser process of real +// IDs to temporary IDs. We can then update the transaction +// to its real ID asynchronously. +IPC_SYNC_MESSAGE_CONTROL4_2(ViewHostMsg_IDBDatabaseTransaction, + int32, /* idb_database_id */ + std::vector<string16>, /* object_stores */ + int32, /* mode */ + int32, /* timeout */ + int32, /* idb_transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBDatabase::~WebIDBDatabase() message. +IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBDatabaseDestroyed, + int32 /* idb_database_id */) + +// WebIDBIndex::name() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexName, + int32, /* idb_index_id */ + string16 /* name */) + +// WebIDBIndex::storeName() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexStoreName, + int32, /* idb_index_id */ + string16 /* store_name */) + +// WebIDBIndex::keyPath() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexKeyPath, + int32, /* idb_index_id */ + NullableString16 /* key_path */) + +// WebIDBIndex::unique() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexUnique, + int32, /* idb_unique_id */ + bool /* unique */) + +// WebIDBIndex::openObjectCursor() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexOpenObjectCursor, + ViewHostMsg_IDBIndexOpenCursor_Params, + WebKit::WebExceptionCode /* ec */) + +// WebIDBIndex::openKeyCursor() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBIndexOpenKeyCursor, + ViewHostMsg_IDBIndexOpenCursor_Params, + WebKit::WebExceptionCode /* ec */) + +// WebIDBIndex::getObject() message. +IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBIndexGetObject, + int32, /* idb_index_id */ + int32, /* response_id */ + IndexedDBKey, /* key */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBIndex::getKey() message. +IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBIndexGetKey, + int32, /* idb_index_id */ + int32, /* response_id */ + IndexedDBKey, /* key */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBIndex::~WebIDBIndex() message. +IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBIndexDestroyed, + int32 /* idb_index_id */) + +// WebIDBObjectStore::name() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreName, + int32, /* idb_object_store_id */ + string16 /* name */) + +// WebIDBObjectStore::keyPath() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreKeyPath, + int32, /* idb_object_store_id */ + NullableString16 /* keyPath */) + +// WebIDBObjectStore::indexNames() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreIndexNames, + int32, /* idb_object_store_id */ + std::vector<string16> /* index_names */) + +// WebIDBObjectStore::get() message. +IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBObjectStoreGet, + int32, /* idb_object_store_id */ + int32, /* response_id */ + IndexedDBKey, /* key */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::put() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStorePut, + ViewHostMsg_IDBObjectStorePut_Params, + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::delete() message. +IPC_SYNC_MESSAGE_CONTROL4_1(ViewHostMsg_IDBObjectStoreDelete, + int32, /* idb_object_store_id */ + int32, /* response_id */ + IndexedDBKey, /* key */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::createIndex() message. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_IDBObjectStoreCreateIndex, + ViewHostMsg_IDBObjectStoreCreateIndex_Params, + int32, /* index_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::index() message. +IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_IDBObjectStoreIndex, + int32, /* idb_object_store_id */ + string16, /* name */ + int32, /* idb_index_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::deleteIndex() message. +IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_IDBObjectStoreDeleteIndex, + int32, /* idb_object_store_id */ + string16, /* name */ + int32, /* transaction_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::openCursor() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBObjectStoreOpenCursor, + ViewHostMsg_IDBObjectStoreOpenCursor_Params, + WebKit::WebExceptionCode /* ec */) + +// WebIDBObjectStore::~WebIDBObjectStore() message. +IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBObjectStoreDestroyed, + int32 /* idb_object_store_id */) + +// WebIDBDatabase::~WebIDBCursor() message. +IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBCursorDestroyed, + int32 /* idb_cursor_id */) + +// IDBTransaction::ObjectStore message. +IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_IDBTransactionObjectStore, + int32, /* transaction_id */ + string16, /* name */ + int32, /* object_store_id */ + WebKit::WebExceptionCode /* ec */) + +// WebIDBTransaction::mode() message. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_IDBTransactionMode, + int32, /* idb_transaction_id */ + int /* mode */) + +// WebIDBTransaction::abort() message. +IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionAbort, + int32 /* idb_transaction_id */) + +// IDBTransaction::DidCompleteTaskEvents() message. +IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionDidCompleteTaskEvents, + int32 /* idb_transaction_id */) + +// WebIDBTransaction::~WebIDBTransaction() message. +IPC_MESSAGE_CONTROL1(ViewHostMsg_IDBTransactionDestroyed, + int32 /* idb_transaction_id */) + +// Get file size in bytes. Set result to -1 if failed to get the file size. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetFileSize, + FilePath /* path */, + int64 /* result */) + +// Get file modification time in seconds. Set result to 0 if failed to get the +// file modification time. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_GetFileModificationTime, + FilePath /* path */, + base::Time /* result */) + +// Open the file. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_OpenFile, + FilePath /* path */, + int /* mode */, + IPC::PlatformFileForTransit /* result */) + +// Opens a file asynchronously. The response returns a file descriptor +// and an error code from base/platform_file.h. +IPC_MESSAGE_ROUTED3(ViewHostMsg_AsyncOpenFile, + FilePath /* file path */, + int /* flags */, + int /* message_id */) + +// Sent by the renderer process to acknowledge receipt of a +// ViewMsg_CSSInsertRequest message and css has been inserted into the frame. +IPC_MESSAGE_ROUTED0(ViewHostMsg_OnCSSInserted) + +// Sent by the renderer process to check whether access to web databases is +// granted by content settings. This may block and trigger a cookie prompt. +IPC_SYNC_MESSAGE_ROUTED4_1(ViewHostMsg_AllowDatabase, + std::string /* origin_url */, + string16 /* database name */, + string16 /* database display name */, + unsigned long /* estimated size */, + bool /* result */) + +// Asks the browser process to open a DB file with the given name. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DatabaseOpenFile, + string16 /* vfs file name */, + int /* desired flags */, + IPC::PlatformFileForTransit /* file_handle */) + +// Asks the browser process to delete a DB file +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_DatabaseDeleteFile, + string16 /* vfs file name */, + bool /* whether or not to sync the directory */, + int /* SQLite error code */) + +// Asks the browser process to return the attributes of a DB file +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_DatabaseGetFileAttributes, + string16 /* vfs file name */, + int32 /* the attributes for the given DB file */) + +// Asks the browser process to return the size of a DB file +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_DatabaseGetFileSize, + string16 /* vfs file name */, + int64 /* the size of the given DB file */) + +// Notifies the browser process that a new database has been opened +IPC_MESSAGE_CONTROL4(ViewHostMsg_DatabaseOpened, + string16 /* origin identifier */, + string16 /* database name */, + string16 /* database description */, + int64 /* estimated size */) + +// Notifies the browser process that a database might have been modified +IPC_MESSAGE_CONTROL2(ViewHostMsg_DatabaseModified, + string16 /* origin identifier */, + string16 /* database name */) + +// Notifies the browser process that a database is about to close +IPC_MESSAGE_CONTROL2(ViewHostMsg_DatabaseClosed, + string16 /* origin identifier */, + string16 /* database name */) + +// Notifies the browser of the language (ISO 639_1 code language, such as fr, +// en, zh...) of the current page. +IPC_MESSAGE_ROUTED1(ViewHostMsg_PageLanguageDetermined, + std::string /* the language */) + +// Notifies the browser that a page has been translated. +IPC_MESSAGE_ROUTED4(ViewHostMsg_PageTranslated, + int, /* page id */ + std::string /* the original language */, + std::string /* the translated language */, + TranslateErrors::Type /* the error type if available */) + +//--------------------------------------------------------------------------- +// Socket Stream messages: +// These are messages from the SocketStreamHandle to the browser. + +// Open new Socket Stream for the |socket_url| identified by |socket_id| +// in the renderer process. +// The browser starts connecting asynchronously. +// Once Socket Stream connection is established, the browser will send +// ViewMsg_SocketStream_Connected back. +IPC_MESSAGE_CONTROL2(ViewHostMsg_SocketStream_Connect, + GURL /* socket_url */, + int /* socket_id */) + +// Request to send data on the Socket Stream. +// SocketStreamHandle can send data at most |max_pending_send_allowed| bytes, +// which is given by ViewMsg_SocketStream_Connected at any time. +// The number of pending bytes can be tracked by size of |data| sent +// and |amount_sent| parameter of ViewMsg_SocketStream_DataSent. +// That is, the following constraints is applied: +// (accumulated total of |data|) - (accumulated total of |amount_sent|) +// <= |max_pending_send_allowed| +// If the SocketStreamHandle ever tries to exceed the +// |max_pending_send_allowed|, the connection will be closed. +IPC_MESSAGE_CONTROL2(ViewHostMsg_SocketStream_SendData, + int /* socket_id */, + std::vector<char> /* data */) + +// Request to close the Socket Stream. +// The browser will send ViewMsg_SocketStream_Closed back when the Socket +// Stream is completely closed. +IPC_MESSAGE_CONTROL1(ViewHostMsg_SocketStream_Close, + int /* socket_id */) + +//--------------------------------------------------------------------------- +// Request for cryptographic operation messages: +// These are messages from the renderer to the browser to perform a +// cryptographic operation. + +// Asks the browser process to generate a keypair for grabbing a client +// certificate from a CA (<keygen> tag), and returns the signed public +// key and challenge string. +IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_Keygen, + uint32 /* key size index */, + std::string /* challenge string */, + GURL /* URL of requestor */, + std::string /* signed public key and challenge */) + +// The renderer has tried to spell check a word, but couldn't because no +// dictionary was available to load. Request that the browser find an +// appropriate dictionary and return it. +IPC_MESSAGE_CONTROL0(ViewHostMsg_SpellChecker_RequestDictionary) + +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_SpellChecker_PlatformCheckSpelling, + string16 /* word */, + int /* document tag */, + bool /* correct */) + +IPC_SYNC_MESSAGE_CONTROL1_1( + ViewHostMsg_SpellChecker_PlatformFillSuggestionList, + string16 /* word */, + std::vector<string16> /* suggestions */) + +//--------------------------------------------------------------------------- +// Geolocation services messages + +// A GeolocationServiceBridgeImpl in the renderer process has been created. +// This is used to lazily initialize the host dispatchers and related +// Geolocation infrastructure in the browser process. +IPC_MESSAGE_CONTROL1(ViewHostMsg_Geolocation_RegisterDispatcher, + int /* render_view_id */) + +// A GeolocationServiceBridgeImpl has been destroyed. +// This is used to let the Geolocation infrastructure do its cleanup. +IPC_MESSAGE_CONTROL1(ViewHostMsg_Geolocation_UnregisterDispatcher, + int /* render_view_id */) + +// The |render_view_id| and |bridge_id| representing |host| is requesting +// permission to access geolocation position. +// This will be replied by ViewMsg_Geolocation_PermissionSet. +IPC_MESSAGE_CONTROL3(ViewHostMsg_Geolocation_RequestPermission, + int /* render_view_id */, + int /* bridge_id */, + GURL /* GURL of the frame requesting geolocation */) + +// The |render_view_id| and |bridge_id| representing |GURL| is cancelling its +// previous permission request to access geolocation position. +IPC_MESSAGE_CONTROL3(ViewHostMsg_Geolocation_CancelPermissionRequest, + int /* render_view_id */, + int /* bridge_id */, + GURL /* GURL of the frame */) + +// The |render_view_id| and |bridge_id| requests Geolocation service to start +// updating. +// This is an asynchronous call, and the browser process may eventually reply +// with the updated geoposition, or an error (access denied, location +// unavailable, etc.) +IPC_MESSAGE_CONTROL4(ViewHostMsg_Geolocation_StartUpdating, + int /* render_view_id */, + int /* bridge_id */, + GURL /* GURL of the frame requesting geolocation */, + bool /* enable_high_accuracy */) + +// The |render_view_id| and |bridge_id| requests Geolocation service to stop +// updating. +// Note that the geolocation service may continue to fetch geolocation data +// for other origins. +IPC_MESSAGE_CONTROL2(ViewHostMsg_Geolocation_StopUpdating, + int /* render_view_id */, + int /* bridge_id */) + +// The |render_view_id| and |bridge_id| requests Geolocation service to +// suspend. +// Note that the geolocation service may continue to fetch geolocation data +// for other origins. +IPC_MESSAGE_CONTROL2(ViewHostMsg_Geolocation_Suspend, + int /* render_view_id */, + int /* bridge_id */) + +// The |render_view_id| and |bridge_id| requests Geolocation service to +// resume. +IPC_MESSAGE_CONTROL2(ViewHostMsg_Geolocation_Resume, + int /* render_view_id */, + int /* bridge_id */) + +// Updates the minimum/maximum allowed zoom percent for this tab from the +// default values. If |remember| is true, then the zoom setting is applied to +// other pages in the site and is saved, otherwise it only applies to this +// tab. +IPC_MESSAGE_ROUTED3(ViewHostMsg_UpdateZoomLimits, + int /* minimum_percent */, + int /* maximum_percent */, + bool /* remember */) + +// Requests the speech input service to start speech recognition on behalf of +// the given |render_view_id|. +IPC_MESSAGE_CONTROL5(ViewHostMsg_SpeechInput_StartRecognition, + int /* render_view_id */, + int /* request_id */, + gfx::Rect /* element_rect */, + std::string /* language */, + std::string /* grammar */) + +// Requests the speech input service to cancel speech recognition on behalf of +// the given |render_view_id|. If speech recognition is not happening nor or +// is happening on behalf of some other render view, this call does nothing. +IPC_MESSAGE_CONTROL2(ViewHostMsg_SpeechInput_CancelRecognition, + int /* render_view_id */, + int /* request id */) + +// Requests the speech input service to stop audio recording on behalf of +// the given |render_view_id|. Any audio recorded so far will be fed to the +// speech recognizer. If speech recognition is not happening nor or is +// happening on behalf of some other render view, this call does nothing. +IPC_MESSAGE_CONTROL2(ViewHostMsg_SpeechInput_StopRecording, + int /* render_view_id */, + int /* request id */) + +//--------------------------------------------------------------------------- +// Device orientation services messages: + +// A RenderView requests to start receiving device orientation updates. +IPC_MESSAGE_CONTROL1(ViewHostMsg_DeviceOrientation_StartUpdating, + int /* render_view_id */) + +// A RenderView requests to stop receiving device orientation updates. +IPC_MESSAGE_CONTROL1(ViewHostMsg_DeviceOrientation_StopUpdating, + int /* render_view_id */) + +//--------------------------------------------------------------------------- +// FileSystem API messages +// These are messages sent from the renderer to the browser process. + +// WebFrameClient::openFileSystem() message. +IPC_MESSAGE_CONTROL5(ViewHostMsg_OpenFileSystemRequest, + int /* request_id */, + GURL /* origin_url */, + fileapi::FileSystemType /* type */, + int64 /* requested_size */, + bool /* create */) + +// WebFileSystem::move() message. +IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Move, + int /* request_id */, + FilePath /* src path */, + FilePath /* dest path */) + +// WebFileSystem::copy() message. +IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Copy, + int /* request_id */, + FilePath /* src path */, + FilePath /* dest path */) + +// WebFileSystem::remove() message. +IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Remove, + int /* request_id */, + FilePath /* path */, + bool /* recursive */) + +// WebFileSystem::readMetadata() message. +IPC_MESSAGE_CONTROL2(ViewHostMsg_FileSystem_ReadMetadata, + int /* request_id */, + FilePath /* path */) + +// WebFileSystem::create() message. +IPC_MESSAGE_CONTROL5(ViewHostMsg_FileSystem_Create, + int /* request_id */, + FilePath /* path */, + bool /* exclusive */, + bool /* is_directory */, + bool /* recursive */) + +// WebFileSystem::exists() messages. +IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Exists, + int /* request_id */, + FilePath /* path */, + bool /* is_directory */) + +// WebFileSystem::readDirectory() message. +IPC_MESSAGE_CONTROL2(ViewHostMsg_FileSystem_ReadDirectory, + int /* request_id */, + FilePath /* path */) + +// WebFileWriter::write() message. +IPC_MESSAGE_CONTROL4(ViewHostMsg_FileSystem_Write, + int /* request id */, + FilePath /* file path */, + GURL /* blob URL */, + int64 /* position */) + +// WebFileWriter::truncate() message. +IPC_MESSAGE_CONTROL3(ViewHostMsg_FileSystem_Truncate, + int /* request id */, + FilePath /* file path */, + int64 /* length */) + +// Pepper's Touch() message. +IPC_MESSAGE_CONTROL4(ViewHostMsg_FileSystem_TouchFile, + int /* request_id */, + FilePath /* path */, + base::Time /* last_access_time */, + base::Time /* last_modified_time */) + +// WebFileWriter::cancel() message. +IPC_MESSAGE_CONTROL2(ViewHostMsg_FileSystem_CancelWrite, + int /* request id */, + int /* id of request to cancel */) + +//--------------------------------------------------------------------------- +// Blob messages: + +// Registers a blob URL referring to the specified blob data. +IPC_MESSAGE_CONTROL2(ViewHostMsg_RegisterBlobUrl, + GURL /* url */, + scoped_refptr<webkit_blob::BlobData> /* blob_data */) + +// Registers a blob URL referring to the blob data identified by the specified +// source URL. +IPC_MESSAGE_CONTROL2(ViewHostMsg_RegisterBlobUrlFrom, + GURL /* url */, + GURL /* src_url */) + +// Unregister a blob URL. +IPC_MESSAGE_CONTROL1(ViewHostMsg_UnregisterBlobUrl, GURL /* url */) + +// Suggest results ----------------------------------------------------------- + +IPC_MESSAGE_ROUTED2(ViewHostMsg_SetSuggestions, + int32 /* page_id */, + std::vector<std::string> /* suggestions */) + +IPC_MESSAGE_ROUTED2(ViewHostMsg_InstantSupportDetermined, + int32 /* page_id */, + bool /* result */) + +// Client-Side Phishing Detector --------------------------------------------- +// Inform the browser that the current URL is phishing according to the +// client-side phishing detector. +IPC_MESSAGE_ROUTED3(ViewHostMsg_DetectedPhishingSite, + GURL /* phishing_url */, + double /* phishing_score */, + SkBitmap /* thumbnail */) + +// Response from ViewMsg_ScriptEvalRequest. The ID is the parameter supplied +// to ViewMsg_ScriptEvalRequest. The result has the value returned by the +// script as it's only element, one of Null, Boolean, Integer, Real, Date, or +// String. +IPC_MESSAGE_ROUTED2(ViewHostMsg_ScriptEvalResponse, + int /* id */, + ListValue /* result */) + +// Updates the content restrictions, i.e. to disable print/copy. +IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateContentRestrictions, + int /* restrictions */) + +// Trusted Pepper Filesystem messages ---------------------------------------- + +// Open the file. +IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_PepperOpenFile, + FilePath /* path */, + int /* flags */, + base::PlatformFileError /* error_code */, + IPC::PlatformFileForTransit /* result */) + +// Rename the file. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_PepperRenameFile, + FilePath /* path_from */, + FilePath /* path_to */, + base::PlatformFileError /* error_code */) + +// Delete the file. +IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_PepperDeleteFileOrDir, + FilePath /* path */, + bool /* recursive */, + base::PlatformFileError /* error_code */) + +// Create the directory. +IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_PepperCreateDir, + FilePath /* path */, + base::PlatformFileError /* error_code */) + +// Query the file's info. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_PepperQueryFile, + FilePath /* path */, + base::PlatformFileInfo, /* info */ + base::PlatformFileError /* error_code */) + +// Get the directory's contents. +IPC_SYNC_MESSAGE_CONTROL1_2(ViewHostMsg_PepperGetDirContents, + FilePath /* path */, + PepperDirContents, /* contents */ + base::PlatformFileError /* error_code */) diff --git a/chrome/common/service_messages.cc b/chrome/common/service_messages.cc index 97a10fd..98f8923 100644 --- a/chrome/common/service_messages.cc +++ b/chrome/common/service_messages.cc @@ -2,8 +2,5 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#define IPC_MESSAGE_IMPL #include "chrome/common/service_messages.h" - -#define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/common/service_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" diff --git a/chrome/common/service_messages.h b/chrome/common/service_messages.h index d514bff..1c23ead 100644 --- a/chrome/common/service_messages.h +++ b/chrome/common/service_messages.h @@ -5,10 +5,7 @@ #ifndef CHROME_COMMON_SERVICE_MESSAGES_H_ #define CHROME_COMMON_SERVICE_MESSAGES_H_ -#include "ipc/ipc_message_utils.h" - -#define MESSAGES_INTERNAL_FILE "chrome/common/service_messages_internal.h" -#include "ipc/ipc_message_macros.h" +#include "chrome/common/service_messages_internal.h" #endif // CHROME_COMMON_SERVICE_MESSAGES_H_ diff --git a/chrome/common/service_messages_internal.h b/chrome/common/service_messages_internal.h index bb6e34d..e5ae7b3 100644 --- a/chrome/common/service_messages_internal.h +++ b/chrome/common/service_messages_internal.h @@ -4,66 +4,54 @@ #include <string> -// This header is meant to be included in multiple passes, hence no traditional -// header guard. -// See ipc_message_macros.h for explanation of the macros and passes. - -// This file needs to be included again, even though we're actually included -// from it via utility_messages.h. #include "ipc/ipc_message_macros.h" +#define IPC_MESSAGE_START ServiceMsgStart + //------------------------------------------------------------------------------ // Service process messages: // These are messages from the browser to the service process. -IPC_BEGIN_MESSAGES(Service) - - // Tell the service process to enable the cloud proxy passing in the lsid - // of the account to be used. - IPC_MESSAGE_CONTROL1(ServiceMsg_EnableCloudPrintProxy, - std::string /* lsid */) - // Tell the service process to enable the cloud proxy passing in specific - // tokens to be used. - IPC_MESSAGE_CONTROL2(ServiceMsg_EnableCloudPrintProxyWithTokens, - std::string, /* token for cloudprint service */ - std::string /* token for Google Talk service */) - // Tell the service process to disable the cloud proxy. - IPC_MESSAGE_CONTROL0(ServiceMsg_DisableCloudPrintProxy) - - // Requests a message back on whether the cloud print proxy is - // enabled. - IPC_MESSAGE_CONTROL0(ServiceMsg_IsCloudPrintProxyEnabled) - - // This message is for testing purpose. - IPC_MESSAGE_CONTROL0(ServiceMsg_Hello) - - // This message is for enabling the remoting process. - IPC_MESSAGE_CONTROL3(ServiceMsg_EnableRemotingWithTokens, - std::string, /* username */ - std::string, /* Token for remoting */ - std::string /* Token for Google Talk */) - - // Tell the service process to shutdown. - IPC_MESSAGE_CONTROL0(ServiceMsg_Shutdown) - - // Tell the service process that an update is available. - IPC_MESSAGE_CONTROL0(ServiceMsg_UpdateAvailable) - -IPC_END_MESSAGES(Service) +// Tell the service process to enable the cloud proxy passing in the lsid +// of the account to be used. +IPC_MESSAGE_CONTROL1(ServiceMsg_EnableCloudPrintProxy, + std::string /* lsid */) +// Tell the service process to enable the cloud proxy passing in specific +// tokens to be used. +IPC_MESSAGE_CONTROL2(ServiceMsg_EnableCloudPrintProxyWithTokens, + std::string, /* token for cloudprint service */ + std::string /* token for Google Talk service */) +// Tell the service process to disable the cloud proxy. +IPC_MESSAGE_CONTROL0(ServiceMsg_DisableCloudPrintProxy) + +// Requests a message back on whether the cloud print proxy is +// enabled. +IPC_MESSAGE_CONTROL0(ServiceMsg_IsCloudPrintProxyEnabled) + +// This message is for testing purpose. +IPC_MESSAGE_CONTROL0(ServiceMsg_Hello) + +// This message is for enabling the remoting process. +IPC_MESSAGE_CONTROL3(ServiceMsg_EnableRemotingWithTokens, + std::string, /* username */ + std::string, /* Token for remoting */ + std::string /* Token for Google Talk */) + +// Tell the service process to shutdown. +IPC_MESSAGE_CONTROL0(ServiceMsg_Shutdown) + +// Tell the service process that an update is available. +IPC_MESSAGE_CONTROL0(ServiceMsg_UpdateAvailable) //------------------------------------------------------------------------------ // Service process host messages: // These are messages from the service process to the browser. -IPC_BEGIN_MESSAGES(ServiceHost) - - // Sent when the cloud print proxy has an authentication error. - IPC_MESSAGE_CONTROL0(ServiceHostMsg_CloudPrintProxy_AuthError) - - // Sent as a response to a request for enablement status. - IPC_MESSAGE_CONTROL2(ServiceHostMsg_CloudPrintProxy_IsEnabled, - bool, /* Is the proxy enabled? */ - std::string /* Email address of account */) +// Sent when the cloud print proxy has an authentication error. +IPC_MESSAGE_CONTROL0(ServiceHostMsg_CloudPrintProxy_AuthError) - // Sent from the service process in response to a Hello message. - IPC_MESSAGE_CONTROL0(ServiceHostMsg_GoodDay) +// Sent as a response to a request for enablement status. +IPC_MESSAGE_CONTROL2(ServiceHostMsg_CloudPrintProxy_IsEnabled, + bool, /* Is the proxy enabled? */ + std::string /* Email address of account */) -IPC_END_MESSAGES(ServiceHost) +// Sent from the service process in response to a Hello message. +IPC_MESSAGE_CONTROL0(ServiceHostMsg_GoodDay) diff --git a/chrome/common/utility_messages.cc b/chrome/common/utility_messages.cc index b0cd5cc..5742f29 100644 --- a/chrome/common/utility_messages.cc +++ b/chrome/common/utility_messages.cc @@ -2,15 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/utility_messages.h" - +#include "base/file_path.h" #include "base/values.h" #include "chrome/common/common_param_traits.h" #include "chrome/common/indexed_db_key.h" #include "chrome/common/serialized_script_value.h" -#include "base/file_path.h" -#include "third_party/skia/include/core/SkBitmap.h" -#define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/common/utility_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" +#define IPC_MESSAGE_IMPL +#include "chrome/common/utility_messages.h"
\ No newline at end of file diff --git a/chrome/common/utility_messages.h b/chrome/common/utility_messages.h index 49bc9ce..3e298d6 100644 --- a/chrome/common/utility_messages.h +++ b/chrome/common/utility_messages.h @@ -71,7 +71,6 @@ struct ParamTraits<UpdateManifest::Results> { } // namespace IPC -#define MESSAGES_INTERNAL_FILE "chrome/common/utility_messages_internal.h" -#include "ipc/ipc_message_macros.h" +#include "chrome/common/utility_messages_internal.h" #endif // CHROME_COMMON_UTILITY_MESSAGES_H_ diff --git a/chrome/common/utility_messages_internal.h b/chrome/common/utility_messages_internal.h index adb7077..62d329a 100644 --- a/chrome/common/utility_messages_internal.h +++ b/chrome/common/utility_messages_internal.h @@ -5,17 +5,13 @@ #include <string> #include <vector> -// This header is meant to be included in multiple passes, hence no traditional -// header guard. It is included by utility_messages_internal.h -// See ipc_message_macros.h for explanation of the macros and passes. - -// This file needs to be included again, even though we're actually included -// from it via utility_messages.h. -#include "ipc/ipc_message_macros.h" - #include "base/platform_file.h" #include "gfx/rect.h" +#include "ipc/ipc_message_macros.h" #include "printing/page_range.h" +#include "third_party/skia/include/core/SkBitmap.h" + +#define IPC_MESSAGE_START NaClMsgStart class FilePath; class IndexedDBKey; @@ -25,118 +21,110 @@ class SkBitmap; //------------------------------------------------------------------------------ // Utility process messages: // These are messages from the browser to the utility process. -IPC_BEGIN_MESSAGES(Utility) - - // Tell the utility process to unpack the given extension file in its - // directory and verify that it is valid. - IPC_MESSAGE_CONTROL1(UtilityMsg_UnpackExtension, - FilePath /* extension_filename */) - - // Tell the utility process to parse the given JSON data and verify its - // validity. - IPC_MESSAGE_CONTROL1(UtilityMsg_UnpackWebResource, - std::string /* JSON data */) - - // Tell the utility process to parse the given xml document. - IPC_MESSAGE_CONTROL1(UtilityMsg_ParseUpdateManifest, - std::string /* xml document contents */) - - // Tell the utility process to decode the given image data. - IPC_MESSAGE_CONTROL1(UtilityMsg_DecodeImage, - std::vector<unsigned char>) // encoded image contents - - // Tell the utility process to render the given PDF into a metafile. - IPC_MESSAGE_CONTROL5(UtilityMsg_RenderPDFPagesToMetafile, - base::PlatformFile, // PDF file - FilePath, // Location for output metafile - gfx::Rect, // Render Area - int, // DPI - std::vector<printing::PageRange>) - - // Tell the utility process to extract the given IDBKeyPath from the - // SerializedScriptValue vector and reply with the corresponding IDBKeys. - IPC_MESSAGE_CONTROL3(UtilityMsg_IDBKeysFromValuesAndKeyPath, - int, // id - std::vector<SerializedScriptValue>, - string16) // IDBKeyPath - - // Tells the utility process that it's running in batch mode. - IPC_MESSAGE_CONTROL0(UtilityMsg_BatchMode_Started) - - // Tells the utility process that it can shutdown. - IPC_MESSAGE_CONTROL0(UtilityMsg_BatchMode_Finished) - -IPC_END_MESSAGES(Utility) +// Tell the utility process to unpack the given extension file in its +// directory and verify that it is valid. +IPC_MESSAGE_CONTROL1(UtilityMsg_UnpackExtension, + FilePath /* extension_filename */) + +// Tell the utility process to parse the given JSON data and verify its +// validity. +IPC_MESSAGE_CONTROL1(UtilityMsg_UnpackWebResource, + std::string /* JSON data */) + +// Tell the utility process to parse the given xml document. +IPC_MESSAGE_CONTROL1(UtilityMsg_ParseUpdateManifest, + std::string /* xml document contents */) + +// Tell the utility process to decode the given image data. +IPC_MESSAGE_CONTROL1(UtilityMsg_DecodeImage, + std::vector<unsigned char>) // encoded image contents + +// Tell the utility process to render the given PDF into a metafile. +IPC_MESSAGE_CONTROL5(UtilityMsg_RenderPDFPagesToMetafile, + base::PlatformFile, // PDF file + FilePath, // Location for output metafile + gfx::Rect, // Render Area + int, // DPI + std::vector<printing::PageRange>) + +// Tell the utility process to extract the given IDBKeyPath from the +// SerializedScriptValue vector and reply with the corresponding IDBKeys. +IPC_MESSAGE_CONTROL3(UtilityMsg_IDBKeysFromValuesAndKeyPath, + int, // id + std::vector<SerializedScriptValue>, + string16) // IDBKeyPath + +// Tells the utility process that it's running in batch mode. +IPC_MESSAGE_CONTROL0(UtilityMsg_BatchMode_Started) + +// Tells the utility process that it can shutdown. +IPC_MESSAGE_CONTROL0(UtilityMsg_BatchMode_Finished) //------------------------------------------------------------------------------ // Utility process host messages: // These are messages from the utility process to the browser. -IPC_BEGIN_MESSAGES(UtilityHost) - - // Reply when the utility process is done unpacking an extension. |manifest| - // is the parsed manifest.json file. - // The unpacker should also have written out files containing the decoded - // images and message catalogs from the extension. See ExtensionUnpacker for - // details. - IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackExtension_Succeeded, - DictionaryValue /* manifest */) - - // Reply when the utility process has failed while unpacking an extension. - // |error_message| is a user-displayable explanation of what went wrong. - IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackExtension_Failed, - std::string /* error_message, if any */) - - // Reply when the utility process is done unpacking and parsing JSON data - // from a web resource. - IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackWebResource_Succeeded, - DictionaryValue /* json data */) - - // Reply when the utility process has failed while unpacking and parsing a - // web resource. |error_message| is a user-readable explanation of what - // went wrong. - IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackWebResource_Failed, - std::string /* error_message, if any */) - - // Reply when the utility process has succeeded in parsing an update manifest - // xml document. - IPC_MESSAGE_CONTROL1(UtilityHostMsg_ParseUpdateManifest_Succeeded, - UpdateManifest::Results /* updates */) - - // Reply when an error occured parsing the update manifest. |error_message| - // is a description of what went wrong suitable for logging. - IPC_MESSAGE_CONTROL1(UtilityHostMsg_ParseUpdateManifest_Failed, - std::string /* error_message, if any */) - - // Reply when the utility process has succeeded in decoding the image. - IPC_MESSAGE_CONTROL1(UtilityHostMsg_DecodeImage_Succeeded, - SkBitmap) // decoded image - - // Reply when an error occured decoding the image. - IPC_MESSAGE_CONTROL0(UtilityHostMsg_DecodeImage_Failed) - - // Reply when the utility process has succeeded in rendering the PDF. - IPC_MESSAGE_CONTROL1(UtilityHostMsg_RenderPDFPagesToMetafile_Succeeded, - int) // Highest rendered page number - - // Reply when an error occured rendering the PDF. - IPC_MESSAGE_CONTROL0(UtilityHostMsg_RenderPDFPagesToMetafile_Failed) +// Reply when the utility process is done unpacking an extension. |manifest| +// is the parsed manifest.json file. +// The unpacker should also have written out files containing the decoded +// images and message catalogs from the extension. See ExtensionUnpacker for +// details. +IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackExtension_Succeeded, + DictionaryValue /* manifest */) + +// Reply when the utility process has failed while unpacking an extension. +// |error_message| is a user-displayable explanation of what went wrong. +IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackExtension_Failed, + std::string /* error_message, if any */) + +// Reply when the utility process is done unpacking and parsing JSON data +// from a web resource. +IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackWebResource_Succeeded, + DictionaryValue /* json data */) + +// Reply when the utility process has failed while unpacking and parsing a +// web resource. |error_message| is a user-readable explanation of what +// went wrong. +IPC_MESSAGE_CONTROL1(UtilityHostMsg_UnpackWebResource_Failed, + std::string /* error_message, if any */) + +// Reply when the utility process has succeeded in parsing an update manifest +// xml document. +IPC_MESSAGE_CONTROL1(UtilityHostMsg_ParseUpdateManifest_Succeeded, + UpdateManifest::Results /* updates */) + +// Reply when an error occured parsing the update manifest. |error_message| +// is a description of what went wrong suitable for logging. +IPC_MESSAGE_CONTROL1(UtilityHostMsg_ParseUpdateManifest_Failed, + std::string /* error_message, if any */) + +// Reply when the utility process has succeeded in decoding the image. +IPC_MESSAGE_CONTROL1(UtilityHostMsg_DecodeImage_Succeeded, + SkBitmap) // decoded image + +// Reply when an error occured decoding the image. +IPC_MESSAGE_CONTROL0(UtilityHostMsg_DecodeImage_Failed) + +// Reply when the utility process has succeeded in rendering the PDF. +IPC_MESSAGE_CONTROL1(UtilityHostMsg_RenderPDFPagesToMetafile_Succeeded, + int) // Highest rendered page number + +// Reply when an error occured rendering the PDF. +IPC_MESSAGE_CONTROL0(UtilityHostMsg_RenderPDFPagesToMetafile_Failed) #if defined(OS_WIN) - // Request that the given font be loaded by the host so it's cached by the - // OS. Please see ChildProcessHost::PreCacheFont for details. - IPC_SYNC_MESSAGE_CONTROL1_0(UtilityHostMsg_PreCacheFont, - LOGFONT /* font data */) +// Request that the given font be loaded by the host so it's cached by the +// OS. Please see ChildProcessHost::PreCacheFont for details. +IPC_SYNC_MESSAGE_CONTROL1_0(UtilityHostMsg_PreCacheFont, + LOGFONT /* font data */) #endif // defined(OS_WIN) - // Reply when the utility process has succeeded in obtaining the value for - // IDBKeyPath. - IPC_MESSAGE_CONTROL2(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Succeeded, - int /* id */, - std::vector<IndexedDBKey> /* value */) - - // Reply when the utility process has failed in obtaining the value for - // IDBKeyPath. - IPC_MESSAGE_CONTROL1(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Failed, - int /* id */) +// Reply when the utility process has succeeded in obtaining the value for +// IDBKeyPath. +IPC_MESSAGE_CONTROL2(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Succeeded, + int /* id */, + std::vector<IndexedDBKey> /* value */) -IPC_END_MESSAGES(UtilityHost) +// Reply when the utility process has failed in obtaining the value for +// IDBKeyPath. +IPC_MESSAGE_CONTROL1(UtilityHostMsg_IDBKeysFromValuesAndKeyPath_Failed, + int /* id */) diff --git a/chrome/common/worker_messages.cc b/chrome/common/worker_messages.cc index 192e4fd..19b8d23 100644 --- a/chrome/common/worker_messages.cc +++ b/chrome/common/worker_messages.cc @@ -2,13 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/common/worker_messages.h" - #include "chrome/common/common_param_traits.h" -#define MESSAGES_INTERNAL_IMPL_FILE \ - "chrome/common/worker_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" +#define IPC_MESSAGE_IMPL +#include "chrome/common/worker_messages.h" WorkerHostMsg_PostConsoleMessageToWorkerObject_Params:: WorkerHostMsg_PostConsoleMessageToWorkerObject_Params() diff --git a/chrome/common/worker_messages.h b/chrome/common/worker_messages.h index 0e76c4f..28fec62 100644 --- a/chrome/common/worker_messages.h +++ b/chrome/common/worker_messages.h @@ -71,7 +71,6 @@ struct ParamTraits<WorkerProcessMsg_CreateWorker_Params> { } // namespace IPC -#define MESSAGES_INTERNAL_FILE "chrome/common/worker_messages_internal.h" -#include "ipc/ipc_message_macros.h" +#include "chrome/common/worker_messages_internal.h" #endif // CHROME_COMMON_WORKER_MESSAGES_H_ diff --git a/chrome/common/worker_messages_internal.h b/chrome/common/worker_messages_internal.h index 5d0cb62..d1ef439 100644 --- a/chrome/common/worker_messages_internal.h +++ b/chrome/common/worker_messages_internal.h @@ -8,128 +8,121 @@ #include "googleurl/src/gurl.h" #include "ipc/ipc_message_macros.h" +#define IPC_MESSAGE_START WorkerMsgStart //----------------------------------------------------------------------------- // WorkerProcess messages // These are messages sent from the browser to the worker process. -IPC_BEGIN_MESSAGES(WorkerProcess) - IPC_MESSAGE_CONTROL1(WorkerProcessMsg_CreateWorker, - WorkerProcessMsg_CreateWorker_Params) +IPC_MESSAGE_CONTROL1(WorkerProcessMsg_CreateWorker, + WorkerProcessMsg_CreateWorker_Params) - // Note: these Message Port related messages can also be sent to the - // renderer process. Putting them here since we don't have a shared place - // like common_messages_internal.h - IPC_MESSAGE_ROUTED3(WorkerProcessMsg_Message, - string16 /* message */, - std::vector<int> /* sent_message_port_ids */, - std::vector<int> /* new_routing_ids */) +// Note: these Message Port related messages can also be sent to the +// renderer process. Putting them here since we don't have a shared place +// like common_messages_internal.h +IPC_MESSAGE_ROUTED3(WorkerProcessMsg_Message, + string16 /* message */, + std::vector<int> /* sent_message_port_ids */, + std::vector<int> /* new_routing_ids */) - // Tells the Message Port Channel object that there are no more in-flight - // messages arriving. - IPC_MESSAGE_ROUTED0(WorkerProcessMsg_MessagesQueued) -IPC_END_MESSAGES(WorkerProcess) +// Tells the Message Port Channel object that there are no more in-flight +// messages arriving. +IPC_MESSAGE_ROUTED0(WorkerProcessMsg_MessagesQueued) //----------------------------------------------------------------------------- // WorkerProcessHost messages // These are messages sent from the worker process to the browser process. -IPC_BEGIN_MESSAGES(WorkerProcessHost) - // Note: these Message Port related messages can also be sent out from the - // renderer process. Putting them here since we don't have a shared place - // like common_messages_internal.h - - // Creates a new Message Port Channel object. The first paramaeter is the - // message port channel's routing id in this process. The second parameter - // is the process-wide-unique identifier for that port. - IPC_SYNC_MESSAGE_CONTROL0_2(WorkerProcessHostMsg_CreateMessagePort, - int /* route_id */, - int /* message_port_id */) - - // Sent when a Message Port Channel object is destroyed. - IPC_MESSAGE_CONTROL1(WorkerProcessHostMsg_DestroyMessagePort, - int /* message_port_id */) - - // Sends a message to a message port. Optionally sends a message port as - // as well if sent_message_port_id != MSG_ROUTING_NONE. - IPC_MESSAGE_CONTROL3(WorkerProcessHostMsg_PostMessage, - int /* sender_message_port_id */, - string16 /* message */, - std::vector<int> /* sent_message_port_ids */) - - // Causes messages sent to the remote port to be delivered to this local port. - IPC_MESSAGE_CONTROL2(WorkerProcessHostMsg_Entangle, - int /* local_message_port_id */, - int /* remote_message_port_id */) - - // Causes the browser to queue messages sent to this port until the the port - // has made sure that all in-flight messages were routed to the new - // destination. - IPC_MESSAGE_CONTROL1(WorkerProcessHostMsg_QueueMessages, - int /* message_port_id */) - - // Sends the browser all the queued messages that arrived at this message port - // after it was sent in a postMessage call. - // NOTE: MSVS can't compile the macro if std::vector<std::pair<string16, int> > - // is used, so we typedef it in worker_messages.h. - IPC_MESSAGE_CONTROL2(WorkerProcessHostMsg_SendQueuedMessages, - int /* message_port_id */, - std::vector<QueuedMessage> /* queued_messages */) - - // Sent by the worker process to check whether access to web databases is - // granted by content settings. - IPC_SYNC_MESSAGE_ROUTED4_1(WorkerProcessHostMsg_AllowDatabase, - GURL /* origin url */, - string16 /* database name */, - string16 /* database display name */, - unsigned long /* estimated size */, - bool /* result */) -IPC_END_MESSAGES(WorkerProcessHost) +// Note: these Message Port related messages can also be sent out from the +// renderer process. Putting them here since we don't have a shared place +// like common_messages_internal.h + +// Creates a new Message Port Channel object. The first paramaeter is the +// message port channel's routing id in this process. The second parameter +// is the process-wide-unique identifier for that port. +IPC_SYNC_MESSAGE_CONTROL0_2(WorkerProcessHostMsg_CreateMessagePort, + int /* route_id */, + int /* message_port_id */) + +// Sent when a Message Port Channel object is destroyed. +IPC_MESSAGE_CONTROL1(WorkerProcessHostMsg_DestroyMessagePort, + int /* message_port_id */) + +// Sends a message to a message port. Optionally sends a message port as +// as well if sent_message_port_id != MSG_ROUTING_NONE. +IPC_MESSAGE_CONTROL3(WorkerProcessHostMsg_PostMessage, + int /* sender_message_port_id */, + string16 /* message */, + std::vector<int> /* sent_message_port_ids */) + +// Causes messages sent to the remote port to be delivered to this local port. +IPC_MESSAGE_CONTROL2(WorkerProcessHostMsg_Entangle, + int /* local_message_port_id */, + int /* remote_message_port_id */) + +// Causes the browser to queue messages sent to this port until the the port +// has made sure that all in-flight messages were routed to the new +// destination. +IPC_MESSAGE_CONTROL1(WorkerProcessHostMsg_QueueMessages, + int /* message_port_id */) + +// Sends the browser all the queued messages that arrived at this message port +// after it was sent in a postMessage call. +// NOTE: MSVS can't compile the macro if std::vector<std::pair<string16, int> > +// is used, so we typedef it in worker_messages.h. +IPC_MESSAGE_CONTROL2(WorkerProcessHostMsg_SendQueuedMessages, + int /* message_port_id */, + std::vector<QueuedMessage> /* queued_messages */) + +// Sent by the worker process to check whether access to web databases is +// granted by content settings. +IPC_SYNC_MESSAGE_ROUTED4_1(WorkerProcessHostMsg_AllowDatabase, + GURL /* origin url */, + string16 /* database name */, + string16 /* database display name */, + unsigned long /* estimated size */, + bool /* result */) //----------------------------------------------------------------------------- // Worker messages // These are messages sent from the renderer process to the worker process. -IPC_BEGIN_MESSAGES(Worker) - IPC_MESSAGE_ROUTED3(WorkerMsg_StartWorkerContext, - GURL /* url */, - string16 /* user_agent */, - string16 /* source_code */) +IPC_MESSAGE_ROUTED3(WorkerMsg_StartWorkerContext, + GURL /* url */, + string16 /* user_agent */, + string16 /* source_code */) - IPC_MESSAGE_ROUTED0(WorkerMsg_TerminateWorkerContext) +IPC_MESSAGE_ROUTED0(WorkerMsg_TerminateWorkerContext) - IPC_MESSAGE_ROUTED3(WorkerMsg_PostMessage, - string16 /* message */, - std::vector<int> /* sent_message_port_ids */, - std::vector<int> /* new_routing_ids */) +IPC_MESSAGE_ROUTED3(WorkerMsg_PostMessage, + string16 /* message */, + std::vector<int> /* sent_message_port_ids */, + std::vector<int> /* new_routing_ids */) - IPC_MESSAGE_ROUTED2(WorkerMsg_Connect, - int /* sent_message_port_id */, - int /* routing_id */) +IPC_MESSAGE_ROUTED2(WorkerMsg_Connect, + int /* sent_message_port_id */, + int /* routing_id */) - IPC_MESSAGE_ROUTED0(WorkerMsg_WorkerObjectDestroyed) -IPC_END_MESSAGES(Worker) +IPC_MESSAGE_ROUTED0(WorkerMsg_WorkerObjectDestroyed) //----------------------------------------------------------------------------- // WorkerHost messages // These are messages sent from the worker process to the renderer process. -IPC_BEGIN_MESSAGES(WorkerHost) - // WorkerMsg_PostMessage is also sent here. - IPC_MESSAGE_ROUTED3(WorkerHostMsg_PostExceptionToWorkerObject, - string16 /* error_message */, - int /* line_number */, - string16 /* source_url*/) - - IPC_MESSAGE_ROUTED1(WorkerHostMsg_PostConsoleMessageToWorkerObject, - WorkerHostMsg_PostConsoleMessageToWorkerObject_Params) - - IPC_MESSAGE_ROUTED1(WorkerHostMsg_ConfirmMessageFromWorkerObject, - bool /* bool has_pending_activity */) - - IPC_MESSAGE_ROUTED1(WorkerHostMsg_ReportPendingActivity, - bool /* bool has_pending_activity */) - - IPC_MESSAGE_CONTROL1(WorkerHostMsg_WorkerContextClosed, - int /* worker_route_id */) - IPC_MESSAGE_ROUTED0(WorkerHostMsg_WorkerContextDestroyed) -IPC_END_MESSAGES(WorkerHost) +// WorkerMsg_PostMessage is also sent here. +IPC_MESSAGE_ROUTED3(WorkerHostMsg_PostExceptionToWorkerObject, + string16 /* error_message */, + int /* line_number */, + string16 /* source_url*/) + +IPC_MESSAGE_ROUTED1(WorkerHostMsg_PostConsoleMessageToWorkerObject, + WorkerHostMsg_PostConsoleMessageToWorkerObject_Params) + +IPC_MESSAGE_ROUTED1(WorkerHostMsg_ConfirmMessageFromWorkerObject, + bool /* bool has_pending_activity */) + +IPC_MESSAGE_ROUTED1(WorkerHostMsg_ReportPendingActivity, + bool /* bool has_pending_activity */) + +IPC_MESSAGE_CONTROL1(WorkerHostMsg_WorkerContextClosed, + int /* worker_route_id */) +IPC_MESSAGE_ROUTED0(WorkerHostMsg_WorkerContextDestroyed) diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index fd2afaa..fdce639 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -229,20 +229,6 @@ bool TabProxy::NavigateToURLAsyncWithDisposition( return status; } -#if defined(OS_WIN) -// TODO(port): Get rid of HWND. -bool TabProxy::GetHWND(HWND* hwnd) const { - if (!is_valid()) - return false; - if (!hwnd) { - NOTREACHED(); - return false; - } - - return sender_->Send(new AutomationMsg_TabHWND(0, handle_, hwnd)); -} -#endif // defined(OS_WIN) - bool TabProxy::GetProcessID(int* process_id) const { if (!is_valid()) return false; diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h index 452a2ca..9470131 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -197,14 +197,6 @@ class TabProxy : public AutomationResourceProxy, // the last tab. bool Close(bool wait_until_closed) WARN_UNUSED_RESULT; -#if defined(OS_WIN) - // TODO(port): Use portable replacement for HWND. - - // Gets the HWND that corresponds to the content area of this tab. - // Returns true if the call was successful. - bool GetHWND(HWND* hwnd) const WARN_UNUSED_RESULT; -#endif // defined(OS_WIN) - // Gets the process ID that corresponds to the content area of this tab. // Returns true if the call was successful. If the specified tab has no // separate process for rendering its content, the return value is true but diff --git a/chrome/test/interactive_ui/npapi_interactive_test.cc b/chrome/test/interactive_ui/npapi_interactive_test.cc index 5c7ddbc..c6e40b2 100644 --- a/chrome/test/interactive_ui/npapi_interactive_test.cc +++ b/chrome/test/interactive_ui/npapi_interactive_test.cc @@ -34,7 +34,6 @@ #include "app/keyboard_codes.h" #include "base/file_path.h" #include "chrome/browser/net/url_request_mock_http_job.h" -#include "chrome/test/automation/tab_proxy.h" #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/npapi_test_helper.h" #include "chrome/test/ui_test_utils.h" @@ -46,39 +45,24 @@ static const FilePath::CharType* kTestDir = FILE_PATH_LITERAL("npapi"); // Tests if a plugin executing a self deleting script in the context of // a synchronous mousemove works correctly TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInvokeInSynchronousMouseMove) { - if (!UITest::in_process_renderer()) { - scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); - HWND tab_window = NULL; - tab_proxy->GetHWND(&tab_window); - - EXPECT_TRUE(IsWindow(tab_window)); - - show_window_ = true; - const FilePath kTestDir(FILE_PATH_LITERAL("npapi")); - const FilePath test_case( - FILE_PATH_LITERAL("execute_script_delete_in_mouse_move.html")); - GURL url = ui_test_utils::GetTestUrl(kTestDir, test_case); - NavigateToURL(url); - - POINT cursor_position = {130, 130}; - ClientToScreen(tab_window, &cursor_position); - - double screen_width = ::GetSystemMetrics(SM_CXSCREEN) - 1; - double screen_height = ::GetSystemMetrics(SM_CYSCREEN) - 1; - double location_x = cursor_position.x * (65535.0f / screen_width); - double location_y = cursor_position.y * (65535.0f / screen_height); - - INPUT input_info = {0}; - input_info.type = INPUT_MOUSE; - input_info.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE; - input_info.mi.dx = static_cast<long>(location_x); - input_info.mi.dy = static_cast<long>(location_y); - ::SendInput(1, &input_info, sizeof(INPUT)); - - WaitForFinish("execute_script_delete_in_mouse_move", "1", url, - kTestCompleteCookie, kTestCompleteSuccess, - action_max_timeout_ms()); - } + if (UITest::in_process_renderer()) + return; + + show_window_ = true; + const FilePath kTestDir(FILE_PATH_LITERAL("npapi")); + const FilePath test_case( + FILE_PATH_LITERAL("execute_script_delete_in_mouse_move.html")); + GURL url = ui_test_utils::GetTestUrl(kTestDir, test_case); + NavigateToURL(url); + + scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); + + gfx::Point cursor_position(150, 250); + window->SimulateOSMouseMove(cursor_position); + + WaitForFinish("execute_script_delete_in_mouse_move", "1", url, + kTestCompleteCookie, kTestCompleteSuccess, + action_max_timeout_ms()); } // Flaky, http://crbug.com/60071. diff --git a/chrome_frame/cfproxy_support.cc b/chrome_frame/cfproxy_support.cc index dc2eb8b..723943a 100644 --- a/chrome_frame/cfproxy_support.cc +++ b/chrome_frame/cfproxy_support.cc @@ -345,25 +345,25 @@ std::wstring BuildCmdLine(const std::string& channel_id, int IsTabMessage(const IPC::Message& message) { switch (message.type()) { - case AutomationMsg_NavigationStateChanged__ID: - case AutomationMsg_UpdateTargetUrl__ID: - case AutomationMsg_HandleAccelerator__ID: - case AutomationMsg_TabbedOut__ID: - case AutomationMsg_OpenURL__ID: - case AutomationMsg_NavigationFailed__ID: - case AutomationMsg_DidNavigate__ID: - case AutomationMsg_TabLoaded__ID: - case AutomationMsg_ForwardMessageToExternalHost__ID: - case AutomationMsg_ForwardContextMenuToExternalHost__ID: - case AutomationMsg_RequestStart__ID: - case AutomationMsg_RequestRead__ID: - case AutomationMsg_RequestEnd__ID: - case AutomationMsg_DownloadRequestInHost__ID: - case AutomationMsg_SetCookieAsync__ID: - case AutomationMsg_AttachExternalTab__ID: - case AutomationMsg_RequestGoToHistoryEntryOffset__ID: - case AutomationMsg_GetCookiesFromHost__ID: - case AutomationMsg_CloseExternalTab__ID: { + case AutomationMsg_NavigationStateChanged::ID: + case AutomationMsg_UpdateTargetUrl::ID: + case AutomationMsg_HandleAccelerator::ID: + case AutomationMsg_TabbedOut::ID: + case AutomationMsg_OpenURL::ID: + case AutomationMsg_NavigationFailed::ID: + case AutomationMsg_DidNavigate::ID: + case AutomationMsg_TabLoaded::ID: + case AutomationMsg_ForwardMessageToExternalHost::ID: + case AutomationMsg_ForwardContextMenuToExternalHost::ID: + case AutomationMsg_RequestStart::ID: + case AutomationMsg_RequestRead::ID: + case AutomationMsg_RequestEnd::ID: + case AutomationMsg_DownloadRequestInHost::ID: + case AutomationMsg_SetCookieAsync::ID: + case AutomationMsg_AttachExternalTab::ID: + case AutomationMsg_RequestGoToHistoryEntryOffset::ID: + case AutomationMsg_GetCookiesFromHost::ID: + case AutomationMsg_CloseExternalTab::ID: { // Read tab handle from the message. void* iter = NULL; int tab_handle = 0; @@ -380,7 +380,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, // The first argument of the message is always the tab handle. void* iter = 0; switch (m.type()) { - case AutomationMsg_NavigationStateChanged__ID: { + case AutomationMsg_NavigationStateChanged::ID: { // Tuple3<int, int, IPC::NavigationInfo> AutomationMsg_NavigationStateChanged::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -388,7 +388,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_UpdateTargetUrl__ID: { + case AutomationMsg_UpdateTargetUrl::ID: { // Tuple2<int, std::wstring> AutomationMsg_UpdateTargetUrl::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -396,7 +396,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_HandleAccelerator__ID: { + case AutomationMsg_HandleAccelerator::ID: { // Tuple2<int, MSG> AutomationMsg_HandleAccelerator::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -404,7 +404,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_TabbedOut__ID: { + case AutomationMsg_TabbedOut::ID: { // Tuple2<int, bool> AutomationMsg_TabbedOut::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -412,7 +412,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_OpenURL__ID: { + case AutomationMsg_OpenURL::ID: { // Tuple4<int, GURL, GURL, int> AutomationMsg_OpenURL::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -420,7 +420,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_NavigationFailed__ID: { + case AutomationMsg_NavigationFailed::ID: { // Tuple3<int, int, GURL> AutomationMsg_NavigationFailed::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -428,7 +428,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_DidNavigate__ID: { + case AutomationMsg_DidNavigate::ID: { // Tuple2<int, IPC::NavigationInfo> AutomationMsg_DidNavigate::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -436,7 +436,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_TabLoaded__ID: { + case AutomationMsg_TabLoaded::ID: { // Tuple2<int, GURL> AutomationMsg_TabLoaded::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -444,7 +444,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_ForwardMessageToExternalHost__ID: { + case AutomationMsg_ForwardMessageToExternalHost::ID: { // Tuple4<int, string, string, string> AutomationMsg_ForwardMessageToExternalHost::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -452,7 +452,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_ForwardContextMenuToExternalHost__ID: { + case AutomationMsg_ForwardContextMenuToExternalHost::ID: { // Tuple4<int, HANDLE, int, IPC::ContextMenuParams> AutomationMsg_ForwardContextMenuToExternalHost::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -460,7 +460,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_RequestStart__ID: { + case AutomationMsg_RequestStart::ID: { // Tuple3<int, int, IPC::AutomationURLRequest> AutomationMsg_RequestStart::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -468,7 +468,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_RequestRead__ID: { + case AutomationMsg_RequestRead::ID: { // Tuple3<int, int, int> AutomationMsg_RequestRead::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -476,7 +476,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_RequestEnd__ID: { + case AutomationMsg_RequestEnd::ID: { // Tuple3<int, int, URLRequestStatus> AutomationMsg_RequestEnd::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -484,7 +484,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_DownloadRequestInHost__ID: { + case AutomationMsg_DownloadRequestInHost::ID: { // Tuple2<int, int> AutomationMsg_DownloadRequestInHost::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -492,7 +492,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_SetCookieAsync__ID: { + case AutomationMsg_SetCookieAsync::ID: { // Tuple3<int, GURL, string> AutomationMsg_SetCookieAsync::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -500,7 +500,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_AttachExternalTab__ID: { + case AutomationMsg_AttachExternalTab::ID: { // Tuple2<int, IPC::AttachExternalTabParams> AutomationMsg_AttachExternalTab::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -508,7 +508,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_RequestGoToHistoryEntryOffset__ID: { + case AutomationMsg_RequestGoToHistoryEntryOffset::ID: { // Tuple2<int, int> AutomationMsg_RequestGoToHistoryEntryOffset::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -516,7 +516,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_GetCookiesFromHost__ID: { + case AutomationMsg_GetCookiesFromHost::ID: { // Tuple3<int, GURL, int> AutomationMsg_GetCookiesFromHost::Param params; if (ReadParam(&m, &iter, ¶ms)) @@ -524,7 +524,7 @@ bool DispatchTabMessageToDelegate(ChromeProxyDelegate* delegate, return true; } - case AutomationMsg_CloseExternalTab__ID: { + case AutomationMsg_CloseExternalTab::ID: { // Tuple1<int> delegate->TabClosed(); return true; diff --git a/chrome_frame/test/automation_client_mock.cc b/chrome_frame/test/automation_client_mock.cc index 2cf981b..48c5856 100644 --- a/chrome_frame/test/automation_client_mock.cc +++ b/chrome_frame/test/automation_client_mock.cc @@ -253,7 +253,7 @@ TEST_F(CFACMockTest, MockedCreateTabOk) { HWND h1 = ::GetDesktopWindow(); HWND h2 = ::GetDesktopWindow(); EXPECT_CALL(mock_proxy_, SendAsAsync(testing::Property( - &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), + &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab::ID), testing::NotNull(), _)) .Times(1).WillOnce(HandleCreateTab(tab_handle_, h1, h2, 99)); @@ -287,7 +287,7 @@ TEST_F(CFACMockTest, MockedCreateTabFailed) { .WillRepeatedly(Return("")); EXPECT_CALL(mock_proxy_, SendAsAsync(testing::Property( - &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), + &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab::ID), testing::NotNull(), _)) .Times(1).WillOnce(HandleCreateTab(tab_handle_, null_wnd, null_wnd, 99)); @@ -350,7 +350,7 @@ TEST_F(CFACMockTest, OnChannelError) { HWND h1 = ::GetDesktopWindow(); HWND h2 = ::GetDesktopWindow(); EXPECT_CALL(proxy, SendAsAsync(testing::Property( - &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), + &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab::ID), testing::NotNull(), _)).Times(3) .WillOnce(HandleCreateTab(tab_handle_, h1, h2, 99)) .WillOnce(HandleCreateTab(tab_handle_ * 2, h1, h2, 100)) @@ -430,7 +430,7 @@ TEST_F(CFACMockTest, NavigateTwiceAfterInitToSameUrl) { HWND h1 = ::GetDesktopWindow(); HWND h2 = ::GetDesktopWindow(); EXPECT_CALL(mock_proxy_, SendAsAsync(testing::Property( - &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab__ID), + &IPC::SyncMessage::type, AutomationMsg_CreateExternalTab::ID), testing::NotNull(), _)) .Times(1).WillOnce(HandleCreateTab(tab_handle_, h1, h2, 99)); @@ -443,14 +443,14 @@ TEST_F(CFACMockTest, NavigateTwiceAfterInitToSameUrl) { std::string(), false)); EXPECT_CALL(mock_proxy_, SendAsAsync(testing::Property( - &IPC::SyncMessage::type, AutomationMsg_NavigateInExternalTab__ID), + &IPC::SyncMessage::type, AutomationMsg_NavigateInExternalTab::ID), testing::NotNull(), _)) .Times(1).WillOnce(QUIT_LOOP(loop_)); EXPECT_CALL(mock_proxy_, CancelAsync(_)).Times(testing::AnyNumber()); EXPECT_CALL(mock_proxy_, Send( - testing::Property(&IPC::Message::type, AutomationMsg_TabReposition__ID))) + testing::Property(&IPC::Message::type, AutomationMsg_TabReposition::ID))) .Times(1) .WillOnce(Return(true)); diff --git a/ipc/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc index 8c4dbe3..4b5e938 100644 --- a/ipc/ipc_fuzzing_tests.cc +++ b/ipc/ipc_fuzzing_tests.cc @@ -98,8 +98,7 @@ TEST(IPCMessageIntegrity, ReadVectorTooLarge2) { // We don't actually use the messages defined in this file, but we do this // to get to the IPC macros. -#define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h" -#include "ipc/ipc_message_macros.h" +#include "ipc/ipc_sync_message_unittest.h" enum IPCMessageIds { UNUSED_IPC_TYPE, diff --git a/ipc/ipc_logging.cc b/ipc/ipc_logging.cc index 905f097..3b26cdc 100644 --- a/ipc/ipc_logging.cc +++ b/ipc/ipc_logging.cc @@ -5,7 +5,6 @@ #include "ipc/ipc_logging.h" #ifdef IPC_MESSAGE_LOG_ENABLED -// This will cause render_messages.h etc to define ViewMsgLog and friends. #define IPC_MESSAGE_MACROS_LOG_ENABLED #endif @@ -13,6 +12,7 @@ #include "base/logging.h" #include "base/message_loop.h" #include "base/process_util.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/thread.h" #include "base/time.h" @@ -38,7 +38,7 @@ const int kLogSendDelayMs = 100; // We use a pointer to the function table to avoid any linker dependencies on // all the traits used as IPC message parameters. -Logging::LogFunction *Logging::log_function_mapping_; +LogFunctionMap* Logging::log_function_map_; Logging::Logging() : enabled_(false), @@ -70,10 +70,6 @@ Logging* Logging::current() { return Singleton<Logging>::get(); } -void Logging::SetLoggerFunctions(LogFunction *functions) { - log_function_mapping_ = functions; -} - void Logging::SetConsumer(Consumer* consumer) { consumer_ = consumer; } @@ -164,16 +160,20 @@ void Logging::OnPostDispatchMessage(const Message& message, void Logging::GetMessageText(uint32 type, std::string* name, const Message* message, std::string* params) { - if (!log_function_mapping_) + if (!log_function_map_) return; - int message_class = type >> 16; - if (log_function_mapping_[message_class] != NULL) { - log_function_mapping_[message_class](type, name, message, params); - } else { - DVLOG(1) << "No logger function associated with message class " - << message_class; + LogFunctionMap::iterator it = log_function_map_->find(type); + if (it == log_function_map_->end()) { + if (name) { + *name = "[UNKNOWN MSG "; + *name += base::IntToString(type); + *name += " ]"; + } + return; } + + (*it->second)(name, message, params); } void Logging::Log(const LogData& data) { diff --git a/ipc/ipc_logging.h b/ipc/ipc_logging.h index 36e584a..ee2f62b 100644 --- a/ipc/ipc_logging.h +++ b/ipc/ipc_logging.h @@ -12,10 +12,19 @@ #include <vector> +#include "base/hash_tables.h" #include "base/message_loop.h" #include "base/scoped_ptr.h" #include "base/singleton.h" +// Logging function. |name| is a string in ASCII and |params| is a string in +// UTF-8. +typedef void (*LogFunction)(std::string* name, + const IPC::Message* msg, + std::string* params); + +typedef base::hash_map<uint32, LogFunction > LogFunctionMap; + namespace IPC { class Message; @@ -71,14 +80,13 @@ class Logging { static void GetMessageText(uint32 type, std::string* name, const Message* message, std::string* params); - // Logging function. |name| is a string in ASCII and |params| is a string in - // UTF-8. - typedef void (*LogFunction)(uint32 type, - std::string* name, - const Message* msg, - std::string* params); + static void set_log_function_map(LogFunctionMap* functions) { + log_function_map_ = functions; + } - static void SetLoggerFunctions(LogFunction *functions); + static LogFunctionMap* log_function_map() { + return log_function_map_; + } private: friend struct DefaultSingletonTraits<Logging>; @@ -98,7 +106,7 @@ class Logging { Consumer* consumer_; - static LogFunction *log_function_mapping_; + static LogFunctionMap* log_function_map_; }; } // namespace IPC diff --git a/ipc/ipc_message.h b/ipc/ipc_message.h index bff0ff70..5ffddde 100644 --- a/ipc/ipc_message.h +++ b/ipc/ipc_message.h @@ -157,7 +157,7 @@ class Message : public Pickle { } // Used for async messages with no parameters. - static void Log(const Message* msg, std::string* l) { + static void Log(std::string* name, const Message* msg, std::string* l) { } // Find the end of the message data that starts at range_start. Returns NULL diff --git a/ipc/ipc_message_impl_macros.h b/ipc/ipc_message_impl_macros.h index 3fa8978..b6b6278 100644 --- a/ipc/ipc_message_impl_macros.h +++ b/ipc/ipc_message_impl_macros.h @@ -6,7 +6,7 @@ // messages. This file works similarly, except that it defines the // implementations of the constructors and the logging methods. (These only // have to be generated once). It is meant to be included in a XXX_messages.cc -// file. +// file right before including XXX_messages_internal.h. #ifndef IPC_IPC_MESSAGE_IMPL_MACROS_H_ #define IPC_IPC_MESSAGE_IMPL_MACROS_H_ @@ -14,97 +14,16 @@ #include "ipc/ipc_message_utils.h" #include "ipc/ipc_message_utils_impl.h" -#ifndef MESSAGES_INTERNAL_IMPL_FILE -#error This file should only be included by X_messages.cc, which needs to define MESSAGES_INTERNAL_IMPL_FILE first. -#endif - -// Trick xcode into seeing the possible real dependencies since they -// don't understand #include MESSAGES_INTERNAL_FILE. See http://crbug.com/7828 -#if 0 -#include "ipc/ipc_sync_message_unittest.h" -#include "chrome/common/automation_messages_internal.h" -#include "chrome/common/devtools_messages_internal.h" -#include "chrome/common/gpu_messages_internal.h" -#include "chrome/common/nacl_messages_internal.h" -#include "chrome/common/plugin_messages_internal.h" -#include "chrome/common/render_messages_internal.h" -#include "chrome/common/service_messages_internal.h" -#include "chrome/common/utility_messages_internal.h" -#include "chrome/common/worker_messages_internal.h" -#include "ppapi/proxy/ppapi_messages_internal.h" -#endif - -// These are probalby still defined because of ipc_message_macros.h should be -// included before us for the class/method declarations. -#undef IPC_BEGIN_MESSAGES -#undef IPC_END_MESSAGES -#undef IPC_MESSAGE_CONTROL0 -#undef IPC_MESSAGE_CONTROL1 -#undef IPC_MESSAGE_CONTROL2 -#undef IPC_MESSAGE_CONTROL3 -#undef IPC_MESSAGE_CONTROL4 -#undef IPC_MESSAGE_CONTROL5 -#undef IPC_MESSAGE_ROUTED0 -#undef IPC_MESSAGE_ROUTED1 -#undef IPC_MESSAGE_ROUTED2 -#undef IPC_MESSAGE_ROUTED3 -#undef IPC_MESSAGE_ROUTED4 -#undef IPC_MESSAGE_ROUTED5 -#undef IPC_SYNC_MESSAGE_CONTROL0_0 -#undef IPC_SYNC_MESSAGE_CONTROL0_1 -#undef IPC_SYNC_MESSAGE_CONTROL0_2 -#undef IPC_SYNC_MESSAGE_CONTROL0_3 -#undef IPC_SYNC_MESSAGE_CONTROL1_0 -#undef IPC_SYNC_MESSAGE_CONTROL1_1 -#undef IPC_SYNC_MESSAGE_CONTROL1_2 -#undef IPC_SYNC_MESSAGE_CONTROL1_3 -#undef IPC_SYNC_MESSAGE_CONTROL2_0 -#undef IPC_SYNC_MESSAGE_CONTROL2_1 -#undef IPC_SYNC_MESSAGE_CONTROL2_2 -#undef IPC_SYNC_MESSAGE_CONTROL2_3 -#undef IPC_SYNC_MESSAGE_CONTROL3_1 -#undef IPC_SYNC_MESSAGE_CONTROL3_2 -#undef IPC_SYNC_MESSAGE_CONTROL3_3 -#undef IPC_SYNC_MESSAGE_CONTROL3_4 -#undef IPC_SYNC_MESSAGE_CONTROL4_1 -#undef IPC_SYNC_MESSAGE_CONTROL4_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_0 -#undef IPC_SYNC_MESSAGE_ROUTED0_1 -#undef IPC_SYNC_MESSAGE_ROUTED0_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_0 -#undef IPC_SYNC_MESSAGE_ROUTED1_1 -#undef IPC_SYNC_MESSAGE_ROUTED1_2 -#undef IPC_SYNC_MESSAGE_ROUTED1_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_4 -#undef IPC_SYNC_MESSAGE_ROUTED2_0 -#undef IPC_SYNC_MESSAGE_ROUTED2_1 -#undef IPC_SYNC_MESSAGE_ROUTED2_2 -#undef IPC_SYNC_MESSAGE_ROUTED2_3 -#undef IPC_SYNC_MESSAGE_ROUTED3_0 -#undef IPC_SYNC_MESSAGE_ROUTED3_1 -#undef IPC_SYNC_MESSAGE_ROUTED3_2 -#undef IPC_SYNC_MESSAGE_ROUTED3_3 -#undef IPC_SYNC_MESSAGE_ROUTED3_4 -#undef IPC_SYNC_MESSAGE_ROUTED4_0 -#undef IPC_SYNC_MESSAGE_ROUTED4_1 -#undef IPC_SYNC_MESSAGE_ROUTED4_2 -#undef IPC_SYNC_MESSAGE_ROUTED4_3 -#undef IPC_SYNC_MESSAGE_ROUTED5_0 -#undef IPC_SYNC_MESSAGE_ROUTED5_1 -#undef IPC_SYNC_MESSAGE_ROUTED5_2 -#undef IPC_SYNC_MESSAGE_ROUTED5_3 - -// These don't do anything during this pass. -#define IPC_BEGIN_MESSAGES(label) -#define IPC_END_MESSAGES(label) - // Every class must include a destructor and a log method that is keyed to the // specific types. #define IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) \ msg_class::~msg_class() {} \ \ - void msg_class::Log(const Message* msg, std::string* l) { \ + void msg_class::Log(std::string* name, const Message* msg, std::string* l) { \ + if (name) \ + *name = #msg_class; \ + if (!msg || !l) \ + return; \ Param p; \ if (Read(msg, &p)) \ IPC::LogParam(p, l); \ @@ -112,23 +31,23 @@ // This derives from IPC::Message and thus doesn't need us to keep the // implementations in this impl file. -#define IPC_MESSAGE_CONTROL0(msg_class) +#define IPC_MESSAGE_CONTROL0_EXTRA(msg_class) -#define IPC_MESSAGE_CONTROL1(msg_class, type1) \ +#define IPC_MESSAGE_CONTROL1_EXTRA(msg_class, type1) \ msg_class::msg_class(const type1& arg1) \ : IPC::MessageWithTuple< Tuple1<type1> >( \ MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1)) {} \ \ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ +#define IPC_MESSAGE_CONTROL2_EXTRA(msg_class, type1, type2) \ msg_class::msg_class(const type1& arg1, const type2& arg2) \ : IPC::MessageWithTuple< Tuple2<type1, type2> >( \ MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2)) {} \ \ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ +#define IPC_MESSAGE_CONTROL3_EXTRA(msg_class, type1, type2, type3) \ msg_class::msg_class(const type1& arg1, const type2& arg2, \ const type3& arg3) \ : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ @@ -136,7 +55,7 @@ \ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ +#define IPC_MESSAGE_CONTROL4_EXTRA(msg_class, type1, type2, type3, type4) \ msg_class::msg_class(const type1& arg1, const type2& arg2, \ const type3& arg3, const type4& arg4) \ : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ @@ -144,7 +63,7 @@ \ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \ +#define IPC_MESSAGE_CONTROL5_EXTRA(msg_class, type1, type2, type3, type4, type5) \ msg_class::msg_class(const type1& arg1, const type2& arg2, \ const type3& arg3, const type4& arg4, \ const type5& arg5) \ @@ -156,16 +75,16 @@ // This derives from IPC::Message and thus doesn't need us to keep the // implementations in this impl file. -#define IPC_MESSAGE_ROUTED0(msg_class) +#define IPC_MESSAGE_ROUTED0_EXTRA(msg_class) -#define IPC_MESSAGE_ROUTED1(msg_class, type1) \ +#define IPC_MESSAGE_ROUTED1_EXTRA(msg_class, type1) \ msg_class::msg_class(int32 routing_id, const type1& arg1) \ : IPC::MessageWithTuple< Tuple1<type1> >( \ routing_id, ID, MakeRefTuple(arg1)) {} \ \ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ +#define IPC_MESSAGE_ROUTED2_EXTRA(msg_class, type1, type2) \ msg_class::msg_class(int32 routing_id, const type1& arg1, const type2& arg2) \ : IPC::MessageWithTuple< Tuple2<type1, type2> >( \ routing_id, ID, MakeRefTuple(arg1, arg2)) {} \ @@ -173,7 +92,7 @@ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ +#define IPC_MESSAGE_ROUTED3_EXTRA(msg_class, type1, type2, type3) \ msg_class::msg_class(int32 routing_id, const type1& arg1, \ const type2& arg2, const type3& arg3) \ : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ @@ -181,7 +100,7 @@ \ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ +#define IPC_MESSAGE_ROUTED4_EXTRA(msg_class, type1, type2, type3, type4) \ msg_class::msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ const type3& arg3, const type4& arg4) \ : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ @@ -189,7 +108,7 @@ \ IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \ +#define IPC_MESSAGE_ROUTED5_EXTRA(msg_class, type1, type2, type3, type4, type5) \ msg_class::msg_class(int32 routing_id, const type1& arg1, \ const type2& arg2, const type3& arg3, \ const type4& arg4, const type5& arg5) \ @@ -205,12 +124,15 @@ #define IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) \ msg_class::~msg_class() {} \ \ - void msg_class::Log(const Message* msg, std::string* l) { \ + void msg_class::Log(std::string* name, const Message* msg, std::string* l) { \ + if (name) \ + *name = #msg_class; \ + if (!msg || !l) \ + return; \ if (msg->is_sync()) { \ TupleTypes<SendParam>::ValueTuple p; \ if (ReadSendParam(msg, &p)) \ IPC::LogParam(p, l); \ - \ AddOutputParamsToLog(msg, l); \ } else { \ TupleTypes<ReplyParam>::ValueTuple p; \ @@ -219,7 +141,7 @@ } \ } -#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \ +#define IPC_SYNC_MESSAGE_CONTROL0_0_EXTRA(msg_class) \ msg_class::msg_class() \ : IPC::MessageWithReply<Tuple0, Tuple0 >( \ MSG_ROUTING_CONTROL, ID, \ @@ -227,7 +149,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ +#define IPC_SYNC_MESSAGE_CONTROL0_1_EXTRA(msg_class, type1_out) \ msg_class::msg_class(type1_out* arg1) \ : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \ MSG_ROUTING_CONTROL, ID, \ @@ -235,7 +157,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_CONTROL0_2_EXTRA(msg_class, type1_out, type2_out) \ msg_class::msg_class(type1_out* arg1, type2_out* arg2) \ : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \ MSG_ROUTING_CONTROL, ID, \ @@ -243,7 +165,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, \ +#define IPC_SYNC_MESSAGE_CONTROL0_3_EXTRA(msg_class, type1_out, type2_out, \ type3_out) \ msg_class::msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3) \ : IPC::MessageWithReply<Tuple0, Tuple3<type1_out&, type2_out&, \ @@ -254,7 +176,7 @@ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \ +#define IPC_SYNC_MESSAGE_CONTROL1_0_EXTRA(msg_class, type1_in) \ msg_class::msg_class(const type1_in& arg1) \ : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \ MSG_ROUTING_CONTROL, ID, \ @@ -262,7 +184,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \ +#define IPC_SYNC_MESSAGE_CONTROL1_1_EXTRA(msg_class, type1_in, type1_out) \ msg_class::msg_class(const type1_in& arg1, type1_out* arg2) \ : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \ MSG_ROUTING_CONTROL, ID, \ @@ -270,7 +192,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_CONTROL1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) \ msg_class::msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3) \ : IPC::MessageWithReply<Tuple1<type1_in>, \ Tuple2<type1_out&, type2_out&> >( \ @@ -279,7 +201,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, \ +#define IPC_SYNC_MESSAGE_CONTROL1_3_EXTRA(msg_class, type1_in, type1_out, \ type2_out, type3_out) \ msg_class::msg_class(const type1_in& arg1, type1_out* arg2, \ type2_out* arg3, type3_out* arg4) \ @@ -290,7 +212,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \ +#define IPC_SYNC_MESSAGE_CONTROL2_0_EXTRA(msg_class, type1_in, type2_in) \ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2) \ : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \ MSG_ROUTING_CONTROL, ID, \ @@ -298,7 +220,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out) \ +#define IPC_SYNC_MESSAGE_CONTROL2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) \ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ type1_out* arg3) \ : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ @@ -309,7 +231,7 @@ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_CONTROL2_2_EXTRA(msg_class, type1_in, type2_in, \ type1_out, type2_out) \ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ type1_out* arg3, type2_out* arg4) \ @@ -320,7 +242,7 @@ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_CONTROL2_3_EXTRA(msg_class, type1_in, type2_in, \ type1_out, type2_out, type3_out) \ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ type1_out* arg3, type2_out* arg4, type3_out* arg5) \ @@ -332,7 +254,7 @@ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_CONTROL3_1_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type1_out) \ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ const type3_in& arg3, type1_out* arg4) \ @@ -342,7 +264,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_CONTROL3_2_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type1_out, type2_out) \ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ const type3_in& arg3, type1_out* arg4, type2_out* arg5) \ @@ -353,7 +275,7 @@ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_CONTROL3_3_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type1_out, type2_out, \ type3_out) \ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ @@ -367,7 +289,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL3_4(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_CONTROL3_4_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type1_out, type2_out, \ type3_out, type4_out) \ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ @@ -382,7 +304,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_CONTROL4_1_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type4_in, type1_out) \ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ const type3_in& arg3, const type4_in& arg4, \ @@ -394,7 +316,7 @@ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_CONTROL4_2_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type4_in, type1_out, \ type2_out) \ msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ @@ -408,7 +330,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \ +#define IPC_SYNC_MESSAGE_ROUTED0_0_EXTRA(msg_class) \ msg_class::msg_class(int routing_id) \ : IPC::MessageWithReply<Tuple0, Tuple0>( \ routing_id, ID, \ @@ -416,7 +338,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \ +#define IPC_SYNC_MESSAGE_ROUTED0_1_EXTRA(msg_class, type1_out) \ msg_class::msg_class(int routing_id, type1_out* arg1) \ : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \ routing_id, ID, \ @@ -424,7 +346,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_ROUTED0_2_EXTRA(msg_class, type1_out, type2_out) \ msg_class::msg_class(int routing_id, type1_out* arg1, type2_out* arg2) \ : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \ routing_id, ID, \ @@ -432,7 +354,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, \ +#define IPC_SYNC_MESSAGE_ROUTED0_3_EXTRA(msg_class, type1_out, type2_out, \ type3_out) \ msg_class::msg_class(int routing_id, type1_out* arg1, type2_out* arg2, \ type3_out* arg3) \ @@ -442,7 +364,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in) \ +#define IPC_SYNC_MESSAGE_ROUTED1_0_EXTRA(msg_class, type1_in) \ msg_class::msg_class(int routing_id, const type1_in& arg1) \ : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \ routing_id, ID, \ @@ -450,7 +372,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out) \ +#define IPC_SYNC_MESSAGE_ROUTED1_1_EXTRA(msg_class, type1_in, type1_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ type1_out* arg2) \ : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \ @@ -459,7 +381,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, \ +#define IPC_SYNC_MESSAGE_ROUTED1_2_EXTRA(msg_class, type1_in, type1_out, \ type2_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ type1_out* arg2, type2_out* arg3) \ @@ -470,7 +392,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, \ +#define IPC_SYNC_MESSAGE_ROUTED1_3_EXTRA(msg_class, type1_in, type1_out, \ type2_out, type3_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ type1_out* arg2, type2_out* arg3, type3_out* arg4) \ @@ -480,7 +402,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, \ +#define IPC_SYNC_MESSAGE_ROUTED1_4_EXTRA(msg_class, type1_in, type1_out, \ type2_out, type3_out, type4_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ type1_out* arg2, type2_out* arg3, \ @@ -492,7 +414,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in) \ +#define IPC_SYNC_MESSAGE_ROUTED2_0_EXTRA(msg_class, type1_in, type2_in) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ const type2_in& arg2) \ : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \ @@ -500,7 +422,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED2_1_EXTRA(msg_class, type1_in, type2_in, \ type1_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ const type2_in& arg2, type1_out* arg3) \ @@ -510,7 +432,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED2_2_EXTRA(msg_class, type1_in, type2_in, \ type1_out, type2_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ const type2_in& arg2, type1_out* arg3, \ @@ -521,7 +443,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED2_3_EXTRA(msg_class, type1_in, type2_in, \ type1_out, type2_out, type3_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ const type2_in& arg2, type1_out* arg3, \ @@ -532,7 +454,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED3_0_EXTRA(msg_class, type1_in, type2_in, \ type3_in) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ const type2_in& arg2, const type3_in& arg3) \ @@ -542,7 +464,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED3_1_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type1_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ const type2_in& arg2, const type3_in& arg3, \ @@ -553,7 +475,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED3_2_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type1_out, type2_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ const type2_in& arg2, const type3_in& arg3, \ @@ -564,7 +486,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED3_3_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type1_out, type2_out, \ type3_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ @@ -577,7 +499,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED3_4(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED3_4_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type1_out, type2_out, \ type3_out, type4_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ @@ -591,7 +513,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED4_0_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type4_in) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ const type2_in& arg2, const type3_in& arg3, \ @@ -602,7 +524,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED4_1_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type4_in, type1_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ const type2_in& arg2, const type3_in& arg3, \ @@ -614,7 +536,7 @@ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED4_2_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type4_in, type1_out, \ type2_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ @@ -627,7 +549,7 @@ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED4_3_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type4_in, type1_out, \ type2_out, type3_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ @@ -641,7 +563,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED5_0_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type4_in, type5_in) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ const type2_in& arg2, const type3_in& arg3, \ @@ -652,7 +574,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED5_1_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type4_in, type5_in, type1_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ const type2_in& arg2, const type3_in& arg3, \ @@ -665,7 +587,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED5_2_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type4_in, type5_in, \ type1_out, type2_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ @@ -679,7 +601,7 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, \ +#define IPC_SYNC_MESSAGE_ROUTED5_3_EXTRA(msg_class, type1_in, type2_in, \ type3_in, type4_in, type5_in, \ type1_out, type2_out, type3_out) \ msg_class::msg_class(int routing_id, const type1_in& arg1, \ @@ -695,16 +617,4 @@ \ IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) -// Trigger the header guard define in ipc_message_macros.h so we don't get -// duplicate including when we include MESSAGES_INTERNAL_FILE again at the end -// of this file. -#define IPC_MESSAGE_MACROS_INCLUDE_BLOCK - -// Redefine MESSAGES_INTERNAL_FILE just for the header check in -// ipc_messages_macros.h that happens before it breaks on the header guard. -#define MESSAGES_INTERNAL_FILE MESSAGES_INTERNAL_IMPL_FILE - -// Include our INTERNAL file first to get the normal expansion. -#include MESSAGES_INTERNAL_IMPL_FILE - #endif // IPC_IPC_MESSAGE_IMPL_MACROS_H_ diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h index 6ce275c..ab07192 100644 --- a/ipc/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h @@ -5,15 +5,13 @@ // This header is meant to be included in multiple passes, hence no traditional // header guard. // -// In the first pass, IPC_MESSAGE_MACROS_ENUMS should be defined, which will -// create enums for each of the messages defined with the IPC_MESSAGE_* macros. -// -// In the second pass, either IPC_MESSAGE_MACROS_DEBUGSTRINGS or -// IPC_MESSAGE_MACROS_CLASSES should be defined (if both, DEBUGSTRINGS takes -// precedence). Only one .cc file should have DEBUGSTRINGS defined, as this -// will create helper functions mapping message types to strings. Having -// CLASSES defined will create classes for each of the messages defined with -// the IPC_MESSAGE_* macros. +// In your XXX_messages_internal.h file, before defining any messages do: +// #define IPC_MESSAGE_START XMsgStart +// XMstStart value is from the IPCMessageStart enum in ipc_message_utils.h, and +// needs to be unique for each different file. +// In your XXX_messages.cc file, after all the includes for param types: +// #define IPC_MESSAGE_IMPL +// #include "X_messages.h" // // "Sync" messages are just synchronous calls, the Send() call doesn't return // until a reply comes back. Input parameters are first (const TYPE&), and @@ -42,1291 +40,994 @@ #include "ipc/ipc_message_utils.h" +// In case a file includes several X_messages.h files, we don't want to get +// errors because each X_messages_internal.h file will define this. +#undef IPC_MESSAGE_START -#ifndef MESSAGES_INTERNAL_FILE -#error This file should only be included by X_messages.h, which needs to define\ - MESSAGES_INTERNAL_FILE first. -#endif - -// Trick xcode into seeing the possible real dependencies since they -// don't understand #include MESSAGES_INTERNAL_FILE. See http://crbug.com/7828 -#if 0 -#include "ipc/ipc_sync_message_unittest.h" -#include "chrome/common/automation_messages_internal.h" -#include "chrome/common/devtools_messages_internal.h" -#include "chrome/common/plugin_messages_internal.h" -#include "chrome/common/render_messages_internal.h" -#include "chrome/common/worker_messages_internal.h" -#include "ppapi/proxy/ppapi_messages_internal.h" -#endif - -#ifndef IPC_MESSAGE_MACROS_INCLUDE_BLOCK -#define IPC_MESSAGE_MACROS_INCLUDE_BLOCK - -// Multi-pass include of X_messages_internal.h. Preprocessor magic allows -// us to use 1 header to define the enums and classes for our render messages. -#define IPC_MESSAGE_MACROS_ENUMS -#include MESSAGES_INTERNAL_FILE - -#define IPC_MESSAGE_MACROS_CLASSES -#include MESSAGES_INTERNAL_FILE - -#ifdef IPC_MESSAGE_MACROS_LOG_ENABLED -#define IPC_MESSAGE_MACROS_LOG -#include MESSAGES_INTERNAL_FILE -#endif - -#undef MESSAGES_INTERNAL_FILE -#undef IPC_MESSAGE_MACROS_INCLUDE_BLOCK - -#endif - -#if defined(IPC_MESSAGE_MACROS_ENUMS) -#undef IPC_MESSAGE_MACROS_ENUMS - - -// Undefine the macros from the previous pass (if any). -#undef IPC_BEGIN_MESSAGES -#undef IPC_END_MESSAGES -#undef IPC_MESSAGE_CONTROL0 -#undef IPC_MESSAGE_CONTROL1 -#undef IPC_MESSAGE_CONTROL2 -#undef IPC_MESSAGE_CONTROL3 -#undef IPC_MESSAGE_CONTROL4 -#undef IPC_MESSAGE_CONTROL5 -#undef IPC_MESSAGE_ROUTED0 -#undef IPC_MESSAGE_ROUTED1 -#undef IPC_MESSAGE_ROUTED2 -#undef IPC_MESSAGE_ROUTED3 -#undef IPC_MESSAGE_ROUTED4 -#undef IPC_MESSAGE_ROUTED5 -#undef IPC_SYNC_MESSAGE_CONTROL0_0 -#undef IPC_SYNC_MESSAGE_CONTROL0_1 -#undef IPC_SYNC_MESSAGE_CONTROL0_2 -#undef IPC_SYNC_MESSAGE_CONTROL0_3 -#undef IPC_SYNC_MESSAGE_CONTROL1_0 -#undef IPC_SYNC_MESSAGE_CONTROL1_1 -#undef IPC_SYNC_MESSAGE_CONTROL1_2 -#undef IPC_SYNC_MESSAGE_CONTROL1_3 -#undef IPC_SYNC_MESSAGE_CONTROL2_0 -#undef IPC_SYNC_MESSAGE_CONTROL2_1 -#undef IPC_SYNC_MESSAGE_CONTROL2_2 -#undef IPC_SYNC_MESSAGE_CONTROL2_3 -#undef IPC_SYNC_MESSAGE_CONTROL3_1 -#undef IPC_SYNC_MESSAGE_CONTROL3_2 -#undef IPC_SYNC_MESSAGE_CONTROL3_3 -#undef IPC_SYNC_MESSAGE_CONTROL3_4 -#undef IPC_SYNC_MESSAGE_CONTROL4_1 -#undef IPC_SYNC_MESSAGE_CONTROL4_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_0 -#undef IPC_SYNC_MESSAGE_ROUTED0_1 -#undef IPC_SYNC_MESSAGE_ROUTED0_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_0 -#undef IPC_SYNC_MESSAGE_ROUTED1_1 -#undef IPC_SYNC_MESSAGE_ROUTED1_2 -#undef IPC_SYNC_MESSAGE_ROUTED1_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_4 -#undef IPC_SYNC_MESSAGE_ROUTED2_0 -#undef IPC_SYNC_MESSAGE_ROUTED2_1 -#undef IPC_SYNC_MESSAGE_ROUTED2_2 -#undef IPC_SYNC_MESSAGE_ROUTED2_3 -#undef IPC_SYNC_MESSAGE_ROUTED3_0 -#undef IPC_SYNC_MESSAGE_ROUTED3_1 -#undef IPC_SYNC_MESSAGE_ROUTED3_2 -#undef IPC_SYNC_MESSAGE_ROUTED3_3 -#undef IPC_SYNC_MESSAGE_ROUTED3_4 -#undef IPC_SYNC_MESSAGE_ROUTED4_0 -#undef IPC_SYNC_MESSAGE_ROUTED4_1 -#undef IPC_SYNC_MESSAGE_ROUTED4_2 -#undef IPC_SYNC_MESSAGE_ROUTED4_3 -#undef IPC_SYNC_MESSAGE_ROUTED5_0 -#undef IPC_SYNC_MESSAGE_ROUTED5_1 -#undef IPC_SYNC_MESSAGE_ROUTED5_2 -#undef IPC_SYNC_MESSAGE_ROUTED5_3 - -// We're using the lowest 16 bits of type for the message id, and the highest -// 16 bits for the channel type. -// -// Do label##PreStart so that automation messages keep the same id as before. -#define IPC_BEGIN_MESSAGES(label) \ - enum label##MsgType { \ - label##Start = label##MsgStart << 16, \ - label##PreStart = (label##MsgStart << 16) - 1, - -#define IPC_END_MESSAGES(label) \ - label##End \ - }; - -#define IPC_MESSAGE_CONTROL0(msg_class) \ - msg_class##__ID, - -#define IPC_MESSAGE_CONTROL1(msg_class, type1) \ - msg_class##__ID, - -#define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ - msg_class##__ID, - -#define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ - msg_class##__ID, - -#define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ - msg_class##__ID, - -#define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \ - msg_class##__ID, - -#define IPC_MESSAGE_ROUTED0(msg_class) \ - msg_class##__ID, - -#define IPC_MESSAGE_ROUTED1(msg_class, type1) \ - msg_class##__ID, - -#define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ - msg_class##__ID, - -#define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ - msg_class##__ID, - -#define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ - msg_class##__ID, - -#define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, type3_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL3_4(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, type3_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, type2_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, type1_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, type3_in) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED3_4(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, type3_in, type4_in) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) \ - msg_class##__ID, - -#define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) \ - msg_class##__ID, - -// Message crackers and handlers. -// Prefer to use the IPC_BEGIN_MESSAGE_MAP_EX to the older macros since they -// allow you to detect when a message could not be de-serialized. Usage: -// -// void MyClass::OnMessageReceived(const IPC::Message& msg) { -// bool msg_is_good = false; -// IPC_BEGIN_MESSAGE_MAP_EX(MyClass, msg, msg_is_good) -// IPC_MESSAGE_HANDLER(MsgClassOne, OnMsgClassOne) -// ...more handlers here ... -// IPC_MESSAGE_HANDLER(MsgClassTen, OnMsgClassTen) -// IPC_END_MESSAGE_MAP_EX() -// if (!msg_is_good) { -// // Signal error here or terminate offending process. -// } -// } - -#define IPC_DEFINE_MESSAGE_MAP(class_name) \ -void class_name::OnMessageReceived(const IPC::Message& msg) \ - IPC_BEGIN_MESSAGE_MAP(class_name, msg) - -#define IPC_BEGIN_MESSAGE_MAP_EX(class_name, msg, msg_is_ok) \ - { \ - typedef class_name _IpcMessageHandlerClass; \ - const IPC::Message& ipc_message__ = msg; \ - bool& msg_is_ok__ = msg_is_ok; \ - switch (ipc_message__.type()) { \ - -#define IPC_BEGIN_MESSAGE_MAP(class_name, msg) \ - { \ - typedef class_name _IpcMessageHandlerClass; \ - const IPC::Message& ipc_message__ = msg; \ - bool msg_is_ok__ = true; \ - switch (ipc_message__.type()) { \ - -#define IPC_MESSAGE_FORWARD(msg_class, obj, member_func) \ - case msg_class::ID: \ - msg_is_ok__ = msg_class::Dispatch(&ipc_message__, obj, &member_func); \ - break; - -#define IPC_MESSAGE_HANDLER(msg_class, member_func) \ - IPC_MESSAGE_FORWARD(msg_class, this, _IpcMessageHandlerClass::member_func) +#if defined(IPC_MESSAGE_IMPL) +#include "ipc/ipc_message_impl_macros.h" +#elif defined(IPC_MESSAGE_MACROS_LOG_ENABLED) -#define IPC_MESSAGE_FORWARD_DELAY_REPLY(msg_class, obj, member_func) \ - case msg_class::ID: \ - msg_class::DispatchDelayReply(&ipc_message__, obj, &member_func); \ - break; - -#define IPC_MESSAGE_HANDLER_DELAY_REPLY(msg_class, member_func) \ - IPC_MESSAGE_FORWARD_DELAY_REPLY(msg_class, this, \ - _IpcMessageHandlerClass::member_func) - -#define IPC_MESSAGE_HANDLER_GENERIC(msg_class, code) \ - case msg_class::ID: \ - code; \ - break; - -#define IPC_REPLY_HANDLER(func) \ - case IPC_REPLY_ID: \ - func(ipc_message__); \ - break; - - -#define IPC_MESSAGE_UNHANDLED(code) \ - default: \ - code; \ - break; - -#define IPC_MESSAGE_UNHANDLED_ERROR() \ - IPC_MESSAGE_UNHANDLED(NOTREACHED() << \ - "Invalid message with type = " << \ - ipc_message__.type()) - -#define IPC_END_MESSAGE_MAP() \ - DCHECK(msg_is_ok__); \ - } \ -} +#ifndef IPC_LOG_TABLE_CREATED +#define IPC_LOG_TABLE_CREATED -#define IPC_END_MESSAGE_MAP_EX() \ - } \ -} +#include "base/hash_tables.h" -#elif defined(IPC_MESSAGE_MACROS_LOG) -#undef IPC_MESSAGE_MACROS_LOG - - -// Undefine the macros from the previous pass (if any). -#undef IPC_BEGIN_MESSAGES -#undef IPC_END_MESSAGES -#undef IPC_MESSAGE_CONTROL0 -#undef IPC_MESSAGE_CONTROL1 -#undef IPC_MESSAGE_CONTROL2 -#undef IPC_MESSAGE_CONTROL3 -#undef IPC_MESSAGE_CONTROL4 -#undef IPC_MESSAGE_CONTROL5 -#undef IPC_MESSAGE_ROUTED0 -#undef IPC_MESSAGE_ROUTED1 -#undef IPC_MESSAGE_ROUTED2 -#undef IPC_MESSAGE_ROUTED3 -#undef IPC_MESSAGE_ROUTED4 -#undef IPC_MESSAGE_ROUTED5 -#undef IPC_SYNC_MESSAGE_CONTROL0_0 -#undef IPC_SYNC_MESSAGE_CONTROL0_1 -#undef IPC_SYNC_MESSAGE_CONTROL0_2 -#undef IPC_SYNC_MESSAGE_CONTROL0_3 -#undef IPC_SYNC_MESSAGE_CONTROL1_0 -#undef IPC_SYNC_MESSAGE_CONTROL1_1 -#undef IPC_SYNC_MESSAGE_CONTROL1_2 -#undef IPC_SYNC_MESSAGE_CONTROL1_3 -#undef IPC_SYNC_MESSAGE_CONTROL2_0 -#undef IPC_SYNC_MESSAGE_CONTROL2_1 -#undef IPC_SYNC_MESSAGE_CONTROL2_2 -#undef IPC_SYNC_MESSAGE_CONTROL2_3 -#undef IPC_SYNC_MESSAGE_CONTROL3_1 -#undef IPC_SYNC_MESSAGE_CONTROL3_2 -#undef IPC_SYNC_MESSAGE_CONTROL3_3 -#undef IPC_SYNC_MESSAGE_CONTROL3_4 -#undef IPC_SYNC_MESSAGE_CONTROL4_1 -#undef IPC_SYNC_MESSAGE_CONTROL4_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_0 -#undef IPC_SYNC_MESSAGE_ROUTED0_1 -#undef IPC_SYNC_MESSAGE_ROUTED0_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_0 -#undef IPC_SYNC_MESSAGE_ROUTED1_1 -#undef IPC_SYNC_MESSAGE_ROUTED1_2 -#undef IPC_SYNC_MESSAGE_ROUTED1_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_4 -#undef IPC_SYNC_MESSAGE_ROUTED2_0 -#undef IPC_SYNC_MESSAGE_ROUTED2_1 -#undef IPC_SYNC_MESSAGE_ROUTED2_2 -#undef IPC_SYNC_MESSAGE_ROUTED2_3 -#undef IPC_SYNC_MESSAGE_ROUTED3_0 -#undef IPC_SYNC_MESSAGE_ROUTED3_1 -#undef IPC_SYNC_MESSAGE_ROUTED3_2 -#undef IPC_SYNC_MESSAGE_ROUTED3_3 -#undef IPC_SYNC_MESSAGE_ROUTED3_4 -#undef IPC_SYNC_MESSAGE_ROUTED4_0 -#undef IPC_SYNC_MESSAGE_ROUTED4_1 -#undef IPC_SYNC_MESSAGE_ROUTED4_2 -#undef IPC_SYNC_MESSAGE_ROUTED4_3 -#undef IPC_SYNC_MESSAGE_ROUTED5_0 -#undef IPC_SYNC_MESSAGE_ROUTED5_1 -#undef IPC_SYNC_MESSAGE_ROUTED5_2 -#undef IPC_SYNC_MESSAGE_ROUTED5_3 +typedef void (*LogFunction)(std::string* name, + const IPC::Message* msg, + std::string* params); -#ifndef IPC_LOG_TABLE_CREATED -#define IPC_LOG_TABLE_CREATED -typedef void (*LogFunction)(uint32 type, - std::string* name, - const IPC::Message* msg, - std::string* params); +typedef base::hash_map<uint32, LogFunction > LogFunctionMap; +LogFunctionMap g_log_function_mapping; -LogFunction g_log_function_mapping[LastMsgIndex]; #endif -#define IPC_BEGIN_MESSAGES(label) \ - void label##MsgLog(uint32 type, std::string* name, const IPC::Message* msg, \ - std::string* params) { \ - switch (type) { - -#define IPC_END_MESSAGES(label) \ - default: \ - if (name) \ - *name = "[UNKNOWN " #label " MSG]"; \ - } \ - } \ - class LoggerRegisterHelper##label { \ +#define IPC_MESSAGE_LOG(msg_class) \ + class LoggerRegisterHelper##msg_class { \ public: \ - LoggerRegisterHelper##label() { \ - g_log_function_mapping[label##MsgStart] = label##MsgLog; \ + LoggerRegisterHelper##msg_class() { \ + g_log_function_mapping[msg_class::ID] = msg_class::Log; \ } \ }; \ - LoggerRegisterHelper##label g_LoggerRegisterHelper##label; - -#define IPC_MESSAGE_LOG(msg_class) \ - case msg_class##__ID: \ - if (name) \ - *name = #msg_class; \ - if (msg && params) \ - msg_class::Log(msg, params); \ - break; + LoggerRegisterHelper##msg_class g_LoggerRegisterHelper##msg_class; -#define IPC_MESSAGE_CONTROL0(msg_class) \ +#define IPC_MESSAGE_CONTROL0_EXTRA(msg_class) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_MESSAGE_CONTROL1(msg_class, type1) \ +#define IPC_MESSAGE_CONTROL1_EXTRA(msg_class, type1) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ +#define IPC_MESSAGE_CONTROL2_EXTRA(msg_class, type1, type2) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ +#define IPC_MESSAGE_CONTROL3_EXTRA(msg_class, type1, type2, type3) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ +#define IPC_MESSAGE_CONTROL4_EXTRA(msg_class, type1, type2, type3, type4) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \ +#define IPC_MESSAGE_CONTROL5_EXTRA(msg_class, type1, type2, type3, type4, type5) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_MESSAGE_ROUTED0(msg_class) \ +#define IPC_MESSAGE_ROUTED0_EXTRA(msg_class) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_MESSAGE_ROUTED1(msg_class, type1) \ +#define IPC_MESSAGE_ROUTED1_EXTRA(msg_class, type1) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ +#define IPC_MESSAGE_ROUTED2_EXTRA(msg_class, type1, type2) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ +#define IPC_MESSAGE_ROUTED3_EXTRA(msg_class, type1, type2, type3) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ +#define IPC_MESSAGE_ROUTED4_EXTRA(msg_class, type1, type2, type3, type4) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \ +#define IPC_MESSAGE_ROUTED5_EXTRA(msg_class, type1, type2, type3, type4, type5) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \ +#define IPC_SYNC_MESSAGE_CONTROL0_0_EXTRA(msg_class) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ +#define IPC_SYNC_MESSAGE_CONTROL0_1_EXTRA(msg_class, type1_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_CONTROL0_2_EXTRA(msg_class, type1_out, type2_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, type3_out) \ +#define IPC_SYNC_MESSAGE_CONTROL0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \ +#define IPC_SYNC_MESSAGE_CONTROL1_0_EXTRA(msg_class, type1_in) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \ +#define IPC_SYNC_MESSAGE_CONTROL1_1_EXTRA(msg_class, type1_in, type1_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_CONTROL1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \ +#define IPC_SYNC_MESSAGE_CONTROL1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \ +#define IPC_SYNC_MESSAGE_CONTROL2_0_EXTRA(msg_class, type1_in, type2_in) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out) \ +#define IPC_SYNC_MESSAGE_CONTROL2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_CONTROL2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ +#define IPC_SYNC_MESSAGE_CONTROL2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \ +#define IPC_SYNC_MESSAGE_CONTROL3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_CONTROL3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ +#define IPC_SYNC_MESSAGE_CONTROL3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL3_4(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ +#define IPC_SYNC_MESSAGE_CONTROL3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ +#define IPC_SYNC_MESSAGE_CONTROL4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_CONTROL4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \ +#define IPC_SYNC_MESSAGE_ROUTED0_0_EXTRA(msg_class) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \ +#define IPC_SYNC_MESSAGE_ROUTED0_1_EXTRA(msg_class, type1_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_ROUTED0_2_EXTRA(msg_class, type1_out, type2_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, type3_out) \ +#define IPC_SYNC_MESSAGE_ROUTED0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in) \ +#define IPC_SYNC_MESSAGE_ROUTED1_0_EXTRA(msg_class, type1_in) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out) \ +#define IPC_SYNC_MESSAGE_ROUTED1_1_EXTRA(msg_class, type1_in, type1_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_ROUTED1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \ +#define IPC_SYNC_MESSAGE_ROUTED1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) \ +#define IPC_SYNC_MESSAGE_ROUTED1_4_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in) \ +#define IPC_SYNC_MESSAGE_ROUTED2_0_EXTRA(msg_class, type1_in, type2_in) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, type1_out) \ +#define IPC_SYNC_MESSAGE_ROUTED2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_ROUTED2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ +#define IPC_SYNC_MESSAGE_ROUTED2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, type3_in) \ +#define IPC_SYNC_MESSAGE_ROUTED3_0_EXTRA(msg_class, type1_in, type2_in, type3_in) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \ +#define IPC_SYNC_MESSAGE_ROUTED3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_ROUTED3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ +#define IPC_SYNC_MESSAGE_ROUTED3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED3_4(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ +#define IPC_SYNC_MESSAGE_ROUTED3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, type3_in, type4_in) \ +#define IPC_SYNC_MESSAGE_ROUTED4_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ +#define IPC_SYNC_MESSAGE_ROUTED4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_ROUTED4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) \ +#define IPC_SYNC_MESSAGE_ROUTED4_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) \ +#define IPC_SYNC_MESSAGE_ROUTED5_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) \ +#define IPC_SYNC_MESSAGE_ROUTED5_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) \ +#define IPC_SYNC_MESSAGE_ROUTED5_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) \ IPC_MESSAGE_LOG(msg_class) -#define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) \ +#define IPC_SYNC_MESSAGE_ROUTED5_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) \ IPC_MESSAGE_LOG(msg_class) -#elif defined(IPC_MESSAGE_MACROS_CLASSES) -#undef IPC_MESSAGE_MACROS_CLASSES - - -// Undefine the macros from the previous pass (if any). -#undef IPC_BEGIN_MESSAGES -#undef IPC_END_MESSAGES -#undef IPC_MESSAGE_CONTROL0 -#undef IPC_MESSAGE_CONTROL1 -#undef IPC_MESSAGE_CONTROL2 -#undef IPC_MESSAGE_CONTROL3 -#undef IPC_MESSAGE_CONTROL4 -#undef IPC_MESSAGE_CONTROL5 -#undef IPC_MESSAGE_ROUTED0 -#undef IPC_MESSAGE_ROUTED1 -#undef IPC_MESSAGE_ROUTED2 -#undef IPC_MESSAGE_ROUTED3 -#undef IPC_MESSAGE_ROUTED4 -#undef IPC_MESSAGE_ROUTED5 -#undef IPC_SYNC_MESSAGE_CONTROL0_0 -#undef IPC_SYNC_MESSAGE_CONTROL0_1 -#undef IPC_SYNC_MESSAGE_CONTROL0_2 -#undef IPC_SYNC_MESSAGE_CONTROL0_3 -#undef IPC_SYNC_MESSAGE_CONTROL1_0 -#undef IPC_SYNC_MESSAGE_CONTROL1_1 -#undef IPC_SYNC_MESSAGE_CONTROL1_2 -#undef IPC_SYNC_MESSAGE_CONTROL1_3 -#undef IPC_SYNC_MESSAGE_CONTROL2_0 -#undef IPC_SYNC_MESSAGE_CONTROL2_1 -#undef IPC_SYNC_MESSAGE_CONTROL2_2 -#undef IPC_SYNC_MESSAGE_CONTROL2_3 -#undef IPC_SYNC_MESSAGE_CONTROL3_1 -#undef IPC_SYNC_MESSAGE_CONTROL3_2 -#undef IPC_SYNC_MESSAGE_CONTROL3_3 -#undef IPC_SYNC_MESSAGE_CONTROL3_4 -#undef IPC_SYNC_MESSAGE_CONTROL4_1 -#undef IPC_SYNC_MESSAGE_CONTROL4_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_0 -#undef IPC_SYNC_MESSAGE_ROUTED0_1 -#undef IPC_SYNC_MESSAGE_ROUTED0_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_0 -#undef IPC_SYNC_MESSAGE_ROUTED1_1 -#undef IPC_SYNC_MESSAGE_ROUTED1_2 -#undef IPC_SYNC_MESSAGE_ROUTED1_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_4 -#undef IPC_SYNC_MESSAGE_ROUTED2_0 -#undef IPC_SYNC_MESSAGE_ROUTED2_1 -#undef IPC_SYNC_MESSAGE_ROUTED2_2 -#undef IPC_SYNC_MESSAGE_ROUTED2_3 -#undef IPC_SYNC_MESSAGE_ROUTED3_0 -#undef IPC_SYNC_MESSAGE_ROUTED3_1 -#undef IPC_SYNC_MESSAGE_ROUTED3_2 -#undef IPC_SYNC_MESSAGE_ROUTED3_3 -#undef IPC_SYNC_MESSAGE_ROUTED3_4 -#undef IPC_SYNC_MESSAGE_ROUTED4_0 -#undef IPC_SYNC_MESSAGE_ROUTED4_1 -#undef IPC_SYNC_MESSAGE_ROUTED4_2 -#undef IPC_SYNC_MESSAGE_ROUTED4_3 -#undef IPC_SYNC_MESSAGE_ROUTED5_0 -#undef IPC_SYNC_MESSAGE_ROUTED5_1 -#undef IPC_SYNC_MESSAGE_ROUTED5_2 -#undef IPC_SYNC_MESSAGE_ROUTED5_3 - -#define IPC_BEGIN_MESSAGES(label) -#define IPC_END_MESSAGES(label) +#else + +#define IPC_MESSAGE_CONTROL0_EXTRA(msg_class) +#define IPC_MESSAGE_CONTROL1_EXTRA(msg_class, type1) +#define IPC_MESSAGE_CONTROL2_EXTRA(msg_class, type1, type2) +#define IPC_MESSAGE_CONTROL3_EXTRA(msg_class, type1, type2, type3) +#define IPC_MESSAGE_CONTROL4_EXTRA(msg_class, type1, type2, type3, type4) +#define IPC_MESSAGE_CONTROL5_EXTRA(msg_class, type1, type2, type3, type4, type5) +#define IPC_MESSAGE_ROUTED0_EXTRA(msg_class) +#define IPC_MESSAGE_ROUTED1_EXTRA(msg_class, type1) +#define IPC_MESSAGE_ROUTED2_EXTRA(msg_class, type1, type2) +#define IPC_MESSAGE_ROUTED3_EXTRA(msg_class, type1, type2, type3) +#define IPC_MESSAGE_ROUTED4_EXTRA(msg_class, type1, type2, type3, type4) +#define IPC_MESSAGE_ROUTED5_EXTRA(msg_class, type1, type2, type3, type4, type5) +#define IPC_SYNC_MESSAGE_CONTROL0_0_EXTRA(msg_class) +#define IPC_SYNC_MESSAGE_CONTROL0_1_EXTRA(msg_class, type1_out) +#define IPC_SYNC_MESSAGE_CONTROL0_2_EXTRA(msg_class, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_CONTROL0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_CONTROL1_0_EXTRA(msg_class, type1_in) +#define IPC_SYNC_MESSAGE_CONTROL1_1_EXTRA(msg_class, type1_in, type1_out) +#define IPC_SYNC_MESSAGE_CONTROL1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_CONTROL1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_CONTROL2_0_EXTRA(msg_class, type1_in, type2_in) +#define IPC_SYNC_MESSAGE_CONTROL2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) +#define IPC_SYNC_MESSAGE_CONTROL2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_CONTROL2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_CONTROL3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) +#define IPC_SYNC_MESSAGE_CONTROL3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_CONTROL3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_CONTROL3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) +#define IPC_SYNC_MESSAGE_CONTROL4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) +#define IPC_SYNC_MESSAGE_CONTROL4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED0_0_EXTRA(msg_class) +#define IPC_SYNC_MESSAGE_ROUTED0_1_EXTRA(msg_class, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED0_2_EXTRA(msg_class, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_ROUTED1_0_EXTRA(msg_class, type1_in) +#define IPC_SYNC_MESSAGE_ROUTED1_1_EXTRA(msg_class, type1_in, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_ROUTED1_4_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) +#define IPC_SYNC_MESSAGE_ROUTED2_0_EXTRA(msg_class, type1_in, type2_in) +#define IPC_SYNC_MESSAGE_ROUTED2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_ROUTED3_0_EXTRA(msg_class, type1_in, type2_in, type3_in) +#define IPC_SYNC_MESSAGE_ROUTED3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_ROUTED3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) +#define IPC_SYNC_MESSAGE_ROUTED4_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in) +#define IPC_SYNC_MESSAGE_ROUTED4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED4_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_ROUTED5_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) +#define IPC_SYNC_MESSAGE_ROUTED5_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED5_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED5_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) + +#endif + +// Note: we currently use __LINE__ to give unique IDs to messages within a file. +// They're globally unique since each file defines its own IPC_MESSAGE_START. +// Ideally, we wouldn't use line numbers, but instead use the __COUNTER__ macro, +// but it needs gcc 4.3 and xcode doesn't use it yet. When that happens, switch +// to it. #define IPC_MESSAGE_CONTROL0(msg_class) \ class msg_class : public IPC::Message { \ public: \ - enum { ID = msg_class##__ID }; \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ msg_class() \ : IPC::Message(MSG_ROUTING_CONTROL, \ ID, \ PRIORITY_NORMAL) {} \ - }; + }; \ + IPC_MESSAGE_CONTROL0_EXTRA(msg_class) #define IPC_MESSAGE_CONTROL1(msg_class, type1) \ class msg_class : public IPC::MessageWithTuple< Tuple1<type1> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1& arg1); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_MESSAGE_CONTROL1_EXTRA(msg_class, type1) #define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ class msg_class : public IPC::MessageWithTuple< Tuple2<type1, type2> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1& arg1, const type2& arg2); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_MESSAGE_CONTROL2_EXTRA(msg_class, type1, type2) #define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ class msg_class : \ public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2, const type3& arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1& arg1, const type2& arg2, const type3& arg3); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_MESSAGE_CONTROL3_EXTRA(msg_class, type1, type2, type3) #define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ class msg_class : \ public IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2, const type3& arg3, \ - const type4& arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1& arg1, const type2& arg2, const type3& arg3, \ + const type4& arg4); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_MESSAGE_CONTROL4_EXTRA(msg_class, type1, type2, type3, type4) #define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \ class msg_class : \ public IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, \ type5> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4, const type5& arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1& arg1, const type2& arg2, \ + const type3& arg3, const type4& arg4, const type5& arg5); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_MESSAGE_CONTROL5_EXTRA(msg_class, type1, type2, type3, type4, type5) #define IPC_MESSAGE_ROUTED0(msg_class) \ class msg_class : public IPC::Message { \ public: \ - enum { ID = msg_class##__ID }; \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ msg_class(int32 routing_id) \ : IPC::Message(routing_id, ID, PRIORITY_NORMAL) {} \ - }; + }; \ + IPC_MESSAGE_ROUTED0_EXTRA(msg_class) #define IPC_MESSAGE_ROUTED1(msg_class, type1) \ class msg_class : public IPC::MessageWithTuple< Tuple1<type1> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int32 routing_id, const type1& arg1); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_MESSAGE_ROUTED1_EXTRA(msg_class, type1) #define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ class msg_class \ : public IPC::MessageWithTuple< Tuple2<type1, type2> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_MESSAGE_ROUTED2_EXTRA(msg_class, type1, type2) #define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ class msg_class \ : public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ + const type3& arg3); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_MESSAGE_ROUTED3_EXTRA(msg_class, type1, type2, type3) #define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ class msg_class \ : public IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ + const type3& arg3, const type4& arg4); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_MESSAGE_ROUTED4_EXTRA(msg_class, type1, type2, type3, type4) #define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \ class msg_class \ : public IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, \ type5> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4, const type5& arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ + const type3& arg3, const type4& arg4, const type5& arg5); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_MESSAGE_ROUTED5_EXTRA(msg_class, type1, type2, type3, type4, type5) #define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \ class msg_class : public IPC::MessageWithReply<Tuple0, Tuple0 > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL0_0_EXTRA(msg_class) #define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ class msg_class : public IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> > {\ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(type1_out* arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(type1_out* arg1); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL0_1_EXTRA(msg_class, type1_out) #define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(type1_out* arg1, type2_out* arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(type1_out* arg1, type2_out* arg2); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL0_2_EXTRA(msg_class, type1_out, type2_out) #define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, type3_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple0, \ Tuple3<type1_out&, type2_out&, type3_out&> >{ \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) #define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \ class msg_class : \ public IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL1_0_EXTRA(msg_class, type1_in) #define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, type1_out* arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, type1_out* arg2); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL1_1_EXTRA(msg_class, type1_in, type1_out) #define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) #define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple1<type1_in>, \ Tuple3<type1_out&, type2_out&, type3_out&> >{ \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) #define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \ class msg_class : \ public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, const type2_in& arg2); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL2_0_EXTRA(msg_class, type1_in, type2_in) #define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + public: \ + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) #define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ Tuple2<type1_out&, type2_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) #define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) #define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ Tuple1<type1_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) #define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ Tuple2<type1_out&, type2_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) #define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) #define IPC_SYNC_MESSAGE_CONTROL3_4(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6, type4_out* arg7); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6, type4_out* arg7); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) #define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ Tuple1<type1_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) #define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ Tuple2<type1_out&, type2_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_CONTROL4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) #define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \ class msg_class : public IPC::MessageWithReply<Tuple0, Tuple0 > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED0_0_EXTRA(msg_class) #define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \ class msg_class : public IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, type1_out* arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, type1_out* arg1); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED0_1_EXTRA(msg_class, type1_out) #define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, type1_out* arg1, type2_out* arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, type1_out* arg1, type2_out* arg2); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED0_2_EXTRA(msg_class, type1_out, type2_out) #define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, type3_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple0, \ Tuple3<type1_out&, type2_out&, type3_out&> >{ \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, type1_out* arg1, type2_out* arg2, type3_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, type1_out* arg1, type2_out* arg2, type3_out* arg3); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED0_3_EXTRA(msg_class, type1_out, type2_out, type3_out) #define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in) \ class msg_class : \ public IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED1_0_EXTRA(msg_class, type1_in) #define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, type1_out* arg2); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED1_1_EXTRA(msg_class, type1_in, type1_out) #define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, type2_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED1_2_EXTRA(msg_class, type1_in, type1_out, type2_out) #define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple1<type1_in>, \ Tuple3<type1_out&, type2_out&, type3_out&> >{ \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED1_3_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out) #define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple1<type1_in>, \ Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >{ \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4, type4_out* arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4, type4_out* arg5); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED1_4_EXTRA(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) #define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in) \ class msg_class : \ public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED2_0_EXTRA(msg_class, type1_in, type2_in) #define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, type1_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED2_1_EXTRA(msg_class, type1_in, type2_in, type1_out) #define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ Tuple2<type1_out&, type2_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED2_2_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out) #define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED2_3_EXTRA(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) #define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, type3_in) \ class msg_class : \ public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, Tuple0 > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED3_0_EXTRA(msg_class, type1_in, type2_in, type3_in) #define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ Tuple1<type1_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED3_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out) #define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ Tuple2<type1_out&, type2_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED3_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) #define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED3_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) #define IPC_SYNC_MESSAGE_ROUTED3_4(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6, type4_out* arg7); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6, type4_out* arg7); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED3_4_EXTRA(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out, type4_out) #define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, type3_in, type4_in) \ class msg_class : \ public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ Tuple0 > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED4_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in) #define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ Tuple1<type1_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED4_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) #define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ Tuple2<type1_out&, type2_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED4_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) #define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6, type3_out* arg7); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6, type3_out* arg7); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED4_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) #define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) \ class msg_class : \ public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ Tuple0 > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED5_0_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) #define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ Tuple1<type1_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5, type1_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5, type1_out* arg6); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED5_1_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) #define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ Tuple2<type1_out&, type2_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED5_2_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) #define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) \ class msg_class : \ public IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7, type3_out* arg8); \ - ~msg_class(); \ - static void Log(const Message* msg, std::string* l); \ - }; + enum { ID = (IPC_MESSAGE_START << 16) + __LINE__ }; \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7, type3_out* arg8); \ + ~msg_class(); \ + static void Log(std::string* name, const Message* msg, std::string* l); \ + }; \ + IPC_SYNC_MESSAGE_ROUTED5_3_EXTRA(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) + + + +// Message crackers and handlers. +// Prefer to use the IPC_BEGIN_MESSAGE_MAP_EX to the older macros since they +// allow you to detect when a message could not be de-serialized. Usage: +// +// void MyClass::OnMessageReceived(const IPC::Message& msg) { +// bool msg_is_good = false; +// IPC_BEGIN_MESSAGE_MAP_EX(MyClass, msg, msg_is_good) +// IPC_MESSAGE_HANDLER(MsgClassOne, OnMsgClassOne) +// ...more handlers here ... +// IPC_MESSAGE_HANDLER(MsgClassTen, OnMsgClassTen) +// IPC_END_MESSAGE_MAP_EX() +// if (!msg_is_good) { +// // Signal error here or terminate offending process. +// } +// } + + +#define IPC_DEFINE_MESSAGE_MAP(class_name) \ +void class_name::OnMessageReceived(const IPC::Message& msg) \ + IPC_BEGIN_MESSAGE_MAP(class_name, msg) + +#define IPC_BEGIN_MESSAGE_MAP_EX(class_name, msg, msg_is_ok) \ + { \ + typedef class_name _IpcMessageHandlerClass; \ + const IPC::Message& ipc_message__ = msg; \ + bool& msg_is_ok__ = msg_is_ok; \ + switch (ipc_message__.type()) { \ + +#define IPC_BEGIN_MESSAGE_MAP(class_name, msg) \ + { \ + typedef class_name _IpcMessageHandlerClass; \ + const IPC::Message& ipc_message__ = msg; \ + bool msg_is_ok__ = true; \ + switch (ipc_message__.type()) { \ -#endif // #if defined() +#define IPC_MESSAGE_FORWARD(msg_class, obj, member_func) \ + case msg_class::ID: \ + msg_is_ok__ = msg_class::Dispatch(&ipc_message__, obj, &member_func); \ + break; + +#define IPC_MESSAGE_HANDLER(msg_class, member_func) \ + IPC_MESSAGE_FORWARD(msg_class, this, _IpcMessageHandlerClass::member_func) + +#define IPC_MESSAGE_FORWARD_DELAY_REPLY(msg_class, obj, member_func) \ + case msg_class::ID: \ + msg_class::DispatchDelayReply(&ipc_message__, obj, &member_func); \ + break; + +#define IPC_MESSAGE_HANDLER_DELAY_REPLY(msg_class, member_func) \ + IPC_MESSAGE_FORWARD_DELAY_REPLY(msg_class, this, \ + _IpcMessageHandlerClass::member_func) + +#define IPC_MESSAGE_HANDLER_GENERIC(msg_class, code) \ + case msg_class::ID: \ + code; \ + break; + +#define IPC_REPLY_HANDLER(func) \ + case IPC_REPLY_ID: \ + func(ipc_message__); \ + break; + + +#define IPC_MESSAGE_UNHANDLED(code) \ + default: \ + code; \ + break; + +#define IPC_MESSAGE_UNHANDLED_ERROR() \ + IPC_MESSAGE_UNHANDLED(NOTREACHED() << \ + "Invalid message with type = " << \ + ipc_message__.type()) + +#define IPC_END_MESSAGE_MAP() \ + DCHECK(msg_is_ok__); \ + } \ +} + +#define IPC_END_MESSAGE_MAP_EX() \ + } \ +}
\ No newline at end of file diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h index 7d8cf4f..8e0f670 100644 --- a/ipc/ipc_message_utils.h +++ b/ipc/ipc_message_utils.h @@ -46,41 +46,19 @@ // base. Messages have unique IDs across channels in order for the IPC logging // code to figure out the message class from its ID. enum IPCMessageStart { - // By using a start value of 0 for automation messages, we keep backward - // compatibility with old builds. AutomationMsgStart = 0, ViewMsgStart, - ViewHostMsgStart, - PluginProcessMsgStart, - PluginProcessHostMsgStart, PluginMsgStart, - PluginHostMsgStart, - ProfileImportProcessMsgStart, - ProfileImportProcessHostMsgStart, - NPObjectMsgStart, + ProfileImportMsgStart, TestMsgStart, - DevToolsAgentMsgStart, - DevToolsClientMsgStart, - WorkerProcessMsgStart, - WorkerProcessHostMsgStart, + DevToolsMsgStart, WorkerMsgStart, - WorkerHostMsgStart, - NaClProcessMsgStart, - GpuCommandBufferMsgStart, + NaClMsgStart, UtilityMsgStart, - UtilityHostMsgStart, GpuMsgStart, - GpuHostMsgStart, - GpuChannelMsgStart, - GpuVideoDecoderHostMsgStart, - GpuVideoDecoderMsgStart, ServiceMsgStart, - ServiceHostMsgStart, PpapiMsgStart, - PpapiHostMsgStart, - // NOTE: When you add a new message class, also update - // IPCStatusView::IPCStatusView to ensure logging works. - LastMsgIndex + FirefoxImporterUnittestMsgStart, }; class DictionaryValue; diff --git a/ipc/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc index bf21917..5617146 100644 --- a/ipc/ipc_sync_channel_unittest.cc +++ b/ipc/ipc_sync_channel_unittest.cc @@ -20,16 +20,9 @@ #include "ipc/ipc_message.h" #include "ipc/ipc_sync_channel.h" #include "ipc/ipc_sync_message_filter.h" +#include "ipc/ipc_sync_message_unittest.h" #include "testing/gtest/include/gtest/gtest.h" - -#define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h" -#include "ipc/ipc_message_macros.h" - -// Definition of IPC Messages used for this test. -#define MESSAGES_INTERNAL_IMPL_FILE "ipc/ipc_sync_message_unittest.h" -#include "ipc/ipc_message_impl_macros.h" - using namespace IPC; using base::WaitableEvent; diff --git a/ipc/ipc_sync_message_unittest.cc b/ipc/ipc_sync_message_unittest.cc index d214cfc..e64e0c3 100644 --- a/ipc/ipc_sync_message_unittest.cc +++ b/ipc/ipc_sync_message_unittest.cc @@ -14,9 +14,8 @@ #include "base/logging.h" #include "testing/gtest/include/gtest/gtest.h" - -#define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h" -#include "ipc/ipc_message_macros.h" +#define IPC_MESSAGE_IMPL +#include "ipc/ipc_sync_message_unittest.h" static IPC::Message* g_reply; diff --git a/ipc/ipc_sync_message_unittest.h b/ipc/ipc_sync_message_unittest.h index d247428..d5c6905 100644 --- a/ipc/ipc_sync_message_unittest.h +++ b/ipc/ipc_sync_message_unittest.h @@ -6,107 +6,106 @@ #include "ipc/ipc_message_macros.h" -IPC_BEGIN_MESSAGES(Test) - IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_NoArgs) +#define IPC_MESSAGE_START TestMsgStart - IPC_SYNC_MESSAGE_CONTROL0_1(SyncChannelTestMsg_AnswerToLife, - int /* answer */) +IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_NoArgs) - IPC_SYNC_MESSAGE_CONTROL1_1(SyncChannelTestMsg_Double, - int /* in */, - int /* out */) +IPC_SYNC_MESSAGE_CONTROL0_1(SyncChannelTestMsg_AnswerToLife, + int /* answer */) - IPC_SYNC_MESSAGE_CONTROL0_1(SyncChannelNestedTestMsg_String, - std::string) +IPC_SYNC_MESSAGE_CONTROL1_1(SyncChannelTestMsg_Double, + int /* in */, + int /* out */) - // out1 is false - IPC_SYNC_MESSAGE_CONTROL0_1(Msg_C_0_1, bool) +IPC_SYNC_MESSAGE_CONTROL0_1(SyncChannelNestedTestMsg_String, + std::string) - // out1 is true, out2 is 2 - IPC_SYNC_MESSAGE_CONTROL0_2(Msg_C_0_2, bool, int) +// out1 is false +IPC_SYNC_MESSAGE_CONTROL0_1(Msg_C_0_1, bool) - // out1 is false, out2 is 3, out3 is "0_3" - IPC_SYNC_MESSAGE_CONTROL0_3(Msg_C_0_3, bool, int, std::string) +// out1 is true, out2 is 2 +IPC_SYNC_MESSAGE_CONTROL0_2(Msg_C_0_2, bool, int) - // in1 must be 1, out1 is true - IPC_SYNC_MESSAGE_CONTROL1_1(Msg_C_1_1, int, bool) +// out1 is false, out2 is 3, out3 is "0_3" +IPC_SYNC_MESSAGE_CONTROL0_3(Msg_C_0_3, bool, int, std::string) - // in1 must be false, out1 is true, out2 is 12 - IPC_SYNC_MESSAGE_CONTROL1_2(Msg_C_1_2, bool, bool, int) +// in1 must be 1, out1 is true +IPC_SYNC_MESSAGE_CONTROL1_1(Msg_C_1_1, int, bool) - // in1 must be 3, out1 is "1_3", out2 is 13, out3 is false - IPC_SYNC_MESSAGE_CONTROL1_3(Msg_C_1_3, int, std::string, int, bool) +// in1 must be false, out1 is true, out2 is 12 +IPC_SYNC_MESSAGE_CONTROL1_2(Msg_C_1_2, bool, bool, int) - // in1 must be 1, in2 must be false, out1 is true - IPC_SYNC_MESSAGE_CONTROL2_1(Msg_C_2_1, int, bool, bool) +// in1 must be 3, out1 is "1_3", out2 is 13, out3 is false +IPC_SYNC_MESSAGE_CONTROL1_3(Msg_C_1_3, int, std::string, int, bool) - // in1 must be false, in2 must be 2, out1 is true, out2 is 22 - IPC_SYNC_MESSAGE_CONTROL2_2(Msg_C_2_2, bool, int, bool, int) +// in1 must be 1, in2 must be false, out1 is true +IPC_SYNC_MESSAGE_CONTROL2_1(Msg_C_2_1, int, bool, bool) - // in1 must be 3, in2 must be true, out1 is "2_3", out2 is 23, out3 is false - IPC_SYNC_MESSAGE_CONTROL2_3(Msg_C_2_3, int, bool, std::string, int, bool) +// in1 must be false, in2 must be 2, out1 is true, out2 is 22 +IPC_SYNC_MESSAGE_CONTROL2_2(Msg_C_2_2, bool, int, bool, int) - // in1 must be 1, in2 must be false, in3 must be "3_1", out1 is true - IPC_SYNC_MESSAGE_CONTROL3_1(Msg_C_3_1, int, bool, std::string, bool) +// in1 must be 3, in2 must be true, out1 is "2_3", out2 is 23, out3 is false +IPC_SYNC_MESSAGE_CONTROL2_3(Msg_C_2_3, int, bool, std::string, int, bool) - // in1 must be "3_3", in2 must be false, in3 must be 2, out1 is true, out2 is - // 32 - IPC_SYNC_MESSAGE_CONTROL3_2(Msg_C_3_2, std::string, bool, int, bool, int) +// in1 must be 1, in2 must be false, in3 must be "3_1", out1 is true +IPC_SYNC_MESSAGE_CONTROL3_1(Msg_C_3_1, int, bool, std::string, bool) - // in1 must be 3, in2 must be "3_3", in3 must be true, out1 is "3_3", out2 is - // 33, out3 is false - IPC_SYNC_MESSAGE_CONTROL3_3(Msg_C_3_3, int, std::string, bool, std::string, - int, bool) +// in1 must be "3_3", in2 must be false, in3 must be 2, out1 is true, out2 is +// 32 +IPC_SYNC_MESSAGE_CONTROL3_2(Msg_C_3_2, std::string, bool, int, bool, int) - // in1 must be true, in2 must be 3, in3 must be "3_4", out1 is 34, out2 is - // true, out3 is "3_4", out3 is false - IPC_SYNC_MESSAGE_CONTROL3_4(Msg_C_3_4, bool, int, std::string, int, bool, - std::string, bool) +// in1 must be 3, in2 must be "3_3", in3 must be true, out1 is "3_3", out2 is +// 33, out3 is false +IPC_SYNC_MESSAGE_CONTROL3_3(Msg_C_3_3, int, std::string, bool, std::string, + int, bool) - // NOTE: routed messages are just a copy of the above... +// in1 must be true, in2 must be 3, in3 must be "3_4", out1 is 34, out2 is +// true, out3 is "3_4", out3 is false +IPC_SYNC_MESSAGE_CONTROL3_4(Msg_C_3_4, bool, int, std::string, int, bool, + std::string, bool) - // out1 is false - IPC_SYNC_MESSAGE_ROUTED0_1(Msg_R_0_1, bool) +// NOTE: routed messages are just a copy of the above... - // out1 is true, out2 is 2 - IPC_SYNC_MESSAGE_ROUTED0_2(Msg_R_0_2, bool, int) +// out1 is false +IPC_SYNC_MESSAGE_ROUTED0_1(Msg_R_0_1, bool) - // out1 is false, out2 is 3, out3 is "0_3" - IPC_SYNC_MESSAGE_ROUTED0_3(Msg_R_0_3, bool, int, std::string) +// out1 is true, out2 is 2 +IPC_SYNC_MESSAGE_ROUTED0_2(Msg_R_0_2, bool, int) - // in1 must be 1, out1 is true - IPC_SYNC_MESSAGE_ROUTED1_1(Msg_R_1_1, int, bool) +// out1 is false, out2 is 3, out3 is "0_3" +IPC_SYNC_MESSAGE_ROUTED0_3(Msg_R_0_3, bool, int, std::string) - // in1 must be false, out1 is true, out2 is 12 - IPC_SYNC_MESSAGE_ROUTED1_2(Msg_R_1_2, bool, bool, int) +// in1 must be 1, out1 is true +IPC_SYNC_MESSAGE_ROUTED1_1(Msg_R_1_1, int, bool) - // in1 must be 3, out1 is "1_3", out2 is 13, out3 is false - IPC_SYNC_MESSAGE_ROUTED1_3(Msg_R_1_3, int, std::string, int, bool) +// in1 must be false, out1 is true, out2 is 12 +IPC_SYNC_MESSAGE_ROUTED1_2(Msg_R_1_2, bool, bool, int) - // in1 must be 1, in2 must be false, out1 is true - IPC_SYNC_MESSAGE_ROUTED2_1(Msg_R_2_1, int, bool, bool) +// in1 must be 3, out1 is "1_3", out2 is 13, out3 is false +IPC_SYNC_MESSAGE_ROUTED1_3(Msg_R_1_3, int, std::string, int, bool) - // in1 must be false, in2 must be 2, out1 is true, out2 is 22 - IPC_SYNC_MESSAGE_ROUTED2_2(Msg_R_2_2, bool, int, bool, int) +// in1 must be 1, in2 must be false, out1 is true +IPC_SYNC_MESSAGE_ROUTED2_1(Msg_R_2_1, int, bool, bool) - // in1 must be 3, in2 must be true, out1 is "2_3", out2 is 23, out3 is false - IPC_SYNC_MESSAGE_ROUTED2_3(Msg_R_2_3, int, bool, std::string, int, bool) +// in1 must be false, in2 must be 2, out1 is true, out2 is 22 +IPC_SYNC_MESSAGE_ROUTED2_2(Msg_R_2_2, bool, int, bool, int) - // in1 must be 1, in2 must be false, in3 must be "3_1", out1 is true - IPC_SYNC_MESSAGE_ROUTED3_1(Msg_R_3_1, int, bool, std::string, bool) +// in1 must be 3, in2 must be true, out1 is "2_3", out2 is 23, out3 is false +IPC_SYNC_MESSAGE_ROUTED2_3(Msg_R_2_3, int, bool, std::string, int, bool) - // in1 must be "3_3", in2 must be false, in3 must be 2, out1 is true, out2 - // is 32 - IPC_SYNC_MESSAGE_ROUTED3_2(Msg_R_3_2, std::string, bool, int, bool, int) +// in1 must be 1, in2 must be false, in3 must be "3_1", out1 is true +IPC_SYNC_MESSAGE_ROUTED3_1(Msg_R_3_1, int, bool, std::string, bool) - // in1 must be 3, in2 must be "3_3", in3 must be true, out1 is "3_3", out2 is - // 33, out3 is false - IPC_SYNC_MESSAGE_ROUTED3_3(Msg_R_3_3, int, std::string, bool, std::string, - int, bool) +// in1 must be "3_3", in2 must be false, in3 must be 2, out1 is true, out2 +// is 32 +IPC_SYNC_MESSAGE_ROUTED3_2(Msg_R_3_2, std::string, bool, int, bool, int) - // in1 must be true, in2 must be 3, in3 must be "3_4", out1 is 34, out2 is - // true, out3 is "3_4", out4 is false - IPC_SYNC_MESSAGE_ROUTED3_4(Msg_R_3_4, bool, int, std::string, int, bool, - std::string, bool) +// in1 must be 3, in2 must be "3_3", in3 must be true, out1 is "3_3", out2 is +// 33, out3 is false +IPC_SYNC_MESSAGE_ROUTED3_3(Msg_R_3_3, int, std::string, bool, std::string, + int, bool) -IPC_END_MESSAGES(Test) +// in1 must be true, in2 must be 3, in3 must be "3_4", out1 is 34, out2 is +// true, out3 is "3_4", out4 is false +IPC_SYNC_MESSAGE_ROUTED3_4(Msg_R_3_4, bool, int, std::string, int, bool, + std::string, bool) diff --git a/ipc/sync_socket_unittest.cc b/ipc/sync_socket_unittest.cc index 5775d9b..9448487 100644 --- a/ipc/sync_socket_unittest.cc +++ b/ipc/sync_socket_unittest.cc @@ -24,8 +24,7 @@ // We don't actually use the messages defined in this file, but we do this // to get to the IPC macros. -#define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h" -#include "ipc/ipc_message_macros.h" +#include "ipc/ipc_sync_message_unittest.h" enum IPCMessageIds { UNUSED_IPC_TYPE, diff --git a/ppapi/proxy/ppapi_messages.cc b/ppapi/proxy/ppapi_messages.cc index da3601f..a7c0a0d 100644 --- a/ppapi/proxy/ppapi_messages.cc +++ b/ppapi/proxy/ppapi_messages.cc @@ -2,13 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "ppapi/proxy/ppapi_messages.h" - #include "base/file_path.h" #include "ipc/ipc_channel_handle.h" -#include "ppapi/c/dev/pp_file_info_dev.h" -#include "ppapi/c/ppb_var.h" -// This actually defines the implementations of all the IPC message functions. -#define MESSAGES_INTERNAL_IMPL_FILE "ppapi/proxy/ppapi_messages_internal.h" -#include "ipc/ipc_message_impl_macros.h" +#define IPC_MESSAGE_IMPL +#include "ppapi/proxy/ppapi_messages.h" diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index dd2b246..af2ebe8 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -23,7 +23,6 @@ #include "ppapi/proxy/ppapi_param_traits.h" #include "ppapi/proxy/serialized_structs.h" -#define MESSAGES_INTERNAL_FILE "ppapi/proxy/ppapi_messages_internal.h" -#include "ipc/ipc_message_macros.h" +#include "ppapi/proxy/ppapi_messages_internal.h" #endif // PPAPI_PROXY_PPAPI_MESSAGES_H_ diff --git a/ppapi/proxy/ppapi_messages_internal.h b/ppapi/proxy/ppapi_messages_internal.h index 5e9ad61..e9542a2 100644 --- a/ppapi/proxy/ppapi_messages_internal.h +++ b/ppapi/proxy/ppapi_messages_internal.h @@ -2,539 +2,531 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This header is meant to be included in multiple passes, hence no traditional -// header guard. It is included by backing_store_messages_internal.h -// See ipc_message_macros.h for explanation of the macros and passes. - -// This file needs to be included again, even though we're actually included -// from it via utility_messages.h. #include "ipc/ipc_message_macros.h" +#include "ppapi/c/dev/pp_file_info_dev.h" +#include "ppapi/c/ppb_var.h" + +#define IPC_MESSAGE_START PpapiMsgStart // These are from the plugin to the renderer -IPC_BEGIN_MESSAGES(Ppapi) - // Loads the given plugin. - IPC_MESSAGE_CONTROL3(PpapiMsg_LoadPlugin, - base::ProcessHandle /* host_process_handle */, - FilePath /* path */, - int /* renderer_id */) - - IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_InitializeModule, - PP_Module /* module_id */, - bool /* result */) - - IPC_MESSAGE_CONTROL0(PpapiMsg_Shutdown) - - // Sent in both directions to see if the other side supports the given - // interface. - IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_SupportsInterface, - std::string /* interface_name */, - bool /* result */) - - // Way for the renderer to list all interfaces that is supports in advance to - // avoid extra IPC traffic. - IPC_MESSAGE_CONTROL1(PpapiMsg_DeclareInterfaces, - std::vector<std::string> /* interfaces */) - - IPC_MESSAGE_CONTROL2(PpapiMsg_ExecuteCallback, - uint32 /* serialized_callback */, - int32 /* param */) - - // PPB_Audio. - - // Notifies the result of the audio stream create call. This is called in - // both error cases and in the normal success case. These cases are - // differentiated by the result code, which is one of the standard PPAPI - // result codes. - // - // The handler of this message should always close all of the handles passed - // in, since some could be valid even in the error case. - IPC_MESSAGE_ROUTED5(PpapiMsg_PPBAudio_NotifyAudioStreamCreated, - PP_Resource /* audio_id */, - int32_t /* result_code (will be != PP_OK on failure) */, - IPC::PlatformFileForTransit /* socket_handle */, - base::SharedMemoryHandle /* handle */, - int32_t /* length */) - - // PPB_Graphics2D. - IPC_MESSAGE_ROUTED2(PpapiMsg_PPBGraphics2D_FlushACK, - PP_Resource /* graphics_2d */, - int32_t /* pp_error */) - - // PPP_Class. - IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_HasProperty, - int64 /* ppp_class */, - int64 /* object */, - pp::proxy::SerializedVar /* property */, - pp::proxy::SerializedVar /* out_exception */, - bool /* result */) - IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_HasMethod, - int64 /* ppp_class */, - int64 /* object */, - pp::proxy::SerializedVar /* method */, - pp::proxy::SerializedVar /* out_exception */, - bool /* result */) - IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_GetProperty, - int64 /* ppp_class */, - int64 /* object */, - pp::proxy::SerializedVar /* property */, - pp::proxy::SerializedVar /* out_exception */, - pp::proxy::SerializedVar /* result */) - IPC_SYNC_MESSAGE_ROUTED2_2(PpapiMsg_PPPClass_EnumerateProperties, - int64 /* ppp_class */, - int64 /* object */, - std::vector<pp::proxy::SerializedVar> /* props */, - pp::proxy::SerializedVar /* out_exception */) - IPC_SYNC_MESSAGE_ROUTED4_1(PpapiMsg_PPPClass_SetProperty, - int64 /* ppp_class */, - int64 /* object */, - pp::proxy::SerializedVar /* name */, - pp::proxy::SerializedVar /* value */, - pp::proxy::SerializedVar /* out_exception */) - IPC_SYNC_MESSAGE_ROUTED3_1(PpapiMsg_PPPClass_RemoveProperty, - int64 /* ppp_class */, - int64 /* object */, - pp::proxy::SerializedVar /* property */, - pp::proxy::SerializedVar /* out_exception */) - IPC_SYNC_MESSAGE_ROUTED4_2(PpapiMsg_PPPClass_Call, - int64 /* ppp_class */, - int64 /* object */, - pp::proxy::SerializedVar /* method_name */, - std::vector<pp::proxy::SerializedVar> /* args */, - pp::proxy::SerializedVar /* out_exception */, - pp::proxy::SerializedVar /* result */) - IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_Construct, - int64 /* ppp_class */, - int64 /* object */, - std::vector<pp::proxy::SerializedVar> /* args */, - pp::proxy::SerializedVar /* out_exception */, - pp::proxy::SerializedVar /* result */) - IPC_MESSAGE_ROUTED2(PpapiMsg_PPPClass_Deallocate, - int64 /* ppp_class */, - int64 /* object */) - - // PPP_Instance. - IPC_SYNC_MESSAGE_ROUTED3_1(PpapiMsg_PPPInstance_DidCreate, - PP_Instance /* instance */, - std::vector<std::string> /* argn */, - std::vector<std::string> /* argv */, - PP_Bool /* result */) - IPC_MESSAGE_ROUTED1(PpapiMsg_PPPInstance_DidDestroy, - PP_Instance /* instance */) - IPC_MESSAGE_ROUTED3(PpapiMsg_PPPInstance_DidChangeView, - PP_Instance /* instance */, - PP_Rect /* position */, - PP_Rect /* clip */) - IPC_MESSAGE_ROUTED2(PpapiMsg_PPPInstance_DidChangeFocus, - PP_Instance /* instance */, - PP_Bool /* has_focus */) - IPC_SYNC_MESSAGE_ROUTED2_1(PpapiMsg_PPPInstance_HandleInputEvent, - PP_Instance /* instance */, - PP_InputEvent /* event */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED2_1(PpapiMsg_PPPInstance_HandleDocumentLoad, - PP_Instance /* instance */, - PP_Resource /* url_loader */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiMsg_PPPInstance_GetInstanceObject, - PP_Instance /* instance */, - pp::proxy::SerializedVar /* result */) - - - // PPB_URLLoader - // (Messages from browser to plugin to notify it of changes in state.) - IPC_MESSAGE_ROUTED5(PpapiMsg_PPBURLLoader_UpdateProgress, - PP_Resource /* resource */, - int64 /* bytes_sent */, - int64 /* total_bytes_to_be_sent */, - int64 /* bytes_received */, - int64 /* total_bytes_to_be_received */) - IPC_MESSAGE_ROUTED3(PpapiMsg_PPBURLLoader_ReadResponseBody_Ack, - PP_Resource /* loader */, - int32 /* result */, - std::string /* data */) -IPC_END_MESSAGES(Ppapi) +// Loads the given plugin. +IPC_MESSAGE_CONTROL3(PpapiMsg_LoadPlugin, + base::ProcessHandle /* host_process_handle */, + FilePath /* path */, + int /* renderer_id */) + +IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_InitializeModule, + PP_Module /* module_id */, + bool /* result */) + +IPC_MESSAGE_CONTROL0(PpapiMsg_Shutdown) + +// Sent in both directions to see if the other side supports the given +// interface. +IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_SupportsInterface, + std::string /* interface_name */, + bool /* result */) + +// Way for the renderer to list all interfaces that is supports in advance to +// avoid extra IPC traffic. +IPC_MESSAGE_CONTROL1(PpapiMsg_DeclareInterfaces, + std::vector<std::string> /* interfaces */) + +IPC_MESSAGE_CONTROL2(PpapiMsg_ExecuteCallback, + uint32 /* serialized_callback */, + int32 /* param */) + +// PPB_Audio. + +// Notifies the result of the audio stream create call. This is called in +// both error cases and in the normal success case. These cases are +// differentiated by the result code, which is one of the standard PPAPI +// result codes. +// +// The handler of this message should always close all of the handles passed +// in, since some could be valid even in the error case. +IPC_MESSAGE_ROUTED5(PpapiMsg_PPBAudio_NotifyAudioStreamCreated, + PP_Resource /* audio_id */, + int32_t /* result_code (will be != PP_OK on failure) */, + IPC::PlatformFileForTransit /* socket_handle */, + base::SharedMemoryHandle /* handle */, + int32_t /* length */) + +// PPB_Graphics2D. +IPC_MESSAGE_ROUTED2(PpapiMsg_PPBGraphics2D_FlushACK, + PP_Resource /* graphics_2d */, + int32_t /* pp_error */) + +// PPP_Class. +IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_HasProperty, + int64 /* ppp_class */, + int64 /* object */, + pp::proxy::SerializedVar /* property */, + pp::proxy::SerializedVar /* out_exception */, + bool /* result */) +IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_HasMethod, + int64 /* ppp_class */, + int64 /* object */, + pp::proxy::SerializedVar /* method */, + pp::proxy::SerializedVar /* out_exception */, + bool /* result */) +IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_GetProperty, + int64 /* ppp_class */, + int64 /* object */, + pp::proxy::SerializedVar /* property */, + pp::proxy::SerializedVar /* out_exception */, + pp::proxy::SerializedVar /* result */) +IPC_SYNC_MESSAGE_ROUTED2_2(PpapiMsg_PPPClass_EnumerateProperties, + int64 /* ppp_class */, + int64 /* object */, + std::vector<pp::proxy::SerializedVar> /* props */, + pp::proxy::SerializedVar /* out_exception */) +IPC_SYNC_MESSAGE_ROUTED4_1(PpapiMsg_PPPClass_SetProperty, + int64 /* ppp_class */, + int64 /* object */, + pp::proxy::SerializedVar /* name */, + pp::proxy::SerializedVar /* value */, + pp::proxy::SerializedVar /* out_exception */) +IPC_SYNC_MESSAGE_ROUTED3_1(PpapiMsg_PPPClass_RemoveProperty, + int64 /* ppp_class */, + int64 /* object */, + pp::proxy::SerializedVar /* property */, + pp::proxy::SerializedVar /* out_exception */) +IPC_SYNC_MESSAGE_ROUTED4_2(PpapiMsg_PPPClass_Call, + int64 /* ppp_class */, + int64 /* object */, + pp::proxy::SerializedVar /* method_name */, + std::vector<pp::proxy::SerializedVar> /* args */, + pp::proxy::SerializedVar /* out_exception */, + pp::proxy::SerializedVar /* result */) +IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_Construct, + int64 /* ppp_class */, + int64 /* object */, + std::vector<pp::proxy::SerializedVar> /* args */, + pp::proxy::SerializedVar /* out_exception */, + pp::proxy::SerializedVar /* result */) +IPC_MESSAGE_ROUTED2(PpapiMsg_PPPClass_Deallocate, + int64 /* ppp_class */, + int64 /* object */) + +// PPP_Instance. +IPC_SYNC_MESSAGE_ROUTED3_1(PpapiMsg_PPPInstance_DidCreate, + PP_Instance /* instance */, + std::vector<std::string> /* argn */, + std::vector<std::string> /* argv */, + PP_Bool /* result */) +IPC_MESSAGE_ROUTED1(PpapiMsg_PPPInstance_DidDestroy, + PP_Instance /* instance */) +IPC_MESSAGE_ROUTED3(PpapiMsg_PPPInstance_DidChangeView, + PP_Instance /* instance */, + PP_Rect /* position */, + PP_Rect /* clip */) +IPC_MESSAGE_ROUTED2(PpapiMsg_PPPInstance_DidChangeFocus, + PP_Instance /* instance */, + PP_Bool /* has_focus */) +IPC_SYNC_MESSAGE_ROUTED2_1(PpapiMsg_PPPInstance_HandleInputEvent, + PP_Instance /* instance */, + PP_InputEvent /* event */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED2_1(PpapiMsg_PPPInstance_HandleDocumentLoad, + PP_Instance /* instance */, + PP_Resource /* url_loader */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiMsg_PPPInstance_GetInstanceObject, + PP_Instance /* instance */, + pp::proxy::SerializedVar /* result */) + + +// PPB_URLLoader +// (Messages from browser to plugin to notify it of changes in state.) +IPC_MESSAGE_ROUTED5(PpapiMsg_PPBURLLoader_UpdateProgress, + PP_Resource /* resource */, + int64 /* bytes_sent */, + int64 /* total_bytes_to_be_sent */, + int64 /* bytes_received */, + int64 /* total_bytes_to_be_received */) +IPC_MESSAGE_ROUTED3(PpapiMsg_PPBURLLoader_ReadResponseBody_Ack, + PP_Resource /* loader */, + int32 /* result */, + std::string /* data */) // ----------------------------------------------------------------------------- // These are from the plugin to the renderer. -IPC_BEGIN_MESSAGES(PpapiHost) - // Reply to PpapiMsg_LoadPlugin. - IPC_MESSAGE_CONTROL1(PpapiHostMsg_PluginLoaded, - IPC::ChannelHandle /* handle */) - - // PPB_Audio. - IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBAudio_Create, - PP_Instance /* instance_id */, - PP_Resource /* config_id */, - PP_Resource /* result */) - IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBAudio_StartOrStop, - PP_Resource /* audio_id */, - bool /* play */) - - // PPB_AudioConfig. - IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBAudioConfig_Create, - PP_Module /* module */, - int32_t /* sample_rate */, - uint32_t /* sample_frame_count */, - PP_Resource /* result */) - IPC_SYNC_MESSAGE_ROUTED1_1( - PpapiHostMsg_PPBAudioConfig_RecommendSampleFrameCount, - uint32_t /* requested */, - uint32_t /* result */) - - // PPB_Buffer. - IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBBuffer_Create, - PP_Module /* module */, - uint32_t /* size */, - PP_Resource /* result_resource */, - int32_t /* result_shm_handle */) - - // PPB_Core. - IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBCore_AddRefResource, PP_Resource) - IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBCore_ReleaseResource, PP_Resource) - - // PPB_CharSet. - IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBCharSet_UTF16ToCharSet, - string16 /* utf16 */, - std::string /* char_set */, - int32_t /* on_error */, - std::string /* output */, - bool /* output_is_success */) - IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBCharSet_CharSetToUTF16, - std::string /* input */, - std::string /* char_set */, - int32_t /* on_error */, - string16 /* output */, - bool /* output_is_success */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCharSet_GetDefaultCharSet, - PP_Module /* module */, - pp::proxy::SerializedVar /* result */) - - // PPB_CursorControl. - IPC_SYNC_MESSAGE_ROUTED4_1(PpapiHostMsg_PPBCursorControl_SetCursor, - PP_Instance /* instance */, - int32_t /* type */, - PP_Resource /* custom_image */, - PP_Point /* hot_spot */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCursorControl_LockCursor, - PP_Instance /* instance */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCursorControl_UnlockCursor, - PP_Instance /* instance */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCursorControl_HasCursorLock, - PP_Instance /* instance */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCursorControl_CanLockCursor, - PP_Instance /* instance */, - PP_Bool /* result */) - - // PPB_Flash. - IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, - PP_Instance /* instance */, - bool /* on_top */) - // This has to be synchronous becuase the caller may want to composite on - // top of the resulting text after the call is complete. - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBFlash_DrawGlyphs, - pp::proxy::PPBFlash_DrawGlyphs_Params /* params */, - bool /* result */) - IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFlash_GetProxyForURL, - PP_Module /* module */, - std::string /* url */, - pp::proxy::SerializedVar /* result */) - IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBFlash_OpenModuleLocalFile, - PP_Module /* module */, - std::string /* path */, - int32_t /* mode */, - IPC::PlatformFileForTransit /* file_handle */, - int32_t /* result */) - IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBFlash_RenameModuleLocalFile, - PP_Module /* module */, - std::string /* path_from */, - std::string /* path_to */, - int32_t /* result */) - IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBFlash_DeleteModuleLocalFileOrDir, - PP_Module /* module */, - std::string /* path */, - bool /* recursive */, - int32_t /* result */) - IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFlash_CreateModuleLocalDir, - PP_Module /* module */, - std::string /* path */, - int32_t /* result */) - IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBFlash_QueryModuleLocalFile, - PP_Module /* module */, - std::string /* path */, - PP_FileInfo_Dev /* info */, - int32_t /* result */) - IPC_SYNC_MESSAGE_ROUTED2_2( - PpapiHostMsg_PPBFlash_GetModuleLocalDirContents, - PP_Module /* module */, - std::string /* path */, - std::vector<pp::proxy::SerializedDirEntry> /* entries */, - int32_t /* result */) - IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBFlash_NavigateToURL, - PP_Instance /* instance */, - std::string /* url */, - std::string /* target */, - bool /* result */) - - // PPB_Font. - IPC_SYNC_MESSAGE_ROUTED2_3( - PpapiHostMsg_PPBFont_Create, - PP_Module /* pp_module */, - pp::proxy::SerializedFontDescription /* in_description */, - PP_Resource /* result */, - pp::proxy::SerializedFontDescription /* out_description */, - std::string /* out_metrics */) - IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFont_DrawTextAt, - pp::proxy::SerializedVar /* text */, - pp::proxy::PPBFont_DrawTextAt_Params /* params */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED4_1(PpapiHostMsg_PPBFont_MeasureText, - PP_Resource /* font */, - pp::proxy::SerializedVar /* text */, - PP_Bool /* text_is_rtl */, - PP_Bool /* override_direction */, - int32_t /* result */) - IPC_SYNC_MESSAGE_ROUTED5_1(PpapiHostMsg_PPBFont_CharacterOffsetForPixel, - PP_Resource /* font */, - pp::proxy::SerializedVar /* text */, - PP_Bool /* text_is_rtl */, - PP_Bool /* override_direction */, - int32_t /* pixel_pos */, - uint32_t /* result */) - IPC_SYNC_MESSAGE_ROUTED5_1(PpapiHostMsg_PPBFont_PixelOffsetForCharacter, - PP_Resource /* font */, - pp::proxy::SerializedVar /* text */, - PP_Bool /* text_is_rtl */, - PP_Bool /* override_direction */, - uint32_t /* char_offset */, - int32_t /* result */) - - // PPB_Fullscreen. - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBFullscreen_IsFullscreen, - PP_Instance /* instance */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFullscreen_SetFullscreen, - PP_Instance /* instance */, - PP_Bool /* fullscreen */, - PP_Bool /* result */) - - // PPB_Graphics2D. - IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBGraphics2D_Create, - PP_Module /* module */, - PP_Size /* size */, - PP_Bool /* is_always_opaque */, - PP_Resource /* result */) - IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBGraphics2D_PaintImageData, - PP_Resource /* graphics_2d */, - PP_Resource /* image_data */, - PP_Point /* top_left */, - bool /* src_rect_specified */, - PP_Rect /* src_rect */) - IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBGraphics2D_Scroll, - PP_Resource /* graphics_2d */, - bool /* clip_specified */, - PP_Rect /* clip */, - PP_Point /* amount */) - IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBGraphics2D_ReplaceContents, - PP_Resource /* graphics_2d */, - PP_Resource /* image_data */) - IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBGraphics2D_Flush, - PP_Resource /* graphics_2d */) - - // PPB_ImageData. - IPC_SYNC_MESSAGE_ROUTED0_1( - PpapiHostMsg_PPBImageData_GetNativeImageDataFormat, - int32 /* result_format */) - IPC_SYNC_MESSAGE_ROUTED1_1( - PpapiHostMsg_PPBImageData_IsImageDataFormatSupported, - int32 /* format */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED4_3(PpapiHostMsg_PPBImageData_Create, - PP_Module /* module */, - int32 /* format */, - PP_Size /* size */, - PP_Bool /* init_to_zero */, - PP_Resource /* result_resource */, - std::string /* image_data_desc */, - pp::proxy::ImageHandle /* result */) - - // PPB_Instance. - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_GetWindowObject, - PP_Instance /* instance */, - pp::proxy::SerializedVar /* result */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_GetOwnerElementObject, - PP_Instance /* instance */, - pp::proxy::SerializedVar /* result */) - IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBInstance_BindGraphics, - PP_Instance /* instance */, - PP_Resource /* device */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_IsFullFrame, - PP_Instance /* instance */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBInstance_ExecuteScript, - PP_Instance /* instance */, - pp::proxy::SerializedVar /* script */, - pp::proxy::SerializedVar /* out_exception */, - pp::proxy::SerializedVar /* result */) - - IPC_SYNC_MESSAGE_ROUTED3_1( - PpapiHostMsg_PPBPdf_GetFontFileWithFallback, - PP_Module /* module */, - pp::proxy::SerializedFontDescription /* description */, - int32_t /* charset */, - PP_Resource /* result */) - IPC_SYNC_MESSAGE_ROUTED2_1( - PpapiHostMsg_PPBPdf_GetFontTableForPrivateFontFile, - PP_Resource /* font_file */, - uint32_t /* table */, - std::string /* result */) - - // PPB_Testing. - IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBTesting_ReadImageData, - PP_Resource /* device_context_2d */, - PP_Resource /* image */, - PP_Point /* top_left */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED0_1(PpapiHostMsg_PPBTesting_RunMessageLoop, - bool /* dummy since there's no 0_0 variant */) - IPC_MESSAGE_ROUTED0(PpapiHostMsg_PPBTesting_QuitMessageLoop) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBTesting_GetLiveObjectCount, - PP_Module /* module */, - uint32 /* result */) - - // PPB_URLLoader. - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLLoader_Create, - PP_Instance /* instance */, - PP_Resource /* result */) - IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBURLLoader_Open, - PP_Resource /* loader */, - PP_Resource /*request_info */, - uint32_t /* serialized_callback */) - IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLLoader_FollowRedirect, - PP_Resource /* loader */, - uint32_t /* serialized_callback */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLLoader_GetResponseInfo, - PP_Resource /* loader */, - PP_Resource /* response_info_out */) - IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLLoader_ReadResponseBody, - PP_Resource /* loader */, - int32_t /* bytes_to_read */) - IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLLoader_FinishStreamingToFile, - PP_Resource /* loader */, - uint32_t /* serialized_callback */) - IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBURLLoader_Close, - PP_Resource /* loader */) - - // PPB_URLLoaderTrusted. - IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBURLLoaderTrusted_GrantUniversalAccess, - PP_Resource /* loader */) - - // PPB_URLRequestInfo. - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLRequestInfo_Create, - PP_Module /* module */, - PP_Resource /* result */) - IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBURLRequestInfo_SetProperty, - PP_Resource /* request */, - int32_t /* property */, - pp::proxy::SerializedVar /* value */) - IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody, - PP_Resource /* request */, - std::string /* data */) - IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBURLRequestInfo_AppendFileToBody, - PP_Resource /* request */, - PP_Resource /* file_ref */, - int64_t /* start_offset */, - int64_t /* number_of_bytes */, - double /* expected_last_modified_time */) - - // PPB_URLResponseInfo. - IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBURLResponseInfo_GetProperty, - PP_Resource /* response */, - int32_t /* property */, - pp::proxy::SerializedVar /* result */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef, - PP_Resource /* response */, - PP_Resource /* file_ref_result */) - - // PPB_Var. - IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVar_AddRefObject, - int64 /* object_id */) - IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVar_ReleaseObject, - int64 /* object_id */) - IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBVar_ConvertType, - PP_Instance /* instance */, - pp::proxy::SerializedVar /* var */, - int /* new_type */, - pp::proxy::SerializedVar /* exception */, - pp::proxy::SerializedVar /* result */) - IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBVar_DefineProperty, - pp::proxy::SerializedVar /* object */, - PP_ObjectProperty /* property */, - pp::proxy::SerializedVar /* out_exception */) - IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_HasProperty, - pp::proxy::SerializedVar /* object */, - pp::proxy::SerializedVar /* property */, - pp::proxy::SerializedVar /* out_exception */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_HasMethodDeprecated, - pp::proxy::SerializedVar /* object */, - pp::proxy::SerializedVar /* method */, - pp::proxy::SerializedVar /* out_exception */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_GetProperty, - pp::proxy::SerializedVar /* object */, - pp::proxy::SerializedVar /* property */, - pp::proxy::SerializedVar /* out_exception */, - pp::proxy::SerializedVar /* result */) - IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_DeleteProperty, - pp::proxy::SerializedVar /* object */, - pp::proxy::SerializedVar /* property */, - pp::proxy::SerializedVar /* out_exception */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED1_2(PpapiHostMsg_PPBVar_EnumerateProperties, - pp::proxy::SerializedVar /* object */, - std::vector<pp::proxy::SerializedVar> /* props */, - pp::proxy::SerializedVar /* out_exception */) - IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBVar_SetPropertyDeprecated, - pp::proxy::SerializedVar /* object */, - pp::proxy::SerializedVar /* name */, - pp::proxy::SerializedVar /* value */, - pp::proxy::SerializedVar /* out_exception */) - IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBVar_IsCallable, - pp::proxy::SerializedVar /* object */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED4_2(PpapiHostMsg_PPBVar_Call, - pp::proxy::SerializedVar /* object */, - pp::proxy::SerializedVar /* this_object */, - pp::proxy::SerializedVar /* method_name */, - std::vector<pp::proxy::SerializedVar> /* args */, - pp::proxy::SerializedVar /* out_exception */, - pp::proxy::SerializedVar /* result */) - IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBVar_CallDeprecated, - pp::proxy::SerializedVar /* object */, - pp::proxy::SerializedVar /* method_name */, - std::vector<pp::proxy::SerializedVar> /* args */, - pp::proxy::SerializedVar /* out_exception */, - pp::proxy::SerializedVar /* result */) - IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_Construct, - pp::proxy::SerializedVar /* object */, - std::vector<pp::proxy::SerializedVar> /* args */, - pp::proxy::SerializedVar /* out_exception */, - pp::proxy::SerializedVar /* result */) - IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_IsInstanceOfDeprecated, - pp::proxy::SerializedVar /* var */, - int64 /* object_class */, - int64 /* object-data */, - PP_Bool /* result */) - IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBVar_CreateObjectDeprecated, - PP_Module /* module */, - int64 /* object_class */, - int64 /* object_data */, - pp::proxy::SerializedVar /* result */) - -IPC_END_MESSAGES(PpapiHost) - +// Reply to PpapiMsg_LoadPlugin. +IPC_MESSAGE_CONTROL1(PpapiHostMsg_PluginLoaded, + IPC::ChannelHandle /* handle */) + +// PPB_Audio. +IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBAudio_Create, + PP_Instance /* instance_id */, + PP_Resource /* config_id */, + PP_Resource /* result */) +IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBAudio_StartOrStop, + PP_Resource /* audio_id */, + bool /* play */) + +// PPB_AudioConfig. +IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBAudioConfig_Create, + PP_Module /* module */, + int32_t /* sample_rate */, + uint32_t /* sample_frame_count */, + PP_Resource /* result */) +IPC_SYNC_MESSAGE_ROUTED1_1( + PpapiHostMsg_PPBAudioConfig_RecommendSampleFrameCount, + uint32_t /* requested */, + uint32_t /* result */) + +// PPB_Buffer. +IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBBuffer_Create, + PP_Module /* module */, + uint32_t /* size */, + PP_Resource /* result_resource */, + int32_t /* result_shm_handle */) + +// PPB_Core. +IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBCore_AddRefResource, PP_Resource) +IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBCore_ReleaseResource, PP_Resource) + +// PPB_CharSet. +IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBCharSet_UTF16ToCharSet, + string16 /* utf16 */, + std::string /* char_set */, + int32_t /* on_error */, + std::string /* output */, + bool /* output_is_success */) +IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBCharSet_CharSetToUTF16, + std::string /* input */, + std::string /* char_set */, + int32_t /* on_error */, + string16 /* output */, + bool /* output_is_success */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCharSet_GetDefaultCharSet, + PP_Module /* module */, + pp::proxy::SerializedVar /* result */) + +// PPB_CursorControl. +IPC_SYNC_MESSAGE_ROUTED4_1(PpapiHostMsg_PPBCursorControl_SetCursor, + PP_Instance /* instance */, + int32_t /* type */, + PP_Resource /* custom_image */, + PP_Point /* hot_spot */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCursorControl_LockCursor, + PP_Instance /* instance */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCursorControl_UnlockCursor, + PP_Instance /* instance */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCursorControl_HasCursorLock, + PP_Instance /* instance */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBCursorControl_CanLockCursor, + PP_Instance /* instance */, + PP_Bool /* result */) + +// PPB_Flash. +IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop, + PP_Instance /* instance */, + bool /* on_top */) +// This has to be synchronous becuase the caller may want to composite on +// top of the resulting text after the call is complete. +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBFlash_DrawGlyphs, + pp::proxy::PPBFlash_DrawGlyphs_Params /* params */, + bool /* result */) +IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFlash_GetProxyForURL, + PP_Module /* module */, + std::string /* url */, + pp::proxy::SerializedVar /* result */) +IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBFlash_OpenModuleLocalFile, + PP_Module /* module */, + std::string /* path */, + int32_t /* mode */, + IPC::PlatformFileForTransit /* file_handle */, + int32_t /* result */) +IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBFlash_RenameModuleLocalFile, + PP_Module /* module */, + std::string /* path_from */, + std::string /* path_to */, + int32_t /* result */) +IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBFlash_DeleteModuleLocalFileOrDir, + PP_Module /* module */, + std::string /* path */, + bool /* recursive */, + int32_t /* result */) +IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFlash_CreateModuleLocalDir, + PP_Module /* module */, + std::string /* path */, + int32_t /* result */) +IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBFlash_QueryModuleLocalFile, + PP_Module /* module */, + std::string /* path */, + PP_FileInfo_Dev /* info */, + int32_t /* result */) +IPC_SYNC_MESSAGE_ROUTED2_2( + PpapiHostMsg_PPBFlash_GetModuleLocalDirContents, + PP_Module /* module */, + std::string /* path */, + std::vector<pp::proxy::SerializedDirEntry> /* entries */, + int32_t /* result */) +IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBFlash_NavigateToURL, + PP_Instance /* instance */, + std::string /* url */, + std::string /* target */, + bool /* result */) + +// PPB_Font. +IPC_SYNC_MESSAGE_ROUTED2_3( + PpapiHostMsg_PPBFont_Create, + PP_Module /* pp_module */, + pp::proxy::SerializedFontDescription /* in_description */, + PP_Resource /* result */, + pp::proxy::SerializedFontDescription /* out_description */, + std::string /* out_metrics */) +IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFont_DrawTextAt, + pp::proxy::SerializedVar /* text */, + pp::proxy::PPBFont_DrawTextAt_Params /* params */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED4_1(PpapiHostMsg_PPBFont_MeasureText, + PP_Resource /* font */, + pp::proxy::SerializedVar /* text */, + PP_Bool /* text_is_rtl */, + PP_Bool /* override_direction */, + int32_t /* result */) +IPC_SYNC_MESSAGE_ROUTED5_1(PpapiHostMsg_PPBFont_CharacterOffsetForPixel, + PP_Resource /* font */, + pp::proxy::SerializedVar /* text */, + PP_Bool /* text_is_rtl */, + PP_Bool /* override_direction */, + int32_t /* pixel_pos */, + uint32_t /* result */) +IPC_SYNC_MESSAGE_ROUTED5_1(PpapiHostMsg_PPBFont_PixelOffsetForCharacter, + PP_Resource /* font */, + pp::proxy::SerializedVar /* text */, + PP_Bool /* text_is_rtl */, + PP_Bool /* override_direction */, + uint32_t /* char_offset */, + int32_t /* result */) + +// PPB_Fullscreen. +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBFullscreen_IsFullscreen, + PP_Instance /* instance */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFullscreen_SetFullscreen, + PP_Instance /* instance */, + PP_Bool /* fullscreen */, + PP_Bool /* result */) + +// PPB_Graphics2D. +IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBGraphics2D_Create, + PP_Module /* module */, + PP_Size /* size */, + PP_Bool /* is_always_opaque */, + PP_Resource /* result */) +IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBGraphics2D_PaintImageData, + PP_Resource /* graphics_2d */, + PP_Resource /* image_data */, + PP_Point /* top_left */, + bool /* src_rect_specified */, + PP_Rect /* src_rect */) +IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBGraphics2D_Scroll, + PP_Resource /* graphics_2d */, + bool /* clip_specified */, + PP_Rect /* clip */, + PP_Point /* amount */) +IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBGraphics2D_ReplaceContents, + PP_Resource /* graphics_2d */, + PP_Resource /* image_data */) +IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBGraphics2D_Flush, + PP_Resource /* graphics_2d */) + +// PPB_ImageData. +IPC_SYNC_MESSAGE_ROUTED0_1( + PpapiHostMsg_PPBImageData_GetNativeImageDataFormat, + int32 /* result_format */) +IPC_SYNC_MESSAGE_ROUTED1_1( + PpapiHostMsg_PPBImageData_IsImageDataFormatSupported, + int32 /* format */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED4_3(PpapiHostMsg_PPBImageData_Create, + PP_Module /* module */, + int32 /* format */, + PP_Size /* size */, + PP_Bool /* init_to_zero */, + PP_Resource /* result_resource */, + std::string /* image_data_desc */, + pp::proxy::ImageHandle /* result */) + +// PPB_Instance. +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_GetWindowObject, + PP_Instance /* instance */, + pp::proxy::SerializedVar /* result */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_GetOwnerElementObject, + PP_Instance /* instance */, + pp::proxy::SerializedVar /* result */) +IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBInstance_BindGraphics, + PP_Instance /* instance */, + PP_Resource /* device */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_IsFullFrame, + PP_Instance /* instance */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBInstance_ExecuteScript, + PP_Instance /* instance */, + pp::proxy::SerializedVar /* script */, + pp::proxy::SerializedVar /* out_exception */, + pp::proxy::SerializedVar /* result */) + +IPC_SYNC_MESSAGE_ROUTED3_1( + PpapiHostMsg_PPBPdf_GetFontFileWithFallback, + PP_Module /* module */, + pp::proxy::SerializedFontDescription /* description */, + int32_t /* charset */, + PP_Resource /* result */) +IPC_SYNC_MESSAGE_ROUTED2_1( + PpapiHostMsg_PPBPdf_GetFontTableForPrivateFontFile, + PP_Resource /* font_file */, + uint32_t /* table */, + std::string /* result */) + +// PPB_Testing. +IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBTesting_ReadImageData, + PP_Resource /* device_context_2d */, + PP_Resource /* image */, + PP_Point /* top_left */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED0_1(PpapiHostMsg_PPBTesting_RunMessageLoop, + bool /* dummy since there's no 0_0 variant */) +IPC_MESSAGE_ROUTED0(PpapiHostMsg_PPBTesting_QuitMessageLoop) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBTesting_GetLiveObjectCount, + PP_Module /* module */, + uint32 /* result */) + +// PPB_URLLoader. +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLLoader_Create, + PP_Instance /* instance */, + PP_Resource /* result */) +IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBURLLoader_Open, + PP_Resource /* loader */, + PP_Resource /*request_info */, + uint32_t /* serialized_callback */) +IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLLoader_FollowRedirect, + PP_Resource /* loader */, + uint32_t /* serialized_callback */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLLoader_GetResponseInfo, + PP_Resource /* loader */, + PP_Resource /* response_info_out */) +IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLLoader_ReadResponseBody, + PP_Resource /* loader */, + int32_t /* bytes_to_read */) +IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLLoader_FinishStreamingToFile, + PP_Resource /* loader */, + uint32_t /* serialized_callback */) +IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBURLLoader_Close, + PP_Resource /* loader */) + +// PPB_URLLoaderTrusted. +IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBURLLoaderTrusted_GrantUniversalAccess, + PP_Resource /* loader */) + +// PPB_URLRequestInfo. +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLRequestInfo_Create, + PP_Module /* module */, + PP_Resource /* result */) +IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBURLRequestInfo_SetProperty, + PP_Resource /* request */, + int32_t /* property */, + pp::proxy::SerializedVar /* value */) +IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBURLRequestInfo_AppendDataToBody, + PP_Resource /* request */, + std::string /* data */) +IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBURLRequestInfo_AppendFileToBody, + PP_Resource /* request */, + PP_Resource /* file_ref */, + int64_t /* start_offset */, + int64_t /* number_of_bytes */, + double /* expected_last_modified_time */) + +// PPB_URLResponseInfo. +IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBURLResponseInfo_GetProperty, + PP_Resource /* response */, + int32_t /* property */, + pp::proxy::SerializedVar /* result */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBURLResponseInfo_GetBodyAsFileRef, + PP_Resource /* response */, + PP_Resource /* file_ref_result */) + +// PPB_Var. +IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVar_AddRefObject, + int64 /* object_id */) +IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVar_ReleaseObject, + int64 /* object_id */) +IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBVar_ConvertType, + PP_Instance /* instance */, + pp::proxy::SerializedVar /* var */, + int /* new_type */, + pp::proxy::SerializedVar /* exception */, + pp::proxy::SerializedVar /* result */) +IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBVar_DefineProperty, + pp::proxy::SerializedVar /* object */, + PP_ObjectProperty /* property */, + pp::proxy::SerializedVar /* out_exception */) +IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_HasProperty, + pp::proxy::SerializedVar /* object */, + pp::proxy::SerializedVar /* property */, + pp::proxy::SerializedVar /* out_exception */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_HasMethodDeprecated, + pp::proxy::SerializedVar /* object */, + pp::proxy::SerializedVar /* method */, + pp::proxy::SerializedVar /* out_exception */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_GetProperty, + pp::proxy::SerializedVar /* object */, + pp::proxy::SerializedVar /* property */, + pp::proxy::SerializedVar /* out_exception */, + pp::proxy::SerializedVar /* result */) +IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_DeleteProperty, + pp::proxy::SerializedVar /* object */, + pp::proxy::SerializedVar /* property */, + pp::proxy::SerializedVar /* out_exception */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED1_2(PpapiHostMsg_PPBVar_EnumerateProperties, + pp::proxy::SerializedVar /* object */, + std::vector<pp::proxy::SerializedVar> /* props */, + pp::proxy::SerializedVar /* out_exception */) +IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBVar_SetPropertyDeprecated, + pp::proxy::SerializedVar /* object */, + pp::proxy::SerializedVar /* name */, + pp::proxy::SerializedVar /* value */, + pp::proxy::SerializedVar /* out_exception */) +IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBVar_IsCallable, + pp::proxy::SerializedVar /* object */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED4_2(PpapiHostMsg_PPBVar_Call, + pp::proxy::SerializedVar /* object */, + pp::proxy::SerializedVar /* this_object */, + pp::proxy::SerializedVar /* method_name */, + std::vector<pp::proxy::SerializedVar> /* args */, + pp::proxy::SerializedVar /* out_exception */, + pp::proxy::SerializedVar /* result */) +IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBVar_CallDeprecated, + pp::proxy::SerializedVar /* object */, + pp::proxy::SerializedVar /* method_name */, + std::vector<pp::proxy::SerializedVar> /* args */, + pp::proxy::SerializedVar /* out_exception */, + pp::proxy::SerializedVar /* result */) +IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_Construct, + pp::proxy::SerializedVar /* object */, + std::vector<pp::proxy::SerializedVar> /* args */, + pp::proxy::SerializedVar /* out_exception */, + pp::proxy::SerializedVar /* result */) +IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_IsInstanceOfDeprecated, + pp::proxy::SerializedVar /* var */, + int64 /* object_class */, + int64 /* object-data */, + PP_Bool /* result */) +IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBVar_CreateObjectDeprecated, + PP_Module /* module */, + int64 /* object_class */, + int64 /* object_data */, + pp::proxy::SerializedVar /* result */) |