Backed out changeset 8dddd6843317 to try to fix orange.
authorTed Mielczarek <ted.mielczarek@gmail.com>
Thu, 05 Nov 2009 17:58:03 -0500
changeset 32785 33c33143f5b7cef1e9940a37ec68034af4b4810d
parent 32782 8dddd6843317ef651086f69845c59eaa8dd9d76b
child 32786 ea4d99bf54a7220e7c68480f6c510550dd394525
push id589
push usertmielczarek@mozilla.com
push dateThu, 05 Nov 2009 22:56:09 +0000
bugs519357
milestone1.9.2b2pre
backs out8dddd6843317ef651086f69845c59eaa8dd9d76b
Backed out changeset 8dddd6843317 to try to fix orange. Benjamin Smedberg – Bug 519357 - Only load known binary components from the app directory by reading a components.list file, r=vlad, a=blocking1.9.2+
browser/installer/package-manifest.in
build/macosx/universal/flight.mk
config/rules.mk
js/src/config/rules.mk
layout/tools/reftest/Makefile.in
xpcom/components/nsComponentManager.cpp
xpcom/components/nsComponentManager.h
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -102,17 +102,16 @@
 @BINPATH@/run-mozilla.sh
 #endif
 #endif
 #ifdef MOZ_SPLASHSCREEN
 @BINPATH@/splash.bmp
 #endif
 
 ; [Components]
-@BINPATH@/components/components.list
 @BINPATH@/components/alerts.xpt
 #ifdef ACCESSIBILITY
 #ifdef XP_WIN32
 @BINPATH@/AccessibleMarshal.dll
 @BINPATH@/components/accessibility-msaa.xpt
 #endif
 @BINPATH@/components/accessibility.xpt
 #endif
--- a/build/macosx/universal/flight.mk
+++ b/build/macosx/universal/flight.mk
@@ -101,14 +101,13 @@ postflight_all:
 	  $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG_JAR) \
 	  $(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME)/$(BUILDCONFIG_JAR)
 	mkdir -p $(DIST_UNI)/$(MOZ_PKG_APPNAME)
 	rm -f $(DIST_X86)/universal
 	ln -s $(DIST_UNI) $(DIST_X86)/universal
 	rm -rf $(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
 	$(TOPSRCDIR)/build/macosx/universal/unify \
           --unify-with-sort "\.manifest$$" \
-          --unify-with-sort "components\.list$$" \
 	  $(DIST_PPC)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
 	  $(DIST_X86)/$(MOZ_PKG_APPNAME)/$(APPNAME) \
 	  $(DIST_UNI)/$(MOZ_PKG_APPNAME)/$(APPNAME)
 # A universal .dmg can now be produced by making in either architecture's
 # INSTALLER_DIR.
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -861,17 +861,16 @@ else
 	$(INSTALL) $(IFLAGS1) $(LIBRARY) $(DIST)/lib
 endif
 endif # DIST_INSTALL
 endif # LIBRARY
 ifdef SHARED_LIBRARY
 ifdef IS_COMPONENT
 	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components
 	$(ELF_DYNSTR_GC) $(FINAL_TARGET)/components/$(SHARED_LIBRARY)
-	@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_TARGET)/components/components.list $(SHARED_LIBRARY)
 ifdef BEOS_ADDON_WORKAROUND
 	( cd $(FINAL_TARGET)/components && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) )
 endif
 else # ! IS_COMPONENT
 ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
 	$(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(DIST)/lib
 else
 	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/lib
@@ -1775,32 +1774,29 @@ endif # XPIDLSRCS
 endif # MOZ_JAVAXPCOM
 
 ################################################################################
 # Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components
 ifdef EXTRA_COMPONENTS
 libs:: $(EXTRA_COMPONENTS)
 ifndef NO_DIST_INSTALL
 	$(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/components
-	@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_TARGET)/components/components.list $(notdir $^)
 endif
 
 endif
 
 ifdef EXTRA_PP_COMPONENTS
 libs:: $(EXTRA_PP_COMPONENTS)
 ifndef NO_DIST_INSTALL
 	$(EXIT_ON_ERROR) \
 	$(NSINSTALL) -D $(FINAL_TARGET)/components; \
 	for i in $^; do \
-	  fname=`basename $$i`; \
-	  dest=$(FINAL_TARGET)/components/$${fname}; \
+	  dest=$(FINAL_TARGET)/components/`basename $$i`; \
 	  $(RM) -f $$dest; \
 	  $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
-	  $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_TARGET)/components/components.list $$fname; \
 	done
 endif
 
 endif
 
 ################################################################################
 # Copy each element of EXTRA_JS_MODULES to $(FINAL_TARGET)/modules
 ifdef EXTRA_JS_MODULES
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -861,17 +861,16 @@ else
 	$(INSTALL) $(IFLAGS1) $(LIBRARY) $(DIST)/lib
 endif
 endif # DIST_INSTALL
 endif # LIBRARY
 ifdef SHARED_LIBRARY
 ifdef IS_COMPONENT
 	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(FINAL_TARGET)/components
 	$(ELF_DYNSTR_GC) $(FINAL_TARGET)/components/$(SHARED_LIBRARY)
-	@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_TARGET)/components/components.list $(SHARED_LIBRARY)
 ifdef BEOS_ADDON_WORKAROUND
 	( cd $(FINAL_TARGET)/components && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) )
 endif
 else # ! IS_COMPONENT
 ifneq (,$(filter OS2 WINNT WINCE,$(OS_ARCH)))
 	$(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(DIST)/lib
 else
 	$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/lib
@@ -1775,32 +1774,29 @@ endif # XPIDLSRCS
 endif # MOZ_JAVAXPCOM
 
 ################################################################################
 # Copy each element of EXTRA_COMPONENTS to $(FINAL_TARGET)/components
 ifdef EXTRA_COMPONENTS
 libs:: $(EXTRA_COMPONENTS)
 ifndef NO_DIST_INSTALL
 	$(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/components
-	@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_TARGET)/components/components.list $(notdir $^)
 endif
 
 endif
 
 ifdef EXTRA_PP_COMPONENTS
 libs:: $(EXTRA_PP_COMPONENTS)
 ifndef NO_DIST_INSTALL
 	$(EXIT_ON_ERROR) \
 	$(NSINSTALL) -D $(FINAL_TARGET)/components; \
 	for i in $^; do \
-	  fname=`basename $$i`; \
-	  dest=$(FINAL_TARGET)/components/$${fname}; \
+	  dest=$(FINAL_TARGET)/components/`basename $$i`; \
 	  $(RM) -f $$dest; \
 	  $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
-	  $(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(FINAL_TARGET)/components/components.list $$fname; \
 	done
 endif
 
 endif
 
 ################################################################################
 # Copy each element of EXTRA_JS_MODULES to $(FINAL_TARGET)/modules
 ifdef EXTRA_JS_MODULES
--- a/layout/tools/reftest/Makefile.in
+++ b/layout/tools/reftest/Makefile.in
@@ -83,18 +83,16 @@ endif
 
 $(_HARNESS_FILES): $(_DEST_DIR)
 
 # copy harness and the reftest extension bits to $(_DEST_DIR)
 copy-harness: $(_HARNESS_FILES)
 	$(INSTALL) $(_HARNESS_FILES) $(_DEST_DIR)
 	(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - reftest) | (cd $(_DEST_DIR) && tar -xf -)
 	$(INSTALL) $(DIST)/bin/components/httpd.js $(_DEST_DIR)/reftest/components
-# need to get httpd.js into components.list so it loads
-	@$(PERL) -I$(MOZILLA_DIR)/config $(MOZILLA_DIR)/config/build-list.pl $(_DEST_DIR)/reftest/components/components.list httpd.js
 	$(INSTALL) $(DIST)/bin/components/test_necko.xpt $(_DEST_DIR)/reftest/components
 
 PKG_STAGE = $(DIST)/test-package-stage
 
 # stage harness and tests for packaging
 stage-package:
 	$(NSINSTALL) -D $(PKG_STAGE)/reftest && $(NSINSTALL) -D $(PKG_STAGE)/reftest/tests
 	@(cd $(DEPTH)/_tests/reftest/ && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/reftest && tar -xf -)
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -81,17 +81,16 @@
 #include "nsString.h"
 #include "nsXPIDLString.h"
 #include "prcmon.h"
 #include "xptinfo.h" // this after nsISupports, to pick up IID so that xpt stuff doesn't try to define it itself...
 #include "nsThreadUtils.h"
 #include "prthread.h"
 #include "private/pprthred.h"
 #include "nsTArray.h"
-#include "prio.h"
 
 #include "nsInt64.h"
 #include "nsManifestLineReader.h"
 
 #include NEW_H     // for placement new
 
 
 #ifdef XP_BEOS
@@ -2919,36 +2918,21 @@ nsComponentManagerImpl::AutoRegisterImpl
         return NS_NOINTERFACE;
 
     rv = AutoRegisterComponent(lf, aDeferred);
     if (NS_FAILED(rv))
         aLeftovers.AppendObject(lf);
     return rv;
 }
 
-static const char kNL[] = "\r\n";
-
 nsresult
 nsComponentManagerImpl::AutoRegisterDirectory(nsIFile *inDirSpec,
                           nsCOMArray<nsILocalFile>    &aLeftovers,
                           nsTArray<DeferredModule>    &aDeferred)
 {
-    nsCOMPtr<nsIFile> componentsList;
-    inDirSpec->Clone(getter_AddRefs(componentsList));
-    if (componentsList) {
-        nsCOMPtr<nsILocalFile> lfComponentsList =
-            do_QueryInterface(componentsList);
-        lfComponentsList->AppendNative(NS_LITERAL_CSTRING("components.list"));
-        PRFileDesc* fd;
-        if (NS_SUCCEEDED(lfComponentsList->OpenNSPRFileDesc(PR_RDONLY,
-                                                            0400, &fd)))
-            return AutoRegisterComponentsList(inDirSpec, fd,
-                                              aLeftovers, aDeferred);
-    }
-
     nsCOMPtr<nsISimpleEnumerator> entries;
     nsresult rv = inDirSpec->GetDirectoryEntries(getter_AddRefs(entries));
     if (NS_FAILED(rv))
         return rv;
 
     PRBool hasMore;
     nsCOMPtr<nsISupports> elem;
 
@@ -2973,62 +2957,16 @@ nsComponentManagerImpl::AutoRegisterDire
                 aLeftovers.AppendObject(lf);
         }
     }
 
     return NS_OK;
 }
 
 nsresult
-nsComponentManagerImpl::AutoRegisterComponentsList(nsIFile* inDir,
-                                  PRFileDesc* fd,
-                                  nsCOMArray<nsILocalFile>& aLeftovers,
-                                  nsTArray<DeferredModule>& aDeferred)
-{
-    PRFileInfo info;
-    if (PR_SUCCESS != PR_GetOpenFileInfo(fd, &info))
-        return NS_ErrorAccordingToNSPR();
-
-    nsAutoArrayPtr<char> buf(new char[info.size + 1]);
-    if (!buf)
-        return NS_ERROR_OUT_OF_MEMORY;
-
-    PRInt32 read = 0;
-    while (read < info.size) {
-        PRInt32 n = PR_Read(fd, buf + read, info.size - read);
-        if (n < 0)
-            return NS_ErrorAccordingToNSPR();
-
-        read += n;
-        if (n == 0)
-            break;
-    }
-
-    buf[read] = '\0';
-    char* c = buf;
-    while (char *token = NS_strtok(kNL, &c)) {
-        if (token[0] == '#')
-            continue;
-
-        nsCOMPtr<nsIFile> component;
-        inDir->Clone(getter_AddRefs(component));
-        if (!component)
-            return NS_ERROR_OUT_OF_MEMORY;
-
-        nsCOMPtr<nsILocalFile> lfcomponent = do_QueryInterface(component);
-        lfcomponent->AppendNative(nsDependentCString(token));
-
-        nsresult rv = AutoRegisterComponent(lfcomponent, aDeferred);
-        if (NS_FAILED(rv))
-            aLeftovers.AppendObject(lfcomponent);
-    }
-    return NS_OK;
-}
-
-nsresult
 nsComponentManagerImpl::AutoRegisterComponent(PRInt32 unused,
                                               nsIFile *component)
 {
     nsCOMPtr<nsILocalFile> lf(do_QueryInterface(component));
     if (!lf)
         return NS_NOINTERFACE;
 
     GetAllLoaders();
--- a/xpcom/components/nsComponentManager.h
+++ b/xpcom/components/nsComponentManager.h
@@ -221,20 +221,16 @@ public:
 
     void DeleteContractIDEntriesByCID(const nsCID* aClass, nsIFactory* factory);
     nsresult AutoRegisterImpl(nsIFile*                  inDirSpec,
                               nsCOMArray<nsILocalFile> &aLeftovers,
                               nsTArray<DeferredModule> &aDeferred);
     nsresult AutoRegisterDirectory(nsIFile*                  aComponentFile,
                                    nsCOMArray<nsILocalFile> &aLeftovers,
                                    nsTArray<DeferredModule> &aDeferred);
-    nsresult AutoRegisterComponentsList(nsIFile* inDir,
-                                        PRFileDesc* fd,
-                                        nsCOMArray<nsILocalFile>& aLeftovers,
-                                        nsTArray<DeferredModule>& aDeferred);
     nsresult AutoRegisterComponent(nsILocalFile*             aComponentFile,
                                    nsTArray<DeferredModule> &aDeferred,
                                    LoaderType                minLoader = NS_LOADER_TYPE_NATIVE);
     void LoadLeftoverComponents(nsCOMArray<nsILocalFile> &aLeftovers,
                                 nsTArray<DeferredModule> &aDeferred,
                                 LoaderType                minLoader);
 
     void LoadDeferredModules(nsTArray<DeferredModule> &aDeferred);