Bug 608981 - Enable building of places in Thunderbird, but disable history by default; r=philringnalda
☠☠ backed out by 7a81fdf82d0b ☠ ☠
authorMark Banner <bugzilla@standard8.plus.com>
Mon, 22 Nov 2010 19:22:57 +0000
changeset 6740 33511651e217403204a4f17e8e1e8b1187ebc234
parent 6739 d4b0999ac013d104c6a6293cc9ca33360190725d
child 6741 191d148a57e01398c19f4a22c43d1137641fd26a
push idunknown
push userunknown
push dateunknown
reviewersphilringnalda
bugs608981
Bug 608981 - Enable building of places in Thunderbird, but disable history by default; r=philringnalda
mail/app/profile/all-thunderbird.js
mail/components/Makefile.in
mail/components/build/Makefile.in
mail/components/build/nsMailComps.cpp
mail/components/history/Makefile.in
mail/components/history/history.cpp
mail/components/history/history.h
mail/confvars.sh
mail/installer/package-manifest.in
--- a/mail/app/profile/all-thunderbird.js
+++ b/mail/app/profile/all-thunderbird.js
@@ -605,8 +605,53 @@ pref("browser.link.open_newwindow", 3);
 // 1: don't divert window.open at all
 // 2: don't divert window.open with features
 //
 // Thunderbird only supports a value of 0. Other values can be set, but are
 // not implemented or supported.
 pref("browser.link.open_newwindow.restriction", 0);
 
 pref("browser.tabs.loadDivertedInBackground", false);
+
+// Disable places by default as we don't want to store global history
+// Below we define reasonable defaults as copied from Firefox so that we have
+// something sensible should an extension wish to enable this.
+pref("places.history.enabled", false);
+
+// The percentage of system memory that the Places database can use.  Out of the
+// allowed cache size it will at most use the size of the database file.
+// Changes to this value are effective after an application restart.
+// Acceptable values are between 0 and 50.
+pref("places.database.cache_to_memory_percentage", 6);
+
+// the (maximum) number of the recent visits to sample
+// when calculating frecency
+pref("places.frecency.numVisits", 10);
+
+// buckets (in days) for frecency calculation
+pref("places.frecency.firstBucketCutoff", 4);
+pref("places.frecency.secondBucketCutoff", 14);
+pref("places.frecency.thirdBucketCutoff", 31);
+pref("places.frecency.fourthBucketCutoff", 90);
+
+// weights for buckets for frecency calculations
+pref("places.frecency.firstBucketWeight", 100);
+pref("places.frecency.secondBucketWeight", 70);
+pref("places.frecency.thirdBucketWeight", 50);
+pref("places.frecency.fourthBucketWeight", 30);
+pref("places.frecency.defaultBucketWeight", 10);
+
+// bonus (in percent) for visit transition types for frecency calculations
+pref("places.frecency.embedVisitBonus", 0);
+pref("places.frecency.framedLinkVisitBonus", 0);
+pref("places.frecency.linkVisitBonus", 100);
+pref("places.frecency.typedVisitBonus", 2000);
+pref("places.frecency.bookmarkVisitBonus", 75);
+pref("places.frecency.downloadVisitBonus", 0);
+pref("places.frecency.permRedirectVisitBonus", 0);
+pref("places.frecency.tempRedirectVisitBonus", 0);
+pref("places.frecency.defaultVisitBonus", 0);
+
+// bonus (in percent) for place types for frecency calculations
+pref("places.frecency.unvisitedBookmarkBonus", 140);
+pref("places.frecency.unvisitedTypedBonus", 200);
+
+pref("browser.urlbar.restrict.openpage", "%");
--- a/mail/components/Makefile.in
+++ b/mail/components/Makefile.in
@@ -49,20 +49,16 @@ DIRS    = compose preferences addrbook m
 ifneq (,$(filter windows gtk2 cocoa, $(MOZ_WIDGET_TOOLKIT)))
 DIRS += shell
 endif
 
 ifdef MOZ_SAFE_BROWSING
 DIRS += phishing 
 endif
 
