2012-04-03 03:34:16 +02:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions copyright (c) 2011 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.
|
|
|
|
|
|
|
|
// IPC messages for CEF.
|
|
|
|
// Multiply-included message file, hence no include guard.
|
|
|
|
|
2016-01-06 20:20:54 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2015-11-26 03:53:12 +01:00
|
|
|
#include "libcef/common/net/upload_data.h"
|
2014-02-05 21:35:45 +01:00
|
|
|
|
2013-07-24 22:15:18 +02:00
|
|
|
#include "base/memory/shared_memory.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "base/values.h"
|
|
|
|
#include "content/public/common/common_param_traits.h"
|
|
|
|
#include "content/public/common/referrer.h"
|
2015-02-04 19:10:14 +01:00
|
|
|
#include "ui/gfx/ipc/gfx_param_traits.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "ipc/ipc_message_macros.h"
|
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
// Singly-included section for enums and custom IPC traits.
|
|
|
|
#ifndef CEF_LIBCEF_COMMON_CEF_MESSAGES_H_
|
|
|
|
#define CEF_LIBCEF_COMMON_CEF_MESSAGES_H_
|
|
|
|
|
|
|
|
// Based on ChromeViewHostMsg_GetPluginInfo_Status.
|
|
|
|
enum class CefViewHostMsg_GetPluginInfo_Status {
|
|
|
|
kAllowed,
|
|
|
|
kBlocked,
|
|
|
|
kBlockedByPolicy,
|
|
|
|
kDisabled,
|
|
|
|
kNotFound,
|
|
|
|
kNPAPINotSupported,
|
|
|
|
kOutdatedBlocked,
|
|
|
|
kOutdatedDisallowed,
|
|
|
|
kPlayImportantContent,
|
|
|
|
kUnauthorized,
|
|
|
|
};
|
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
|
|
|
|
// Extracted from chrome/common/automation_messages.h.
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<scoped_refptr<net::UploadData> > {
|
|
|
|
typedef scoped_refptr<net::UploadData> param_type;
|
|
|
|
static void Write(Message* m, const param_type& p);
|
|
|
|
static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
|
|
|
|
static void Log(const param_type& p, std::string* l);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace IPC
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_COMMON_CEF_MESSAGES_H_
|
|
|
|
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// TODO(cef): Re-using the message start for extensions may be problematic in
|
|
|
|
// the future. It would be better if ipc_message_utils.h contained a value
|
|
|
|
// reserved for consumers of the content API.
|
|
|
|
// See: http://crbug.com/110911
|
|
|
|
#define IPC_MESSAGE_START ExtensionMsgStart
|
|
|
|
|
|
|
|
// Common types.
|
|
|
|
|
|
|
|
// Parameters structure for a request.
|
|
|
|
IPC_STRUCT_BEGIN(Cef_Request_Params)
|
|
|
|
// Unique request id to match requests and responses.
|
|
|
|
IPC_STRUCT_MEMBER(int, request_id)
|
|
|
|
|
|
|
|
// Unique id of the target frame. -1 if unknown / invalid.
|
2016-01-06 20:20:54 +01:00
|
|
|
IPC_STRUCT_MEMBER(int64_t, frame_id)
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// True if the request is user-initiated instead of internal.
|
|
|
|
IPC_STRUCT_MEMBER(bool, user_initiated)
|
|
|
|
|
|
|
|
// True if a response is expected.
|
|
|
|
IPC_STRUCT_MEMBER(bool, expect_response)
|
|
|
|
|
|
|
|
// Message name.
|
|
|
|
IPC_STRUCT_MEMBER(std::string, name)
|
|
|
|
|
|
|
|
// List of message arguments.
|
2014-01-02 23:41:11 +01:00
|
|
|
IPC_STRUCT_MEMBER(base::ListValue, arguments)
|
2012-04-03 03:34:16 +02:00
|
|
|
IPC_STRUCT_END()
|
|
|
|
|
|
|
|
// Parameters structure for a response.
|
|
|
|
IPC_STRUCT_BEGIN(Cef_Response_Params)
|
|
|
|
// Unique request id to match requests and responses.
|
|
|
|
IPC_STRUCT_MEMBER(int, request_id)
|
|
|
|
|
|
|
|
// True if a response ack is expected.
|
|
|
|
IPC_STRUCT_MEMBER(bool, expect_response_ack)
|
|
|
|
|
|
|
|
// True on success.
|
|
|
|
IPC_STRUCT_MEMBER(bool, success)
|
|
|
|
|
|
|
|
// Response or error string depending on the value of |success|.
|
|
|
|
IPC_STRUCT_MEMBER(std::string, response)
|
|
|
|
IPC_STRUCT_END()
|
|
|
|
|
2012-11-20 21:08:36 +01:00
|
|
|
// Parameters structure for a cross-origin white list entry.
|
|
|
|
IPC_STRUCT_BEGIN(Cef_CrossOriginWhiteListEntry_Params)
|
|
|
|
IPC_STRUCT_MEMBER(std::string, source_origin)
|
|
|
|
IPC_STRUCT_MEMBER(std::string, target_protocol)
|
|
|
|
IPC_STRUCT_MEMBER(std::string, target_domain)
|
|
|
|
IPC_STRUCT_MEMBER(bool, allow_target_subdomains)
|
|
|
|
IPC_STRUCT_END()
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-04-24 15:48:32 +02:00
|
|
|
// Parameters structure for a draggable region.
|
|
|
|
IPC_STRUCT_BEGIN(Cef_DraggableRegion_Params)
|
|
|
|
IPC_STRUCT_MEMBER(gfx::Rect, bounds)
|
|
|
|
IPC_STRUCT_MEMBER(bool, draggable)
|
|
|
|
IPC_STRUCT_END()
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Messages sent from the browser to the renderer.
|
|
|
|
|
2014-07-16 23:27:25 +02:00
|
|
|
// Parameters for a resource request.
|
|
|
|
IPC_STRUCT_BEGIN(CefMsg_LoadRequest_Params)
|
|
|
|
// The request method: GET, POST, etc.
|
|
|
|
IPC_STRUCT_MEMBER(std::string, method)
|
|
|
|
|
|
|
|
// The requested URL.
|
|
|
|
IPC_STRUCT_MEMBER(GURL, url)
|
|
|
|
|
|
|
|
// The URL to send in the "Referer" header field. Can be empty if there is
|
|
|
|
// no referrer.
|
|
|
|
IPC_STRUCT_MEMBER(GURL, referrer)
|
|
|
|
// One of the blink::WebReferrerPolicy values.
|
|
|
|
IPC_STRUCT_MEMBER(int, referrer_policy)
|
|
|
|
|
|
|
|
// Identifies the frame within the RenderView that sent the request.
|
|
|
|
// -1 if unknown / invalid.
|
2016-01-06 20:20:54 +01:00
|
|
|
IPC_STRUCT_MEMBER(int64_t, frame_id)
|
2014-07-16 23:27:25 +02:00
|
|
|
|
|
|
|
// Usually the URL of the document in the top-level window, which may be
|
|
|
|
// checked by the third-party cookie blocking policy. Leaving it empty may
|
|
|
|
// lead to undesired cookie blocking. Third-party cookie blocking can be
|
|
|
|
// bypassed by setting first_party_for_cookies = url, but this should ideally
|
|
|
|
// only be done if there really is no way to determine the correct value.
|
|
|
|
IPC_STRUCT_MEMBER(GURL, first_party_for_cookies)
|
|
|
|
|
|
|
|
// Additional HTTP request headers.
|
|
|
|
IPC_STRUCT_MEMBER(std::string, headers)
|
|
|
|
|
|
|
|
// net::URLRequest load flags (0 by default).
|
|
|
|
IPC_STRUCT_MEMBER(int, load_flags)
|
|
|
|
|
|
|
|
// Optional upload data (may be null).
|
|
|
|
IPC_STRUCT_MEMBER(scoped_refptr<net::UploadData>, upload_data)
|
|
|
|
IPC_STRUCT_END()
|
|
|
|
|
|
|
|
// Tell the renderer to load a request.
|
|
|
|
IPC_MESSAGE_ROUTED1(CefMsg_LoadRequest,
|
|
|
|
CefMsg_LoadRequest_Params)
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Sent when the browser has a request for the renderer. The renderer may
|
|
|
|
// respond with a CefHostMsg_Response.
|
|
|
|
IPC_MESSAGE_ROUTED1(CefMsg_Request,
|
|
|
|
Cef_Request_Params)
|
|
|
|
|
|
|
|
// Optional message sent in response to a CefHostMsg_Request.
|
|
|
|
IPC_MESSAGE_ROUTED1(CefMsg_Response,
|
|
|
|
Cef_Response_Params)
|
|
|
|
|
|
|
|
// Optional Ack message sent to the browser to notify that a CefHostMsg_Response
|
|
|
|
// has been processed.
|
|
|
|
IPC_MESSAGE_ROUTED1(CefMsg_ResponseAck,
|
|
|
|
int /* request_id */)
|
|
|
|
|
2015-09-09 16:05:39 +02:00
|
|
|
// Tells the render frame to load all blocked plugins with the given identifier.
|
|
|
|
// Based on ChromeViewMsg_LoadBlockedPlugins.
|
|
|
|
IPC_MESSAGE_ROUTED1(CefViewMsg_LoadBlockedPlugins,
|
|
|
|
std::string /* identifier */)
|
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
// Sent on process startup to indicate whether this process is running in
|
|
|
|
// incognito mode. Based on ChromeViewMsg_SetIsIncognitoProcess.
|
|
|
|
IPC_MESSAGE_CONTROL1(CefProcessMsg_SetIsIncognitoProcess,
|
|
|
|
bool /* is_incognito_processs */)
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Sent to child processes to add or remove a cross-origin whitelist entry.
|
2012-11-20 21:08:36 +01:00
|
|
|
IPC_MESSAGE_CONTROL2(CefProcessMsg_ModifyCrossOriginWhitelistEntry,
|
2012-04-03 03:34:16 +02:00
|
|
|
bool /* add */,
|
2012-11-20 21:08:36 +01:00
|
|
|
Cef_CrossOriginWhiteListEntry_Params /* params */)
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Sent to child processes to clear the cross-origin whitelist.
|
|
|
|
IPC_MESSAGE_CONTROL0(CefProcessMsg_ClearCrossOriginWhitelist)
|
|
|
|
|
|
|
|
|
|
|
|
// Messages sent from the renderer to the browser.
|
|
|
|
|
2012-11-20 21:08:36 +01:00
|
|
|
// Parameters for a newly created render thread.
|
|
|
|
IPC_STRUCT_BEGIN(CefProcessHostMsg_GetNewRenderThreadInfo_Params)
|
|
|
|
IPC_STRUCT_MEMBER(std::vector<Cef_CrossOriginWhiteListEntry_Params>,
|
|
|
|
cross_origin_whitelist_entries)
|
|
|
|
|
2014-01-02 23:41:11 +01:00
|
|
|
IPC_STRUCT_MEMBER(base::ListValue, extra_info)
|
2012-11-20 21:08:36 +01:00
|
|
|
IPC_STRUCT_END()
|
|
|
|
|
|
|
|
// Retrieve information about a newly created render thread.
|
|
|
|
IPC_SYNC_MESSAGE_CONTROL0_1(
|
|
|
|
CefProcessHostMsg_GetNewRenderThreadInfo,
|
|
|
|
CefProcessHostMsg_GetNewRenderThreadInfo_Params /* params*/)
|
|
|
|
|
|
|
|
// Parameters for a newly created browser window.
|
|
|
|
IPC_STRUCT_BEGIN(CefProcessHostMsg_GetNewBrowserInfo_Params)
|
|
|
|
IPC_STRUCT_MEMBER(int, browser_id)
|
|
|
|
IPC_STRUCT_MEMBER(bool, is_popup)
|
2014-07-01 00:30:29 +02:00
|
|
|
IPC_STRUCT_MEMBER(bool, is_windowless)
|
2015-10-21 20:17:09 +02:00
|
|
|
IPC_STRUCT_MEMBER(bool, is_guest_view)
|
2012-11-20 21:08:36 +01:00
|
|
|
IPC_STRUCT_END()
|
|
|
|
|
2014-01-02 23:41:11 +01:00
|
|
|
// Retrieve information about a newly created browser.
|
|
|
|
IPC_SYNC_MESSAGE_CONTROL2_1(
|
2012-11-20 21:08:36 +01:00
|
|
|
CefProcessHostMsg_GetNewBrowserInfo,
|
2014-01-02 23:41:11 +01:00
|
|
|
int /* render_view_routing_id */,
|
|
|
|
int /* render_frame_routing_id */,
|
2012-11-20 21:08:36 +01:00
|
|
|
CefProcessHostMsg_GetNewBrowserInfo_Params /* params*/)
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2015-07-16 23:40:01 +02:00
|
|
|
IPC_ENUM_TRAITS_MAX_VALUE(CefViewHostMsg_GetPluginInfo_Status,
|
|
|
|
CefViewHostMsg_GetPluginInfo_Status::kUnauthorized)
|
|
|
|
|
|
|
|
// Output parameters for CefViewHostMsg_GetPluginInfo message.
|
|
|
|
IPC_STRUCT_BEGIN(CefViewHostMsg_GetPluginInfo_Output)
|
|
|
|
IPC_STRUCT_MEMBER(CefViewHostMsg_GetPluginInfo_Status, status)
|
|
|
|
IPC_STRUCT_MEMBER(content::WebPluginInfo, plugin)
|
|
|
|
IPC_STRUCT_MEMBER(std::string, actual_mime_type)
|
|
|
|
IPC_STRUCT_MEMBER(std::string, group_identifier)
|
|
|
|
IPC_STRUCT_MEMBER(base::string16, group_name)
|
|
|
|
IPC_STRUCT_END()
|
|
|
|
|
|
|
|
// Return information about a plugin for the given URL and MIME type.
|
|
|
|
// In contrast to ViewHostMsg_GetPluginInfo in content/, this IPC call knows
|
|
|
|
// about specific reasons why a plugin can't be used, for example because it's
|
|
|
|
// disabled. Based on ChromeViewHostMsg_GetPluginInfo.
|
|
|
|
IPC_SYNC_MESSAGE_CONTROL4_1(CefViewHostMsg_GetPluginInfo,
|
|
|
|
int /* render_frame_id */,
|
|
|
|
GURL /* url */,
|
|
|
|
GURL /* top origin url */,
|
|
|
|
std::string /* mime_type */,
|
|
|
|
CefViewHostMsg_GetPluginInfo_Output /* output */)
|
|
|
|
|
2015-08-31 13:28:07 +02:00
|
|
|
// Returns whether any internal plugin supporting |mime_type| is registered and
|
|
|
|
// enabled. Does not determine whether the plugin can actually be instantiated
|
|
|
|
// (e.g. whether it has all its dependencies).
|
|
|
|
// When the returned *|is_available| is true, |additional_param_names| and
|
|
|
|
// |additional_param_values| contain the name-value pairs, if any, specified
|
|
|
|
// for the *first* non-disabled plugin found that is registered for |mime_type|.
|
|
|
|
// Based on ChromeViewHostMsg_IsInternalPluginAvailableForMimeType.
|
|
|
|
IPC_SYNC_MESSAGE_CONTROL1_3(
|
|
|
|
CefViewHostMsg_IsInternalPluginAvailableForMimeType,
|
|
|
|
std::string /* mime_type */,
|
|
|
|
bool /* is_available */,
|
|
|
|
std::vector<base::string16> /* additional_param_names */,
|
|
|
|
std::vector<base::string16> /* additional_param_values */)
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Sent when a frame is identified for the first time.
|
|
|
|
IPC_MESSAGE_ROUTED3(CefHostMsg_FrameIdentified,
|
2016-01-06 20:20:54 +01:00
|
|
|
int64_t /* frame_id */,
|
|
|
|
int64_t /* parent_frame_id */,
|
2013-12-17 23:04:35 +01:00
|
|
|
base::string16 /* frame_name */)
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2012-11-21 23:11:22 +01:00
|
|
|
// Sent when a frame has finished loading. Based on ViewHostMsg_DidFinishLoad.
|
|
|
|
IPC_MESSAGE_ROUTED4(CefHostMsg_DidFinishLoad,
|
2016-01-06 20:20:54 +01:00
|
|
|
int64_t /* frame_id */,
|
2012-11-21 23:11:22 +01:00
|
|
|
GURL /* validated_url */,
|
|
|
|
bool /* is_main_frame */,
|
|
|
|
int /* http_status_code */)
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Sent when the renderer has a request for the browser. The browser may respond
|
|
|
|
// with a CefMsg_Response.
|
|
|
|
IPC_MESSAGE_ROUTED1(CefHostMsg_Request,
|
|
|
|
Cef_Request_Params)
|
|
|
|
|
|
|
|
// Optional message sent in response to a CefMsg_Request.
|
|
|
|
IPC_MESSAGE_ROUTED1(CefHostMsg_Response,
|
|
|
|
Cef_Response_Params)
|
|
|
|
|
|
|
|
// Optional Ack message sent to the browser to notify that a CefMsg_Response
|
|
|
|
// has been processed.
|
|
|
|
IPC_MESSAGE_ROUTED1(CefHostMsg_ResponseAck,
|
|
|
|
int /* request_id */)
|
2012-10-04 21:17:13 +02:00
|
|
|
|
2015-04-24 15:48:32 +02:00
|
|
|
// Sent by the renderer when the draggable regions are updated.
|
|
|
|
IPC_MESSAGE_ROUTED1(CefHostMsg_UpdateDraggableRegions,
|
|
|
|
std::vector<Cef_DraggableRegion_Params> /* regions */)
|