Bug 507073 - Don't build nsBrowserDirectoryProvider as a separate library. r=vlad
authorRyan Flint <rflint@ryanflint.com>
Sat, 07 Nov 2009 02:19:44 -0500
changeset 34659 e91b5f834338011bdc98bd33cda217c243096719
parent 34658 b697b641e508c6116301583266cd0e60f657989a
child 34660 5d321b7b899f1d6120054c990a4735f39f278eb2
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad
bugs507073
milestone1.9.3a1pre
Bug 507073 - Don't build nsBrowserDirectoryProvider as a separate library. r=vlad
browser/components/build/Makefile.in
browser/components/build/nsBrowserCompsCID.h
browser/components/build/nsModule.cpp
browser/components/dirprovider/DirectoryProvider.cpp
browser/components/dirprovider/DirectoryProvider.h
browser/components/dirprovider/Makefile.in
browser/components/dirprovider/nsBrowserDirectoryProvider.cpp
browser/components/dirprovider/tests/Makefile.in
browser/components/dirprovider/tests/unit/head_dirprovider.js
browser/components/dirprovider/tests/unit/test_bookmark_pref.js
browser/components/dirprovider/tests/unit/test_keys.js
browser/installer/removed-files.in
--- a/browser/components/build/Makefile.in
+++ b/browser/components/build/Makefile.in
@@ -31,27 +31,29 @@ OS_LIBS	+= $(call EXPAND_LIBNAME,ole32 s
 endif
 
 LOCAL_INCLUDES = \
 	-I$(srcdir)/../shell/src \
 	-I$(srcdir)/../feeds/src \
 	-I$(srcdir)/../places/src \
 	-I$(srcdir)/../privatebrowsing/src \
 	-I$(srcdir)/../about \
+	-I$(srcdir)/../dirprovider \
 	$(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,version)
 endif
 
 SHARED_LIBRARY_LIBS = \
 	../feeds/src/$(LIB_PREFIX)browser_feeds_s.$(LIB_SUFFIX) \
 	../places/src/$(LIB_PREFIX)browserplaces_s.$(LIB_SUFFIX) \
 	../privatebrowsing/src/$(LIB_PREFIX)privatebrowsing_s.$(LIB_SUFFIX) \
 	../about/$(LIB_PREFIX)browserabout_s.$(LIB_SUFFIX) \
+	../dirprovider/$(LIB_PREFIX)browserdir_s.$(LIB_SUFFIX) \
 	$(NULL)
 
 ifneq (,$(filter windows cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
 SHARED_LIBRARY_LIBS += ../shell/src/$(LIB_PREFIX)shellservice_s.$(LIB_SUFFIX)
 endif
 
 EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib)
 
--- a/browser/components/build/nsBrowserCompsCID.h
+++ b/browser/components/build/nsBrowserCompsCID.h
@@ -101,8 +101,11 @@
 // 136e2c4d-c5a4-477c-b131-d93d7d704f64
 #define NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID \
 { 0x136e2c4d, 0xc5a4, 0x477c, { 0xb1, 0x31, 0xd9, 0x3d, 0x7d, 0x70, 0x4f, 0x64 } }
 
 // 7e4bb6ad-2fc4-4dc6-89ef-23e8e5ccf980
 #define NS_BROWSER_ABOUT_REDIRECTOR_CID \
 { 0x7e4bb6ad, 0x2fc4, 0x4dc6, { 0x89, 0xef, 0x23, 0xe8, 0xe5, 0xcc, 0xf9, 0x80 } }
 
+// {6DEB193C-F87D-4078-BC78-5E64655B4D62}
+#define NS_BROWSERDIRECTORYPROVIDER_CID \
+{ 0x6deb193c, 0xf87d, 0x4078, { 0xbc, 0x78, 0x5e, 0x64, 0x65, 0x5b, 0x4d, 0x62 } }
--- a/browser/components/build/nsModule.cpp
+++ b/browser/components/build/nsModule.cpp
@@ -34,16 +34,17 @@
  * 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 "nsIGenericFactory.h"
 
 #include "nsBrowserCompsCID.h"
+#include "DirectoryProvider.h"
 #include "nsPlacesImportExportService.h"
 
 #if defined(XP_WIN)
 #include "nsWindowsShellService.h"
 #elif defined(XP_MACOSX)
 #include "nsMacShellService.h"
 #elif defined(MOZ_WIDGET_GTK2)
 #include "nsGNOMEShellService.h"
@@ -79,16 +80,17 @@
 
 #include "nsPrivateBrowsingServiceWrapper.h"
 #include "nsNetCID.h"
 
 using namespace mozilla::browser;
 
 /////////////////////////////////////////////////////////////////////////////
 
+NS_GENERIC_FACTORY_CONSTRUCTOR(DirectoryProvider)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsPlacesImportExportService)
 #if defined(XP_WIN)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsShellService)
 #elif defined(XP_MACOSX)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
 #elif defined(MOZ_WIDGET_GTK2)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
 #endif
@@ -119,16 +121,24 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsICabPro
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrivateBrowsingServiceWrapper, Init)
 
 /////////////////////////////////////////////////////////////////////////////
 
 static const nsModuleComponentInfo components[] =
 {
+  { "Browser Directory Provider",
+    NS_BROWSERDIRECTORYPROVIDER_CID,
+    NS_BROWSERDIRECTORYPROVIDER_CONTRACTID,
+    DirectoryProviderConstructor,
+    DirectoryProvider::Register,
+    DirectoryProvider::Unregister
+  },
+
 #if defined(XP_WIN)
   { "Browser Shell Service",
     NS_SHELLSERVICE_CID,
     NS_SHELLSERVICE_CONTRACTID,
     nsWindowsShellServiceConstructor},
 
 #elif defined(MOZ_WIDGET_GTK2)
   { "Browser Shell Service",
rename from browser/components/dirprovider/nsBrowserDirectoryProvider.cpp
rename to browser/components/dirprovider/DirectoryProvider.cpp
--- a/browser/components/dirprovider/nsBrowserDirectoryProvider.cpp
+++ b/browser/components/dirprovider/DirectoryProvider.cpp
@@ -31,16 +31,17 @@
  * 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 "nsIDirectoryService.h"
+#include "DirectoryProvider.h"
 
 #include "nsIFile.h"
 #include "nsISimpleEnumerator.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 
 #include "nsArrayEnumerator.h"
 #include "nsEnumeratorUtils.h"
@@ -51,62 +52,25 @@
 #include "nsComponentManagerUtils.h"
 #include "nsCOMArray.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsIGenericFactory.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStringAPI.h"
 #include "nsXULAppAPI.h"
 
-class nsBrowserDirectoryProvider :
-  public nsIDirectoryServiceProvider2
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIDIRECTORYSERVICEPROVIDER
-  NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
-
-  static NS_METHOD Register(nsIComponentManager* aCompMgr,
-                            nsIFile* aPath, const char *aLoaderStr,
-                            const char *aType,
-                            const nsModuleComponentInfo *aInfo);
-
-  static NS_METHOD Unregister(nsIComponentManager* aCompMgr,
-                              nsIFile* aPath, const char *aLoaderStr,
-                              const nsModuleComponentInfo *aInfo);
+namespace mozilla {
+namespace browser {
 
-private:
-  nsresult RestoreBookmarksFromBackup(const nsACString& aLeafName,
-				      nsIFile* aParentDir, nsIFile* aTarget);
-  void EnsureProfileFile(const nsACString& aLeafName,
-			 nsIFile* aParentDir, nsIFile* aTarget);
-
-  class AppendingEnumerator : public nsISimpleEnumerator
-  {
-  public:
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSISIMPLEENUMERATOR
-
-    AppendingEnumerator(nsISimpleEnumerator* aBase,
-                        char const *const *aAppendList);
-
-  private:
-    nsCOMPtr<nsISimpleEnumerator> mBase;
-    char const *const *const      mAppendList;
-    nsCOMPtr<nsIFile>             mNext;
-  };
-};
-
-NS_IMPL_ISUPPORTS2(nsBrowserDirectoryProvider,
+NS_IMPL_ISUPPORTS2(DirectoryProvider,
                    nsIDirectoryServiceProvider,
                    nsIDirectoryServiceProvider2)
 
 NS_IMETHODIMP
-nsBrowserDirectoryProvider::GetFile(const char *aKey, PRBool *aPersist,
-                                    nsIFile* *aResult)
+DirectoryProvider::GetFile(const char *aKey, PRBool *aPersist, nsIFile* *aResult)
 {
   nsresult rv;
 
   *aResult = nsnull;
 
   // NOTE: This function can be reentrant through the NS_GetSpecialDirectory
   // call, so be careful not to cause infinite recursion.
 
@@ -285,18 +249,17 @@ AppendDistroSearchDirs(nsIProperties* aD
         if (NS_SUCCEEDED(rv) && exists)
           array.AppendObject(defLocalePlugins);
       }
     }
   }
 }
 
 NS_IMETHODIMP
-nsBrowserDirectoryProvider::GetFiles(const char *aKey,
-                                     nsISimpleEnumerator* *aResult)
+DirectoryProvider::GetFiles(const char *aKey, nsISimpleEnumerator* *aResult)
 {
   nsresult rv;
 
   if (!strcmp(aKey, NS_APP_SEARCH_DIR_LIST)) {
     nsCOMPtr<nsIProperties> dirSvc
       (do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID));
     if (!dirSvc)
       return NS_ERROR_FAILURE;
@@ -326,85 +289,64 @@ nsBrowserDirectoryProvider::GetFiles(con
       return NS_ERROR_OUT_OF_MEMORY;
 
     return NS_NewUnionEnumerator(aResult, extEnum, baseEnum);
   }
 
   return NS_ERROR_FAILURE;
 }
 
-static char const kContractID[] = "@mozilla.org/browser/directory-provider;1";
-
-// {6DEB193C-F87D-4078-BC78-5E64655B4D62}
-#define NS_BROWSERDIRECTORYPROVIDER_CID \
-  { 0x6deb193c, 0xf87d, 0x4078, { 0xbc, 0x78, 0x5e, 0x64, 0x65, 0x5b, 0x4d, 0x62 } }
-
 NS_METHOD
-nsBrowserDirectoryProvider::Register(nsIComponentManager* aCompMgr,
-                                     nsIFile* aPath, const char *aLoaderStr,
-                                     const char *aType,
-                                     const nsModuleComponentInfo *aInfo)
+DirectoryProvider::Register(nsIComponentManager* aCompMgr, nsIFile* aPath,
+                            const char *aLoaderStr, const char *aType,
+                            const nsModuleComponentInfo *aInfo)
 {
   nsresult rv;
 
   nsCOMPtr<nsICategoryManager> catMan
     (do_GetService(NS_CATEGORYMANAGER_CONTRACTID));
   if (!catMan)
     return NS_ERROR_FAILURE;
 
   rv = catMan->AddCategoryEntry(XPCOM_DIRECTORY_PROVIDER_CATEGORY,
                                 "browser-directory-provider",
-                                kContractID, PR_TRUE, PR_TRUE, nsnull);
+                                NS_BROWSERDIRECTORYPROVIDER_CONTRACTID,
+                                PR_TRUE, PR_TRUE, nsnull);
   return rv;
 }
 
 
 NS_METHOD
-nsBrowserDirectoryProvider::Unregister(nsIComponentManager* aCompMgr,
-                                       nsIFile* aPath, const char *aLoaderStr,
-                                       const nsModuleComponentInfo *aInfo)
+DirectoryProvider::Unregister(nsIComponentManager* aCompMgr, 
+                              nsIFile* aPath, const char *aLoaderStr,
+                              const nsModuleComponentInfo *aInfo)
 {
   nsresult rv;
 
   nsCOMPtr<nsICategoryManager> catMan
     (do_GetService(NS_CATEGORYMANAGER_CONTRACTID));
   if (!catMan)
     return NS_ERROR_FAILURE;
 
   rv = catMan->DeleteCategoryEntry(XPCOM_DIRECTORY_PROVIDER_CATEGORY,
                                    "browser-directory-provider", PR_TRUE);
   return rv;
 }
 
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsBrowserDirectoryProvider)
-
-static const nsModuleComponentInfo components[] = {
-  {
-    "nsBrowserDirectoryProvider",
-    NS_BROWSERDIRECTORYPROVIDER_CID,
-    kContractID,
-    nsBrowserDirectoryProviderConstructor,
-    nsBrowserDirectoryProvider::Register,
-    nsBrowserDirectoryProvider::Unregister
-  }
-};
-
-NS_IMPL_NSGETMODULE(BrowserDirProvider, components)
-NS_IMPL_ISUPPORTS1(nsBrowserDirectoryProvider::AppendingEnumerator,
-                   nsISimpleEnumerator)
+NS_IMPL_ISUPPORTS1(DirectoryProvider::AppendingEnumerator, nsISimpleEnumerator)
 
 NS_IMETHODIMP
