File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,14 @@ import {NoPriority} from './SchedulerPriorities';
15
15
let runIdCounter : number = 0 ;
16
16
let mainThreadIdCounter : number = 0 ;
17
17
18
+ // We only use SharedArrayBuffer when cross origin isolation is enabled.
19
+ // $FlowFixMe Flow doesn't know about SharedArrayBuffer
20
+ const isEnabledSharedArrayBuffer = typeof SharedArrayBuffer === 'function' && typeof window !== 'undefined' && window . crossOriginIsolated === true
21
+
18
22
const profilingStateSize = 4 ;
19
23
export const sharedProfilingBuffer = enableProfiling
20
- ? // $FlowFixMe Flow doesn't know about SharedArrayBuffer
21
- typeof SharedArrayBuffer === 'function'
24
+ ?
25
+ isEnabledSharedArrayBuffer
22
26
? new SharedArrayBuffer ( profilingStateSize * Int32Array . BYTES_PER_ELEMENT )
23
27
: // $FlowFixMe Flow doesn't know about ArrayBuffer
24
28
typeof ArrayBuffer === 'function'
You can’t perform that action at this time.
0 commit comments