refactor: use Map for windowProxies in window-setup.ts (#20600)
This commit is contained in:
parent
e06b0aa73b
commit
b29f0b9348
1 changed files with 4 additions and 4 deletions
|
@ -28,19 +28,19 @@ const toString = (value: any) => {
|
|||
return value != null ? `${value}` : value
|
||||
}
|
||||
|
||||
const windowProxies: Record<number, BrowserWindowProxy> = {}
|
||||
const windowProxies = new Map<number, BrowserWindowProxy>()
|
||||
|
||||
const getOrCreateProxy = (guestId: number) => {
|
||||
let proxy = windowProxies[guestId]
|
||||
let proxy = windowProxies.get(guestId)
|
||||
if (proxy == null) {
|
||||
proxy = new BrowserWindowProxy(guestId)
|
||||
windowProxies[guestId] = proxy
|
||||
windowProxies.set(guestId, proxy)
|
||||
}
|
||||
return proxy
|
||||
}
|
||||
|
||||
const removeProxy = (guestId: number) => {
|
||||
delete windowProxies[guestId]
|
||||
windowProxies.delete(guestId)
|
||||
}
|
||||
|
||||
type LocationProperties = 'hash' | 'href' | 'host' | 'hostname' | 'origin' | 'pathname' | 'port' | 'protocol' | 'search'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue