chore: rename atomBinding to electronBinding (#17419)
This commit is contained in:
parent
5025c991ee
commit
38d75010c7
81 changed files with 167 additions and 164 deletions
|
@ -3,8 +3,8 @@ import * as path from 'path'
|
|||
import * as electron from 'electron'
|
||||
import { EventEmitter } from 'events'
|
||||
|
||||
const bindings = process.atomBinding('app')
|
||||
const commandLine = process.atomBinding('command_line')
|
||||
const bindings = process.electronBinding('app')
|
||||
const commandLine = process.electronBinding('command_line')
|
||||
const { app, App } = bindings
|
||||
|
||||
// Only one app object permitted.
|
||||
|
@ -64,5 +64,5 @@ for (const name of events) {
|
|||
}
|
||||
|
||||
// Wrappers for native classes.
|
||||
const { DownloadItem } = process.atomBinding('download_item')
|
||||
const { DownloadItem } = process.electronBinding('download_item')
|
||||
Object.setPrototypeOf(DownloadItem.prototype, EventEmitter.prototype)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const EventEmitter = require('events').EventEmitter
|
||||
const { autoUpdater, AutoUpdater } = process.atomBinding('auto_updater')
|
||||
const { autoUpdater, AutoUpdater } = process.electronBinding('auto_updater')
|
||||
|
||||
// AutoUpdater is an EventEmitter.
|
||||
Object.setPrototypeOf(AutoUpdater.prototype, EventEmitter.prototype)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { BrowserView } = process.atomBinding('browser_view')
|
||||
const { BrowserView } = process.electronBinding('browser_view')
|
||||
|
||||
Object.setPrototypeOf(BrowserView.prototype, EventEmitter.prototype)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const electron = require('electron')
|
||||
const { WebContentsView, TopLevelWindow } = electron
|
||||
const { BrowserWindow } = process.atomBinding('window')
|
||||
const { BrowserWindow } = process.electronBinding('window')
|
||||
|
||||
Object.setPrototypeOf(BrowserWindow.prototype, TopLevelWindow.prototype)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
const { deprecate } = require('electron')
|
||||
const contentTracing = process.atomBinding('content_tracing')
|
||||
const contentTracing = process.electronBinding('content_tracing')
|
||||
|
||||
contentTracing.getCategories = deprecate.promisify(contentTracing.getCategories)
|
||||
contentTracing.startRecording = deprecate.promisify(contentTracing.startRecording)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
'use strict'
|
||||
|
||||
const { app, BrowserWindow, deprecate } = require('electron')
|
||||
const binding = process.atomBinding('dialog')
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const binding = process.electronBinding('dialog')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
const fileDialogProperties = {
|
||||
openFile: 1 << 0,
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = process.atomBinding('global_shortcut').globalShortcut
|
||||
module.exports = process.electronBinding('global_shortcut').globalShortcut
|
||||
|
|
|
@ -4,7 +4,7 @@ const { deprecate } = require('electron')
|
|||
|
||||
if (process.platform === 'darwin') {
|
||||
const { EventEmitter } = require('events')
|
||||
const { inAppPurchase, InAppPurchase } = process.atomBinding('in_app_purchase')
|
||||
const { inAppPurchase, InAppPurchase } = process.electronBinding('in_app_purchase')
|
||||
|
||||
// inAppPurchase is an EventEmitter.
|
||||
Object.setPrototypeOf(InAppPurchase.prototype, EventEmitter.prototype)
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
const { TopLevelWindow, MenuItem, webContents } = require('electron')
|
||||
const { sortMenuItems } = require('@electron/internal/browser/api/menu-utils')
|
||||
const EventEmitter = require('events').EventEmitter
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const bindings = process.atomBinding('menu')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
const bindings = process.electronBinding('menu')
|
||||
|
||||
const { Menu } = bindings
|
||||
let applicationMenu = null
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const features = process.atomBinding('features')
|
||||
const features = process.electronBinding('features')
|
||||
|
||||
// Browser side modules, please sort alphabetically.
|
||||
module.exports = [
|
||||
|
|
|
@ -4,8 +4,8 @@ const url = require('url')
|
|||
const { EventEmitter } = require('events')
|
||||
const { Readable } = require('stream')
|
||||
const { app } = require('electron')
|
||||
const { Session } = process.atomBinding('session')
|
||||
const { net, Net } = process.atomBinding('net')
|
||||
const { Session } = process.electronBinding('session')
|
||||
const { net, Net } = process.electronBinding('net')
|
||||
const { URLRequest } = net
|
||||
|
||||
// Net is an EventEmitter.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { Notification, isSupported } = process.atomBinding('notification')
|
||||
const { Notification, isSupported } = process.electronBinding('notification')
|
||||
|
||||
Object.setPrototypeOf(Notification.prototype, EventEmitter.prototype)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { powerMonitor, PowerMonitor } = process.atomBinding('power_monitor')
|
||||
const { powerMonitor, PowerMonitor } = process.electronBinding('power_monitor')
|
||||
const { deprecate } = require('electron')
|
||||
|
||||
// PowerMonitor is an EventEmitter.
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = process.atomBinding('power_save_blocker').powerSaveBlocker
|
||||
module.exports = process.electronBinding('power_save_blocker').powerSaveBlocker
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { app, session } from 'electron'
|
||||
|
||||
// Global protocol APIs.
|
||||
const protocol = process.atomBinding('protocol')
|
||||
const protocol = process.electronBinding('protocol')
|
||||
|
||||
// Fallback protocol APIs of default session.
|
||||
Object.setPrototypeOf(protocol, new Proxy({}, {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { screen, Screen } = process.atomBinding('screen')
|
||||
const { screen, Screen } = process.electronBinding('screen')
|
||||
|
||||
// Screen is an EventEmitter.
|
||||
Object.setPrototypeOf(Screen.prototype, EventEmitter.prototype)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const { EventEmitter } = require('events')
|
||||
const { app, deprecate } = require('electron')
|
||||
const { fromPartition, Session, Cookies, NetLog, Protocol } = process.atomBinding('session')
|
||||
const { fromPartition, Session, Cookies, NetLog, Protocol } = process.electronBinding('session')
|
||||
|
||||
// Public API.
|
||||
Object.defineProperties(exports, {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { systemPreferences, SystemPreferences } = process.atomBinding('system_preferences')
|
||||
const { systemPreferences, SystemPreferences } = process.electronBinding('system_preferences')
|
||||
|
||||
// SystemPreferences is an EventEmitter.
|
||||
Object.setPrototypeOf(SystemPreferences.prototype, EventEmitter.prototype)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const electron = require('electron')
|
||||
const { EventEmitter } = require('events')
|
||||
const { TopLevelWindow } = process.atomBinding('top_level_window')
|
||||
const { TopLevelWindow } = process.electronBinding('top_level_window')
|
||||
|
||||
Object.setPrototypeOf(TopLevelWindow.prototype, EventEmitter.prototype)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { Tray } = process.atomBinding('tray')
|
||||
const { Tray } = process.electronBinding('tray')
|
||||
|
||||
Object.setPrototypeOf(Tray.prototype, EventEmitter.prototype)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { EventEmitter } = require('events')
|
||||
const { View } = process.atomBinding('view')
|
||||
const { View } = process.electronBinding('view')
|
||||
|
||||
Object.setPrototypeOf(View.prototype, EventEmitter.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { LayoutManager } = electron
|
||||
const { BoxLayout } = process.atomBinding('box_layout')
|
||||
const { BoxLayout } = process.electronBinding('box_layout')
|
||||
|
||||
Object.setPrototypeOf(BoxLayout.prototype, LayoutManager.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { View } = electron
|
||||
const { Button } = process.atomBinding('button')
|
||||
const { Button } = process.electronBinding('button')
|
||||
|
||||
Object.setPrototypeOf(Button.prototype, View.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { Button } = electron
|
||||
const { LabelButton } = process.atomBinding('label_button')
|
||||
const { LabelButton } = process.electronBinding('label_button')
|
||||
|
||||
Object.setPrototypeOf(LabelButton.prototype, Button.prototype)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const { LayoutManager } = process.atomBinding('layout_manager')
|
||||
const { LayoutManager } = process.electronBinding('layout_manager')
|
||||
|
||||
LayoutManager.prototype._init = function () {
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { LabelButton } = electron
|
||||
const { MdTextButton } = process.atomBinding('md_text_button')
|
||||
const { MdTextButton } = process.electronBinding('md_text_button')
|
||||
|
||||
Object.setPrototypeOf(MdTextButton.prototype, LabelButton.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { View } = electron
|
||||
const { ResizeArea } = process.atomBinding('resize_area')
|
||||
const { ResizeArea } = process.electronBinding('resize_area')
|
||||
|
||||
Object.setPrototypeOf(ResizeArea.prototype, View.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { View } = electron
|
||||
const { TextField } = process.atomBinding('text_field')
|
||||
const { TextField } = process.electronBinding('text_field')
|
||||
|
||||
Object.setPrototypeOf(TextField.prototype, View.prototype)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const electron = require('electron')
|
||||
|
||||
const { View } = electron
|
||||
const { WebContentsView } = process.atomBinding('web_contents_view')
|
||||
const { WebContentsView } = process.electronBinding('web_contents_view')
|
||||
|
||||
Object.setPrototypeOf(WebContentsView.prototype, View.prototype)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const features = process.atomBinding('features')
|
||||
const features = process.electronBinding('features')
|
||||
const { EventEmitter } = require('events')
|
||||
const electron = require('electron')
|
||||
const path = require('path')
|
||||
|
@ -95,7 +95,7 @@ const defaultPrintingSetting = {
|
|||
}
|
||||
|
||||
// JavaScript implementations of WebContents.
|
||||
const binding = process.atomBinding('web_contents')
|
||||
const binding = process.electronBinding('web_contents')
|
||||
const { WebContents } = binding
|
||||
|
||||
Object.setPrototypeOf(NavigationController.prototype, EventEmitter.prototype)
|
||||
|
@ -467,7 +467,7 @@ WebContents.prototype._init = function () {
|
|||
}
|
||||
|
||||
// JavaScript wrapper of Debugger.
|
||||
const { Debugger } = process.atomBinding('debugger')
|
||||
const { Debugger } = process.electronBinding('debugger')
|
||||
|
||||
Debugger.prototype.sendCommand = deprecate.promisify(Debugger.prototype.sendCommand)
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
'use strict'
|
||||
|
||||
const { app, webContents, BrowserWindow } = require('electron')
|
||||
const { getAllWebContents } = process.atomBinding('web_contents')
|
||||
const renderProcessPreferences = process.atomBinding('render_process_preferences').forAllWebContents()
|
||||
const { getAllWebContents } = process.electronBinding('web_contents')
|
||||
const renderProcessPreferences = process.electronBinding('render_process_preferences').forAllWebContents()
|
||||
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
|
||||
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { shell, Menu } from 'electron'
|
||||
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
const isMac = process.platform === 'darwin'
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
|
||||
|
||||
const { desktopCapturer } = process.atomBinding('desktop_capturer')
|
||||
const eventBinding = process.atomBinding('event')
|
||||
const { desktopCapturer } = process.electronBinding('desktop_capturer')
|
||||
const eventBinding = process.electronBinding('event')
|
||||
|
||||
const deepEqual = (a, b) => JSON.stringify(a) === JSON.stringify(b)
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ const getNextGuestInstanceId = function () {
|
|||
// Create a new guest instance.
|
||||
const createGuest = function (embedder, params) {
|
||||
if (webViewManager == null) {
|
||||
webViewManager = process.atomBinding('web_view_manager')
|
||||
webViewManager = process.electronBinding('web_view_manager')
|
||||
}
|
||||
|
||||
const guestInstanceId = getNextGuestInstanceId(embedder)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { BrowserWindow, webContents } = require('electron')
|
||||
const { isSameOrigin } = process.atomBinding('v8_util')
|
||||
const { isSameOrigin } = process.electronBinding('v8_util')
|
||||
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
|
||||
const parseFeaturesString = require('@electron/internal/common/parse-features-string')
|
||||
|
||||
|
|
|
@ -162,7 +162,7 @@ require('@electron/internal/browser/chrome-devtools')
|
|||
// Load the chrome extension support.
|
||||
require('@electron/internal/browser/chrome-extension')
|
||||
|
||||
const features = process.atomBinding('features')
|
||||
const features = process.electronBinding('features')
|
||||
if (features.isDesktopCapturerEnabled()) {
|
||||
// Load internal desktop-capturer module.
|
||||
require('@electron/internal/browser/desktop-capturer')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
const getOwnerKey = (webContents, contextId) => {
|
||||
return `${webContents.id}-${contextId}`
|
||||
|
|
|
@ -5,9 +5,9 @@ const { EventEmitter } = require('events')
|
|||
const fs = require('fs')
|
||||
const util = require('util')
|
||||
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const eventBinding = process.atomBinding('event')
|
||||
const clipboard = process.atomBinding('clipboard')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
const eventBinding = process.electronBinding('event')
|
||||
const clipboard = process.electronBinding('clipboard')
|
||||
|
||||
const { isPromise } = electron
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const clipboard = process.atomBinding('clipboard')
|
||||
const clipboard = process.electronBinding('clipboard')
|
||||
|
||||
if (process.type === 'renderer') {
|
||||
const ipcRendererUtils = require('@electron/internal/renderer/ipc-renderer-internal-utils')
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
'use strict'
|
||||
|
||||
const { nativeImage } = process.atomBinding('native_image')
|
||||
const { nativeImage } = process.electronBinding('native_image')
|
||||
|
||||
module.exports = nativeImage
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
'use strict'
|
||||
|
||||
module.exports = process.atomBinding('shell')
|
||||
module.exports = process.electronBinding('shell')
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export function atomBindingSetup (binding: typeof process['_linkedBinding'], processType: typeof process['type']): typeof process['atomBinding'] {
|
||||
return function atomBinding (name: string) {
|
||||
export function electronBindingSetup (binding: typeof process['_linkedBinding'], processType: typeof process['type']): typeof process['electronBinding'] {
|
||||
return function electronBinding (name: string) {
|
||||
try {
|
||||
return binding(`atom_${processType}_${name}`)
|
||||
} catch (error) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const { nativeImage, NativeImage } = process.atomBinding('native_image')
|
||||
const { nativeImage, NativeImage } = process.electronBinding('native_image')
|
||||
|
||||
const objectMap = function (source, mapper) {
|
||||
const sourceEntries = Object.entries(source)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const binding = process.atomBinding('crash_reporter')
|
||||
const binding = process.electronBinding('crash_reporter')
|
||||
|
||||
class CrashReporter {
|
||||
contructor () {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import * as timers from 'timers'
|
||||
import * as util from 'util'
|
||||
|
||||
import { atomBindingSetup } from '@electron/internal/common/atom-binding-setup'
|
||||
import { electronBindingSetup } from '@electron/internal/common/atom-binding-setup'
|
||||
|
||||
process.atomBinding = atomBindingSetup(process._linkedBinding, process.type)
|
||||
process.electronBinding = electronBindingSetup(process._linkedBinding, process.type)
|
||||
|
||||
type AnyFn = (...args: any[]) => any
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
const { EventEmitter } = require('events')
|
||||
|
||||
process.atomBinding = require('@electron/internal/common/atom-binding-setup').atomBindingSetup(nodeProcess.binding, 'renderer')
|
||||
process.electronBinding = require('@electron/internal/common/atom-binding-setup').electronBindingSetup(nodeProcess.binding, 'renderer')
|
||||
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
// The `lib/renderer/ipc-renderer-internal.js` module looks for the ipc object in the
|
||||
// "ipc-internal" hidden value
|
||||
v8Util.setHiddenValue(global, 'ipc-internal', new EventEmitter())
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
/* global nodeProcess, isolatedWorld */
|
||||
|
||||
const atomBinding = require('@electron/internal/common/atom-binding-setup').atomBindingSetup(nodeProcess.binding, 'renderer')
|
||||
const electronBinding = require('@electron/internal/common/atom-binding-setup').electronBindingSetup(nodeProcess.binding, 'renderer')
|
||||
|
||||
const v8Util = atomBinding('v8_util')
|
||||
const v8Util = electronBinding('v8_util')
|
||||
|
||||
const webViewImpl = v8Util.getHiddenValue(isolatedWorld, 'web-view-impl')
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const binding = process.atomBinding('ipc')
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const binding = process.electronBinding('ipc')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
// Created by init.js.
|
||||
const ipcRenderer = v8Util.getHiddenValue(global, 'ipc')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const features = process.atomBinding('features')
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const features = process.electronBinding('features')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
const enableRemoteModule = v8Util.getHiddenValue(global, 'enableRemoteModule')
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
const { isPromise } = require('electron')
|
||||
const resolvePromise = Promise.resolve.bind(Promise)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { EventEmitter } from 'events'
|
||||
import { deprecate } from 'electron'
|
||||
|
||||
const binding = process.atomBinding('web_frame')
|
||||
const binding = process.electronBinding('web_frame')
|
||||
|
||||
class WebFrame extends EventEmitter {
|
||||
constructor (public context: Window) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
class CallbacksRegistry {
|
||||
constructor () {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal'
|
||||
import { webFrame } from 'electron'
|
||||
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
const IsolatedWorldIDs = {
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,7 @@ const globalPaths = Module.globalPaths
|
|||
globalPaths.push(path.join(__dirname, 'api', 'exports'))
|
||||
|
||||
// The global variable will be used by ipc for event dispatching
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
v8Util.setHiddenValue(global, 'ipc', new EventEmitter())
|
||||
v8Util.setHiddenValue(global, 'ipc-internal', new EventEmitter())
|
||||
|
@ -31,7 +31,7 @@ const { webFrameInit } = require('@electron/internal/renderer/web-frame-init')
|
|||
webFrameInit()
|
||||
|
||||
// Process command line arguments.
|
||||
const { hasSwitch, getSwitchValue } = process.atomBinding('command_line')
|
||||
const { hasSwitch, getSwitchValue } = process.electronBinding('command_line')
|
||||
|
||||
const parseOption = function<T> (
|
||||
name: string, defaultValue: T, converter?: (value: string) => T
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
const binding = process.atomBinding('ipc')
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const binding = process.electronBinding('ipc')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
// Created by init.js.
|
||||
export const ipcRendererInternal: Electron.IpcRendererInternal = v8Util.getHiddenValue(global, 'ipc-internal')
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
asyncPromiseMethods
|
||||
} from '@electron/internal/common/web-view-methods'
|
||||
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
// ID generator.
|
||||
let nextId = 0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal'
|
||||
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
|
||||
function handleFocusBlur (guestInstanceId: number) {
|
||||
// Note that while Chromium content APIs have observer for focus/blur, they
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
'use strict'
|
||||
|
||||
const features = process.atomBinding('features')
|
||||
const features = process.electronBinding('features')
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
const events = require('events')
|
||||
const { EventEmitter } = events
|
||||
|
||||
process.atomBinding = require('@electron/internal/common/atom-binding-setup').atomBindingSetup(binding.get, 'renderer')
|
||||
process.electronBinding = require('@electron/internal/common/atom-binding-setup').electronBindingSetup(binding.get, 'renderer')
|
||||
|
||||
const v8Util = process.atomBinding('v8_util')
|
||||
const v8Util = process.electronBinding('v8_util')
|
||||
// Expose browserify Buffer as a hidden value. This is used by C++ code to
|
||||
// deserialize Buffer instances sent from browser process.
|
||||
v8Util.setHiddenValue(global, 'Buffer', Buffer)
|
||||
|
@ -35,7 +35,7 @@ const {
|
|||
|
||||
process.isRemoteModuleEnabled = isRemoteModuleEnabled
|
||||
|
||||
// The electron module depends on process.atomBinding
|
||||
// The electron module depends on process.electronBinding
|
||||
const electron = require('electron')
|
||||
|
||||
const loadedModules = new Map([
|
||||
|
@ -47,7 +47,7 @@ const loadedModules = new Map([
|
|||
|
||||
// AtomSandboxedRendererClient will look for the "ipcNative" hidden object when
|
||||
// invoking the `onMessage`/`onExit` callbacks.
|
||||
const ipcNative = process.atomBinding('ipc')
|
||||
const ipcNative = process.electronBinding('ipc')
|
||||
v8Util.setHiddenValue(global, 'ipcNative', ipcNative)
|
||||
|
||||
ipcNative.onMessage = function (internal, channel, args, senderId) {
|
||||
|
@ -74,7 +74,7 @@ const { webFrameInit } = require('@electron/internal/renderer/web-frame-init')
|
|||
webFrameInit()
|
||||
|
||||
// Pass different process object to the preload script(which should not have
|
||||
// access to things like `process.atomBinding`).
|
||||
// access to things like `process.electronBinding`).
|
||||
const preloadProcess = new EventEmitter()
|
||||
|
||||
Object.assign(preloadProcess, binding.process)
|
||||
|
@ -103,7 +103,7 @@ function preloadRequire (module) {
|
|||
}
|
||||
|
||||
// Process command line arguments.
|
||||
const { hasSwitch } = process.atomBinding('command_line')
|
||||
const { hasSwitch } = process.electronBinding('command_line')
|
||||
|
||||
const isBackgroundPage = hasSwitch('background-page')
|
||||
const contextIsolation = hasSwitch('context-isolation')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue