Commit b6ebafa2 authored by Bill Budge's avatar Bill Budge Committed by Commit Bot

[api] Add V8::SetIsCrossOriginIsolated method

- Adds a method to tell V8 that the process is cross-origin-isolated
  under COOP+COEP. In this case, SharedArrayBuffer can be enabled.

Bug: chromium:923807
Change-Id: I729093665a50d2b3667c028e05b42d21d76b12d3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2502448Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70805}
parent aa429077
......@@ -9832,6 +9832,12 @@ class V8_EXPORT V8 {
*/
static void GetSharedMemoryStatistics(SharedMemoryStatistics* statistics);
/**
* Notifies V8 that the process is cross-origin-isolated, which enables
* defining the SharedArrayBuffer function on the global object of Contexts.
*/
static void SetIsCrossOriginIsolated();
private:
V8();
......
......@@ -5862,6 +5862,10 @@ void V8::GetSharedMemoryStatistics(SharedMemoryStatistics* statistics) {
i::ReadOnlyHeap::PopulateReadOnlySpaceStatistics(statistics);
}
void V8::SetIsCrossOriginIsolated() {
i::FLAG_harmony_sharedarraybuffer = true;
}
template <typename ObjectType>
struct InvokeBootstrapper;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment