Date: Fri, 8 Jun 2012 13:58:50 GMT From: svn-freebsd-gecko@chruetertee.ch To: freebsd-gecko@freebsd.org Subject: [SVN-Commit] r723 - in branches/experimental/www: firefox firefox-beta firefox-beta/files firefox-esr firefox-esr/files firefox/files libxul libxul/files Message-ID: <201206081358.q58Dwolt002928@trillian.chruetertee.ch>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Fri Jun 8 13:58:50 2012 New Revision: 723 Log: alternative fix for system-wide plugins Deleted: branches/experimental/www/firefox-beta/files/patch-browser-app-Makefile.in branches/experimental/www/firefox-esr/files/patch-browser-app-Makefile.in branches/experimental/www/firefox/files/patch-browser-app-Makefile.in Modified: branches/experimental/www/firefox-beta/Makefile branches/experimental/www/firefox-beta/files/patch-browser-app-nsBrowserApp.cpp branches/experimental/www/firefox-esr/Makefile branches/experimental/www/firefox-esr/files/patch-browser-app-nsBrowserApp.cpp branches/experimental/www/firefox/Makefile branches/experimental/www/firefox/files/patch-browser-app-nsBrowserApp.cpp branches/experimental/www/libxul/Makefile branches/experimental/www/libxul/files/patch-browser-app-nsBrowserApp.cpp Modified: branches/experimental/www/firefox-beta/Makefile ============================================================================== --- branches/experimental/www/firefox-beta/Makefile Fri Jun 8 13:57:52 2012 (r722) +++ branches/experimental/www/firefox-beta/Makefile Fri Jun 8 13:58:50 2012 (r723) @@ -117,7 +117,8 @@ ${WRKSRC}/storage/build/Makefile.in \ ${WRKSRC}/toolkit/library/Makefile.in \ ${WRKSRC}/db/sqlite3/src/Makefile.in - @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + ${WRKSRC}/browser/app/nsBrowserApp.cpp \ ${WRKSRC}/security/manager/ssl/src/Makefile.in \ ${WRKSRC}/js/src/config/mkdepend/Makefile.in \ ${WRKSRC}/js/src/config/config.mk \ Deleted: branches/experimental/www/firefox-beta/files/patch-browser-app-Makefile.in ============================================================================== --- branches/experimental/www/firefox-beta/files/patch-browser-app-Makefile.in Fri Jun 8 13:58:50 2012 (r722) +++ /dev/null 00:00:00 1970 (deleted) @@ -1,130 +0,0 @@ ---- browser/app/Makefile.in.orig 2012-05-23 20:56:32.000000000 +0200 -+++ browser/app/Makefile.in 2012-05-27 18:12:41.000000000 +0200 -@@ -56,37 +56,46 @@ - # hardcode en-US for the moment - AB_CD = en-US - --DEFINES += \ -- -DAB_CD=$(AB_CD) \ -- -DAPP_VERSION="$(MOZ_APP_VERSION)" \ -- -DFIREFOX_ICO=\"$(DIST)/branding/firefox.ico\" \ -- -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\" \ -- $(NULL) -+DEFINES += -DAB_CD=$(AB_CD) -+ -+APP_VERSION = $(shell cat $(srcdir)/../config/version.txt) -+DEFINES += -DAPP_VERSION="$(APP_VERSION)" - - ifdef LIBXUL_SDK - include $(topsrcdir)/config/rules.mk - else - # Build a binary bootstrapping with XRE_main - -+ifneq (,$(filter OS2 WINNT,$(OS_ARCH))) - PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX) -+else -+PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX) -+endif - - CPPSRCS = nsBrowserApp.cpp - --LOCAL_INCLUDES += \ -- -I$(topsrcdir)/toolkit/xre \ -- -I$(topsrcdir)/xpcom/base \ -- -I$(topsrcdir)/xpcom/build \ -- -I$(DEPTH)/build \ -- $(NULL) -+LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre -+LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base -+LOCAL_INCLUDES += -I$(DEPTH)/build - --DEFINES += -DXPCOM_GLUE --STL_FLAGS= -+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) -+LIBS += $(DIST)/bin/XUL -+TK_LIBS := $(TK_LIBS) -+else -+EXTRA_DSO_LIBS += xul -+endif - - LIBS += \ -+ $(STATIC_COMPONENTS_LINKER_PATH) \ - $(EXTRA_DSO_LIBS) \ -- $(XPCOM_STANDALONE_GLUE_LDOPTS) \ -+ $(XPCOM_GLUE_LDOPTS) \ -+ $(NSPR_LIBS) \ - $(NULL) - -+ifdef MOZ_JPROF -+LIBS += -ljprof -+endif -+ - ifdef MOZ_LINKER - LIBS += $(ZLIB_LIBS) - endif -@@ -118,11 +127,17 @@ - else - RCFLAGS += -DMOZ_PHOENIX --include-dir $(srcdir) - endif -+ifdef DEBUG -+RCFLAGS += -DDEBUG -+endif - endif - - ifeq ($(OS_ARCH),OS2) - RESFILE=splashos2.res - RCFLAGS += -DMOZ_PHOENIX -+ifdef DEBUG -+RCFLAGS += -DDEBUG -+endif - RCFLAGS += -DFIREFOX_ICO=\"$(DIST)/branding/firefox-os2.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document-os2.ico\" - endif - -@@ -150,15 +165,26 @@ - - ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH))) - --libs:: -- cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX) -+$(MOZ_APP_NAME):: $(topsrcdir)/build/unix/mozilla.in $(GLOBAL_DEPS) -+ cat $< | sed -e "s|%MOZAPPDIR%|$(installdir)|" \ -+ -e "s|%MOZ_APP_DISPLAYNAME%|$(MOZ_APP_DISPLAYNAME)|" > $@ -+ chmod +x $@ - -+libs:: $(MOZ_APP_NAME) -+ $(INSTALL) $< $(DIST)/bin -+ -+install:: $(MOZ_APP_NAME) -+ $(SYSINSTALL) $< $(DESTDIR)$(bindir) -+ -+GARBAGE += $(MOZ_APP_NAME) - GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, firefox.js) - - endif - - endif # LIBXUL_SDK - -+DEFINES += -DFIREFOX_ICO=\"$(DIST)/branding/firefox.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document.ico\" -+ - ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2) - libs:: - $(INSTALL) $(IFLAGS1) $(DIST)/branding/mozicon128.png $(DIST)/bin/icons -@@ -201,15 +227,17 @@ - rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(MOZ_MACBUNDLE_NAME) --exclude English.lproj - $(MKDIR) -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj - rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj -- sed -e "s/%APP_VERSION%/$(MOZ_APP_VERSION)/" -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" -e "s/%LOWER_MAC_APP_NAME%/$(LOWER_MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Info.plist -+ sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" -e "s/%LOWER_MAC_APP_NAME%/$(LOWER_MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Info.plist - sed -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj/InfoPlist.strings - rsync -a $(DIST)/bin/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES) -+ $(RM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)/mangle $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)/shlibsign - ifdef LIBXUL_SDK - cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/firefox - else - $(RM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM) - rsync -aL $(PROGRAM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS - endif -+ -cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES) - cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/firefox.icns - cp -RL $(DIST)/branding/document.icns $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/document.icns - printf APPLMOZB > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/PkgInfo Modified: branches/experimental/www/firefox-beta/files/patch-browser-app-nsBrowserApp.cpp ============================================================================== --- branches/experimental/www/firefox-beta/files/patch-browser-app-nsBrowserApp.cpp Fri Jun 8 13:57:52 2012 (r722) +++ branches/experimental/www/firefox-beta/files/patch-browser-app-nsBrowserApp.cpp Fri Jun 8 13:58:50 2012 (r723) @@ -1,239 +1,10 @@ ---- browser/app/nsBrowserApp.cpp.orig 2012-05-23 20:56:32.000000000 +0200 -+++ browser/app/nsBrowserApp.cpp 2012-05-27 18:11:50.000000000 +0200 -@@ -37,38 +37,28 @@ - * ***** END LICENSE BLOCK ***** */ - - #include "nsXULAppAPI.h" --#include "application.ini.h" --#include "nsXPCOMGlue.h" --#if defined(XP_WIN) -+#ifdef XP_WIN - #include <windows.h> - #include <stdlib.h> --#elif defined(XP_UNIX) --#include <sys/time.h> --#include <sys/resource.h> --#endif -- --#ifdef XP_MACOSX --#include "MacQuirks.h" +--- browser/app/nsBrowserApp.cpp~ ++++ browser/app/nsBrowserApp.cpp +@@ -197,6 +197,7 @@ int main(int argc, char* argv[]) + TriggerQuirks(); #endif - #include <stdio.h> - #include <stdarg.h> - -+#include "plstr.h" -+#include "prprf.h" -+#include "prenv.h" -+ - #include "nsCOMPtr.h" - #include "nsILocalFile.h" - #include "nsStringGlue.h" - - #ifdef XP_WIN -+// we want to use the DLL blocklist if possible -+#define XRE_WANT_DLL_BLOCKLIST - // we want a wmain entry point - #include "nsWindowsWMain.cpp" --#define snprintf _snprintf --#define strcasecmp _stricmp - #endif --#include "BinaryPath.h" -- --#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL -- --#include "mozilla/Telemetry.h" - - static void Output(const char *fmt, ... ) - { -@@ -95,12 +85,12 @@ - { - if (*++arg == '-') - ++arg; -- return !strcasecmp(arg, s); -+ return !PL_strcasecmp(arg, s); - } - - #if defined(XP_WIN) || defined(XP_OS2) - if (*arg == '/') -- return !strcasecmp(++arg, s); -+ return !PL_strcasecmp(++arg, s); - #endif - - return false; -@@ -116,35 +106,22 @@ - ~ScopedLogging() { NS_LogTerm(); } - }; - --XRE_GetFileFromPathType XRE_GetFileFromPath; --XRE_CreateAppDataType XRE_CreateAppData; --XRE_FreeAppDataType XRE_FreeAppData; --#ifdef XRE_HAS_DLL_BLOCKLIST --XRE_SetupDllBlocklistType XRE_SetupDllBlocklist; --#endif --XRE_TelemetryAccumulateType XRE_TelemetryAccumulate; --XRE_mainType XRE_main; -- --static const nsDynamicFunctionLoad kXULFuncs[] = { -- { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath }, -- { "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData }, -- { "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData }, --#ifdef XRE_HAS_DLL_BLOCKLIST -- { "XRE_SetupDllBlocklist", (NSFuncPtr*) &XRE_SetupDllBlocklist }, --#endif -- { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate }, -- { "XRE_main", (NSFuncPtr*) &XRE_main }, -- { nsnull, nsnull } --}; -- --static int do_main(int argc, char* argv[]) -+int main(int argc, char* argv[]) - { -+ ScopedLogging log; -+ - nsCOMPtr<nsILocalFile> appini; -- nsresult rv; -+ nsresult rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appini)); -+ if (NS_FAILED(rv)) { -+ Output("Couldn't calculate the application directory."); -+ return 255; -+ } -+ appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini")); - - // Allow firefox.exe to launch XULRunner apps via -app <application.ini> - // Note that -app must be the *first* argument. -- const char *appDataFile = getenv("XUL_APP_FILE"); -+ char *appEnv = nsnull; -+ const char *appDataFile = PR_GetEnv("XUL_APP_FILE"); - if (appDataFile && *appDataFile) { - rv = XRE_GetFileFromPath(appDataFile, getter_AddRefs(appini)); - if (NS_FAILED(rv)) { -@@ -164,119 +141,23 @@ - return 255; - } - -- char appEnv[MAXPATHLEN]; -- snprintf(appEnv, MAXPATHLEN, "XUL_APP_FILE=%s", argv[2]); -- if (putenv(appEnv)) { -- Output("Couldn't set %s.\n", appEnv); -- return 255; -- } -+ appEnv = PR_smprintf("XUL_APP_FILE=%s", argv[2]); -+ PR_SetEnv(appEnv); - argv[2] = argv[0]; - argv += 2; - argc -= 2; - } - -- if (appini) { -- nsXREAppData *appData; -- rv = XRE_CreateAppData(appini, &appData); -- if (NS_FAILED(rv)) { -- Output("Couldn't read application.ini"); -- return 255; -- } -- int result = XRE_main(argc, argv, appData); -- XRE_FreeAppData(appData); -- return result; -- } -- -- return XRE_main(argc, argv, &sAppData); --} -- --int main(int argc, char* argv[]) --{ -- char exePath[MAXPATHLEN]; -- --#ifdef XP_MACOSX -- TriggerQuirks(); --#endif -- -- nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath); -- if (NS_FAILED(rv)) { -- Output("Couldn't calculate the application directory.\n"); -- return 255; -- } -- -- char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]); -- if (!lastSlash || (lastSlash - exePath > MAXPATHLEN - sizeof(XPCOM_DLL) - 1)) -- return 255; -- -- strcpy(++lastSlash, XPCOM_DLL); -- -- int gotCounters; --#if defined(XP_UNIX) -- struct rusage initialRUsage; -- gotCounters = !getrusage(RUSAGE_SELF, &initialRUsage); --#elif defined(XP_WIN) -- // GetProcessIoCounters().ReadOperationCount seems to have little to -- // do with actual read operations. It reports 0 or 1 at this stage -- // in the program. Luckily 1 coincides with when prefetch is -- // enabled. If Windows prefetch didn't happen we can do our own -- // faster dll preloading. -- IO_COUNTERS ioCounters; -- gotCounters = GetProcessIoCounters(GetCurrentProcess(), &ioCounters); -- if (gotCounters && !ioCounters.ReadOperationCount) --#endif -- { -- XPCOMGlueEnablePreload(); -- } -- -- -- rv = XPCOMGlueStartup(exePath); -- if (NS_FAILED(rv)) { -- Output("Couldn't load XPCOM.\n"); -- return 255; -- } -- // Reset exePath so that it is the directory name and not the xpcom dll name -- *lastSlash = 0; -- -- rv = XPCOMGlueLoadXULFunctions(kXULFuncs); -+ nsXREAppData *appData; -+ rv = XRE_CreateAppData(appini, &appData); ++ setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko19:%%LOCALBASE%%/lib/npapi/symlinks/firefox", 0); + nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath); if (NS_FAILED(rv)) { -- Output("Couldn't load XRE functions.\n"); -+ Output("Couldn't read application.ini"); - return 255; - } - --#ifdef XRE_HAS_DLL_BLOCKLIST -- XRE_SetupDllBlocklist(); --#endif -- -- if (gotCounters) { --#if defined(XP_WIN) -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_OPS, -- int(ioCounters.ReadOperationCount)); -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_TRANSFER, -- int(ioCounters.ReadTransferCount / 1024)); -- IO_COUNTERS newIoCounters; -- if (GetProcessIoCounters(GetCurrentProcess(), &newIoCounters)) { -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_OPS, -- int(newIoCounters.ReadOperationCount - ioCounters.ReadOperationCount)); -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_TRANSFER, -- int((newIoCounters.ReadTransferCount - ioCounters.ReadTransferCount) / 1024)); -- } --#elif defined(XP_UNIX) -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_HARD_FAULTS, -- int(initialRUsage.ru_majflt)); -- struct rusage newRUsage; -- if (!getrusage(RUSAGE_SELF, &newRUsage)) { -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_HARD_FAULTS, -- int(newRUsage.ru_majflt - initialRUsage.ru_majflt)); -- } --#endif -- } -- -- int result; -- { -- ScopedLogging log; -- result = do_main(argc, argv); -- } -- -- XPCOMGlueShutdown(); -+ int result = XRE_main(argc, argv, appData); -+ XRE_FreeAppData(appData); -+ if (appEnv) -+ PR_smprintf_free(appEnv); - return result; - } + Output("Couldn't calculate the application directory.\n"); Modified: branches/experimental/www/firefox-esr/Makefile ============================================================================== --- branches/experimental/www/firefox-esr/Makefile Fri Jun 8 13:57:52 2012 (r722) +++ branches/experimental/www/firefox-esr/Makefile Fri Jun 8 13:58:50 2012 (r723) @@ -117,7 +117,8 @@ ${WRKSRC}/storage/build/Makefile.in \ ${WRKSRC}/toolkit/library/Makefile.in \ ${WRKSRC}/db/sqlite3/src/Makefile.in - @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + ${WRKSRC}/browser/app/nsBrowserApp.cpp \ ${WRKSRC}/security/manager/ssl/src/Makefile.in \ ${WRKSRC}/js/src/config/mkdepend/Makefile.in \ ${WRKSRC}/js/src/config/config.mk \ Deleted: branches/experimental/www/firefox-esr/files/patch-browser-app-Makefile.in ============================================================================== --- branches/experimental/www/firefox-esr/files/patch-browser-app-Makefile.in Fri Jun 8 13:58:50 2012 (r722) +++ /dev/null 00:00:00 1970 (deleted) @@ -1,63 +0,0 @@ ---- browser/app/Makefile.in 2011-09-28 22:24:36.000000000 +0200 -+++ ../../ff6/mozilla-release/browser/app/Makefile.in 2011-09-02 22:15:19.000000000 +0200 -@@ -92,22 +91,35 @@ - else - # Build a binary bootstrapping with XRE_main - -+ifneq (,$(filter OS2 WINNT,$(OS_ARCH))) - PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX) -+else -+PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX) -+endif - - CPPSRCS = nsBrowserApp.cpp - - LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre - LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base --LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/build - --DEFINES += -DXPCOM_GLUE --STL_FLAGS= -+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) -+LIBS += $(DIST)/bin/XUL -+TK_LIBS := $(TK_LIBS) -+else -+EXTRA_DSO_LIBS += xul -+endif - - LIBS += \ -+ $(STATIC_COMPONENTS_LINKER_PATH) \ - $(EXTRA_DSO_LIBS) \ -- $(XPCOM_STANDALONE_GLUE_LDOPTS) \ -+ $(XPCOM_GLUE_LDOPTS) \ -+ $(NSPR_LIBS) \ - $(NULL) - -+ifdef MOZ_JPROF -+LIBS += -ljprof -+endif -+ - ifndef MOZ_WINCONSOLE - ifdef MOZ_DEBUG - MOZ_WINCONSOLE = 1 -@@ -182,9 +194,18 @@ - - ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH))) - --libs:: -- cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX) -+$(MOZ_APP_NAME):: $(topsrcdir)/build/unix/mozilla.in $(GLOBAL_DEPS) -+ cat $< | sed -e "s|%MOZAPPDIR%|$(installdir)|" \ -+ -e "s|%MOZ_APP_DISPLAYNAME%|$(MOZ_APP_DISPLAYNAME)|" > $@ -+ chmod +x $@ -+ -+libs:: $(MOZ_APP_NAME) -+ $(INSTALL) $< $(DIST)/bin -+ -+install:: $(MOZ_APP_NAME) -+ $(SYSINSTALL) $< $(DESTDIR)$(bindir) - -+GARBAGE += $(MOZ_APP_NAME) - GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, firefox.js) - - endif Modified: branches/experimental/www/firefox-esr/files/patch-browser-app-nsBrowserApp.cpp ============================================================================== --- branches/experimental/www/firefox-esr/files/patch-browser-app-nsBrowserApp.cpp Fri Jun 8 13:57:52 2012 (r722) +++ branches/experimental/www/firefox-esr/files/patch-browser-app-nsBrowserApp.cpp Fri Jun 8 13:58:50 2012 (r723) @@ -1,221 +1,10 @@ ---- browser/app/nsBrowserApp.cpp 2011-09-28 22:24:36.000000000 +0200 -+++ ../../ff6/mozilla-release/browser/app/nsBrowserApp.cpp 2011-09-02 22:15:19.000000000 +0200 -@@ -36,19 +36,14 @@ - * - * ***** END LICENSE BLOCK ***** */ - --#include "nsXPCOMGlue.h" - #include "nsXULAppAPI.h" --#if defined(XP_WIN) -+#ifdef XP_WIN - #include <windows.h> - #include <stdlib.h> --#elif defined(XP_UNIX) --#include <sys/time.h> --#include <sys/resource.h> - #endif - - #include <stdio.h> - #include <stdarg.h> --#include <string.h> - - #include "plstr.h" - #include "prprf.h" -@@ -59,16 +54,11 @@ - #include "nsStringGlue.h" - - #ifdef XP_WIN -+// we want to use the DLL blocklist if possible -+#define XRE_WANT_DLL_BLOCKLIST - // we want a wmain entry point - #include "nsWindowsWMain.cpp" --#define snprintf _snprintf --#define strcasecmp _stricmp - #endif --#include "BinaryPath.h" -- --#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL -- --#include "mozilla/Telemetry.h" - - static void Output(const char *fmt, ... ) - { -@@ -95,12 +85,12 @@ - { - if (*++arg == '-') - ++arg; -- return !strcasecmp(arg, s); -+ return !PL_strcasecmp(arg, s); - } - - #if defined(XP_WIN) || defined(XP_OS2) - if (*arg == '/') -- return !strcasecmp(++arg, s); -+ return !PL_strcasecmp(++arg, s); +--- browser/app/nsBrowserApp.cpp~ ++++ browser/app/nsBrowserApp.cpp +@@ -197,6 +197,7 @@ int main(int argc, char* argv[]) + TriggerQuirks(); #endif - return PR_FALSE; -@@ -116,48 +106,22 @@ - ~ScopedLogging() { NS_LogTerm(); } - }; - --XRE_GetFileFromPathType XRE_GetFileFromPath; --XRE_CreateAppDataType XRE_CreateAppData; --XRE_FreeAppDataType XRE_FreeAppData; --#ifdef XRE_HAS_DLL_BLOCKLIST --XRE_SetupDllBlocklistType XRE_SetupDllBlocklist; --#endif --XRE_TelemetryAccumulateType XRE_TelemetryAccumulate; --XRE_mainType XRE_main; -- --static const nsDynamicFunctionLoad kXULFuncs[] = { -- { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath }, -- { "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData }, -- { "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData }, --#ifdef XRE_HAS_DLL_BLOCKLIST -- { "XRE_SetupDllBlocklist", (NSFuncPtr*) &XRE_SetupDllBlocklist }, --#endif -- { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate }, -- { "XRE_main", (NSFuncPtr*) &XRE_main }, -- { nsnull, nsnull } --}; -- --static int do_main(const char *exePath, int argc, char* argv[]) -+int main(int argc, char* argv[]) - { -+ ScopedLogging log; -+ - nsCOMPtr<nsILocalFile> appini; --#ifdef XP_WIN -- // exePath comes from mozilla::BinaryPath::Get, which returns a UTF-8 -- // encoded path, so it is safe to convert it -- nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), false, -- getter_AddRefs(appini)); --#else -- nsresult rv = NS_NewNativeLocalFile(nsDependentCString(exePath), false, -- getter_AddRefs(appini)); --#endif -+ nsresult rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appini)); ++ setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko19:%%LOCALBASE%%/lib/npapi/symlinks/firefox", 0); + nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath); if (NS_FAILED(rv)) { -+ Output("Couldn't calculate the application directory."); - return 255; - } -- - appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini")); - - // Allow firefox.exe to launch XULRunner apps via -app <application.ini> - // Note that -app must be the *first* argument. -- const char *appDataFile = getenv("XUL_APP_FILE"); -+ char *appEnv = nsnull; -+ const char *appDataFile = PR_GetEnv("XUL_APP_FILE"); - if (appDataFile && *appDataFile) { - rv = XRE_GetFileFromPath(appDataFile, getter_AddRefs(appini)); - if (NS_FAILED(rv)) { -@@ -177,12 +141,8 @@ - return 255; - } - -- char appEnv[MAXPATHLEN]; -- snprintf(appEnv, MAXPATHLEN, "XUL_APP_FILE=%s", argv[2]); -- if (putenv(appEnv)) { -- Output("Couldn't set %s.\n", appEnv); -- return 255; -- } -+ appEnv = PR_smprintf("XUL_APP_FILE=%s", argv[2]); -+ PR_SetEnv(appEnv); - argv[2] = argv[0]; - argv += 2; - argc -= 2; -@@ -197,90 +157,7 @@ - - int result = XRE_main(argc, argv, appData); - XRE_FreeAppData(appData); -- return result; --} -- --int main(int argc, char* argv[]) --{ -- char exePath[MAXPATHLEN]; -- -- nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath); -- if (NS_FAILED(rv)) { -- Output("Couldn't calculate the application directory.\n"); -- return 255; -- } -- -- char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]); -- if (!lastSlash || (lastSlash - exePath > MAXPATHLEN - sizeof(XPCOM_DLL) - 1)) -- return 255; -- -- strcpy(++lastSlash, XPCOM_DLL); -- -- int gotCounters; --#if defined(XP_UNIX) -- struct rusage initialRUsage; -- gotCounters = !getrusage(RUSAGE_SELF, &initialRUsage); --#elif defined(XP_WIN) -- // GetProcessIoCounters().ReadOperationCount seems to have little to -- // do with actual read operations. It reports 0 or 1 at this stage -- // in the program. Luckily 1 coincides with when prefetch is -- // enabled. If Windows prefetch didn't happen we can do our own -- // faster dll preloading. -- IO_COUNTERS ioCounters; -- gotCounters = GetProcessIoCounters(GetCurrentProcess(), &ioCounters); -- if (gotCounters && !ioCounters.ReadOperationCount) --#endif -- { -- XPCOMGlueEnablePreload(); -- } -- -- -- rv = XPCOMGlueStartup(exePath); -- if (NS_FAILED(rv)) { -- Output("Couldn't load XPCOM.\n"); -- return 255; -- } -- -- rv = XPCOMGlueLoadXULFunctions(kXULFuncs); -- if (NS_FAILED(rv)) { -- Output("Couldn't load XRE functions.\n"); -- return 255; -- } -- --#ifdef XRE_HAS_DLL_BLOCKLIST -- XRE_SetupDllBlocklist(); --#endif -- -- if (gotCounters) { --#if defined(XP_WIN) -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_OPS, -- int(ioCounters.ReadOperationCount)); -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_TRANSFER, -- int(ioCounters.ReadTransferCount / 1024)); -- IO_COUNTERS newIoCounters; -- if (GetProcessIoCounters(GetCurrentProcess(), &newIoCounters)) { -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_OPS, -- int(newIoCounters.ReadOperationCount - ioCounters.ReadOperationCount)); -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_TRANSFER, -- int((newIoCounters.ReadTransferCount - ioCounters.ReadTransferCount) / 1024)); -- } --#elif defined(XP_UNIX) -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_HARD_FAULTS, -- int(initialRUsage.ru_majflt)); -- struct rusage newRUsage; -- if (!getrusage(RUSAGE_SELF, &newRUsage)) { -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_HARD_FAULTS, -- int(newRUsage.ru_majflt - initialRUsage.ru_majflt)); -- } --#endif -- } -- -- int result; -- { -- ScopedLogging log; -- result = do_main(exePath, argc, argv); -- } -- -- XPCOMGlueShutdown(); -+ if (appEnv) -+ PR_smprintf_free(appEnv); - return result; - } + Output("Couldn't calculate the application directory.\n"); Modified: branches/experimental/www/firefox/Makefile ============================================================================== --- branches/experimental/www/firefox/Makefile Fri Jun 8 13:57:52 2012 (r722) +++ branches/experimental/www/firefox/Makefile Fri Jun 8 13:58:50 2012 (r723) @@ -116,7 +116,8 @@ ${WRKSRC}/storage/build/Makefile.in \ ${WRKSRC}/toolkit/library/Makefile.in \ ${WRKSRC}/db/sqlite3/src/Makefile.in - @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + ${WRKSRC}/browser/app/nsBrowserApp.cpp \ ${WRKSRC}/security/manager/ssl/src/Makefile.in \ ${WRKSRC}/js/src/config/mkdepend/Makefile.in \ ${WRKSRC}/js/src/config/config.mk \ Deleted: branches/experimental/www/firefox/files/patch-browser-app-Makefile.in ============================================================================== --- branches/experimental/www/firefox/files/patch-browser-app-Makefile.in Fri Jun 8 13:58:50 2012 (r722) +++ /dev/null 00:00:00 1970 (deleted) @@ -1,64 +0,0 @@ ---- browser/app/Makefile.in.orig 2012-02-22 17:06:17.000000000 +0100 -+++ browser/app/Makefile.in 2012-03-07 20:46:17.000000000 +0100 -@@ -66,23 +66,36 @@ - else - # Build a binary bootstrapping with XRE_main - -+ifneq (,$(filter OS2 WINNT,$(OS_ARCH))) - PROGRAM = $(MOZ_APP_NAME)$(BIN_SUFFIX) -+else -+PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX) -+endif - - CPPSRCS = nsBrowserApp.cpp - - LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre - LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base --LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/build - LOCAL_INCLUDES += -I$(DEPTH)/build - --DEFINES += -DXPCOM_GLUE --STL_FLAGS= -+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) -+LIBS += $(DIST)/bin/XUL -+TK_LIBS := $(TK_LIBS) -+else -+EXTRA_DSO_LIBS += xul -+endif - - LIBS += \ -+ $(STATIC_COMPONENTS_LINKER_PATH) \ - $(EXTRA_DSO_LIBS) \ -- $(XPCOM_STANDALONE_GLUE_LDOPTS) \ -+ $(XPCOM_GLUE_LDOPTS) \ -+ $(NSPR_LIBS) \ - $(NULL) - -+ifdef MOZ_JPROF -+LIBS += -ljprof -+endif -+ - ifdef MOZ_LINKER - LIBS += $(ZLIB_LIBS) - endif -@@ -157,9 +170,18 @@ - - ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH))) - --libs:: -- cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX) -+$(MOZ_APP_NAME):: $(topsrcdir)/build/unix/mozilla.in $(GLOBAL_DEPS) -+ cat $< | sed -e "s|%MOZAPPDIR%|$(installdir)|" \ -+ -e "s|%MOZ_APP_DISPLAYNAME%|$(MOZ_APP_DISPLAYNAME)|" > $@ -+ chmod +x $@ -+ -+libs:: $(MOZ_APP_NAME) -+ $(INSTALL) $< $(DIST)/bin -+ -+install:: $(MOZ_APP_NAME) -+ $(SYSINSTALL) $< $(DESTDIR)$(bindir) - -+GARBAGE += $(MOZ_APP_NAME) - GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, firefox.js) - - endif Modified: branches/experimental/www/firefox/files/patch-browser-app-nsBrowserApp.cpp ============================================================================== --- branches/experimental/www/firefox/files/patch-browser-app-nsBrowserApp.cpp Fri Jun 8 13:57:52 2012 (r722) +++ branches/experimental/www/firefox/files/patch-browser-app-nsBrowserApp.cpp Fri Jun 8 13:58:50 2012 (r723) @@ -1,252 +1,10 @@ ---- browser/app/nsBrowserApp.cpp 2012-03-13 02:36:38.000000000 +0100 -+++ ../../../firefox-esr/work/mozilla-esr10/browser/app/nsBrowserApp.cpp 2012-03-15 10:17:09.000000000 +0100 -@@ -36,23 +36,14 @@ - * - * ***** END LICENSE BLOCK ***** */ - --#include "application.ini.h" --#include "nsXPCOMGlue.h" --#if defined(XP_WIN) -+#include "nsXULAppAPI.h" -+#ifdef XP_WIN - #include <windows.h> - #include <stdlib.h> --#elif defined(XP_UNIX) --#include <sys/time.h> --#include <sys/resource.h> --#endif -- --#ifdef XP_MACOSX --#include "MacQuirks.h" +--- browser/app/nsBrowserApp.cpp~ ++++ browser/app/nsBrowserApp.cpp +@@ -197,6 +197,7 @@ int main(int argc, char* argv[]) + TriggerQuirks(); #endif - #include <stdio.h> - #include <stdarg.h> --#include <string.h> - - #include "plstr.h" - #include "prprf.h" -@@ -63,16 +54,11 @@ - #include "nsStringGlue.h" - - #ifdef XP_WIN -+// we want to use the DLL blocklist if possible -+#define XRE_WANT_DLL_BLOCKLIST - // we want a wmain entry point - #include "nsWindowsWMain.cpp" --#define snprintf _snprintf --#define strcasecmp _stricmp - #endif --#include "BinaryPath.h" -- --#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL -- --#include "mozilla/Telemetry.h" - - static void Output(const char *fmt, ... ) - { -@@ -99,12 +85,12 @@ - { - if (*++arg == '-') - ++arg; -- return !strcasecmp(arg, s); -+ return !PL_strcasecmp(arg, s); - } - - #if defined(XP_WIN) || defined(XP_OS2) - if (*arg == '/') -- return !strcasecmp(++arg, s); -+ return !PL_strcasecmp(++arg, s); - #endif - - return false; -@@ -120,35 +106,22 @@ - ~ScopedLogging() { NS_LogTerm(); } - }; - --XRE_GetFileFromPathType XRE_GetFileFromPath; --XRE_CreateAppDataType XRE_CreateAppData; --XRE_FreeAppDataType XRE_FreeAppData; --#ifdef XRE_HAS_DLL_BLOCKLIST --XRE_SetupDllBlocklistType XRE_SetupDllBlocklist; --#endif --XRE_TelemetryAccumulateType XRE_TelemetryAccumulate; --XRE_mainType XRE_main; -- --static const nsDynamicFunctionLoad kXULFuncs[] = { -- { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath }, -- { "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData }, -- { "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData }, --#ifdef XRE_HAS_DLL_BLOCKLIST -- { "XRE_SetupDllBlocklist", (NSFuncPtr*) &XRE_SetupDllBlocklist }, --#endif -- { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate }, -- { "XRE_main", (NSFuncPtr*) &XRE_main }, -- { nsnull, nsnull } --}; -- --static int do_main(const char *exePath, int argc, char* argv[]) -+int main(int argc, char* argv[]) - { -+ ScopedLogging log; -+ - nsCOMPtr<nsILocalFile> appini; -- nsresult rv; -+ nsresult rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appini)); -+ if (NS_FAILED(rv)) { -+ Output("Couldn't calculate the application directory."); -+ return 255; -+ } -+ appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini")); - - // Allow firefox.exe to launch XULRunner apps via -app <application.ini> - // Note that -app must be the *first* argument. -- const char *appDataFile = getenv("XUL_APP_FILE"); -+ char *appEnv = nsnull; -+ const char *appDataFile = PR_GetEnv("XUL_APP_FILE"); - if (appDataFile && *appDataFile) { - rv = XRE_GetFileFromPath(appDataFile, getter_AddRefs(appini)); - if (NS_FAILED(rv)) { -@@ -168,133 +141,23 @@ - return 255; - } - -- char appEnv[MAXPATHLEN]; -- snprintf(appEnv, MAXPATHLEN, "XUL_APP_FILE=%s", argv[2]); -- if (putenv(appEnv)) { -- Output("Couldn't set %s.\n", appEnv); -- return 255; -- } -+ appEnv = PR_smprintf("XUL_APP_FILE=%s", argv[2]); -+ PR_SetEnv(appEnv); - argv[2] = argv[0]; - argv += 2; - argc -= 2; - } - -- int result; -- if (appini) { -- nsXREAppData *appData; -- rv = XRE_CreateAppData(appini, &appData); -- if (NS_FAILED(rv)) { -- Output("Couldn't read application.ini"); -- return 255; -- } -- result = XRE_main(argc, argv, appData); -- XRE_FreeAppData(appData); -- } else { --#ifdef XP_WIN -- // exePath comes from mozilla::BinaryPath::Get, which returns a UTF-8 -- // encoded path, so it is safe to convert it -- rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), PR_FALSE, -- getter_AddRefs(appini)); --#else -- rv = NS_NewNativeLocalFile(nsDependentCString(exePath), PR_FALSE, -- getter_AddRefs(appini)); --#endif -- if (NS_FAILED(rv)) { -- return 255; -- } -- result = XRE_main(argc, argv, &sAppData); -- } -- -- return result; --} -- --int main(int argc, char* argv[]) --{ -- char exePath[MAXPATHLEN]; -- --#ifdef XP_MACOSX -- TriggerQuirks(); --#endif -- -- nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath); -- if (NS_FAILED(rv)) { -- Output("Couldn't calculate the application directory.\n"); -- return 255; -- } -- -- char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]); -- if (!lastSlash || (lastSlash - exePath > MAXPATHLEN - sizeof(XPCOM_DLL) - 1)) -- return 255; -- -- strcpy(++lastSlash, XPCOM_DLL); -- -- int gotCounters; --#if defined(XP_UNIX) -- struct rusage initialRUsage; -- gotCounters = !getrusage(RUSAGE_SELF, &initialRUsage); --#elif defined(XP_WIN) -- // GetProcessIoCounters().ReadOperationCount seems to have little to -- // do with actual read operations. It reports 0 or 1 at this stage -- // in the program. Luckily 1 coincides with when prefetch is -- // enabled. If Windows prefetch didn't happen we can do our own -- // faster dll preloading. -- IO_COUNTERS ioCounters; -- gotCounters = GetProcessIoCounters(GetCurrentProcess(), &ioCounters); -- if (gotCounters && !ioCounters.ReadOperationCount) --#endif -- { -- XPCOMGlueEnablePreload(); -- } -- -- -- rv = XPCOMGlueStartup(exePath); -- if (NS_FAILED(rv)) { -- Output("Couldn't load XPCOM.\n"); -- return 255; -- } -- // Reset exePath so that it is the directory name and not the xpcom dll name -- *lastSlash = 0; -- -- rv = XPCOMGlueLoadXULFunctions(kXULFuncs); -+ nsXREAppData *appData; -+ rv = XRE_CreateAppData(appini, &appData); ++ setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko19:%%LOCALBASE%%/lib/npapi/symlinks/firefox", 0); + nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath); if (NS_FAILED(rv)) { -- Output("Couldn't load XRE functions.\n"); -+ Output("Couldn't read application.ini"); - return 255; - } - --#ifdef XRE_HAS_DLL_BLOCKLIST -- XRE_SetupDllBlocklist(); --#endif -- -- if (gotCounters) { --#if defined(XP_WIN) -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_OPS, -- int(ioCounters.ReadOperationCount)); -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_TRANSFER, -- int(ioCounters.ReadTransferCount / 1024)); -- IO_COUNTERS newIoCounters; -- if (GetProcessIoCounters(GetCurrentProcess(), &newIoCounters)) { -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_OPS, -- int(newIoCounters.ReadOperationCount - ioCounters.ReadOperationCount)); -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_TRANSFER, -- int((newIoCounters.ReadTransferCount - ioCounters.ReadTransferCount) / 1024)); -- } --#elif defined(XP_UNIX) -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_HARD_FAULTS, -- int(initialRUsage.ru_majflt)); -- struct rusage newRUsage; -- if (!getrusage(RUSAGE_SELF, &newRUsage)) { -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_HARD_FAULTS, -- int(newRUsage.ru_majflt - initialRUsage.ru_majflt)); -- } --#endif -- } -- -- int result; -- { -- ScopedLogging log; -- result = do_main(exePath, argc, argv); -- } -- -- XPCOMGlueShutdown(); -+ int result = XRE_main(argc, argv, appData); -+ XRE_FreeAppData(appData); -+ if (appEnv) -+ PR_smprintf_free(appEnv); - return result; - } + Output("Couldn't calculate the application directory.\n"); Modified: branches/experimental/www/libxul/Makefile ============================================================================== --- branches/experimental/www/libxul/Makefile Fri Jun 8 13:57:52 2012 (r722) +++ branches/experimental/www/libxul/Makefile Fri Jun 8 13:58:50 2012 (r723) @@ -84,7 +84,8 @@ ${WRKSRC}/storage/build/Makefile.in \ ${WRKSRC}/toolkit/library/Makefile.in \ ${WRKSRC}/db/sqlite3/src/Makefile.in - @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ + ${WRKSRC}/browser/app/nsBrowserApp.cpp \ ${WRKSRC}/js/src/config/mkdepend/Makefile.in \ ${WRKSRC}/js/src/config/config.mk @${REINPLACE_CMD} -e 's|-lc_r|${PTHREAD_LIBS}|g ; \ Modified: branches/experimental/www/libxul/files/patch-browser-app-nsBrowserApp.cpp ============================================================================== --- branches/experimental/www/libxul/files/patch-browser-app-nsBrowserApp.cpp Fri Jun 8 13:57:52 2012 (r722) +++ branches/experimental/www/libxul/files/patch-browser-app-nsBrowserApp.cpp Fri Jun 8 13:58:50 2012 (r723) @@ -1,221 +1,10 @@ ---- browser/app/nsBrowserApp.cpp 2011-09-28 22:24:36.000000000 +0200 -+++ ../../ff6/mozilla-release/browser/app/nsBrowserApp.cpp 2011-09-02 22:15:19.000000000 +0200 -@@ -36,19 +36,14 @@ - * - * ***** END LICENSE BLOCK ***** */ - --#include "nsXPCOMGlue.h" - #include "nsXULAppAPI.h" --#if defined(XP_WIN) -+#ifdef XP_WIN - #include <windows.h> - #include <stdlib.h> --#elif defined(XP_UNIX) --#include <sys/time.h> --#include <sys/resource.h> - #endif - - #include <stdio.h> - #include <stdarg.h> --#include <string.h> - - #include "plstr.h" - #include "prprf.h" -@@ -59,16 +54,11 @@ - #include "nsStringGlue.h" - - #ifdef XP_WIN -+// we want to use the DLL blocklist if possible -+#define XRE_WANT_DLL_BLOCKLIST - // we want a wmain entry point - #include "nsWindowsWMain.cpp" --#define snprintf _snprintf --#define strcasecmp _stricmp - #endif --#include "BinaryPath.h" -- --#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL -- --#include "mozilla/Telemetry.h" - - static void Output(const char *fmt, ... ) - { -@@ -95,12 +85,12 @@ - { - if (*++arg == '-') - ++arg; -- return !strcasecmp(arg, s); -+ return !PL_strcasecmp(arg, s); - } - - #if defined(XP_WIN) || defined(XP_OS2) - if (*arg == '/') -- return !strcasecmp(++arg, s); -+ return !PL_strcasecmp(++arg, s); +--- browser/app/nsBrowserApp.cpp~ ++++ browser/app/nsBrowserApp.cpp +@@ -197,6 +197,7 @@ int main(int argc, char* argv[]) + TriggerQuirks(); #endif - return PR_FALSE; -@@ -116,48 +106,22 @@ - ~ScopedLogging() { NS_LogTerm(); } - }; - --XRE_GetFileFromPathType XRE_GetFileFromPath; --XRE_CreateAppDataType XRE_CreateAppData; --XRE_FreeAppDataType XRE_FreeAppData; --#ifdef XRE_HAS_DLL_BLOCKLIST --XRE_SetupDllBlocklistType XRE_SetupDllBlocklist; --#endif --XRE_TelemetryAccumulateType XRE_TelemetryAccumulate; --XRE_mainType XRE_main; -- --static const nsDynamicFunctionLoad kXULFuncs[] = { -- { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath }, -- { "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData }, -- { "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData }, --#ifdef XRE_HAS_DLL_BLOCKLIST -- { "XRE_SetupDllBlocklist", (NSFuncPtr*) &XRE_SetupDllBlocklist }, --#endif -- { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate }, -- { "XRE_main", (NSFuncPtr*) &XRE_main }, -- { nsnull, nsnull } --}; -- --static int do_main(const char *exePath, int argc, char* argv[]) -+int main(int argc, char* argv[]) - { -+ ScopedLogging log; -+ - nsCOMPtr<nsILocalFile> appini; --#ifdef XP_WIN -- // exePath comes from mozilla::BinaryPath::Get, which returns a UTF-8 -- // encoded path, so it is safe to convert it -- nsresult rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), false, -- getter_AddRefs(appini)); --#else -- nsresult rv = NS_NewNativeLocalFile(nsDependentCString(exePath), false, -- getter_AddRefs(appini)); --#endif -+ nsresult rv = XRE_GetBinaryPath(argv[0], getter_AddRefs(appini)); ++ setenv("MOZ_PLUGIN_PATH", "%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko19:%%LOCALBASE%%/lib/npapi/symlinks/firefox", 0); + nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath); if (NS_FAILED(rv)) { -+ Output("Couldn't calculate the application directory."); - return 255; - } -- - appini->SetNativeLeafName(NS_LITERAL_CSTRING("application.ini")); - - // Allow firefox.exe to launch XULRunner apps via -app <application.ini> - // Note that -app must be the *first* argument. -- const char *appDataFile = getenv("XUL_APP_FILE"); -+ char *appEnv = nsnull; -+ const char *appDataFile = PR_GetEnv("XUL_APP_FILE"); - if (appDataFile && *appDataFile) { - rv = XRE_GetFileFromPath(appDataFile, getter_AddRefs(appini)); - if (NS_FAILED(rv)) { -@@ -177,12 +141,8 @@ - return 255; - } - -- char appEnv[MAXPATHLEN]; -- snprintf(appEnv, MAXPATHLEN, "XUL_APP_FILE=%s", argv[2]); -- if (putenv(appEnv)) { -- Output("Couldn't set %s.\n", appEnv); -- return 255; -- } -+ appEnv = PR_smprintf("XUL_APP_FILE=%s", argv[2]); -+ PR_SetEnv(appEnv); - argv[2] = argv[0]; - argv += 2; - argc -= 2; -@@ -197,90 +157,7 @@ - - int result = XRE_main(argc, argv, appData); - XRE_FreeAppData(appData); -- return result; --} -- --int main(int argc, char* argv[]) --{ -- char exePath[MAXPATHLEN]; -- -- nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath); -- if (NS_FAILED(rv)) { -- Output("Couldn't calculate the application directory.\n"); -- return 255; -- } -- -- char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]); -- if (!lastSlash || (lastSlash - exePath > MAXPATHLEN - sizeof(XPCOM_DLL) - 1)) -- return 255; -- -- strcpy(++lastSlash, XPCOM_DLL); -- -- int gotCounters; --#if defined(XP_UNIX) -- struct rusage initialRUsage; -- gotCounters = !getrusage(RUSAGE_SELF, &initialRUsage); --#elif defined(XP_WIN) -- // GetProcessIoCounters().ReadOperationCount seems to have little to -- // do with actual read operations. It reports 0 or 1 at this stage -- // in the program. Luckily 1 coincides with when prefetch is -- // enabled. If Windows prefetch didn't happen we can do our own -- // faster dll preloading. -- IO_COUNTERS ioCounters; -- gotCounters = GetProcessIoCounters(GetCurrentProcess(), &ioCounters); -- if (gotCounters && !ioCounters.ReadOperationCount) --#endif -- { -- XPCOMGlueEnablePreload(); -- } -- -- -- rv = XPCOMGlueStartup(exePath); -- if (NS_FAILED(rv)) { -- Output("Couldn't load XPCOM.\n"); -- return 255; -- } -- -- rv = XPCOMGlueLoadXULFunctions(kXULFuncs); -- if (NS_FAILED(rv)) { -- Output("Couldn't load XRE functions.\n"); -- return 255; -- } -- --#ifdef XRE_HAS_DLL_BLOCKLIST -- XRE_SetupDllBlocklist(); --#endif -- -- if (gotCounters) { --#if defined(XP_WIN) -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_OPS, -- int(ioCounters.ReadOperationCount)); -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_TRANSFER, -- int(ioCounters.ReadTransferCount / 1024)); -- IO_COUNTERS newIoCounters; -- if (GetProcessIoCounters(GetCurrentProcess(), &newIoCounters)) { -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_OPS, -- int(newIoCounters.ReadOperationCount - ioCounters.ReadOperationCount)); -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_TRANSFER, -- int((newIoCounters.ReadTransferCount - ioCounters.ReadTransferCount) / 1024)); -- } --#elif defined(XP_UNIX) -- XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_HARD_FAULTS, -- int(initialRUsage.ru_majflt)); -- struct rusage newRUsage; -- if (!getrusage(RUSAGE_SELF, &newRUsage)) { -- XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_HARD_FAULTS, -- int(newRUsage.ru_majflt - initialRUsage.ru_majflt)); -- } --#endif -- } -- -- int result; -- { -- ScopedLogging log; -- result = do_main(exePath, argc, argv); -- } -- -- XPCOMGlueShutdown(); -+ if (appEnv) -+ PR_smprintf_free(appEnv); - return result; - } + Output("Couldn't calculate the application directory.\n");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206081358.q58Dwolt002928>