Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: small refactoring regressions (backport: 4-0-x) #15224

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/browser/rpc-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,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')
Expand Down Expand Up @@ -428,6 +428,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 = {
Expand All @@ -440,15 +441,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()
}
}
Expand Down
1 change: 1 addition & 0 deletions lib/common/crash-reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/api/crash-restart.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
})

if (process.platform === 'win32') {
ipcRenderer.sendSync('crash-service-pid', crashReporter._crashServiceProcess.pid)
ipcRenderer.sendSync('crash-service-pid', crashReporter.crashServicePid)
}

setImmediate(() => {
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/api/crash.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down