Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import GrWebShmProxy from './protocol/GrWebShmProxy'
import GrWebShmBufferEvents from './protocol/GrWebShmBufferEvents'
// web gl
import GrWebGlBufferProxy from './protocol/GrWebGlBufferProxy'
import GrWebGlProxy from './protocol/GrWebGlProxy'
import GrWebGlBufferEvents from './protocol/GrWebGlBufferEvents'
/**
* @type {WebFS}
*/
const webFS = WebFS.create(_uuidv4())
/**
* @type {Connection}
*/
const connection = new Connection()
/**
* @type {Display}
*/
const display = new Display(connection)
/**
* @returns {string}
* @private
*/
function _uuidv4 () {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ self.crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
)
}
/**
constructor (display, id) {
super()
/**
* @type {string}
*/
this.id = id
/**
* @type {Connection}
*/
this.connection = new Connection()
/**
* @type {Display}
* @private
*/
this._display = display
/**
* @type {number}
* @private
*/
this._syncEventSerial = 0
/**
* @type {function():void}
* @private
*/
this._destroyedResolver = null
/**
constructor () {
super()
/**
* @type {number}
*/
this.nextId = 1
/**
* @type {Connection}
*/
this.connection = new Connection()
/**
* @type {WlDisplayProxy}
*/
this.displayProxy = new WlDisplayProxy(this, this.nextId++)
/**
* @type {Display}
*/
this.displayProxy.listener = this
}