2019-01-17 18:22:05 +00:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const CrashReporter = require('@electron/internal/common/crash-reporter')
|
|
|
|
const ipcRenderer = require('@electron/internal/renderer/ipc-renderer-internal')
|
2019-04-04 23:07:03 +00:00
|
|
|
const errorUtils = require('@electron/internal/common/error-utils')
|
|
|
|
|
|
|
|
const invoke = function (command, ...args) {
|
|
|
|
const [ error, result ] = ipcRenderer.sendSync(command, ...args)
|
|
|
|
|
|
|
|
if (error) {
|
|
|
|
throw errorUtils.deserialize(error)
|
|
|
|
}
|
|
|
|
|
|
|
|
return result
|
|
|
|
}
|
2019-01-17 18:22:05 +00:00
|
|
|
|
|
|
|
class CrashReporterRenderer extends CrashReporter {
|
2019-04-04 23:07:03 +00:00
|
|
|
init (options) {
|
|
|
|
return invoke('ELECTRON_CRASH_REPORTER_INIT', options)
|
2019-01-17 18:22:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = new CrashReporterRenderer()
|