-nsBrowserDirectoryProvider::AppendingEnumerator::HasMoreElements(PRBool *aResult)
+DirectoryProvider::AppendingEnumerator::HasMoreElements(PRBool *aResult)
 {
   *aResult = mNext ? PR_TRUE : PR_FALSE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBrowserDirectoryProvider::AppendingEnumerator::GetNext(nsISupports* *aResult)
+DirectoryProvider::AppendingEnumerator::GetNext(nsISupports* *aResult)
 {
   if (aResult)
     NS_ADDREF(*aResult = mNext);
 
   mNext = nsnull;
 
   nsresult rv;
 
@@ -435,17 +377,20 @@ nsBrowserDirectoryProvider::AppendingEnu
       break;
 
     mNext = nsnull;
   }
 
   return NS_OK;
 }
 
-nsBrowserDirectoryProvider::AppendingEnumerator::AppendingEnumerator
+DirectoryProvider::AppendingEnumerator::AppendingEnumerator
     (nsISimpleEnumerator* aBase,
      char const *const *aAppendList) :
   mBase(aBase),
   mAppendList(aAppendList)
 {
   // Initialize mNext to begin.
   GetNext(nsnull);
 }
+
+} // namespace browser
+} // namespace mozilla
new file mode 100644
--- /dev/null
+++ b/browser/components/dirprovider/DirectoryProvider.h
@@ -0,0 +1,89 @@
+/* ***** 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 the Mozilla Firefox browser.
+ *
+ * The Initial Developer of the Original Code is
+ * Benjamin Smedberg <benjamin@smedbergs.us>
+ *
+ * Portions created by the Initial Developer are Copyright (C) 2005
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * 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 DirectoryProvider_h__
+#define DirectoryProvider_h__
+
+#include "nsIDirectoryService.h"
+#include "nsComponentManagerUtils.h"
+#include "nsISimpleEnumerator.h"
+#include "nsIFile.h"
+#include "nsIGenericFactory.h"
+
+#define NS_BROWSERDIRECTORYPROVIDER_CONTRACTID \
+  "@mozilla.org/browser/directory-provider;1"
+
+namespace mozilla {
+namespace browser {
+
+class DirectoryProvider : public nsIDirectoryServiceProvider2
+{
+public:
+  NS_DECL_ISUPPORTS
+  NS_DECL_NSIDIRECTORYSERVICEPROVIDER
+  NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
+
+  static NS_METHOD Register(nsIComponentManager* aCompMgr,
+                            nsIFile* aPath, const char *aLoaderStr,
+                            const char *aType,
+                            const nsModuleComponentInfo *aInfo);
+
+  static NS_METHOD Unregister(nsIComponentManager* aCompMgr,
+                              nsIFile* aPath, const char *aLoaderStr,
+                              const nsModuleComponentInfo *aInfo);
+
+private:
+  class AppendingEnumerator : public nsISimpleEnumerator
+  {
+  public:
+    NS_DECL_ISUPPORTS
+    NS_DECL_NSISIMPLEENUMERATOR
+
+    AppendingEnumerator(nsISimpleEnumerator* aBase,
+                        char const *const *aAppendList);
+
+  private:
+    nsCOMPtr<nsISimpleEnumerator> mBase;
+    char const *const *const      mAppendList;
+    nsCOMPtr<nsIFile>             mNext;
+  };
+};
+
+} // namespace browser
+} // namespace mozilla
+
+#endif // DirectoryProvider_h__
--- a/browser/components/dirprovider/Makefile.in
+++ b/browser/components/dirprovider/Makefile.in
@@ -37,29 +37,35 @@
 
 DEPTH     = ../../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-MODULE               = browsercomps
-LIBRARY_NAME         = browserdirprovider
-SHORT_LIBNAME        = brwsrdir
-IS_COMPONENT         = 1
-MODULE_NAME          = BrowserDirProvider
-FORCE_SHARED_LIB     = 1
+MODULE = browserdir
+LIBRARY_NAME = browserdir_s
+
+DIRS = tests
+
+FORCE_STATIC_LIB = 1
+FORCE_USE_PIC = 1
 
 # Because we are an application component, link against the CRT statically
 # (on Windows, but only if we're not building our own CRT for jemalloc)
 ifndef MOZ_MEMORY
 USE_STATIC_LIBS      = 1
 endif
 
-CPPSRCS = nsBrowserDirectoryProvider.cpp
+EXPORTS_NAMESPACES = mozilla/browser
+EXPORTS_mozilla/browser = DirectoryProvider.h
+
+CPPSRCS = DirectoryProvider.cpp
+
+LOCAL_INCLUDES = -I$(srcdir)/../build
 
 EXTRA_DSO_LDOPTS = \
 	$(XPCOM_GLUE_LDOPTS) \
 	$(NSPR_LIBS) \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/browser/components/dirprovider/tests/Makefile.in
@@ -0,0 +1,49 @@
+# ***** 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 mozilla.org code.
+#
+# The Initial Developer of the Original Code is Mozilla Foundation.
+# Portions created by the Initial Developer are Copyright (C) 2009
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Ryan Flint <rflint@mozilla.com> (Original Author)
+#
+# 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@
+relativesrcdir = browser/components/dirprovider/tests
+
+include $(DEPTH)/config/autoconf.mk
+
+MODULE = test_browserdir
+
+XPCSHELL_TESTS = unit
+
+include $(topsrcdir)/config/rules.mk
new file mode 100644
--- /dev/null
+++ b/browser/components/dirprovider/tests/unit/head_dirprovider.js
@@ -0,0 +1,52 @@
+/* ***** 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 mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Ryan Flint <rflint@mozilla.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 ***** */
+
+const Cc = Components.classes;
+const Ci = Components.interfaces;
+
+var gProfD = do_get_profile();
+var gDirSvc = Cc["@mozilla.org/file/directory_service;1"].
+              getService(Ci.nsIProperties);
+var gPrefSvc = Cc["@mozilla.org/preferences-service;1"].
+               getService(Ci.nsIPrefBranch);
+
+function writeTestFile(aParent, aName) {
+  let file = aParent.clone();
+  file.append(aName);
+  file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0644);
+  return file;
+}
+
new file mode 100644
--- /dev/null
+++ b/browser/components/dirprovider/tests/unit/test_bookmark_pref.js
@@ -0,0 +1,46 @@
+/* ***** 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 mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Ryan Flint <rflint@mozilla.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 ***** */
+
+// We need to run this test separately since DirectoryProvider persists BMarks
+
+function run_test() {
+  let dir = gProfD.clone();
+  let tfile = writeTestFile(dir, "bookmarkfile.test");
+  gPrefSvc.setCharPref("browser.bookmarks.file", tfile.path);
+
+  let bmarks = gDirSvc.get("BMarks", Ci.nsIFile);
+  do_check_true(tfile.equals(bmarks));
+}
new file mode 100644
--- /dev/null
+++ b/browser/components/dirprovider/tests/unit/test_keys.js
@@ -0,0 +1,91 @@
+/* ***** 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 mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2009
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Ryan Flint <rflint@mozilla.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 ***** */
+
+function test_usr_micsum() {
+  let mdir = gProfD.clone();
+  mdir.append("microsummary-generators");
+
+  let tmdir = gDirSvc.get("UsrMicsumGens", Ci.nsIFile);
+  do_check_true(tmdir.equals(mdir));
+
+  if (!tmdir.exists())
+    tmdir.create(Ci.nsIFile.DIRECTORY_TYPE, 0777);
+
+  do_check_true(tmdir.isWritable());
+
+  let tfile = writeTestFile(tmdir, "usrmicsum");
+  do_check_true(tfile.exists());
+
+  mdir.append(tfile.leafName);
+  do_check_true(mdir.exists());
+}
+
+function test_app_micsum() {
+  let mdir = gDirSvc.get("XCurProcD", Ci.nsIFile);
+  mdir.append("microsummary-generators");
+
+  let tmdir = gDirSvc.get("MicsumGens", Ci.nsIFile);
+  do_check_true(tmdir.equals(mdir));
+}
+
+function test_bookmarkhtml() {
+  let bmarks = gProfD.clone();
+  bmarks.append("bookmarks.html");
+
+  let tbmarks = gDirSvc.get("BMarks", Ci.nsIFile);
+  do_check_true(bmarks.equals(tbmarks));
+}
+
+function test_prefoverride() {
+  let dir = gDirSvc.get("DefRt", Ci.nsIFile);
+  dir.append("existing-profile-defaults.js");
+
+  let tdir = gDirSvc.get("ExistingPrefOverride", Ci.nsIFile);
+  do_check_true(dir.equals(tdir));
+}
+
+function run_test() {
+  [test_usr_micsum,
+   test_app_micsum,
+   test_bookmarkhtml,
+   test_prefoverride
+  ].forEach(function(f) {
+    do_test_pending();
+    print("Running test: " + f.name);
+    f();
+    do_test_finished();
+  });
+}
--- a/browser/installer/removed-files.in
+++ b/browser/installer/removed-files.in
@@ -64,16 +64,18 @@ XUL
 @DLL_PREFIX@xpistub@DLL_SUFFIX@
 component.reg
 components/aboutCertError.js
 components/aboutPrivateBrowsing.js
 components/aboutRights.js
 components/aboutRobots.js
 components/aboutSessionRestore.js
 components/compreg.dat
+components/@DLL_PREFIX@browserdirprovider@DLL_SUFFIX@
+components/@DLL_PREFIX@brwsrdir@DLL_SUFFIX@
 components/@DLL_PREFIX@myspell@DLL_SUFFIX@
 components/@DLL_PREFIX@spellchecker@DLL_SUFFIX@
 components/@DLL_PREFIX@spellchk@DLL_SUFFIX@
 components/xpti.dat
 components/xptitemp.dat
 components/nsBackgroundUpdateService.js
 components/nsCloseAllWindows.js
 #ifndef XP_MACOSX