refactor: natively promisify WebContents.prototype.takeHeapSnapshot (#18000)
This commit is contained in:
parent
18b77a4de6
commit
7574f91f31
3 changed files with 22 additions and 26 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue