Bug 1049379 - Remove dangerous public destructor into mobile/android. r=nchen
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 20 Aug 2014 18:11:00 +0900
changeset 200519 eac6582136b3d1bb75b8353948b75122a2902cf8
parent 200518 4bb05704044db60b1ecce3fc4134a2776262b78c
child 200520 1ddfd9afba40866d9755b495d9d7d456748ee595
child 200608 10c76b62dfccbe4c8452003eb2d0a5a4bbd57ee1
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersnchen
bugs1049379
milestone34.0a1
Bug 1049379 - Remove dangerous public destructor into mobile/android. r=nchen
mobile/android/components/build/nsAndroidHistory.h
mobile/android/components/build/nsShellService.h
--- a/mobile/android/components/build/nsAndroidHistory.h
+++ b/mobile/android/components/build/nsAndroidHistory.h
@@ -5,42 +5,45 @@
 
 #ifndef NS_ANDROIDHISTORY_H
 #define NS_ANDROIDHISTORY_H
 
 #include "IHistory.h"
 #include "nsDataHashtable.h"
 #include "nsTPriorityQueue.h"
 #include "nsIRunnable.h"
+#include "nsIURI.h"
 
 #define NS_ANDROIDHISTORY_CID \
     {0xCCAA4880, 0x44DD, 0x40A7, {0xA1, 0x3F, 0x61, 0x56, 0xFC, 0x88, 0x2C, 0x0B}}
 
 // Max size of History::mRecentlyVisitedURIs
 #define RECENTLY_VISITED_URI_SIZE 8
 
 // Max size of History::mEmbedURIs
 #define EMBED_URI_SIZE 128
 
-class nsAndroidHistory : public mozilla::IHistory, public nsIRunnable
+class nsAndroidHistory MOZ_FINAL : public mozilla::IHistory, public nsIRunnable
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_IHISTORY
   NS_DECL_NSIRUNNABLE
 
   /**
    * Obtains a pointer that has had AddRef called on it.  Used by the service
    * manager only.
    */
   static nsAndroidHistory* GetSingleton();
 
   nsAndroidHistory();
 
 private:
+  ~nsAndroidHistory() {}
+
   static nsAndroidHistory* sHistory;
 
   nsDataHashtable<nsStringHashKey, nsTArray<mozilla::dom::Link *> *> mListeners;
   nsTPriorityQueue<nsString> mPendingURIs;
 
   nsresult CanAddURI(nsIURI* aURI, bool* canAdd);
 
   /**
--- a/mobile/android/components/build/nsShellService.h
+++ b/mobile/android/components/build/nsShellService.h
@@ -3,24 +3,26 @@
  * 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 __NS_SHELLSERVICE_H__
 #define __NS_SHELLSERVICE_H__
 
 #include "nsIShellService.h"
 
-class nsShellService : public nsIShellService
+class nsShellService MOZ_FINAL : public nsIShellService
 {
 public:
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSISHELLSERVICE
 
   nsShellService() {};
+
+private:
   ~nsShellService() {};
 
 };
 
 #define nsShellService_CID                          \
 {0xae9ebe1c, 0x61e9, 0x45fa, {0x8f, 0x34, 0xc1, 0x07, 0x80, 0x3a, 0x5b, 0x44}}
 
 #define nsShellService_ContractID "@mozilla.org/browser/shell-service;1"