base::Bind(&CrashReporter::Start, report));
dict.SetMethod("_getUploadedReports",
base::Bind(&CrashReporter::GetUploadedReports, report));
- dict.SetMethod("_setShouldUpload",
- base::Bind(&CrashReporter::SetShouldUpload, report));
- dict.SetMethod("_getShouldUpload",
- base::Bind(&CrashReporter::GetShouldUpload, report));
+ dict.SetMethod("_setUploadToServer",
+ base::Bind(&CrashReporter::SetUploadToServer, report));
+ dict.SetMethod("_getUploadToServer",
+ base::Bind(&CrashReporter::GetUploadToServer, report));
}
} // namespace
const std::string& company_name,
const std::string& submit_url,
const base::FilePath& crashes_dir,
- bool should_upload,
+ bool upload_to_server,
bool skip_system_crash_handler,
const StringMap& extra_parameters) {
SetUploadParameters(extra_parameters);
InitBreakpad(product_name, ATOM_VERSION_STRING, company_name, submit_url,
- crashes_dir, should_upload, skip_system_crash_handler);
+ crashes_dir, upload_to_server, skip_system_crash_handler);
}
void CrashReporter::SetUploadParameters(const StringMap& parameters) {
SetUploadParameters();
}
-void CrashReporter::SetShouldUpload(const bool should_upload) {
+void CrashReporter::SetUploadToServer(const bool upload_to_server) {
}
-bool CrashReporter::GetShouldUpload() {
+bool CrashReporter::GetUploadToServer() {
return true;
}
const std::string& company_name,
const std::string& submit_url,
const base::FilePath& crashes_dir,
- bool should_upload,
+ bool upload_to_server,
bool skip_system_crash_handler,
const StringMap& extra_parameters);
virtual std::vector<CrashReporter::UploadReportResult> GetUploadedReports(
const base::FilePath& crashes_dir);
- virtual void SetShouldUpload(bool should_upload);
- virtual bool GetShouldUpload();
+ virtual void SetUploadToServer(bool upload_to_server);
+ virtual bool GetUploadToServer();
protected:
CrashReporter();
const std::string& company_name,
const std::string& submit_url,
const base::FilePath& crashes_dir,
- bool should_upload,
+ bool upload_to_server,
bool skip_system_crash_handler);
virtual void SetUploadParameters();
const std::string& company_name,
const std::string& submit_url,
const base::FilePath& crashes_dir,
- bool should_upload,
+ bool upload_to_server,
bool skip_system_crash_handler) {
EnableCrashDumping(crashes_dir);
const std::string& company_name,
const std::string& submit_url,
const base::FilePath& crashes_dir,
- bool should_upload,
+ bool upload_to_server,
bool skip_system_crash_handler) override;
void SetUploadParameters() override;
const std::string& company_name,
const std::string& submit_url,
const base::FilePath& crashes_dir,
- bool should_upload,
+ bool upload_to_server,
bool skip_system_crash_handler) override;
void SetUploadParameters() override;
- void SetShouldUpload(bool should_upload) override;
- bool GetShouldUpload() override;
+ void SetUploadToServer(bool upload_to_server) override;
+ bool GetUploadToServer() override;
private:
friend struct base::DefaultSingletonTraits<CrashReporterMac>;
const std::string& company_name,
const std::string& submit_url,
const base::FilePath& crashes_dir,
- bool should_upload,
+ bool upload_to_server,
bool skip_system_crash_handler) {
// check whether crashpad has been initialized.
// Only need to initialize once.
if (is_browser_) {
database_ =
crashpad::CrashReportDatabase::Initialize(crashes_dir);
- SetShouldUpload(should_upload);
+ SetUploadToServer(upload_to_server);
}
}
-bool CrashReporterMac::GetShouldUpload() {
+bool CrashReporterMac::GetUploadToServer() {
bool enabled = true;
if (database_) {
database_->GetSettings()->GetUploadsEnabled(&enabled);
return enabled;
}
-void CrashReporterMac::SetShouldUpload(const bool should_upload) {
+void CrashReporterMac::SetUploadToServer(const bool upload_to_server) {
if (database_) {
- database_->GetSettings()->SetUploadsEnabled(should_upload);
+ database_->GetSettings()->SetUploadsEnabled(upload_to_server);
}
}
const std::string& company_name,
const std::string& submit_url,
const base::FilePath& crashes_dir,
- bool should_upload,
+ bool upload_to_server,
bool skip_system_crash_handler) {
skip_system_crash_handler_ = skip_system_crash_handler;
const std::string& company_name,
const std::string& submit_url,
const base::FilePath& crashes_dir,
- bool should_upload,
+ bool upload_to_server,
bool skip_system_crash_handler) override;
void SetUploadParameters() override;
* `companyName` String (optional)
* `submitURL` String - URL that crash reports will be sent to as POST.
* `productName` String (optional) - Defaults to `app.getName()`.
- * `shouldUpload` Boolean (optional) _macOS_ - Whether crash reports should be sent to the server
+ * `uploadToServer` Boolean (optional) _macOS_ - Whether crash reports should be sent to the server
Default is `true`.
* `ignoreSystemCrashHandler` Boolean (optional) - Default is `false`.
* `extra` Object (optional) - An object you can define that will be sent along with the
Returns all uploaded crash reports. Each report contains the date and uploaded
ID.
-### `crashReporter.getShouldUpload()` _macOS_
+### `crashReporter.getUploadToServer()` _macOS_
Returns `Boolean` - Whether reports should be submitted to the server. Set through
-the `start` method or `setShouldUpload`.
+the `start` method or `setUploadToServer`.
**NOTE:** This API can only be used from the main process
-### `crashReporter.setShouldUpload(shouldUpload)` _macOS_
+### `crashReporter.setUploadToServer(uploadToServer)` _macOS_
-* `shouldUpload` Boolean _macOS_ - Whether reports should be submitted to the server
+* `uploadToServer` Boolean _macOS_ - Whether reports should be submitted to the server
This would normally be controlled by user preferences.
options = {}
}
this.productName = options.productName != null ? options.productName : app.getName()
- let {autoSubmit, companyName, extra, ignoreSystemCrashHandler, submitURL, shouldUpload} = options
+ let {autoSubmit, companyName, extra, ignoreSystemCrashHandler, submitURL, uploadToServer} = options
- if (autoSubmit == null && shouldUpload == null) {
- shouldUpload = true
+ if (autoSubmit == null && uploadToServer == null) {
+ uploadToServer = true
} else {
if (typeof autoSubmit !== 'undefined') {
// TODO: Remove depreceated property in 2.0.0
- console.warn('The "autoSubmit" attribute on electron.crashReporter.start is depreceated. Please use "shouldUpload" instead.')
+ console.warn('The "autoSubmit" attribute on electron.crashReporter.start is depreceated. Please use "uploadToServer" instead.')
}
- shouldUpload = shouldUpload || autoSubmit
+ uploadToServer = uploadToServer || autoSubmit
}
if (ignoreSystemCrashHandler == null) {
ignoreSystemCrashHandler = false
})
}
- binding.start(this.getProductName(), companyName, submitURL, this.getCrashesDirectory(), shouldUpload, ignoreSystemCrashHandler, extra)
+ binding.start(this.getProductName(), companyName, submitURL, this.getCrashesDirectory(), uploadToServer, ignoreSystemCrashHandler, extra)
}
getLastCrashReport () {
return this.tempDirectory
}
- getShouldUpload () {
+ getUploadToServer () {
if (process.type === 'browser') {
- return binding._getShouldUpload()
+ return binding._getUploadToServer()
} else {
- throw new Error('getShouldUpload can only be called from the main process')
+ throw new Error('getUploadToServer can only be called from the main process')
}
}
- setShouldUpload (shouldUpload) {
+ setUploadToServer (uploadToServer) {
if (process.type === 'browser') {
- return binding._setShouldUpload(shouldUpload)
+ return binding._setUploadToServer(uploadToServer)
} else {
- throw new Error('setShouldUpload can only be called from the main process')
+ throw new Error('setUploadToServer can only be called from the main process')
}
}
}