Add binary format support to CefMessageRouter (fixes #3502)

This commit is contained in:
Nik Pavlov
2023-10-25 18:20:55 +00:00
committed by Marshall Greenblatt
parent 1b74ac5124
commit 44323082b1
34 changed files with 2218 additions and 534 deletions

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=905b24443e08e2d3e2464d5f4138e97904be3e9e$
// $hash=8da36dc268f2f9beb26abc105656f3b04b1d46ed$
//
#include "libcef_dll/cpptoc/binary_value_cpptoc.h"
@@ -140,6 +140,25 @@ binary_value_copy(struct _cef_binary_value_t* self) {
return CefBinaryValueCppToC::Wrap(_retval);
}
const void* CEF_CALLBACK
binary_value_get_raw_data(struct _cef_binary_value_t* self) {
shutdown_checker::AssertNotShutdown();
DCHECK(self);
if (!self) {
return NULL;
}
// This manual implementation can be removed once support for 'const void*'
// is integrated into the CEF translator tool (issue #3591).
// Execute
const void* _retval = CefBinaryValueCppToC::Get(self)->GetRawData();
// Return type: simple_byaddr
return _retval;
}
size_t CEF_CALLBACK binary_value_get_size(struct _cef_binary_value_t* self) {
shutdown_checker::AssertNotShutdown();
@@ -193,6 +212,7 @@ CefBinaryValueCppToC::CefBinaryValueCppToC() {
GetStruct()->is_same = binary_value_is_same;
GetStruct()->is_equal = binary_value_is_equal;
GetStruct()->copy = binary_value_copy;
GetStruct()->get_raw_data = binary_value_get_raw_data;
GetStruct()->get_size = binary_value_get_size;
GetStruct()->get_data = binary_value_get_data;
}

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=3bc6db85e54dc87c1e592291be01820547e0989f$
// $hash=4356ad718a385149741e4c8bbbe5d5290466ed40$
//
#include "libcef_dll/cpptoc/shared_memory_region_cpptoc.h"
@@ -64,6 +64,9 @@ shared_memory_region_memory(struct _cef_shared_memory_region_t* self) {
return NULL;
}
// This manual implementation can be removed once support for 'void*'
// is integrated into the CEF translator tool (issue #3591).
// Execute
void* _retval = CefSharedMemoryRegionCppToC::Get(self)->Memory();

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=ecd6caa0c415b57e93bc66f3c7a4cfb547f022c1$
// $hash=21d8fb47eb282f40fb9d602f44b8c1fd4ff44dea$
//
#include "libcef_dll/cpptoc/v8value_cpptoc.h"
@@ -138,16 +138,12 @@ CEF_EXPORT cef_v8value_t* cef_v8value_create_array_buffer(
cef_v8array_buffer_release_callback_t* release_callback) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: buffer; type: simple_byaddr
DCHECK(buffer);
if (!buffer) {
return NULL;
}
// Verify param: release_callback; type: refptr_diff
DCHECK(release_callback);
if (!release_callback) {
return NULL;
}
// Unverified params: buffer
// Execute
CefRefPtr<CefV8Value> _retval = CefV8Value::CreateArrayBuffer(
@@ -948,6 +944,38 @@ int CEF_CALLBACK v8value_neuter_array_buffer(struct _cef_v8value_t* self) {
return _retval;
}
size_t CEF_CALLBACK
v8value_get_array_buffer_byte_length(struct _cef_v8value_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self) {
return 0;
}
// Execute
size_t _retval = CefV8ValueCppToC::Get(self)->GetArrayBufferByteLength();
// Return type: simple
return _retval;
}
void* CEF_CALLBACK v8value_get_array_buffer_data(struct _cef_v8value_t* self) {
DCHECK(self);
if (!self) {
return NULL;
}
// This manual implementation can be removed once support for 'void*'
// is integrated into the CEF translator tool (issue #3591).
// Execute
void* _retval = CefV8ValueCppToC::Get(self)->GetArrayBufferData();
// Return type: simple_byaddr
return _retval;
}
cef_string_userfree_t CEF_CALLBACK
v8value_get_function_name(struct _cef_v8value_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -1153,6 +1181,9 @@ CefV8ValueCppToC::CefV8ValueCppToC() {
GetStruct()->get_array_buffer_release_callback =
v8value_get_array_buffer_release_callback;
GetStruct()->neuter_array_buffer = v8value_neuter_array_buffer;
GetStruct()->get_array_buffer_byte_length =
v8value_get_array_buffer_byte_length;
GetStruct()->get_array_buffer_data = v8value_get_array_buffer_data;
GetStruct()->get_function_name = v8value_get_function_name;
GetStruct()->get_function_handler = v8value_get_function_handler;
GetStruct()->execute_function = v8value_execute_function;