mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
fix: takeHeapSnapshot() using public IPC channel for internal implementation (#16480)
This commit is contained in:
@@ -237,7 +237,7 @@ WebContents.prototype.getZoomFactor = function (callback) {
|
||||
WebContents.prototype.takeHeapSnapshot = function (filePath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const channel = `ELECTRON_TAKE_HEAP_SNAPSHOT_RESULT_${getNextId()}`
|
||||
ipcMain.once(channel, (event, success) => {
|
||||
ipcMainInternal.once(channel, (event, success) => {
|
||||
if (success) {
|
||||
resolve()
|
||||
} else {
|
||||
@@ -245,7 +245,7 @@ WebContents.prototype.takeHeapSnapshot = function (filePath) {
|
||||
}
|
||||
})
|
||||
if (!this._takeHeapSnapshot(filePath, channel)) {
|
||||
ipcMain.emit(channel, false)
|
||||
ipcMainInternal.emit(channel, false)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user