Bug 1049379 - Remove dangerous public destructor into mobile/android. r=nchen
--- 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"