From 7d71ad6f915268f3c414ade2bce330a7bc4df286 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Tue, 22 Jan 2019 09:32:24 +0100 Subject: [PATCH] fix: takeHeapSnapshot() using public IPC channel for internal implementation (#16480) --- atom/renderer/atom_render_frame_observer.cc | 2 +- lib/browser/api/web-contents.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/atom/renderer/atom_render_frame_observer.cc b/atom/renderer/atom_render_frame_observer.cc index 753a4362749c..09d36b80ccec 100644 --- a/atom/renderer/atom_render_frame_observer.cc +++ b/atom/renderer/atom_render_frame_observer.cc @@ -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, diff --git a/lib/browser/api/web-contents.js b/lib/browser/api/web-contents.js index 10a506fac0e4..78933e7114d1 100644 --- a/lib/browser/api/web-contents.js +++ b/lib/browser/api/web-contents.js @@ -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) } }) }