-ifndef MOZ_PLACES
-DIRS += history
-endif
-
 DIRS += build
 
 EXTRA_COMPONENTS = \
 	nsMailDefaultHandler.js \
 	mailContentHandler.js \
 	aboutRights.js \
 	mailComponents.manifest \
 	$(NULL)
--- a/mail/components/build/Makefile.in
+++ b/mail/components/build/Makefile.in
@@ -92,20 +92,16 @@ SHARED_LIBRARY_LIBS = \
 ifneq (,$(filter windows cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
 SHARED_LIBRARY_LIBS += ../shell/$(LIB_PREFIX)shellservice_s.$(LIB_SUFFIX)
 endif
 
 ifneq (,$(filter windows, $(MOZ_WIDGET_TOOLKIT)))
 SHARED_LIBRARY_LIBS += ../search/$(LIB_PREFIX)winsearch_s.$(LIB_SUFFIX)
 endif
 
-ifndef MOZ_PLACES
-SHARED_LIBRARY_LIBS += ../history/$(LIB_PREFIX)mailhistory_s.$(LIB_SUFFIX)
-endif
-
 ifdef MOZILLA_INTERNAL_API
 EXTRA_DSO_LDOPTS += \
 	$(LIBXUL_DIST)/../modules/libreg/src/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX) \
 	$(MOZ_COMPONENT_LIBS) \
 	$(MOZ_UNICHARUTIL_LIBS) \
 	$(NULL)
 else
 EXTRA_DSO_LDOPTS += \
--- a/mail/components/build/nsMailComps.cpp
+++ b/mail/components/build/nsMailComps.cpp
@@ -37,26 +37,16 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "mozilla/ModuleUtils.h"
 #include "nsMailMigrationCID.h"
 #include "nsProfileMigrator.h"
 #include "nsSeamonkeyProfileMigrator.h"
 
-#ifndef MOZ_PLACES
-#include "nsDocShellCID.h"
-#include "history.h"
-
-using namespace mozilla;
-
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(History, History::GetSingleton)
-
-#endif
-
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsProfileMigrator)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSeamonkeyProfileMigrator)
 
 #ifdef XP_WIN32
 
 #include "nsOEProfileMigrator.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsOEProfileMigrator)
 
