diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 13c58000c65d..e513db71c54b 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -363,9 +363,7 @@ @BINPATH@/@PREF_DIR@/firefox.js @BINPATH@/@PREF_DIR@/firefox-branding.js @BINPATH@/@PREF_DIR@/channel-prefs.js -@BINPATH@/greprefs/all.js -@BINPATH@/greprefs/security-prefs.js -@BINPATH@/greprefs/xpinstall.js +@BINPATH@/greprefs.js @BINPATH@/defaults/autoconfig/platform.js @BINPATH@/defaults/autoconfig/prefcalls.js diff --git a/browser/installer/removed-files.in b/browser/installer/removed-files.in index 125b30f4ac33..82be8463764c 100644 --- a/browser/installer/removed-files.in +++ b/browser/installer/removed-files.in @@ -780,6 +780,9 @@ components/xuldoc.xpt components/xultmpl.xpt components/zipwriter.xpt components/firefox.xpt +greprefs/all.js +greprefs/security-prefs.js +greprefs/xpinstall.js run-mozilla.sh firefox dependentlibs.list @@ -810,4 +813,4 @@ install.rdf @DLL_PREFIX@jsj@DLL_SUFFIX@ #ifdef XP_WIN components/brwsrcmp.dll -#endif \ No newline at end of file +#endif diff --git a/modules/libpref/src/Makefile.in b/modules/libpref/src/Makefile.in index 450c9fd40425..b7836f0385ea 100644 --- a/modules/libpref/src/Makefile.in +++ b/modules/libpref/src/Makefile.in @@ -72,8 +72,6 @@ ifdef WINCE DEFINES += -DWINCE=1 endif -PREF_JS_EXPORTS = $(srcdir)/init/all.js - EXTRA_DSO_LDOPTS = \ $(LIBS_DIR) \ $(MOZ_COMPONENT_LIBS) \ @@ -82,9 +80,13 @@ EXTRA_DSO_LDOPTS = \ include $(topsrcdir)/config/rules.mk GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, \ - all.js mailnews.js editor.js \ + mailnews.js editor.js \ aix.js beos.js unix.js winpref.js os2prefs.js openvms.js photon.js) +GARBAGE += greprefs.js + +GREPREF_FILES = $(topsrcdir)/xpinstall/public/xpinstall.js $(topsrcdir)/netwerk/base/public/security-prefs.js $(srcdir)/init/all.js + # Optimizer bug with GCC 3.2.2 on OS/2 ifeq ($(OS_ARCH), OS2) nsPrefService.$(OBJ_SUFFIX): nsPrefService.cpp @@ -92,3 +94,10 @@ nsPrefService.$(OBJ_SUFFIX): nsPrefService.cpp @$(MAKE_DEPS_AUTO_CXX) $(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS:-O2=-O1) $(_VPATH_SRCS) endif + + +greprefs.js: $(GREPREF_FILES) + $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $^ > $@ + +libs:: greprefs.js + $(INSTALL) $^ $(DIST)/bin/ diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefService.cpp index 79791f39328a..eef72eea44f1 100644 --- a/modules/libpref/src/nsPrefService.cpp +++ b/modules/libpref/src/nsPrefService.cpp @@ -464,8 +464,8 @@ static nsresult openPrefFile(nsIFile* aFile) if (NS_FAILED(rv)) return rv; - PRInt64 fileSize; - rv = aFile->GetFileSize(&fileSize); + PRUint32 fileSize; + rv = inStr->Available(&fileSize); if (NS_FAILED(rv)) return rv; @@ -640,18 +640,19 @@ static nsresult pref_LoadPrefsInDirList(const char *listId) static nsresult pref_InitInitialObjects() { nsCOMPtr aFile; + nsCOMPtr greprefsFile; nsCOMPtr defaultPrefDir; nsresult rv; // first we parse the GRE default prefs. This also works if we're not using a GRE, - rv = NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(defaultPrefDir)); + rv = NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(greprefsFile)); NS_ENSURE_SUCCESS(rv, rv); - rv = defaultPrefDir->AppendNative(NS_LITERAL_CSTRING("greprefs")); + rv = greprefsFile->AppendNative(NS_LITERAL_CSTRING("greprefs.js")); NS_ENSURE_SUCCESS(rv, rv); - rv = pref_LoadPrefsInDir(defaultPrefDir, nsnull, 0); + rv = openPrefFile(greprefsFile); if (NS_FAILED(rv)) { NS_WARNING("Error parsing GRE default preferences. Is this an old-style embedding app?"); } diff --git a/netwerk/base/public/Makefile.in b/netwerk/base/public/Makefile.in index 61e88b8e49b0..2d6b8179c54d 100644 --- a/netwerk/base/public/Makefile.in +++ b/netwerk/base/public/Makefile.in @@ -146,8 +146,6 @@ EXPORTS = \ nsASocketHandler.h \ $(NULL) -PREF_JS_EXPORTS = $(srcdir)/security-prefs.js - include $(topsrcdir)/config/rules.mk DEFINES += -DIMPL_NS_NET diff --git a/xpinstall/public/Makefile.in b/xpinstall/public/Makefile.in index dcc1763e7cd7..0642763ac5bf 100644 --- a/xpinstall/public/Makefile.in +++ b/xpinstall/public/Makefile.in @@ -62,6 +62,4 @@ EXPORTS = \ nsSoftwareUpdateIIDs.h \ $(NULL) -PREF_JS_EXPORTS = $(srcdir)/xpinstall.js - include $(topsrcdir)/config/rules.mk