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 608df0a86d
commit 3dc9464583
55 changed files with 4025 additions and 1132 deletions

View File

@@ -39,6 +39,7 @@
#pragma once
#include "include/cef_base.h"
#include "include/cef_shared_memory_region.h"
#include "include/cef_values.h"
typedef cef_process_id_t CefProcessId;
@@ -71,6 +72,7 @@ class CefProcessMessage : public virtual CefBaseRefCounted {
///
// Returns a writable copy of this object.
// Returns nullptr when message contains a shared memory region.
///
/*--cef()--*/
virtual CefRefPtr<CefProcessMessage> Copy() = 0;
@@ -83,9 +85,17 @@ class CefProcessMessage : public virtual CefBaseRefCounted {
///
// Returns the list of arguments.
// Returns nullptr when message contains a shared memory region.
///
/*--cef()--*/
virtual CefRefPtr<CefListValue> GetArgumentList() = 0;
///
// Returns the shared memory region.
// Returns nullptr when message contains an argument list.
///
/*--cef()--*/
virtual CefRefPtr<CefSharedMemoryRegion> GetSharedMemoryRegion() = 0;
};
#endif // CEF_INCLUDE_CEF_MESSAGE_H_