fix: takeHeapSnapshot() using public IPC channel for internal implementation (#16484)

This commit is contained in:
trop[bot]
2019-01-22 11:07:30 -08:00
committed by Samuel Attard
parent 7c55db280b
commit 84f1dc7f8c
2 changed files with 3 additions and 3 deletions

View File

@@ -216,7 +216,7 @@ void AtomRenderFrameObserver::OnTakeHeapSnapshot(
args.AppendBoolean(success);
render_frame_->Send(new AtomFrameHostMsg_Message(
render_frame_->GetRoutingID(), "ipc-message", args));
render_frame_->GetRoutingID(), "ipc-internal-message", args));
}
void AtomRenderFrameObserver::EmitIPCEvent(blink::WebLocalFrame* frame,

View File

@@ -199,7 +199,7 @@ WebContents.prototype.executeJavaScript = function (code, hasUserGesture, callba
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 {
@@ -207,7 +207,7 @@ WebContents.prototype.takeHeapSnapshot = function (filePath) {
}
})
if (!this._takeHeapSnapshot(filePath, channel)) {
ipcMain.emit(channel, false)
ipcMainInternal.emit(channel, false)
}
})
}