chore: rename atomBinding to electronBinding (#17419)

This commit is contained in:
Shelley Vohr 2019-03-18 12:37:06 -07:00 committed by GitHub
parent 5025c991ee
commit 38d75010c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 167 additions and 164 deletions

View file

@ -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')