mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: natively promisify WebContents.prototype.takeHeapSnapshot (#18000)
This commit is contained in:
committed by
Jeremy Apthorp
parent
18b77a4de6
commit
7574f91f31
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user