fix: small refactoring regressions (#15206)
* fix: require('@electron/internal/browser/guest-view-manager') * fix: add missing crashServicePid used by tests
This commit is contained in:
parent
a369a4172b
commit
508551b81b
4 changed files with 9 additions and 4 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
2
spec/fixtures/api/crash-restart.html
vendored
2
spec/fixtures/api/crash-restart.html
vendored
|
@ -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(() => {
|
||||
|
|
2
spec/fixtures/api/crash.html
vendored
2
spec/fixtures/api/crash.html
vendored
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue