Bug 144114 part 3 - Clean up the headers of the nsPrintSettingsService subclasses. r=bobowen
authorJonathan Watt <jwatt@jwatt.org>
Tue, 19 Dec 2017 11:05:37 +0000
changeset 451026 ca6bb250afe4477343775f8bb36846749acb2a1f
parent 451025 2453d0c0d5acc940b6aacef3d32d9b120b80d36f
child 451027 44ba9966025edf9818caa70d639b59fd6f46624b
push id8543
push userryanvm@gmail.com
push dateTue, 16 Jan 2018 14:33:22 +0000
treeherdermozilla-beta@a6525ed16a32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowen
bugs144114
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 144114 part 3 - Clean up the headers of the nsPrintSettingsService subclasses. r=bobowen * * * [mq]: dtor MozReview-Commit-ID: 8ghrXxeKiHF
widget/android/nsPrintSettingsServiceAndroid.h
widget/cocoa/nsPrintSettingsServiceX.h
widget/gtk/nsPrintSettingsServiceGTK.h
widget/nsPrintSettingsImpl.cpp
widget/nsPrintSettingsService.cpp
widget/nsPrintSettingsService.h
widget/windows/nsPrintSettingsServiceWin.h
--- a/widget/android/nsPrintSettingsServiceAndroid.h
+++ b/widget/android/nsPrintSettingsServiceAndroid.h
@@ -7,14 +7,13 @@
 
 #include "nsPrintSettingsService.h"
 #include "nsIPrintSettings.h"
 
 class nsPrintSettingsServiceAndroid final : public nsPrintSettingsService
 {
 public:
   nsPrintSettingsServiceAndroid() {}
-  virtual ~nsPrintSettingsServiceAndroid() {}
 
   nsresult _CreatePrintSettings(nsIPrintSettings** _retval) override;
 };
 
 #endif // nsPrintSettingsServiceAndroid_h
--- a/widget/cocoa/nsPrintSettingsServiceX.h
+++ b/widget/cocoa/nsPrintSettingsServiceX.h
@@ -3,47 +3,51 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsPrintSettingsServiceX_h
 #define nsPrintSettingsServiceX_h
 
 #include "nsPrintSettingsService.h"
 
-namespace mozilla
-{
-namespace embedding
-{
-  class PrintData;
+namespace mozilla {
+namespace embedding {
+class PrintData;
 } // namespace embedding
 } // namespace mozilla
 
 class nsPrintSettingsServiceX final : public nsPrintSettingsService
 {
 public:
   nsPrintSettingsServiceX() {}
-  virtual ~nsPrintSettingsServiceX() {}
 
-  /*
+  /**
    * These serialize and deserialize methods are not symmetrical in that
    * printSettingsX != deserialize(serialize(printSettingsX)). This is because
    * the native print settings stored in the nsPrintSettingsX's NSPrintInfo
    * object are not fully serialized. Only the values needed for successful
    * printing are.
    */
   NS_IMETHODIMP SerializeToPrintData(nsIPrintSettings* aSettings,
                                      nsIWebBrowserPrint* aWBP,
-                                     mozilla::embedding::PrintData* data);
+                                     mozilla::embedding::PrintData* data) override;
+
   NS_IMETHODIMP DeserializeToPrintSettings(const mozilla::embedding::PrintData& data,
-                                           nsIPrintSettings* settings);
+                                           nsIPrintSettings* settings) override;
 
 protected:
-  nsresult   _CreatePrintSettings(nsIPrintSettings **_retval);
-  nsresult   ReadPrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName, uint32_t aFlags);
-  nsresult   WritePrefs(nsIPrintSettings* aPS, const nsAString& aPrinterName, uint32_t aFlags);
+  nsresult ReadPrefs(nsIPrintSettings* aPS,
+                     const nsAString& aPrinterName,
+                     uint32_t aFlags) override;
+
+  nsresult WritePrefs(nsIPrintSettings* aPS,
+                      const nsAString& aPrinterName,
+                      uint32_t aFlags) override;
+
+  nsresult _CreatePrintSettings(nsIPrintSettings** _retval) override;
 
 private:
   /* Serialization done in child to be deserialized in the parent */
   nsresult SerializeToPrintDataChild(nsIPrintSettings* aSettings,
                                      nsIWebBrowserPrint* aWBP,
                                      mozilla::embedding::PrintData* data);
 
   /* Serialization done in parent to be deserialized in the child */
--- a/widget/gtk/nsPrintSettingsServiceGTK.h
+++ b/widget/gtk/nsPrintSettingsServiceGTK.h
@@ -4,34 +4,30 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsPrintSettingsServiceGTK_h
 #define nsPrintSettingsServiceGTK_h
 
 #include "nsPrintSettingsService.h"
 
-namespace mozilla
-{
-namespace embedding
-{
-  class PrintData;
+namespace mozilla {
+namespace embedding {
+class PrintData;
 } // namespace embedding
 } // namespace mozilla
 
 class nsPrintSettingsServiceGTK final : public nsPrintSettingsService
 {
 public:
   nsPrintSettingsServiceGTK() {}
-  virtual ~nsPrintSettingsServiceGTK() {}
 
   NS_IMETHODIMP SerializeToPrintData(nsIPrintSettings* aSettings,
                                      nsIWebBrowserPrint* aWBP,
-                                     mozilla::embedding::PrintData* data);
+                                     mozilla::embedding::PrintData* data) override;
+
   NS_IMETHODIMP DeserializeToPrintSettings(const mozilla::embedding::PrintData& data,
-                                           nsIPrintSettings* settings);
+                                           nsIPrintSettings* settings) override;
 
-  virtual nsresult _CreatePrintSettings(nsIPrintSettings **_retval);
+  virtual nsresult _CreatePrintSettings(nsIPrintSettings** _retval) override;
 };
 
-
-
 #endif // nsPrintSettingsServiceGTK_h
--- a/widget/nsPrintSettingsImpl.cpp
+++ b/widget/nsPrintSettingsImpl.cpp
@@ -7,20 +7,16 @@
 #include "nsReadableUtils.h"
 #include "nsIPrintSession.h"
 #include "mozilla/RefPtr.h"
 
 #define DEFAULT_MARGIN_WIDTH 0.5
 
 NS_IMPL_ISUPPORTS(nsPrintSettings, nsIPrintSettings)
 
-/** ---------------------------------------------------
- *  See documentation in nsPrintSettingsImpl.h
- *	@update 6/21/00 dwc
- */
 nsPrintSettings::nsPrintSettings() :
   mPrintOptions(0L),
   mPrintRange(kRangeAllPages),
   mStartPageNum(1),
   mEndPageNum(1),
   mScaling(1.0),
   mPrintBGColors(false),
   mPrintBGImages(false),
@@ -58,29 +54,21 @@ nsPrintSettings::nsPrintSettings() :
   mHeaderStrs[0].AssignLiteral("&T");
   mHeaderStrs[2].AssignLiteral("&U");
 
   mFooterStrs[0].AssignLiteral("&PT"); // Use &P (Page Num Only) or &PT (Page Num of Page Total)
   mFooterStrs[2].AssignLiteral("&D");
 
 }
 
-/** ---------------------------------------------------
- *  See documentation in nsPrintSettingsImpl.h
- *	@update 6/21/00 dwc
- */
 nsPrintSettings::nsPrintSettings(const nsPrintSettings& aPS)
 {
   *this = aPS;
 }
 
-/** ---------------------------------------------------
- *  See documentation in nsPrintSettingsImpl.h
- *	@update 6/21/00 dwc
- */
 nsPrintSettings::~nsPrintSettings()
 {
 }
 
 NS_IMETHODIMP nsPrintSettings::GetPrintSession(nsIPrintSession **aPrintSession)
 {
   NS_ENSURE_ARG_POINTER(aPrintSession);
   *aPrintSession = nullptr;
--- a/widget/nsPrintSettingsService.cpp
+++ b/widget/nsPrintSettingsService.cpp
@@ -661,20 +661,16 @@ nsPrintSettingsService::ReadPrefs(nsIPri
   }
 
   // Not Reading In:
   //   Number of Copies
 
   return NS_OK;
 }
 
-/** ---------------------------------------------------
- *  See documentation in nsPrintSettingsService.h
- *  @update 1/12/01 rods
- */
 nsresult
 nsPrintSettingsService::WritePrefs(nsIPrintSettings* aPS,
                                    const nsAString& aPrinterName,
                                    uint32_t aFlags)
 {
   NS_ENSURE_ARG_POINTER(aPS);
 
   nsIntMargin margin;
--- a/widget/nsPrintSettingsService.h
+++ b/widget/nsPrintSettingsService.h
@@ -30,16 +30,21 @@ public:
   /**
    * method Init
    *  Initializes member variables. Every consumer that does manual
    *  creation (instead of do_CreateInstance) needs to call this method
    *  immediately after instantiation.
    */
   virtual nsresult Init();
 
+private:
+  // Copying is not supported.
+  nsPrintSettingsService(const nsPrintSettingsService& x) = delete;
+  nsPrintSettingsService& operator=(const nsPrintSettingsService& x) = delete;
+
 protected:
   virtual ~nsPrintSettingsService() {}
 
   void ReadBitFieldPref(const char * aPrefId, int32_t anOption);
   void WriteBitFieldPref(const char * aPrefId, int32_t anOption);
   void ReadJustification(const char * aPrefId, int16_t& aJust,
                          int16_t aInitValue);
   void WriteJustification(const char * aPrefId, int16_t aJust);
@@ -54,41 +59,39 @@ protected:
   nsresult WritePrefDouble(const char * aPrefId, double aVal);
 
   /**
    * method ReadPrefs
    * @param aPS          a pointer to the printer settings
    * @param aPrinterName the name of the printer for which to read prefs
    * @param aFlags       flag specifying which prefs to read
    */
-  virtual nsresult ReadPrefs(nsIPrintSettings* aPS, const nsAString&
-                             aPrinterName, uint32_t aFlags);
+  virtual nsresult ReadPrefs(nsIPrintSettings* aPS,
+                             const nsAString& aPrinterName,
+                             uint32_t aFlags);
   /**
    * method WritePrefs
    * @param aPS          a pointer to the printer settings
    * @param aPrinterName the name of the printer for which to write prefs
    * @param aFlags       flag specifying which prefs to read
    */
-  virtual nsresult WritePrefs(nsIPrintSettings* aPS, const nsAString& aPrefName,
+  virtual nsresult WritePrefs(nsIPrintSettings* aPS,
+                              const nsAString& aPrinterName,
                               uint32_t aFlags);
-  const char* GetPrefName(const char *     aPrefName,
+
+  const char* GetPrefName(const char* aPrefName,
                           const nsAString&  aPrinterName);
 
   /**
    * method _CreatePrintSettings
    *   May be implemented by the platform-specific derived class
    *
    * @return             printer settings instance
    */
   virtual nsresult _CreatePrintSettings(nsIPrintSettings **_retval);
 
   // Members
   nsCOMPtr<nsIPrintSettings> mGlobalPrintSettings;
 
   nsCString mPrefName;
-
-private:
-  // These are not supported and are not implemented!
-  nsPrintSettingsService(const nsPrintSettingsService& x) = delete;
-  nsPrintSettingsService& operator=(const nsPrintSettingsService& x) = delete;
 };
 
 #endif // nsPrintSettingsService_h
--- a/widget/windows/nsPrintSettingsServiceWin.h
+++ b/widget/windows/nsPrintSettingsServiceWin.h
@@ -12,22 +12,20 @@
 
 class nsIPrintSettings;
 class nsIWebBrowserPrint;
 
 class nsPrintSettingsServiceWin final : public nsPrintSettingsService
 {
 public:
   nsPrintSettingsServiceWin() {}
-  virtual ~nsPrintSettingsServiceWin() {}
 
   NS_IMETHODIMP SerializeToPrintData(nsIPrintSettings* aSettings,
                                      nsIWebBrowserPrint* aWBP,
-                                     mozilla::embedding::PrintData* data);
+                                     mozilla::embedding::PrintData* data) override;
+
   NS_IMETHODIMP DeserializeToPrintSettings(const mozilla::embedding::PrintData& data,
-                                           nsIPrintSettings* settings);
+                                           nsIPrintSettings* settings) override;
 
-  virtual nsresult _CreatePrintSettings(nsIPrintSettings **_retval);
+  nsresult _CreatePrintSettings(nsIPrintSettings** _retval) override;
 };
 
-
-
 #endif // nsPrintSettingsServiceWin_h