refactor: natively promisify WebContents.prototype.takeHeapSnapshot (#18000)

This commit is contained in:
Milan Burda 2019-04-29 19:11:11 +02:00 committed by Jeremy Apthorp
parent 18b77a4de6
commit 7574f91f31
3 changed files with 22 additions and 26 deletions

View file

@ -226,18 +226,6 @@ WebContents.prototype.getZoomFactor = function (callback) {
}
}
WebContents.prototype.takeHeapSnapshot = function (filePath) {
return new Promise((resolve, reject) => {
this._takeHeapSnapshot(filePath, (success) => {
if (success) {
resolve()
} else {
reject(new Error('takeHeapSnapshot failed'))
}
})
})
}
// Translate the options of printToPDF.
WebContents.prototype.printToPDF = function (options) {
const printingSetting = Object.assign({}, defaultPrintingSetting)