Bug 608981 - Enable building of places in Thunderbird, but disable history by default; r=philringnalda

This commit is contained in:
Mark Banner 2010-11-22 19:22:57 +00:00
Родитель 949592aa69
Коммит ba8fe2df20
9 изменённых файлов: 54 добавлений и 265 удалений

Просмотреть файл

@ -610,3 +610,48 @@ pref("browser.link.open_newwindow", 3);
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", "%");

Просмотреть файл

@ -54,10 +54,6 @@ ifdef MOZ_SAFE_BROWSING
DIRS += phishing
endif
ifndef MOZ_PLACES
DIRS += history
endif
DIRS += build
EXTRA_COMPONENTS = \

Просмотреть файл

@ -97,10 +97,6 @@ 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) \

Просмотреть файл

@ -42,16 +42,6 @@
#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)
@ -111,10 +101,6 @@ NS_DEFINE_NAMED_CID(NS_MAILGNOMEINTEGRATION_CID);
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 },
@ -136,9 +122,6 @@ const mozilla::Module::CIDEntry kMailCIDs[] = {
#endif
#ifdef XP_MACOSX
{ &kNS_MAILMACINTEGRATION_CID, false, NULL, nsMailMacIntegrationConstructor },
#endif
#ifndef MOZ_PLACES
{ &kNS_HISTORYSERVICE_CID, false, NULL, HistoryConstructor },
#endif
{ NULL }
};
@ -164,9 +147,6 @@ const mozilla::Module::ContractIDEntry kMailContracts[] = {
#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 }
};

Просмотреть файл

@ -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

Просмотреть файл

@ -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;
}
}

Просмотреть файл

@ -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

Просмотреть файл

@ -51,8 +51,6 @@ 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

Просмотреть файл

@ -379,8 +379,17 @@
@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