From 63752889cd04f247673068baf3b2a6f90200d534 Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Fri, 9 Nov 2012 10:55:48 +0100 Subject: [PATCH] Bug 799609 - Disable Places in B2G - Part 1 - Remove Android history from Places r=paolo --- toolkit/components/places/Database.cpp | 6 ------ toolkit/components/places/History.cpp | 9 +++++---- toolkit/components/places/History.h | 8 -------- toolkit/components/places/Makefile.in | 10 ---------- toolkit/components/places/nsPlacesModule.cpp | 21 -------------------- 5 files changed, 5 insertions(+), 49 deletions(-) diff --git a/toolkit/components/places/Database.cpp b/toolkit/components/places/Database.cpp index 64e3413ce424..f52587b2eaac 100644 --- a/toolkit/components/places/Database.cpp +++ b/toolkit/components/places/Database.cpp @@ -363,12 +363,6 @@ Database::~Database() nsresult Database::Init() { -#ifdef MOZ_ANDROID_HISTORY - // Currently places has deeply weaved it way throughout the gecko codebase. - // Here we disable all database creation and loading of places. - return NS_ERROR_NOT_IMPLEMENTED; -#endif - MOZ_ASSERT(NS_IsMainThread()); nsCOMPtr storage = diff --git a/toolkit/components/places/History.cpp b/toolkit/components/places/History.cpp index e572ea9917c0..5a2274a5fced 100644 --- a/toolkit/components/places/History.cpp +++ b/toolkit/components/places/History.cpp @@ -1454,10 +1454,10 @@ History::~History() #endif } -void +NS_IMETHODIMP History::NotifyVisited(nsIURI* aURI) { - NS_ASSERTION(aURI, "Ruh-roh! A NULL URI was passed to us!"); + NS_ENSURE_ARG(aURI); nsAutoScriptBlocker scriptBlocker; @@ -1477,14 +1477,14 @@ History::NotifyVisited(nsIURI* aURI) // If the hash table has not been initialized, then we have nothing to notify // about. if (!mObservers.IsInitialized()) { - return; + return NS_OK; } // Additionally, if we have no observers for this URI, we have nothing to // notify about. KeyClass* key = mObservers.GetEntry(aURI); if (!key) { - return; + return NS_OK; } // Update status of each Link node. @@ -1503,6 +1503,7 @@ History::NotifyVisited(nsIURI* aURI) // All the registered nodes can now be removed for this URI. mObservers.RemoveEntry(aURI); + return NS_OK; } mozIStorageAsyncStatement* diff --git a/toolkit/components/places/History.h b/toolkit/components/places/History.h index fb0a7cfbd840..31ab8d2a2ed8 100644 --- a/toolkit/components/places/History.h +++ b/toolkit/components/places/History.h @@ -47,14 +47,6 @@ public: History(); - /** - * Notifies about the visited status of a given URI. - * - * @param aURI - * The URI to notify about. - */ - void NotifyVisited(nsIURI* aURI); - /** * Obtains the statement to use to check if a URI is visited or not. */ diff --git a/toolkit/components/places/Makefile.in b/toolkit/components/places/Makefile.in index 416ff895d50b..a495b2354a3e 100644 --- a/toolkit/components/places/Makefile.in +++ b/toolkit/components/places/Makefile.in @@ -69,15 +69,6 @@ CPPSRCS = \ LOCAL_INCLUDES += -I$(srcdir)/../build -ifdef MOZ_ANDROID_HISTORY -CPPSRCS += nsAndroidHistory.cpp -LOCAL_INCLUDES += \ - -I$(topsrcdir)/docshell/base \ - -I$(topsrcdir)/content/base/src \ - $(NULL) -endif - -ifndef MOZ_ANDROID_HISTORY EXTRA_COMPONENTS = \ toolkitplaces.manifest \ nsLivemarkService.js \ @@ -104,7 +95,6 @@ EXTRA_PP_JS_MODULES = \ $(NULL) TEST_DIRS += tests -endif include $(topsrcdir)/config/config.mk include $(topsrcdir)/ipc/chromium/chromium-config.mk diff --git a/toolkit/components/places/nsPlacesModule.cpp b/toolkit/components/places/nsPlacesModule.cpp index 9a800fe31ce0..4492702e0ccd 100644 --- a/toolkit/components/places/nsPlacesModule.cpp +++ b/toolkit/components/places/nsPlacesModule.cpp @@ -14,10 +14,6 @@ #include "History.h" #include "nsDocShellCID.h" -#ifdef MOZ_ANDROID_HISTORY -#include "nsAndroidHistory.h" -#endif - using namespace mozilla::places; NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsNavHistory, @@ -30,11 +26,7 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsFaviconService, nsFaviconService::GetSingleton) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsPlacesExportService, nsPlacesExportService::GetSingleton) -#ifdef MOZ_ANDROID_HISTORY -NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsAndroidHistory, nsAndroidHistory::GetSingleton) -#else NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(History, History::GetSingleton) -#endif NS_GENERIC_FACTORY_CONSTRUCTOR(nsAnnoProtocolHandler) NS_DEFINE_NAMED_CID(NS_NAVHISTORYSERVICE_CID); @@ -43,12 +35,7 @@ NS_DEFINE_NAMED_CID(NS_ANNOPROTOCOLHANDLER_CID); NS_DEFINE_NAMED_CID(NS_NAVBOOKMARKSSERVICE_CID); NS_DEFINE_NAMED_CID(NS_FAVICONSERVICE_CID); NS_DEFINE_NAMED_CID(NS_PLACESIMPORTEXPORTSERVICE_CID); - -#ifdef MOZ_ANDROID_HISTORY -NS_DEFINE_NAMED_CID(NS_ANDROIDHISTORY_CID); -#else NS_DEFINE_NAMED_CID(NS_HISTORYSERVICE_CID); -#endif const mozilla::Module::CIDEntry kPlacesCIDs[] = { { &kNS_NAVHISTORYSERVICE_CID, false, NULL, nsNavHistoryConstructor }, @@ -56,11 +43,7 @@ const mozilla::Module::CIDEntry kPlacesCIDs[] = { { &kNS_ANNOPROTOCOLHANDLER_CID, false, NULL, nsAnnoProtocolHandlerConstructor }, { &kNS_NAVBOOKMARKSSERVICE_CID, false, NULL, nsNavBookmarksConstructor }, { &kNS_FAVICONSERVICE_CID, false, NULL, nsFaviconServiceConstructor }, -#ifdef MOZ_ANDROID_HISTORY - { &kNS_ANDROIDHISTORY_CID, false, NULL, nsAndroidHistoryConstructor }, -#else { &kNS_HISTORYSERVICE_CID, false, NULL, HistoryConstructor }, -#endif { &kNS_PLACESIMPORTEXPORTSERVICE_CID, false, NULL, nsPlacesExportServiceConstructor }, { NULL } }; @@ -73,12 +56,8 @@ const mozilla::Module::ContractIDEntry kPlacesContracts[] = { { NS_NAVBOOKMARKSSERVICE_CONTRACTID, &kNS_NAVBOOKMARKSSERVICE_CID }, { NS_FAVICONSERVICE_CONTRACTID, &kNS_FAVICONSERVICE_CID }, { "@mozilla.org/embeddor.implemented/bookmark-charset-resolver;1", &kNS_NAVHISTORYSERVICE_CID }, -#ifdef MOZ_ANDROID_HISTORY - { NS_IHISTORY_CONTRACTID, &kNS_ANDROIDHISTORY_CID }, -#else { NS_IHISTORY_CONTRACTID, &kNS_HISTORYSERVICE_CID }, { NS_DOWNLOADHISTORY_CONTRACTID, &kNS_HISTORYSERVICE_CID }, -#endif { NS_PLACESIMPORTEXPORTSERVICE_CONTRACTID, &kNS_PLACESIMPORTEXPORTSERVICE_CID }, { NULL } };