refactor: enforce naming of ipcMainInternal (#16689)

This commit is contained in:
Samuel Attard 2019-02-04 14:49:53 -08:00 committed by GitHub
parent cacb56b103
commit af64140100
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 45 additions and 43 deletions

View file

@ -1,7 +1,7 @@
'use strict'
const { webContents } = require('electron')
const ipcMain = require('@electron/internal/browser/ipc-main-internal')
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
const parseFeaturesString = require('@electron/internal/common/parse-features-string')
const errorUtils = require('@electron/internal/common/error-utils')
const {
@ -341,7 +341,7 @@ const isWebViewTagEnabled = function (contents) {
}
const handleMessage = function (channel, handler) {
ipcMain.on(channel, (event, ...args) => {
ipcMainInternal.on(channel, (event, ...args) => {
if (isWebViewTagEnabled(event.sender)) {
handler(event, ...args)
} else {
@ -376,7 +376,7 @@ handleMessage('ELECTRON_GUEST_VIEW_MANAGER_ATTACH_GUEST', function (event, embed
})
// this message is sent by the actual <webview>
ipcMain.on('ELECTRON_GUEST_VIEW_MANAGER_FOCUS_CHANGE', function (event, focus, guestInstanceId) {
ipcMainInternal.on('ELECTRON_GUEST_VIEW_MANAGER_FOCUS_CHANGE', function (event, focus, guestInstanceId) {
const guest = getGuest(guestInstanceId)
if (guest === event.sender) {
event.sender.emit('focus-change', {}, focus, guestInstanceId)