Add a shared memory variant of CefProcessMessage (fixes issue #3126)

CefSharedProcessMessageBuilder supports creation of a CefProcessMessage
backed by a CefSharedMemoryRegion.

Performance tests comparing the existing ArgumentList approach and the new
SharedMemoryRegion approach have been added to cefclient at
http://tests/ipc_performance.

CefMessageRouter has been updated to use SharedMemoryRegion as transport
for larger message payloads. The threshold is configurable via
|CefMessageRouterConfig.message_size_threshold|.

To test:
run `ceftests --gtest_filter=SendSharedProcessMessageTest.*:SharedProcessMessageTest.*:MessageRouterTest.Threshold*`
This commit is contained in:
Nik Pavlov
2022-07-04 09:49:15 +00:00
committed by Marshall Greenblatt
parent a931d49f3e
commit 81e892d19e
55 changed files with 4025 additions and 1132 deletions

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=2549ea10cd3a41bc04ab81bad24eb12787de68b9$
// $hash=026a7f827962222a1df8b62a8e7bdfbf4dce27e0$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_
@@ -41,6 +41,7 @@
#pragma once
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_shared_memory_region_capi.h"
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
@@ -69,7 +70,8 @@ typedef struct _cef_process_message_t {
int(CEF_CALLBACK* is_read_only)(struct _cef_process_message_t* self);
///
// Returns a writable copy of this object.
// Returns a writable copy of this object. Returns nullptr when message
// contains a shared memory region.
///
struct _cef_process_message_t*(CEF_CALLBACK* copy)(
struct _cef_process_message_t* self);
@@ -82,10 +84,18 @@ typedef struct _cef_process_message_t {
struct _cef_process_message_t* self);
///
// Returns the list of arguments.
// Returns the list of arguments. Returns nullptr when message contains a
// shared memory region.
///
struct _cef_list_value_t*(CEF_CALLBACK* get_argument_list)(
struct _cef_process_message_t* self);
///
// Returns the shared memory region. Returns nullptr when message contains an
// argument list.
///
struct _cef_shared_memory_region_t*(CEF_CALLBACK* get_shared_memory_region)(
struct _cef_process_message_t* self);
} cef_process_message_t;
///