Bug 321219 - separate places backend into toolkit, r=beng

This commit is contained in:
benjamin@smedbergs.us
2006-07-18 19:41:12 +00:00
parent 2d7a976512
commit bd9d3ba313
20 changed files with 219 additions and 163 deletions

View File

@@ -901,6 +901,7 @@ browser/components/history/Makefile
browser/components/migration/Makefile
browser/components/migration/public/Makefile
browser/components/migration/src/Makefile
browser/components/places/Makefile
browser/components/preferences/Makefile
browser/components/search/Makefile
browser/components/sidebar/Makefile
@@ -975,6 +976,9 @@ toolkit/components/history/src/Makefile
toolkit/components/passwordmgr/Makefile
toolkit/components/passwordmgr/base/Makefile
toolkit/components/passwordmgr/resources/Makefile
toolkit/components/places/Makefile
toolkit/components/places/public/Makefile
toolkit/components/places/src/Makefile
toolkit/components/printing/Makefile
toolkit/components/satchel/Makefile
toolkit/components/satchel/public/Makefile

View File

@@ -59,25 +59,7 @@ ifneq (,$(filter windows mac cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
SHARED_LIBRARY_LIBS += ../shell/src/$(LIB_PREFIX)shellservice_s.$(LIB_SUFFIX)
endif
ifdef MOZ_PLACES
# note: this requires mork because the auto complete code used as the base class
# for the new auto complete result implementation includes the implementation of
# the mork results
REQUIRES += \
autocomplete \
docshell \
locale \
layout \
dom \
morkreader \
history \
storage \
places \
$(NULL)
LOCAL_INCLUDES += -I$(srcdir)/../places/src
SHARED_LIBRARY_LIBS += ../places/src/$(LIB_PREFIX)places_s.$(LIB_SUFFIX)
else
ifndef MOZ_PLACES
SHARED_LIBRARY_LIBS += \
../bookmarks/src/$(LIB_PREFIX)bookmarks_s.$(LIB_SUFFIX) \
$(NULL)
@@ -108,14 +90,6 @@ EXTRA_DSO_LDOPTS += \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
ifdef MOZ_PLACES
ifdef MOZ_ENABLE_LIBXUL
EXTRA_DSO_LDOPTS += $(LIBXUL_DIST)/../db/morkreader/external/$(LIB_PREFIX)morkreader_external_s.$(LIB_SUFFIX)
else
EXTRA_DSO_LDOPTS += $(LIBXUL_DIST)/../db/morkreader/$(LIB_PREFIX)morkreader_s.$(LIB_SUFFIX)
endif
endif
# Mac: Need to link with CoreFoundation for Mac Migrators (PList reading code)
# GTK2: Need to link with glib for GNOME shell service
ifneq (,$(filter mac cocoa gtk2,$(MOZ_WIDGET_TOOLKIT)))

View File

@@ -82,48 +82,6 @@
#define NS_RDF_FORWARDPROXY_INFER_DATASOURCE_CID \
{ 0x7a024bcf, 0xedd5, 0x4d9a, { 0x86, 0x14, 0xd4, 0x4b, 0xe1, 0xda, 0xda, 0xd3 } }
#define NS_NAVHISTORYSERVICE_CID \
{ 0x88cecbb7, 0x6c63, 0x4b3b, { 0x8c, 0xd4, 0x84, 0xf3, 0xb8, 0x22, 0x8c, 0x69 } }
#define NS_NAVHISTORYSERVICE_CONTRACTID \
"@mozilla.org/browser/nav-history-service;1"
#define NS_NAVHISTORYRESULTTREEVIEWER_CID \
{ 0x2ea8966f, 0x0671, 0x4c02, { 0x9c, 0x70, 0x94, 0x59, 0x56, 0xd4, 0x54, 0x34 } }
#define NS_NAVHISTORYRESULTTREEVIEWER_CONTRACTID \
"@mozilla.org/browser/nav-history/result-tree-viewer;1"
#define NS_ANNOTATIONSERVICE_CID \
{ 0x5e8d4751, 0x1852, 0x434b, { 0xa9, 0x92, 0x2c, 0x6d, 0x2a, 0x25, 0xfa, 0x46 } }
#define NS_ANNOTATIONSERVICE_CONTRACTID \
"@mozilla.org/browser/annotation-service;1"
#define NS_NAVBOOKMARKSSERVICE_CID \
{ 0x9de95a0c, 0x39a4, 0x4d64, {0x9a, 0x53, 0x17, 0x94, 0x0d, 0xd7, 0xca, 0xbb}}
#define NS_NAVBOOKMARKSSERVICE_CONTRACTID \
"@mozilla.org/browser/nav-bookmarks-service;1"
#define NS_FAVICONSERVICE_CID \
{ 0x984e3259, 0x9266, 0x49cf, { 0xb6, 0x05, 0x60, 0xb0, 0x22, 0xa0, 0x07, 0x56 } }
#define NS_FAVICONSERVICE_CONTRACTID \
"@mozilla.org/browser/favicon-service;1"
#define NS_LIVEMARKSERVICE_CID \
{ 0xb1257934, 0x86cf, 0x4143, { 0x83, 0x86, 0x73, 0x4a, 0xc3, 0x52, 0xb6, 0xba } }
#define NS_LIVEMARKSERVICE_CONTRACTID \
"@mozilla.org/browser/livemark-service;1"
#define NS_MORKHISTORYIMPORTER_CID \
{ 0x428e6d12, 0x9c6d, 0x436f, {0xb7, 0xa3, 0x6c, 0xa5, 0xf4, 0x80, 0x92, 0x12}}
#define NS_MORKHISTORYIMPORTER_CONTRACTID \
"@mozilla.org/browser/history-importer;1"
#define NS_FEEDSNIFFER_CID \
{ 0x6893e69, 0x71d8, 0x4b23, { 0x81, 0xeb, 0x80, 0x31, 0x4d, 0xaf, 0x3e, 0x66 } }

View File

@@ -39,15 +39,7 @@
#include "nsIGenericFactory.h"
#include "nsBrowserCompsCID.h"
#ifdef MOZ_PLACES
#include "nsAnnoProtocolHandler.h"
#include "nsAnnotationService.h"
#include "nsNavHistory.h"
#include "nsNavBookmarks.h"
#include "nsFaviconService.h"
#include "nsLivemarkService.h"
#include "nsMorkHistoryImporter.h"
#else
#ifndef MOZ_PLACES
#include "nsBookmarksService.h"
#include "nsForwardProxyDataSource.h"
#endif
@@ -88,16 +80,7 @@
/////////////////////////////////////////////////////////////////////////////
#ifdef MOZ_PLACES
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNavHistory, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNavHistoryResultTreeViewer)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAnnoProtocolHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAnnotationService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNavBookmarks, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFaviconService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsLivemarkService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMorkHistoryImporter)
#else
#ifndef MOZ_PLACES
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsBookmarksService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsForwardProxyDataSource, Init)
#endif
@@ -152,58 +135,7 @@ static const nsModuleComponentInfo components[] =
#endif
#if defined(MOZ_PLACES)
{ "Browser Navigation History",
NS_NAVHISTORYSERVICE_CID,
NS_NAVHISTORYSERVICE_CONTRACTID,
nsNavHistoryConstructor },
{ "Browser Navigation History",
NS_NAVHISTORYSERVICE_CID,
"@mozilla.org/browser/global-history;2",
nsNavHistoryConstructor },
{ "Browser Navigation History",
NS_NAVHISTORYSERVICE_CID,
"@mozilla.org/autocomplete/search;1?name=history",
nsNavHistoryConstructor },
{ "History tree view",
NS_NAVHISTORYRESULTTREEVIEWER_CID,
NS_NAVHISTORYRESULTTREEVIEWER_CONTRACTID,
nsNavHistoryResultTreeViewerConstructor },
{ "Page Annotation Service",
NS_ANNOTATIONSERVICE_CID,
NS_ANNOTATIONSERVICE_CONTRACTID,
nsAnnotationServiceConstructor },
{ "Annotation Protocol Handler",
NS_ANNOPROTOCOLHANDLER_CID,
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-anno",
nsAnnoProtocolHandlerConstructor },
{ "Browser Bookmarks Service",
NS_NAVBOOKMARKSSERVICE_CID,
NS_NAVBOOKMARKSSERVICE_CONTRACTID,
nsNavBookmarksConstructor },
{ "Favicon Service",
NS_FAVICONSERVICE_CID,
NS_FAVICONSERVICE_CONTRACTID,
nsFaviconServiceConstructor },
{ "Livemark Service",
NS_LIVEMARKSERVICE_CID,
NS_LIVEMARKSERVICE_CONTRACTID,
nsLivemarkServiceConstructor },
{ "Mork History Importer",
NS_MORKHISTORYIMPORTER_CID,
NS_MORKHISTORYIMPORTER_CONTRACTID,
nsMorkHistoryImporterConstructor },
#else
#ifndef MOZ_PLACES
{ "Bookmarks",
NS_BOOKMARKS_SERVICE_CID,

View File

@@ -40,6 +40,7 @@
#ifdef MOZ_PLACES
#include "nsINavBookmarksService.h"
#include "nsBrowserCompsCID.h"
#include "nsToolkitCompsCID.h"
#else
#include "nsIBookmarksService.h"
#endif
@@ -298,7 +299,7 @@ ImportBookmarksHTML(nsIFile* aBookmarksFile,
// Import the bookmarks into the folder.
rv = bms->ImportBookmarksHTMLToFolder(fileURI, folder);
NS_ENSURE_SUCCESS(rv, rv);
return rv;
#else
nsCOMPtr<nsIRDFResource> folder;
bms->CreateFolderInContainer(importedBookmarksTitle.get(), root, -1,

View File

@@ -43,6 +43,4 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src
include $(topsrcdir)/config/rules.mk

View File

@@ -44,9 +44,11 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = places
LIBRARY_NAME = places_s
MOZILLA_INTERNAL_API = 1
FORCE_STATIC_LIB = 1
LIBRARY_NAME = places
LIBXUL_LIBRARY = 1
EXPORT_LIBRARY = 1
MODULE_NAME = nsPlacesModule
IS_COMPONENT = 1
REQUIRES = xpcom \
string \
@@ -76,8 +78,6 @@ REQUIRES = xpcom \
microsummaries \
$(NULL)
LOCAL_INCLUDES = -I$(srcdir)/../../build
CPPSRCS = \
nsAnnoProtocolHandler.cpp \
nsAnnotationService.cpp \
@@ -93,7 +93,15 @@ CPPSRCS = \
nsBookmarksFeedHandler.cpp \
nsMaybeWeakPtr.cpp \
nsMorkHistoryImporter.cpp \
nsPlacesModule.cpp \
$(NULL)
include $(topsrcdir)/config/rules.mk
EXTRA_DSO_LDOPTS = \
$(DEPTH)/db/morkreader/$(LIB_PREFIX)morkreader_s.$(LIB_SUFFIX) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
LOCAL_INCLUDES += -I$(srcdir)/../../build

View File

@@ -88,7 +88,7 @@
* both require the content (= title) before actually creating it.
*/
#include "nsBrowserCompsCID.h"
#include "nsToolkitCompsCID.h"
#include "nsCOMPtr.h"
#include "nsCRT.h"
#include "nsEscape.h"

View File

@@ -40,7 +40,7 @@
#include "nsIStringBundle.h"
#include "nsIAnnotationService.h"
#include "nsNavHistory.h"
#include "nsBrowserCompsCID.h"
#include "nsToolkitCompsCID.h"
#include "nsILoadGroup.h"
#include "nsIObserver.h"

View File

@@ -44,7 +44,7 @@
#include "nsITransaction.h"
#include "nsNavHistory.h"
#include "nsNavHistoryResult.h" // need for Int64 hashtable
#include "nsBrowserCompsCID.h"
#include "nsToolkitCompsCID.h"
class nsIOutputStream;

View File

@@ -69,6 +69,10 @@ ifdef MOZ_FEEDS
DIRS += feeds
endif
ifdef MOZ_PLACES
DIRS += places
endif
ifdef NS_PRINTING
DIRS += printing
endif

View File

@@ -82,6 +82,27 @@
#define NS_SCRIPTABLEUNESCAPEHTML_CONTRACTID "@mozilla.org/feed-unescapehtml;1"
#define NS_NAVHISTORYSERVICE_CONTRACTID \
"@mozilla.org/browser/nav-history-service;1"
#define NS_NAVHISTORYRESULTTREEVIEWER_CONTRACTID \
"@mozilla.org/browser/nav-history/result-tree-viewer;1"
#define NS_ANNOTATIONSERVICE_CONTRACTID \
"@mozilla.org/browser/annotation-service;1"
#define NS_NAVBOOKMARKSSERVICE_CONTRACTID \
"@mozilla.org/browser/nav-bookmarks-service;1"
#define NS_LIVEMARKSERVICE_CONTRACTID \
"@mozilla.org/browser/livemark-service;1"
#define NS_MORKHISTORYIMPORTER_CONTRACTID \
"@mozilla.org/browser/history-importer;1"
#define NS_FAVICONSERVICE_CONTRACTID \
"@mozilla.org/browser/favicon-service;1"
/////////////////////////////////////////////////////////////////////////////
// {A0CCAAF8-09DA-44D8-B250-9AC3E93C8117}
@@ -134,3 +155,24 @@
// {10f2f5f0-f103-4901-980f-ba11bd70d60d}
#define NS_SCRIPTABLEUNESCAPEHTML_CID \
{ 0x10f2f5f0, 0xf103, 0x4901, { 0x98, 0x0f, 0xba, 0x11, 0xbd, 0x70, 0xd6, 0x0d} }
#define NS_NAVHISTORYSERVICE_CID \
{ 0x88cecbb7, 0x6c63, 0x4b3b, { 0x8c, 0xd4, 0x84, 0xf3, 0xb8, 0x22, 0x8c, 0x69 } }
#define NS_NAVHISTORYRESULTTREEVIEWER_CID \
{ 0x2ea8966f, 0x0671, 0x4c02, { 0x9c, 0x70, 0x94, 0x59, 0x56, 0xd4, 0x54, 0x34 } }
#define NS_ANNOTATIONSERVICE_CID \
{ 0x5e8d4751, 0x1852, 0x434b, { 0xa9, 0x92, 0x2c, 0x6d, 0x2a, 0x25, 0xfa, 0x46 } }
#define NS_NAVBOOKMARKSSERVICE_CID \
{ 0x9de95a0c, 0x39a4, 0x4d64, {0x9a, 0x53, 0x17, 0x94, 0x0d, 0xd7, 0xca, 0xbb}}
#define NS_LIVEMARKSERVICE_CID \
{ 0xb1257934, 0x86cf, 0x4143, { 0x83, 0x86, 0x73, 0x4a, 0xc3, 0x52, 0xb6, 0xba } }
#define NS_MORKHISTORYIMPORTER_CID \
{ 0x428e6d12, 0x9c6d, 0x436f, {0xb7, 0xa3, 0x6c, 0xa5, 0xf4, 0x80, 0x92, 0x12}}
#define NS_FAVICONSERVICE_CID \
{ 0x984e3259, 0x9266, 0x49cf, { 0xb6, 0x05, 0x60, 0xb0, 0x22, 0xa0, 0x07, 0x56 } }

View File

@@ -0,0 +1,48 @@
#
# ***** 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 Places code
#
# The Initial Developer of the Original Code is
# Google Inc.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Brett Wilson <brettw@gmail.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
DIRS = public src
include $(topsrcdir)/config/rules.mk

View File

@@ -44,9 +44,11 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = places
LIBRARY_NAME = places_s
MOZILLA_INTERNAL_API = 1
FORCE_STATIC_LIB = 1
LIBRARY_NAME = places
LIBXUL_LIBRARY = 1
EXPORT_LIBRARY = 1
MODULE_NAME = nsPlacesModule
IS_COMPONENT = 1
REQUIRES = xpcom \
string \
@@ -76,8 +78,6 @@ REQUIRES = xpcom \
microsummaries \
$(NULL)
LOCAL_INCLUDES = -I$(srcdir)/../../build
CPPSRCS = \
nsAnnoProtocolHandler.cpp \
nsAnnotationService.cpp \
@@ -93,7 +93,15 @@ CPPSRCS = \
nsBookmarksFeedHandler.cpp \
nsMaybeWeakPtr.cpp \
nsMorkHistoryImporter.cpp \
nsPlacesModule.cpp \
$(NULL)
include $(topsrcdir)/config/rules.mk
EXTRA_DSO_LDOPTS = \
$(DEPTH)/db/morkreader/$(LIB_PREFIX)morkreader_s.$(LIB_SUFFIX) \
$(MOZ_UNICHARUTIL_LIBS) \
$(MOZ_COMPONENT_LIBS) \
$(NULL)
LOCAL_INCLUDES += -I$(srcdir)/../../build

View File

@@ -88,7 +88,7 @@
* both require the content (= title) before actually creating it.
*/
#include "nsBrowserCompsCID.h"
#include "nsToolkitCompsCID.h"
#include "nsCOMPtr.h"
#include "nsCRT.h"
#include "nsEscape.h"

View File

@@ -40,7 +40,7 @@
#include "nsIStringBundle.h"
#include "nsIAnnotationService.h"
#include "nsNavHistory.h"
#include "nsBrowserCompsCID.h"
#include "nsToolkitCompsCID.h"
#include "nsILoadGroup.h"
#include "nsIObserver.h"

View File

@@ -44,7 +44,7 @@
#include "nsITransaction.h"
#include "nsNavHistory.h"
#include "nsNavHistoryResult.h" // need for Int64 hashtable
#include "nsBrowserCompsCID.h"
#include "nsToolkitCompsCID.h"
class nsIOutputStream;

View File

@@ -0,0 +1,74 @@
#include "nsIGenericFactory.h"
#include "nsAnnoProtocolHandler.h"
#include "nsAnnotationService.h"
#include "nsNavHistory.h"
#include "nsNavBookmarks.h"
#include "nsFaviconService.h"
#include "nsLivemarkService.h"
#include "nsMorkHistoryImporter.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNavHistory, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNavHistoryResultTreeViewer)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAnnoProtocolHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAnnotationService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNavBookmarks, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsFaviconService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsLivemarkService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMorkHistoryImporter)
static const nsModuleComponentInfo components[] =
{
{ "Browser Navigation History",
NS_NAVHISTORYSERVICE_CID,
NS_NAVHISTORYSERVICE_CONTRACTID,
nsNavHistoryConstructor },
{ "Browser Navigation History",
NS_NAVHISTORYSERVICE_CID,
"@mozilla.org/browser/global-history;2",
nsNavHistoryConstructor },
{ "Browser Navigation History",
NS_NAVHISTORYSERVICE_CID,
"@mozilla.org/autocomplete/search;1?name=history",
nsNavHistoryConstructor },
{ "History tree view",
NS_NAVHISTORYRESULTTREEVIEWER_CID,
NS_NAVHISTORYRESULTTREEVIEWER_CONTRACTID,
nsNavHistoryResultTreeViewerConstructor },
{ "Page Annotation Service",
NS_ANNOTATIONSERVICE_CID,
NS_ANNOTATIONSERVICE_CONTRACTID,
nsAnnotationServiceConstructor },
{ "Annotation Protocol Handler",
NS_ANNOPROTOCOLHANDLER_CID,
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-anno",
nsAnnoProtocolHandlerConstructor },
{ "Browser Bookmarks Service",
NS_NAVBOOKMARKSSERVICE_CID,
NS_NAVBOOKMARKSSERVICE_CONTRACTID,
nsNavBookmarksConstructor },
{ "Favicon Service",
NS_FAVICONSERVICE_CID,
NS_FAVICONSERVICE_CONTRACTID,
nsFaviconServiceConstructor },
{ "Livemark Service",
NS_LIVEMARKSERVICE_CID,
NS_LIVEMARKSERVICE_CONTRACTID,
nsLivemarkServiceConstructor },
{ "Mork History Importer",
NS_MORKHISTORYIMPORTER_CID,
NS_MORKHISTORYIMPORTER_CONTRACTID,
nsMorkHistoryImporterConstructor },
};
NS_IMPL_NSGETMODULE(nsPlacesModule, components)

View File

@@ -187,8 +187,12 @@ DEFINES += -DMOZ_FILEVIEW
endif
ifdef MOZ_PLACES
COMPONENT_LIBS += storagecomps
STATIC_LIBS += morkreader_s
COMPONENT_LIBS += \
storagecomps \
places \
$(NULL)
else
ifdef MOZ_MORK
COMPONENT_LIBS += \

View File

@@ -228,7 +228,8 @@
#ifdef MOZ_PLACES
#define PLACES_MODULES \
MODULE(mozStorageModule)
MODULE(mozStorageModule) \
MODULE(nsPlacesModule)
#else
#ifdef MOZ_MORK
#define PLACES_MODULES \