shouldUpload --> uploadToServer
authorSamuel Attard <samuel.r.attard@gmail.com>
Tue, 22 Nov 2016 08:30:20 +0000 (19:30 +1100)
committerKevin Sawicki <kevinsawicki@gmail.com>
Mon, 28 Nov 2016 23:08:28 +0000 (15:08 -0800)
atom/common/api/atom_api_crash_reporter.cc
atom/common/crash_reporter/crash_reporter.cc
atom/common/crash_reporter/crash_reporter.h
atom/common/crash_reporter/crash_reporter_linux.cc
atom/common/crash_reporter/crash_reporter_linux.h
atom/common/crash_reporter/crash_reporter_mac.h
atom/common/crash_reporter/crash_reporter_mac.mm
atom/common/crash_reporter/crash_reporter_win.cc
atom/common/crash_reporter/crash_reporter_win.h
docs/api/crash-reporter.md
lib/common/api/crash-reporter.js

index fb9ad3b..aaaf200 100644 (file)
@@ -40,10 +40,10 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
                  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
index 7f08349..5e13bd6 100644 (file)
@@ -26,13 +26,13 @@ void CrashReporter::Start(const std::string& product_name,
                           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) {
@@ -43,10 +43,10 @@ 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;
 }
 
index fe7d109..6eb43d0 100644 (file)
@@ -26,15 +26,15 @@ class 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,
              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();
@@ -45,7 +45,7 @@ class 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();
 
index 5299997..50e1c5e 100644 (file)
@@ -60,7 +60,7 @@ void CrashReporterLinux::InitBreakpad(const std::string& product_name,
                                       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);
 
index 8be6e5f..846e1f1 100644 (file)
@@ -32,7 +32,7 @@ class CrashReporterLinux : public 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) override;
   void SetUploadParameters() override;
 
index d9b0ca7..9066f20 100644 (file)
@@ -29,11 +29,11 @@ class CrashReporterMac : public 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) 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>;
index 9c649a2..877c68d 100644 (file)
@@ -31,7 +31,7 @@ void CrashReporterMac::InitBreakpad(const std::string& product_name,
                                     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.
@@ -75,11 +75,11 @@ void CrashReporterMac::InitBreakpad(const std::string& product_name,
   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);
@@ -87,9 +87,9 @@ bool CrashReporterMac::GetShouldUpload() {
   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);
   }
 }
 
index d78f35c..25969dc 100644 (file)
@@ -150,7 +150,7 @@ void CrashReporterWin::InitBreakpad(const std::string& product_name,
                                     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;
 
index 6cac002..3fc139a 100644 (file)
@@ -28,7 +28,7 @@ class CrashReporterWin : public 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) override;
   void SetUploadParameters() override;
 
index 216a36a..044e6a8 100644 (file)
@@ -40,7 +40,7 @@ The `crashReporter` module has the following methods:
   * `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
@@ -70,16 +70,16 @@ Returns [`CrashReport[]`](structures/crash-report.md):
 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.
 
index 4b49292..a9509e4 100644 (file)
@@ -13,16 +13,16 @@ class CrashReporter {
       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
@@ -62,7 +62,7 @@ class CrashReporter {
       })
     }
 
-    binding.start(this.getProductName(), companyName, submitURL, this.getCrashesDirectory(), shouldUpload, ignoreSystemCrashHandler, extra)
+    binding.start(this.getProductName(), companyName, submitURL, this.getCrashesDirectory(), uploadToServer, ignoreSystemCrashHandler, extra)
   }
 
   getLastCrashReport () {
@@ -102,19 +102,19 @@ class CrashReporter {
     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')
     }
   }
 }