Commit 47db786c authored by Antonio Sartori's avatar Antonio Sartori Committed by V8 LUCI CQ

[api] Deprecate v8::SetIsCrossOriginIsolated

The method changes a global flag, depending upon which v8 attaches or
not the SharedArrayBuffer constructor to global objects. Chrome ended
up calling it when some contexts had already been created, leading to
inconsistencies. (Also) because of that, we decided to change the
mechanism for enabling cross-origin isolation (cf.
https://crrev.com/c/2880215). I believe it is better not to expose
this method.

Bug: chromium:923807
Change-Id: I269cb1c5406f999a395bbb7657574c0f73b4ae99
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2900224Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Antonio Sartori <antoniosartori@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74600}
parent 50cbeca9
......@@ -9932,6 +9932,9 @@ class V8_EXPORT V8 {
* Notifies V8 that the process is cross-origin-isolated, which enables
* defining the SharedArrayBuffer function on the global object of Contexts.
*/
V8_DEPRECATED(
"Use the command line argument --enable-sharedarraybuffer-per-context "
"together with SetSharedArrayBufferConstructorEnabledCallback")
static void SetIsCrossOriginIsolated();
private:
......
......@@ -5954,13 +5954,7 @@ void V8::GetSharedMemoryStatistics(SharedMemoryStatistics* statistics) {
i::ReadOnlyHeap::PopulateReadOnlySpaceStatistics(statistics);
}
void V8::SetIsCrossOriginIsolated() {
i::FLAG_harmony_sharedarraybuffer = true;
i::FLAG_enable_sharedarraybuffer_per_context = false;
#if V8_ENABLE_WEBASSEMBLY
i::FLAG_experimental_wasm_threads = true;
#endif // V8_ENABLE_WEBASSEMBLY
}
void V8::SetIsCrossOriginIsolated() {}
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