fix: small refactoring regressions ()

* fix: require('@electron/internal/browser/guest-view-manager')

* fix: add missing crashServicePid used by tests
This commit is contained in:
Milan Burda 2018-10-17 21:18:18 +02:00 committed by Shelley Vohr
parent a369a4172b
commit 508551b81b
4 changed files with 9 additions and 4 deletions

View file

@ -382,7 +382,7 @@ handleRemoteCommand('ELECTRON_BROWSER_GUEST_WEB_CONTENTS', function (event, cont
ipcMain.on('ELECTRON_BROWSER_ASYNC_CALL_TO_GUEST_VIEW', function (event, requestId, guestInstanceId, method, args, hasCallback) {
new Promise(resolve => {
const guestViewManager = require('./guest-view-manager')
const guestViewManager = require('@electron/internal/browser/guest-view-manager')
const guest = guestViewManager.getGuest(guestInstanceId)
if (guest.hostWebContents !== event.sender) {
throw new Error('Access denied')
@ -434,6 +434,7 @@ const getTempDirectory = function () {
const crashReporterInit = function (options) {
const productName = options.productName || electron.app.getName()
const crashesDirectory = path.join(getTempDirectory(), `${productName} Crashes`)
let crashServicePid
if (process.platform === 'win32') {
const env = {
@ -446,15 +447,18 @@ const crashReporterInit = function (options) {
'--v=1'
]
spawn(process.helperExecPath, args, {
const crashServiceProcess = spawn(process.helperExecPath, args, {
env,
detached: true
})
crashServicePid = crashServiceProcess.pid
}
return {
productName,
crashesDirectory,
crashServicePid,
appVersion: electron.app.getVersion()
}
}

View file

@ -58,6 +58,7 @@ class CrashReporter {
this.productName = ret.productName
this.crashesDirectory = ret.crashesDirectory
this.crashServicePid = ret.crashServicePid
if (extra == null) extra = {}
if (extra._productName == null) extra._productName = ret.productName

View file

@ -19,7 +19,7 @@ crashReporter.start({
})
if (process.platform === 'win32') {
ipcRenderer.sendSync('crash-service-pid', crashReporter._crashServiceProcess.pid)
ipcRenderer.sendSync('crash-service-pid', crashReporter.crashServicePid)
}
setImmediate(() => {

View file

@ -20,7 +20,7 @@
})
if (process.platform === 'win32') {
ipcRenderer.sendSync('crash-service-pid', crashReporter._crashServiceProcess.pid)
ipcRenderer.sendSync('crash-service-pid', crashReporter.crashServicePid)
}
if (!uploadToServer) {