@@ -106,20 +96,16 @@ NS_DEFINE_NAMED_CID(NS_EUDORAPROFILEMIGR
 #ifdef MOZ_WIDGET_GTK2
 NS_DEFINE_NAMED_CID(NS_MAILGNOMEINTEGRATION_CID);
 #endif
 
 #ifdef XP_MACOSX
 NS_DEFINE_NAMED_CID(NS_MAILMACINTEGRATION_CID);
 #endif
 
-#ifndef MOZ_PLACES
-NS_DEFINE_NAMED_CID(NS_HISTORYSERVICE_CID);
-#endif
-
 const mozilla::Module::CIDEntry kMailCIDs[] = {
   { &kNS_THUNDERBIRD_PROFILEIMPORT_CID, false, NULL, nsProfileMigratorConstructor },
   { &kNS_SEAMONKEYPROFILEMIGRATOR_CID, false, NULL, nsSeamonkeyProfileMigratorConstructor },
 #ifdef XP_WIN32
   { &kNS_OEXPRESSPROFILEMIGRATOR_CID, false, NULL, nsOEProfileMigratorConstructor },
   { &kNS_OUTLOOKPROFILEMIGRATOR_CID, false, NULL, nsOutlookProfileMigratorConstructor },
   { &kNS_MAILWININTEGRATION_CID, false, NULL, nsWindowsShellServiceConstructor },
 #if MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN
@@ -132,19 +118,16 @@ const mozilla::Module::CIDEntry kMailCID
 #endif
 #endif
 #ifdef MOZ_WIDGET_GTK2
   { &kNS_MAILGNOMEINTEGRATION_CID, false, NULL, nsMailGNOMEIntegrationConstructor },
 #endif
 #ifdef XP_MACOSX
   { &kNS_MAILMACINTEGRATION_CID, false, NULL, nsMailMacIntegrationConstructor },
 #endif
-#ifndef MOZ_PLACES
-  { &kNS_HISTORYSERVICE_CID, false, NULL, HistoryConstructor },
-#endif
   { NULL }
 };
 
 const mozilla::Module::ContractIDEntry kMailContracts[] = {
   { NS_PROFILEMIGRATOR_CONTRACTID, &kNS_THUNDERBIRD_PROFILEIMPORT_CID },
   { NS_MAILPROFILEMIGRATOR_CONTRACTID_PREFIX "seamonkey", &kNS_SEAMONKEYPROFILEMIGRATOR_CID },
 #ifdef XP_WIN32
   { NS_MAILPROFILEMIGRATOR_CONTRACTID_PREFIX "oexpress", &kNS_OEXPRESSPROFILEMIGRATOR_CID },
@@ -160,19 +143,16 @@ const mozilla::Module::ContractIDEntry k
 #endif
 #endif
 #ifdef MOZ_WIDGET_GTK2
   { "@mozilla.org/mail/shell-service;1", &kNS_MAILGNOMEINTEGRATION_CID },
 #endif
 #ifdef XP_MACOSX
   { "@mozilla.org/mail/shell-service;1", &kNS_MAILMACINTEGRATION_CID },
 #endif
-#ifndef MOZ_PLACES
-  { NS_IHISTORY_CONTRACTID, &kNS_HISTORYSERVICE_CID },
-#endif
   { NULL }
 };
 
 static const mozilla::Module kMailCompsModule = {
   mozilla::Module::kVersion,
   kMailCIDs,
   kMailContracts
 };
deleted file mode 100644
--- a/mail/components/history/Makefile.in
+++ /dev/null
@@ -1,61 +0,0 @@
-# ***** BEGIN LICENSE BLOCK *****
-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# The Original Code is Thunderbird Empty History.
-#
-# The Initial Developer of the Original Code is
-# the Mozilla Foundation.
-# Portions created by the Initial Developer are Copyright (C) 2010
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#  Mark Banner <bugzilla@standard8.plus.com>
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH     = ../../..
-topsrcdir = @top_srcdir@
-srcdir    = @srcdir@
-VPATH     = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE = mailhistory
-LIBRARY_NAME = mailhistory_s
-# Linux builds should use external API except when we are building libxul.
-ifneq ($(MOZ_WIDGET_TOOLKIT), gtk2)
-MOZILLA_INTERNAL_API = 1
-endif
-ifdef MOZ_ENABLE_LIBXUL
-MOZILLA_INTERNAL_API = 1
-endif
-
-CPPSRCS = \
-  history.cpp \
-  $(NULL)
-
-FORCE_STATIC_LIB = 1
-
-include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/mail/components/history/history.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Thunderbird empty history.
- *
- * The Initial Developer of the Original Code is
- *  the Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Mark Banner <bugzilla@standard8.plus.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "history.h"
-
-using namespace mozilla::dom;
-
-namespace mozilla {
-
-History* History::gService = NULL;
-
-History::History()
-{
-  NS_ASSERTION(!gService, "Ruh-roh!  This service has already been created!");
-  gService = this;
-}
-
-History::~History()
-{
-  gService = NULL;
-}
-
-History*
-History::GetSingleton()
-{
-  if (!gService)
-  {
-    gService = new History();
-    NS_ENSURE_TRUE(gService, nsnull);
-  }
-
-  NS_ADDREF(gService);
-  return gService;
-}
-
-NS_IMPL_ISUPPORTS1(History, IHistory)
-
-NS_IMETHODIMP
-History::RegisterVisitedCallback(nsIURI *aURI, Link *aLink)
-{
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-History::UnregisterVisitedCallback(nsIURI *aURI, Link *aLink)
-{
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-History::VisitURI(nsIURI *aURI, nsIURI *aLastVisitedURI, PRUint32 aFlags)
-{
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-History::SetURITitle(nsIURI* aURI, const nsAString& aTitle)
-{
-  return NS_OK;
-}
-}
deleted file mode 100644
--- a/mail/components/history/history.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Thunderbird empty history.
- *
- * The Initial Developer of the Original Code is
- *  the Mozilla Foundation
- * Portions created by the Initial Developer are Copyright (C) 2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Mark Banner <bugzilla@standard8.plus.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef history_h_
-#define history_h_
-
-#include "mozilla/IHistory.h"
-#include "mozilla/dom/Link.h"
-
-namespace mozilla {
-
-#define NS_HISTORYSERVICE_CID \
-   {0x7f7ad055, 0x49e6, 0x440b, {0xa6, 0xe9, 0x89, 0x71, 0x25, 0xae, 0xc1, 0x1e}}
-
-/**
- * This service only exists here because Thunderbird doesn't currently want
- * MOZ_PLACES and Gecko doesn't want to provide a history service for
- * non-MOZ_PLACES apps or a sane default so that they can get unvisited links
- * without having to implement the service.
- */
-class History : public IHistory
-{
-public:
-  History();
-
-  NS_DECL_ISUPPORTS
-  NS_DECL_IHISTORY
-
-  /**
-   * Obtains a pointer that has had AddRef called on it.  Used by the service
-   * manager only.
-   */
-  static History *GetSingleton();
-
-private:
-  ~History();
-
-  static History *gService;
-};
-
-}
-
-#endif
--- a/mail/confvars.sh
+++ b/mail/confvars.sh
@@ -46,18 +46,16 @@ NECKO_PROTOCOLS_DEFAULT="about data file
 MOZ_MAIL_NEWS=1
 if [ "$COMM_BUILD" ]; then
   MOZ_LDAP_XPCOM=1
 fi
 MOZ_STATIC_MAIL_BUILD=1
 MOZ_COMPOSER=1
 MOZ_SAFE_BROWSING=1
 MOZ_TOOLKIT_SEARCH=
-MOZ_PLACES=
-MOZ_MORKREADER=
 MOZ_MORK=1
 MOZ_IPC=
 MOZ_STATIC_BUILD_UNSUPPORTED=1
 
 MOZ_APP_VERSION_TXT=${_topsrcdir}/$MOZ_BUILD_APP/config/version.txt
 MOZ_BRANDING_DIRECTORY=mail/branding/nightly
 
 MOZ_APP_VERSION=`cat $MOZ_APP_VERSION_TXT`
--- a/mail/installer/package-manifest.in
+++ b/mail/installer/package-manifest.in
@@ -374,18 +374,27 @@
 ; toolkit
 @BINPATH@/components/commandlines.xpt
 @BINPATH@/components/chrome.xpt
 @BINPATH@/components/nsDefaultCLH.js
 @BINPATH@/components/nsDefaultCLH.manifest
 @BINPATH@/components/nsFormAutoComplete.js
 @BINPATH@/components/nsFormHistory.js
 @BINPATH@/components/nsInputListAutoComplete.js
+@BINPATH@/components/nsLivemarkService.js
+@BINPATH@/components/nsMicrosummaryService.js
+@BINPATH@/components/nsPlacesAutoComplete.js
+@BINPATH@/components/nsPlacesAutoComplete.manifest
+@BINPATH@/components/nsPlacesDBFlush.js
+@BINPATH@/components/nsPlacesExpiration.js
 @BINPATH@/components/nsPrompter.js
 @BINPATH@/components/nsPrompter.manifest
+@BINPATH@/components/nsTaggingService.js
+@BINPATH@/components/PlacesCategoriesStarter.js
+@BINPATH@/components/toolkitplaces.manifest
 #ifdef XP_MACOSX
 @BINPATH@/components/libalerts_s.dylib
 #elifdef XP_UNIX
 @BINPATH@/components/toolkitremote.xpt
 @BINPATH@/mozilla-xremote-client
 #endif
 #ifdef MOZ_GTK2
 @BINPATH@/components/filepicker.xpt