GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: use SharedArrayBuffer only when cross-origin isolation is enable… · react/react@8fa0ccc

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/scheduler/src
    • SchedulerProfiling.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/scheduler/src/SchedulerProfiling.js‎

Copy file name to clipboardExpand all lines: packages/scheduler/src/SchedulerProfiling.js
+9-4Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ import {NoPriority} from './SchedulerPriorities';
1515
let runIdCounter: number = 0;
1616
let mainThreadIdCounter: number = 0;
1717

18+
const isEnabledSharedArrayBuffer =
19+
// $FlowFixMe Flow doesn't know about SharedArrayBuffer
20+
typeof SharedArrayBuffer === 'function' &&
21+
// We only use SharedArrayBuffer when cross origin isolation is enabled.
22+
typeof window !== 'undefined' &&
23+
window.crossOriginIsolated === true;
24+
1825
const profilingStateSize = 4;
1926
export const sharedProfilingBuffer = enableProfiling
20-
? // $FlowFixMe Flow doesn't know about SharedArrayBuffer
21-
typeof SharedArrayBuffer === 'function'
27+
? isEnabledSharedArrayBuffer
2228
? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT)
23-
: // $FlowFixMe Flow doesn't know about ArrayBuffer
24-
typeof ArrayBuffer === 'function'
29+
: typeof ArrayBuffer === 'function'
2530
? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT)
2631
: null // Don't crash the init path on IE9
2732
: null;

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.