// Copyright (c) 2010 The Chromium Authors. All rights reserved. // 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 #include #include #include "build/build_config.h" #include "base/file_path.h" #include "base/nullable_string16.h" #include "base/platform_file.h" #include "base/sync_socket.h" #include "base/time.h" #include "base/values.h" #include "chrome/common/content_settings.h" #include "chrome/common/extensions/update_manifest.h" #include "chrome/common/geoposition.h" #include "chrome/common/nacl_types.h" #include "chrome/common/notification_type.h" #include "chrome/common/page_zoom.h" #include "chrome/common/translate_errors.h" #include "chrome/common/window_container_type.h" #include "gfx/rect.h" #include "ipc/ipc_channel_handle.h" #include "ipc/ipc_message.h" #include "ipc/ipc_message_macros.h" #include "third_party/skia/include/core/SkBitmap.h" #include "webkit/glue/dom_operations.h" #include "webkit/glue/form_field.h" #if defined(OS_POSIX) #include "base/file_descriptor_posix.h" #endif #if defined(OS_MACOSX) #include "chrome/common/font_descriptor_mac.h" #endif // TODO(mpcomplete): rename ViewMsg and ViewHostMsg to something that makes // more sense with our current design. // IPC_MESSAGE macros choke on extra , in the std::map, when expanding. We need // to typedef it to avoid that. // Substitution map for l10n messages. typedef std::map SubstitutionMap; struct ThumbnailScore; class WebCursor; //----------------------------------------------------------------------------- // 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) // 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 */) // 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 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) // Replies to creating and updating videos. IPC_MESSAGE_ROUTED1(ViewMsg_CreateVideo_ACK, int32 /* video_id */) IPC_MESSAGE_ROUTED1(ViewMsg_UpdateVideo_ACK, int32 /* video_id */) // 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, EditCommands /* 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 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) #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) // 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 /* data */) // Sent as download progress is being made, size of the resource may be // unknown, in that case |size| is -1. IPC_MESSAGE_ROUTED3(ViewMsg_Resource_DownloadProgress, int /* request_id */, int64 /* position */, int64 /* size */) // 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 the request has been completed. IPC_MESSAGE_ROUTED3(ViewMsg_Resource_RequestComplete, int /* request_id */, URLRequestStatus /* status */, std::string /* security info */) // 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. IPC_MESSAGE_ROUTED2(ViewMsg_ScriptEvalRequest, std::wstring, /* frame_xpath */ std::wstring /* jscript_url */) // 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 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 */, int /* 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 */, int /* 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, /* 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 /* 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 /* urls that have local copy */, std::vector /* 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) #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_CONTROL1(ViewMsg_GpuChannelEstablished, IPC::ChannelHandle /* handle to channel */) // 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 /* 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 /* host_ids */, appcache::EventID) // Notifies the renderer of an AppCache progress event. IPC_MESSAGE_CONTROL4(AppCacheMsg_ProgressEventRaised, std::vector /* 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 /* 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 /* names */, std::vector /* labels */, std::vector /* icons */, std::vector /* 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_ROUTED3(ViewMsg_RequestAudioPacket, int /* stream id */, uint32 /* bytes in buffer */, int64 /* message timestamp */) // 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 */) #else 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. // |args| is a list of primitive Value types that are passed to the function. IPC_MESSAGE_ROUTED4(ViewMsg_ExtensionMessageInvoke, std::string /* function_name */, ListValue /* args */, bool /* requires incognito access */, GURL /* event URL */) // Tell the renderer process all known extension function names. IPC_MESSAGE_CONTROL1(ViewMsg_Extension_SetFunctionNames, std::vector) // 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::vector /* 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 /* URLPatterns the extension can access */) // Tell the renderer process that the given extension is enabled or disabled // for incognito mode. IPC_MESSAGE_CONTROL2(ViewMsg_Extension_ExtensionSetIncognitoEnabled, std::string /* extension_id */, bool /* enabled */) // 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 /* 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*/) // 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 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 */) #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_IDBCallbacksSuccessIDBDatabase, int32 /* response_id */, int32 /* idb_database_id */) IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIndexedDBKey, int32 /* response_id */, IndexedDBKey /* indexed_db_key */) IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBObjectStore, int32 /* response_id */, int32 /* idb_object_store_id */) IPC_MESSAGE_CONTROL2(ViewMsg_IDBCallbacksSuccessIDBIndex, int32 /* response_id */, int32 /* idb_index_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 */) #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 */) #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 /* 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 /* 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 with web extents has been updated. IPC_MESSAGE_CONTROL1(ViewMsg_ExtensionExtentsUpdated, ViewMsg_ExtensionExtentsUpdated_Params) // Request a tree of Accessibility data from the render process. IPC_MESSAGE_ROUTED0(ViewMsg_GetAccessibilityTree) // 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 */) // Relay a speech recognition result, either partial or final. IPC_MESSAGE_ROUTED1(ViewMsg_SpeechInput_SetRecognitionResult, string16 /* result */) // Indicate that speech recognizer has stopped recording and started // recognition. IPC_MESSAGE_ROUTED0(ViewMsg_SpeechInput_RecordingComplete) // Indicate that speech recognizer has completed recognition. This will be // the last message sent in response to a // ViewHostMsg_SpeechInput_StartRecognition. IPC_MESSAGE_ROUTED0(ViewMsg_SpeechInput_RecognitionComplete) IPC_END_MESSAGES(View) //----------------------------------------------------------------------------- // 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 // 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 /* 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 */) // Send the tree of accessibility data to the browser, where it's cached // in order to respond to OS accessibility queries immediately. IPC_MESSAGE_ROUTED1(ViewHostMsg_AccessibilityTree, webkit_glue::WebAccessibility) // Notifies the TabContents that the content being displayed is PDF. // This allows the browser to handle things such as zooming differently. IPC_MESSAGE_ROUTED0(ViewHostMsg_SetDisplayingPDFContent) // Requests the speech input service to start speech recognition on behalf of // the given |render_view_id|. IPC_MESSAGE_CONTROL1(ViewHostMsg_SpeechInput_StartRecognition, int /* render_view_id */) // 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_CONTROL1(ViewHostMsg_SpeechInput_CancelRecognition, int /* render_view_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_CONTROL1(ViewHostMsg_SpeechInput_StopRecording, int /* render_view_id */) IPC_END_MESSAGES(ViewHost)