Replace ReadOnlySharedMemoryRegion with WritableSharedMemoryRegion (see #3502)

Write access to the shared memory region is required because JavaScript lacks
the capability to create read-only ArrayBuffers. When a user attempts to modify
an ArrayBuffer that utilizes a ReadOnlySharedMemoryRegion as its BackingStore
it triggers an access violation.

Note that this pull request may be reverted in the future if JavaScript adds
read-only ArrayBuffer support.
This commit is contained in:
Nik Pavlov
2023-10-16 22:43:29 +00:00
committed by Marshall Greenblatt
parent 3dd6078497
commit e798bbfe5d
16 changed files with 81 additions and 42 deletions

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=08f64795d78bdad29a45222a7263e795ce77a52d$
// $hash=dfa2f2d57339e05592d7ee5f4c4c54dd0932cd94$
//
#ifndef CEF_INCLUDE_CAPI_CEF_SHARED_MEMORY_REGION_CAPI_H_
@@ -69,7 +69,7 @@ typedef struct _cef_shared_memory_region_t {
/// Returns the pointer to the memory. Returns nullptr for invalid instances.
/// The returned pointer is only valid for the life span of this object.
///
const void*(CEF_CALLBACK* memory)(struct _cef_shared_memory_region_t* self);
void*(CEF_CALLBACK* memory)(struct _cef_shared_memory_region_t* self);
} cef_shared_memory_region_t;
#ifdef __cplusplus

View File

@@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "f8f0a0431b4cf46f98e3e58af93199f21d403d69"
#define CEF_API_HASH_UNIVERSAL "e5e3eef669443880f747ebccf04ca470306acec9"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "e5142124a2c423c0c438909bbfb86cd35a2b839d"
#define CEF_API_HASH_PLATFORM "2a84aaf4b26c613183b48b4aac39aa57045287af"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "5748f4bc71b501c804ef284e091e6eea847086d9"
#define CEF_API_HASH_PLATFORM "6e409fac3d2b069c084bc17a04196d4a93d5c028"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "23413591633deaf08aae5248becdb0118b105de1"
#define CEF_API_HASH_PLATFORM "18d2e48f53384ccb092b7dd4f0ae5dceafdac1fa"
#endif
#ifdef __cplusplus

View File

@@ -63,7 +63,7 @@ class CefSharedMemoryRegion : public virtual CefBaseRefCounted {
/// The returned pointer is only valid for the life span of this object.
///
/*--cef()--*/
virtual const void* Memory() = 0;
virtual void* Memory() = 0;
};
#endif // CEF_INCLUDE_CEF_SHARED_MEMORY_REGION_H_