Index: Makefile =================================================================== RCS file: /home/pcvs/ports/www/firefox/Makefile,v retrieving revision 1.218 diff -u -u -r1.218 Makefile --- Makefile 27 Nov 2009 09:09:08 -0000 1.218 +++ Makefile 3 Feb 2010 23:30:05 -0000 @@ -2,26 +2,35 @@ # Date created: 2002/10/21 # Whom: Alan Eldridge # -# $FreeBSD: ports/www/firefox/Makefile,v 1.218 2009/11/27 09:09:08 beat Exp $ -# $MCom: ports-stable/www/firefox/Makefile,v 1.32 2009/01/09 23:41:22 mezz Exp $ +# $FreeBSD$ # PORTNAME= firefox -DISTVERSION= 2.0.0.20 -PORTREVISION= 9 +DISTVERSION= 3.6 PORTEPOCH= 1 CATEGORIES= www ipv6 -MASTER_SITES= ${MASTER_SITE_MOZILLA_EXTENDED} +MASTER_SITES= ${MASTER_SITE_MOZILLA} MASTER_SITE_SUBDIR= ${PORTNAME}/releases/${DISTVERSION}/source -DISTNAME= ${PORTNAME}-${DISTVERSION}-source +DISTNAME= ${PORTNAME}-${DISTVERSION}.source MAINTAINER= gecko@FreeBSD.org COMMENT= Web browser based on the browser portion of Mozilla -BUILD_DEPENDS= nss>=3.11.2:${PORTSDIR}/security/nss +BUILD_DEPENDS= nspr>=4.8:${PORTSDIR}/devel/nspr -MOZILLA_NAME= Firefox +USE_AUTOTOOLS= autoconf:213 +LATEST_LINK= firefox3-devel +USE_GECKO= gecko +MOZ_PKGCONFIG_FILES= # empty +USE_MOZILLA= -png -nss -dbm -jpeg -xft +MOZILLA_NAME= Firefox${MOZILLA_SUFX} +MOZILLA_SUFX= 3 +MOZILLA= ${PORTNAME}${MOZILLA_SUFX} +MOZ_TOOLKIT= cairo-gtk2 +GECKO_PLIST_PRE_DIRS= lib/${MOZILLA}/bin lib/${MOZILLA}/idl \ + lib/${MOZILLA}/include lib/${MOZILLA}/lib +MAKE_JOBS_SAFE= yes WANT_GNOME= yes ALL_TARGET= default CONFIGURE_ENV= LOCALBASE=${LOCALBASE} @@ -29,30 +38,37 @@ HAS_CONFIGURE= yes USE_BZIP2= yes USE_GMAKE= yes -USE_GECKO= gecko -WANT_PERL= yes -GECKO_PLIST_PRE_FILES= lib/${MOZILLA}/chrome/icons/default/default.xpm -GECKO_PLIST_PRE_DIRS= lib/${MOZILLA}/chrome/icons/default lib/${MOZILLA}/chrome/icons +MAKE_JOBS_SAFE= yes +NO_MOZPKGINSTALL=yes +CONFLICTS= firefox-3.[0,5].* -FIREFOX_ICON= ${MOZILLA}.xpm -FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/icons/default.xpm +FIREFOX_ICON= ${MOZILLA}.png +FIREFOX_ICON_SRC= ${PREFIX}/lib/${MOZILLA}/chrome/icons/default/default48.png MOZ_OPTIONS= --program-transform-name='s/firefox/${MOZILLA}/' \ --with-default-mozilla-five-home=${PREFIX}/lib/${MOZILLA} \ + --enable-svg --enable-svg-renderer=cairo \ --enable-application=browser \ - --enable-system-cairo \ - --enable-official-branding \ - --enable-canvas \ - --with-system-nss + --enable-official-branding --disable-updater \ + --enable-canvas --enable-libxul --disable-necko-wifi SYSTEM_PREFS= ${FAKEDIR}/lib/${MOZILLA}/defaults/pref/firefox.js -MOZ_PIS_SCRIPTS= moz_pis_S50cleanhome -OPTIONS= NEWTAB "Open external links in a new tab" on \ +OPTIONS= DBUS "Enable D-BUS support" on \ + NEWTAB "Open external links in a new tab" on \ SMB "Enable smb:// URI support using gnomevfs" off .include -GECKO_PTHREAD_LIBS!=${CC} -dumpspecs | ${GREP} -m 1 pthread: | ${SED} -e 's|^.*%{\!pg: %{pthread:|| ; s|}.*$$||' || ${TRUE} +.if ${OSVERSION} < 700000 +LIB_DEPENDS+= pulse.0:${PORTSDIR}/audio/pulseaudio +EXTRA_PATCHES= ${FILESDIR}/releng6_pulseaudio +.else +EXTRA_PATCHES= ${FILESDIR}/libsydney_oss +.endif + +WRKSRC:= ${WRKSRC}-1.9.2 + +GECKO_PTHREAD_LIBS!=${CC} -dumpspecs | ${GREP} -m 1 '%{\!pg: %{pthread:' | ${SED} -e 's|^.*%{\!pg: %{pthread:|| ; s|}.*$$||' || ${TRUE} .if ${HAVE_GNOME:Mlibgnomeui}!="" USE_GNOME+= libgnomeui @@ -61,20 +77,13 @@ MOZ_OPTIONS+= --disable-gnomeui .endif -.if ${ARCH} == "sparc64" && ${OSVERSION} < 601101 -IGNORE= does not run, update to 6.2-RELEASE or newer +.if defined(WITHOUT_DBUS) +MOZ_OPTIONS+= --disable-dbus --disable-libnotify +.else +LIB_DEPENDS+= dbus-glib-1.2:${PORTSDIR}/devel/dbus-glib \ + notify.1:${PORTSDIR}/devel/libnotify .endif -MOZ_OPTIONS+= --enable-svg --enable-svg-renderer=cairo - -FORBIDDEN= too many security issues \ - http://www.vuxml.org/freebsd/922d2398-9e2d-11de-a998-0030843d3802.html \ - http://www.vuxml.org/freebsd/49e8f2ee-8147-11de-a994-0030843d3802.html - -DEPRECATED= The mozilla team has shifted the development branch of mozilla to \ - seamonkey, this port is outdated and has many vulnerabilities. \ - Please consider using www/seamonkey or www/firefox35 instead. - post-extract:: @${SED} -e 's|@FIREFOX_ICON@|${FIREFOX_ICON}|' -e 's|@MOZILLA@|${MOZILLA}|' \ -e 's|@MOZILLA_NAME@|${MOZILLA_NAME}|' \ @@ -82,20 +91,27 @@ post-patch: ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS:C/-pthread/${GECKO_PTHREAD_LIBS}/}|' \ - ${WRKSRC}/storage/build/Makefile.in + ${WRKSRC}/storage/build/Makefile.in \ + ${WRKSRC}/db/sqlite3/src/Makefile.in @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ - ${WRKSRC}/security/manager/ssl/src/Makefile.in -.for ii in modules/libpref/src/init extensions/sroaming/resources/content/prefs \ - embedding/minimo - @${REINPLACE_CMD} -e '/accessibility.typeaheadfind.enablesound/s/true/false/ ; \ - /dom.disable_window_open_feature.toolbar/s/false/true/' \ - ${WRKSRC}/${ii}/all.js -.endfor - -pre-install: - ${ECHO_CMD} 'share/applications/${MOZILLA}.desktop' >> ${PLIST} - ${ECHO_CMD} "@unexec ${RMDIR} %D/share/applications 2>/dev/null || ${TRUE}" >> ${PLIST} - ${ECHO_CMD} 'share/pixmaps/${FIREFOX_ICON}' >> ${PLIST} + ${WRKSRC}/security/manager/ssl/src/Makefile.in \ + ${WRKSRC}/js/src/config/mkdepend/Makefile.in \ + ${WRKSRC}/js/src/config/config.mk + @${REINPLACE_CMD} -e 's|-lc_r|${PTHREAD_LIBS}|g ; \ + s|-lpthread|${PTHREAD_LIBS}|g ; \ + s|echo aout|echo elf|g ; \ + s|/usr/X11R6|${LOCALBASE}|g' \ + ${WRKSRC}/js/src/configure + +pre-configure: + (cd ${WRKSRC} && ${AUTOCONF}) + (cd ${WRKSRC}/js/src/ && ${AUTOCONF}) + +port-pre-install: +# ${SED} -e 's|1.9a7|0|' ${WRKSRC}/dist/bin/application.ini ${FAKEDIR}/lib + ${ECHO_CMD} 'share/applications/${MOZILLA}.desktop' >> ${PLISTF} + ${ECHO_CMD} "@dirrmtry share/applications" >> ${PLISTD} + ${ECHO_CMD} 'share/pixmaps/${FIREFOX_ICON}' >> ${PLISTF} .if !defined(WITHOUT_NEWTAB) ${ECHO_CMD} >> ${SYSTEM_PREFS} ${ECHO_CMD} "// Open external links in new tab" >> ${SYSTEM_PREFS} @@ -107,7 +123,6 @@ ${MKDIR} ${PREFIX}/share/applications ${PREFIX}/share/pixmaps ${INSTALL_DATA} ${WRKDIR}/${MOZILLA}.desktop ${PREFIX}/share/applications/ ${MKDIR} ${PREFIX}/lib/${MOZILLA}/chrome/icons/default - ${LN} -sf ${FIREFOX_ICON_SRC} ${PREFIX}/lib/${MOZILLA}/chrome/icons/default/default.xpm ${LN} -sf ${FIREFOX_ICON_SRC} ${PREFIX}/share/pixmaps/${FIREFOX_ICON} @${CAT} ${PKGMESSAGE} Index: distinfo =================================================================== RCS file: /home/pcvs/ports/www/firefox/distinfo,v retrieving revision 1.57 diff -u -u -r1.57 distinfo --- distinfo 19 Dec 2008 20:17:38 -0000 1.57 +++ distinfo 3 Feb 2010 23:26:05 -0000 @@ -1,3 +1,3 @@ -MD5 (firefox-2.0.0.20-source.tar.bz2) = f3718fefd01c8edc007ec0b416a8a7b8 -SHA256 (firefox-2.0.0.20-source.tar.bz2) = cc8ac993a38d005d08a325ccaf1255648c38da2c3b7043b277909d1430424494 -SIZE (firefox-2.0.0.20-source.tar.bz2) = 40293412 +MD5 (firefox-3.6.source.tar.bz2) = 458051557ff49e6a352c1d56eee5782a +SHA256 (firefox-3.6.source.tar.bz2) = 8d4f12fff7bc361d83e6b486f9ec4264c60114ed86c805e1221b3d30efec0a4b +SIZE (firefox-3.6.source.tar.bz2) = 48206915 Index: pkg-descr =================================================================== RCS file: /home/pcvs/ports/www/firefox/pkg-descr,v retrieving revision 1.10 diff -u -u -r1.10 pkg-descr --- pkg-descr 10 Nov 2006 07:03:50 -0000 1.10 +++ pkg-descr 3 Feb 2010 23:26:05 -0000 @@ -1,6 +1,7 @@ -Firefox is an award winning, free, open-source web browser for many platforms -and is based on the Mozilla codebase. It is small, fast and easy to use, and -offers many advanced features: +Mozilla Firefox is a free and open source web browser descended from the +Mozilla Application Suite.It is small, fast and easy to use, and offers many +advanced features: + o Popup Blocking o Tabbed Browsing o Live Bookmarks (ie. RSS) Index: pkg-message =================================================================== RCS file: /home/pcvs/ports/www/firefox/pkg-message,v retrieving revision 1.21 diff -u -u -r1.21 pkg-message --- pkg-message 15 Jun 2009 18:34:52 -0000 1.21 +++ pkg-message 3 Feb 2010 23:30:31 -0000 @@ -10,7 +10,23 @@ ssh-keygen -t dsa cat ~/.ssh/id_dsa.pub | ssh remote_host "cat >> .ssh/authorized_keys" -The SSH server on remote_host must allow pub key authentication. +The SSH sever on remote_host must allow pub key authentication. + +====================================================================== + +Firefox 3.6 and HTML5 + +Certain functions used to display HTML5 elements need the sem module. + +If your Firefox crashes with the following message while viewing a +HTML5 page: +"Bad system call (core dumped)" + +you need to load the sem module (kldload sem). + +To load sem on every boot put the following into your +/boot/loader.conf: +sem_load="YES" ====================================================================== @@ -21,7 +37,7 @@ Please include the following information with any bug report: * Output from 'uname -a'. -* Date/time stamp from www/firefox/Makefile. +* Date/time stamp from www/firefox3-devel/Makefile. * Where/when did the problem occur: configuring, building, or running firefox * How can you reproduce the problem? Index: files/libsydney_oss =================================================================== RCS file: files/libsydney_oss diff -N files/libsydney_oss --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/libsydney_oss 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,15 @@ +--- media/libsydneyaudio/src/Makefile.in.orig 2009-08-11 16:28:21.000000000 +0200 ++++ media/libsydneyaudio/src/Makefile.in 2009-08-11 16:29:08.000000000 +0200 +@@ -45,6 +45,12 @@ + LIBRARY_NAME = sydneyaudio + FORCE_STATIC_LIB= 1 + ++ifeq ($(OS_ARCH),FreeBSD) ++CSRCS = \ ++ sydney_audio_oss.c \ ++ $(NULL) ++endif ++ + ifeq ($(OS_ARCH),Linux) + CSRCS = \ + sydney_audio_alsa.c \ Index: files/moz_pis_S50cleanhome =================================================================== RCS file: files/moz_pis_S50cleanhome diff -N files/moz_pis_S50cleanhome --- files/moz_pis_S50cleanhome 26 Feb 2005 09:32:01 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,31 +0,0 @@ -#!/bin/sh -# - -# S50cleanhome -# a script to clean up users' Mozilla home directories to make upgrading -# less painful. - -# We run in our own subshell - -# First, verify protocol -[ "$1" != "start" ] && exit 1 -[ -z "${MOZ_PIS_API}" -o ${MOZ_PIS_API} -ne 2 ] && exit 1 -[ -z "${MOZ_PIS_MOZBINDIR}" -o ! -d "${MOZ_PIS_MOZBINDIR}" ] && exit 1 -[ -z "${HOME}" -o ! -d "${HOME}" ] && exit 1 -[ -z "${MOZ_PIS_USER_DIR}" -o ! -d "${HOME}/${MOZ_PIS_USER_DIR}" ] && exit 1 - -# Try to cleanup ${HOME}/${MOZ_PIS_USER_DIR} - -if [ -f "${HOME}/${MOZ_PIS_USER_DIR}/profiles.ini" ]; then - sed -e '/Path=/! d' -e "s,Path=,${HOME}/${MOZ_PIS_USER_DIR}/," \ - "${HOME}/${MOZ_PIS_USER_DIR}/profiles.ini" \ - | while read dir - do - [ ! -d "${dir}" ] && continue - # Debian does this for new builds - # rm -f "${dir}/XUL.mfasl" - # force a rebuild of compreg.dat and xpti.dat for new installations - [ "${dir}/compreg.dat" -ot "${MOZ_PIS_MOZBINDIR}/components.ini" ] && - rm -f "${dir}/compatibility.ini" "${dir}/XUL.mfasl" - done -fi Index: files/patch-Double.cpp =================================================================== RCS file: files/patch-Double.cpp diff -N files/patch-Double.cpp --- files/patch-Double.cpp 23 Apr 2008 05:45:51 -0000 1.7 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,59 +0,0 @@ ---- extensions/transformiix/source/base/Double.cpp.orig Thu Jan 30 09:26:46 2003 -+++ extensions/transformiix/source/base/Double.cpp Sun Nov 16 01:46:42 2003 -@@ -51,10 +51,10 @@ - //A trick to handle IEEE floating point exceptions on FreeBSD - E.D. - #ifdef __FreeBSD__ - #include --#ifdef __alpha__ --fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP; --#else -+#if defined(__i386__) || defined(__amd64__) - fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP|FP_X_DNML; -+#else -+fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP; - #endif - fp_except_t oldmask = fpsetmask(~allmask); - #endif -@@ -75,22 +75,31 @@ - #define TX_DOUBLE_HI32_EXPMASK 0x7ff00000 - #define TX_DOUBLE_HI32_MANTMASK 0x000fffff - -+union ui32dun { -+ PRUint32 i[2]; -+ double d; -+}; -+ - //-- Initialize Double related constants - #ifdef IS_BIG_ENDIAN --const PRUint32 nanMask[2] = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK, -- 0xffffffff}; --const PRUint32 infMask[2] = {TX_DOUBLE_HI32_EXPMASK, 0}; --const PRUint32 negInfMask[2] = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT, 0}; -+const union ui32dun nanMask = -+ {{TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK, 0xffffffff}}; -+const union ui32dun infMask = -+ {{TX_DOUBLE_HI32_EXPMASK, 0}}; -+const union ui32dun negInfMask = -+ {{TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT, 0}}; - #else --const PRUint32 nanMask[2] = {0xffffffff, -- TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK}; --const PRUint32 infMask[2] = {0, TX_DOUBLE_HI32_EXPMASK}; --const PRUint32 negInfMask[2] = {0, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT}; -+const union ui32dun nanMask = -+ {{0xffffffff, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK}}; -+const union ui32dun infMask = -+ {{0, TX_DOUBLE_HI32_EXPMASK}}; -+const union ui32dun negInfMask = -+ {{0, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT}}; - #endif - --const double Double::NaN = *((double*)nanMask); --const double Double::POSITIVE_INFINITY = *((double*)infMask); --const double Double::NEGATIVE_INFINITY = *((double*)negInfMask); -+const double Double::NaN = nanMask.d; -+const double Double::POSITIVE_INFINITY = infMask.d; -+const double Double::NEGATIVE_INFINITY = negInfMask.d; - - /* - * Determines whether the given double represents positive or negative Index: files/patch-browser_app_mozilla.in =================================================================== RCS file: files/patch-browser_app_mozilla.in diff -N files/patch-browser_app_mozilla.in --- files/patch-browser_app_mozilla.in 29 Nov 2005 21:12:28 -0000 1.11 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,125 +0,0 @@ ---- browser/app/mozilla.in.orig Mon Apr 4 15:08:49 2005 -+++ browser/app/mozilla.in Wed Jun 1 14:47:45 2005 -@@ -49,51 +49,83 @@ - ## the mozilla-bin binary to work. - ## - -+# -+# MOZ_PIS, "Mozilla Plugable Init Scripts" -+# MOZ_PIS_ is the name space used -+# These variables and there meaning are specified in -+# mozilla/xpfe/bootstrap/init.d/README - moz_pis_startstop_scripts() - { -- MOZ_USER_DIR="%MOZ_USER_DIR%" -- # MOZ_PIS_ is the name space for "Mozilla Plugable Init Scripts" -- # These variables and there meaning are specified in -- # mozilla/xpfe/bootstrap/init.d/README -- MOZ_PIS_API=2 -- MOZ_PIS_MOZBINDIR="${dist_bin}" -- MOZ_PIS_SESSION_PID="$$" -- MOZ_PIS_USER_DIR="${MOZ_USER_DIR}" -- export MOZ_PIS_API MOZ_PIS_MOZBINDIR MOZ_PIS_SESSION_PID MOZ_PIS_USER_DIR -- -- case "${1}" in -- "start") -- for curr_pis in "${dist_bin}/init.d"/S* "${HOME}/${MOZ_USER_DIR}/init.d"/S* ; do -- if [ -x "${curr_pis}" ] ; then -- case "${curr_pis}" in -- *.sh) . "${curr_pis}" ;; -- *) "${curr_pis}" "start" ;; -- esac -- fi -- done -- ;; -- "stop") -- for curr_pis in "${HOME}/${MOZ_USER_DIR}/init.d"/K* "${dist_bin}/init.d"/K* ; do -- if [ -x "${curr_pis}" ] ; then -- case "${curr_pis}" in -- *.sh) . "${curr_pis}" ;; -- *) "${curr_pis}" "stop" ;; -- esac -- fi -- done -- ;; -- *) -- echo 1>&2 "$0: Internal error in moz_pis_startstop_scripts." -- exit 1 -- ;; -- esac -+ MOZ_PIS_API=2 -+ MOZ_PIS_MOZBINDIR="${dist_bin}" -+ MOZ_PIS_SESSION_PID="$$" -+ MOZ_PIS_USER_DIR="${MOZ_USER_DIR}" -+ export MOZ_PIS_API MOZ_PIS_MOZBINDIR MOZ_PIS_SESSION_PID MOZ_PIS_USER_DIR -+ -+ case "${1}" in -+ "start") -+ for curr_pis in "${MOZ_PIS_MOZBINDIR}/init.d"/S* \ -+ "${HOME}/${MOZ_PIS_USER_DIR}/init.d"/S*; do -+ if [ -x "${curr_pis}" ]; then -+ case "${curr_pis}" in -+ *.sh) -+ . "${curr_pis}" -+ ;; -+ *) -+ ${curr_pis} "start" -+ ;; -+ esac -+ fi -+ done -+ ;; -+ "stop") -+ for curr_pis in "${MOZ_PIS_MOZBINDIR}/init.d"/K* \ -+ "${HOME}/${MOZ_PIS_USER_DIR}/init.d"/K*; do -+ if [ -x "${curr_pis}" ]; then -+ case "${curr_pis}" in -+ *.sh) -+ . "${curr_pis}" -+ ;; -+ *) -+ ${curr_pis} "stop" -+ ;; -+ esac -+ fi -+ done -+ ;; -+ *) -+ echo "$0: Internal error in moz_pis_startstop_scripts." 1>&2 -+ exit 1 -+ ;; -+ esac - } - --#uncomment for debugging -+# uncomment for debugging - #set -x - --moz_libdir=%MOZAPPDIR% --MRE_HOME=%MREDIR% -+# -+# variables -+# -+#location="new-tab" -+#MOZILLA_UILOCALE="en-US" -+#MOZILLA_UIREGION="US" -+ -+# -+# working definitions -+# -+MOZ_USER_DIR="%MOZ_USER_DIR%" -+moz_libdir="%MOZAPPDIR%" -+MRE_HOME="%MREDIR%" -+ -+debugging= # set the debugging level -+use_openFile="yes" # use openFile() for file/dir -+here=`pwd` -+ -+if [ ! -d "${MRE_HOME}" ]; then -+ # use moz_libdir as MRE_HOME -+ MRE_HOME="${moz_libdir}" -+fi -+export MRE_HOME - - # Use run-mozilla.sh in the current dir if it exists - # If not, then start resolving symlinks until we find run-mozilla.sh Index: files/patch-build_unix_run-mozilla.sh =================================================================== RCS file: /home/pcvs/ports/www/firefox/files/patch-build_unix_run-mozilla.sh,v retrieving revision 1.10 diff -u -u -r1.10 patch-build_unix_run-mozilla.sh --- files/patch-build_unix_run-mozilla.sh 10 Jan 2009 02:45:41 -0000 1.10 +++ files/patch-build_unix_run-mozilla.sh 3 Feb 2010 23:26:05 -0000 @@ -1,21 +1,12 @@ ---- build/unix/run-mozilla.sh.orig Mon Dec 15 12:27:28 2003 -+++ build/unix/run-mozilla.sh Wed Feb 11 14:24:17 2004 -@@ -355,7 +355,7 @@ - fi - ## - ## Set LD_LIBRARY_PATH --LD_LIBRARY_PATH=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/plugins:${MRE_HOME}${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"} -+LD_LIBRARY_PATH=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/plugins:%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko18:%%LOCALBASE%%/lib/npapi/symlinks/firefox:${MRE_HOME}${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"} - if [ -n "$LD_LIBRARYN32_PATH" ] - then - LD_LIBRARYN32_PATH=${MOZ_DIST_BIN}:${MOZ_DIST_BIN}/plugins:${MRE_HOME}${LD_LIBRARYN32_PATH+":$LD_LIBRARYN32_PATH"} -@@ -442,6 +442,9 @@ - # +--- build/unix/run-mozilla.sh.orig Tue Feb 14 19:56:54 2006 ++++ build/unix/run-mozilla.sh Fri Dec 8 15:49:48 2006 +@@ -443,6 +443,9 @@ export MOZILLA_FIVE_HOME LD_LIBRARY_PATH export SHLIB_PATH LIBPATH LIBRARY_PATH ADDON_PATH DYLD_LIBRARY_PATH -+ -+MOZ_PLUGIN_PATH=%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko18:%%LOCALBASE%%/lib/npapi/symlinks/firefox -+export MOZ_PLUGIN_PATH ++MOZ_PLUGIN_PATH=%%LOCALBASE%%/lib/browser_plugins/symlinks/gecko19:%%LOCALBASE%%/lib/npapi/symlinks/firefox3 ++export MOZ_PLUGIN_PATH ++ if [ $moz_debug -eq 1 ] then + moz_debug_program ${1+"$@"} Index: files/patch-config-mkdepend-imakemdep.h =================================================================== RCS file: files/patch-config-mkdepend-imakemdep.h diff -N files/patch-config-mkdepend-imakemdep.h --- files/patch-config-mkdepend-imakemdep.h 2 Feb 2006 13:16:54 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,10 +0,0 @@ ---- config/mkdepend/imakemdep.h Fri Sep 4 21:22:25 1998 -+++ config/mkdepend/imakemdep.h Thu Oct 16 22:43:25 2003 -@@ -278,4 +278,7 @@ - "-D__i386__", - # endif -+# if defined(__amd64__) || defined(__x86_64__) -+ "-D__amd64__ -D__x86_64__", -+# endif - # ifdef __GNUC__ - "-traditional", Index: files/patch-config-rules.mk =================================================================== RCS file: files/patch-config-rules.mk diff -N files/patch-config-rules.mk --- files/patch-config-rules.mk 10 Nov 2006 07:03:50 -0000 1.9 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,13 +0,0 @@ ---- config/rules.mk.orig Thu Sep 14 14:07:03 2006 -+++ config/rules.mk Wed Oct 18 11:00:09 2006 -@@ -442,9 +442,7 @@ - endif - - ifeq ($(OS_ARCH),FreeBSD) --ifdef IS_COMPONENT --EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic --endif -+EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic -lc - endif - - ifeq ($(OS_ARCH),NetBSD) Index: files/patch-config_autoconf.mk.in =================================================================== RCS file: /home/pcvs/ports/www/firefox/files/patch-config_autoconf.mk.in,v retrieving revision 1.1 diff -u -u -r1.1 patch-config_autoconf.mk.in --- files/patch-config_autoconf.mk.in 29 Nov 2005 21:12:28 -0000 1.1 +++ files/patch-config_autoconf.mk.in 3 Feb 2010 23:26:05 -0000 @@ -1,6 +1,6 @@ ---- config/autoconf.mk.in.orig Thu Jul 14 00:50:06 2005 -+++ config/autoconf.mk.in Thu Jul 14 00:50:40 2005 -@@ -50,13 +50,13 @@ +--- config/autoconf.mk.in.orig 2009-04-24 03:46:37.000000000 +0200 ++++ config/autoconf.mk.in 2009-05-11 15:03:26.000000000 +0200 +@@ -57,14 +57,14 @@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ @@ -9,10 +9,22 @@ libdir = @libdir@ datadir = @datadir@ mandir = @mandir@ - idldir = @datadir@/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) +-idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) ++idldir = $(datadir)/idl/%%MOZILLA%% --mozappdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) -+mozappdir = $(libdir)/%%MOZILLA%% - mredir = $(libdir)/mre/mre-$(MOZ_APP_VERSION) - mrelibdir = $(mredir)/lib +-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION) +-sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION) ++installdir = $(libdir)/%%MOZILLA%% ++sdkdir = $(libdir)/%%MOZILLA%% + DIST = $(DEPTH)/dist + LIBXUL_SDK = @LIBXUL_SDK@ +@@ -275,7 +275,7 @@ + OS_CPPFLAGS = @CPPFLAGS@ + OS_CFLAGS = $(OS_CPPFLAGS) @CFLAGS@ + OS_CXXFLAGS = $(OS_CPPFLAGS) @CXXFLAGS@ +-OS_LDFLAGS = @LDFLAGS@ ++OS_LDFLAGS = @LDFLAGS@ -lc + + OS_COMPILE_CFLAGS = $(OS_CPPFLAGS) @COMPILE_CFLAGS@ + OS_COMPILE_CXXFLAGS = $(OS_CPPFLAGS) @COMPILE_CXXFLAGS@ Index: files/patch-config_mkdepend_Makefile.in =================================================================== RCS file: /home/pcvs/ports/www/firefox/files/patch-config_mkdepend_Makefile.in,v retrieving revision 1.1 diff -u -u -r1.1 patch-config_mkdepend_Makefile.in --- files/patch-config_mkdepend_Makefile.in 29 Nov 2005 21:12:28 -0000 1.1 +++ files/patch-config_mkdepend_Makefile.in 3 Feb 2010 23:26:05 -0000 @@ -1,6 +1,6 @@ ---- config/mkdepend/Makefile.in.orig Sun Dec 12 07:36:57 2004 -+++ config/mkdepend/Makefile.in Sun Dec 12 07:37:55 2004 -@@ -57,6 +57,7 @@ +--- config/mkdepend/Makefile.in.orig 2009-04-28 08:07:48.532396203 +0000 ++++ config/mkdepend/Makefile.in 2009-04-28 08:08:07.342398592 +0000 +@@ -73,6 +73,7 @@ include $(topsrcdir)/config/rules.mk HOST_CFLAGS += -DINCLUDEDIR=\"/usr/include\" -DOBJSUFFIX=\".$(OBJ_SUFFIX)\" Index: files/patch-configure =================================================================== RCS file: files/patch-configure diff -N files/patch-configure --- files/patch-configure 20 Jul 2007 12:14:51 -0000 1.8 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,47 +0,0 @@ ---- configure.orig 2007-07-11 12:44:47.000000000 -0400 -+++ configure 2007-07-19 06:04:36.000000000 -0400 -@@ -1047,7 +1047,7 @@ - - MOZJPEG=62 - MOZPNG=10217 --MOZZLIB=1.2.3 -+MOZZLIB=1.2.2 - NSPR_VERSION=4 - NSS_VERSION=3 - -@@ -10403,7 +10403,7 @@ - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_save_LIBS="$LIBS" --LIBS="-liconv $LIBS" -+LIBS="-L$LOCALBASE/lib -liconv $LIBS" - cat > conftest.$ac_ext <&6 -- _ICONV_LIBS="$_ICONV_LIBS -liconv" -+ _ICONV_LIBS="$_ICONV_LIBS -L$LOCALBASE/lib -liconv" - else - echo "$ac_t""no" 1>&6 - echo $ac_n "checking for libiconv in -liconv""... $ac_c" 1>&6 -@@ -10444,7 +10444,7 @@ - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_save_LIBS="$LIBS" --LIBS="-liconv $LIBS" -+LIBS="-L$LOCALBASE/lib -liconv $LIBS" - cat > conftest.$ac_ext <&6 -- _ICONV_LIBS="$_ICONV_LIBS -liconv" -+ _ICONV_LIBS="$_ICONV_LIBS -L$LOCALBASE/lib -liconv" - else - echo "$ac_t""no" 1>&6 - fi Index: files/patch-configure.in =================================================================== RCS file: files/patch-configure.in diff -N files/patch-configure.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-configure.in 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,11 @@ +--- configure.in.orig 2009-10-03 20:24:11.000000000 +0200 ++++ configure.in 2009-10-03 20:24:43.000000000 +0200 +@@ -1352,7 +1352,7 @@ + CPU_ARCH=sparc + ;; + +-x86_64 | ia64) ++amd64 | x86_64 | ia64) + CPU_ARCH="$OS_TEST" + ;; + Index: files/patch-content-xslt-public-txDouble.h =================================================================== RCS file: files/patch-content-xslt-public-txDouble.h diff -N files/patch-content-xslt-public-txDouble.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-content-xslt-public-txDouble.h 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,11 @@ +--- content/xslt/public/txDouble.h.orig 2009-08-16 21:46:27.000000000 +0200 ++++ content/xslt/public/txDouble.h 2009-08-16 21:49:53.000000000 +0200 +@@ -43,7 +43,7 @@ + //A trick to handle IEEE floating point exceptions on FreeBSD - E.D. + #ifdef __FreeBSD__ + #include +-#ifdef __alpha__ ++#if !defined(__amd64__) && !defined(__i386__) + static fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP; + #else + static fp_except_t allmask = FP_X_INV|FP_X_OFL|FP_X_UFL|FP_X_DZ|FP_X_IMP|FP_X_DNML; Index: files/patch-db_sqlite3_src_Makefile.in =================================================================== RCS file: files/patch-db_sqlite3_src_Makefile.in diff -N files/patch-db_sqlite3_src_Makefile.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-db_sqlite3_src_Makefile.in 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,11 @@ +--- db/sqlite3/src/Makefile.in.orig 2009-04-28 11:12:00.829684825 +0000 ++++ db/sqlite3/src/Makefile.in 2009-04-28 11:12:20.628076799 +0000 +@@ -45,6 +45,8 @@ + + include $(DEPTH)/config/autoconf.mk + ++OS_CFLAGS = -I../../../dist/include/sqlite3 ++OS_LIBS = %%PTHREAD_LIBS%% -lc + MODULE = sqlite3 + LIBRARY_NAME = sqlite3 + FORCE_SHARED_LIB = 1 Index: files/patch-embedding_base_nsEmbedAPI.cpp =================================================================== RCS file: files/patch-embedding_base_nsEmbedAPI.cpp diff -N files/patch-embedding_base_nsEmbedAPI.cpp --- files/patch-embedding_base_nsEmbedAPI.cpp 10 Oct 2007 00:15:32 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ ---- embedding/base/nsEmbedAPI.cpp.orig 2007-10-09 20:00:30.000000000 -0400 -+++ embedding/base/nsEmbedAPI.cpp 2007-10-09 20:01:45.000000000 -0400 -@@ -53,7 +53,12 @@ static PRBool sRegistryIniti - static PRUint32 sInitCounter = 0; - - #define HACK_AROUND_THREADING_ISSUES --//#define HACK_AROUND_NONREENTRANT_INITXPCOM -+#ifdef __FreeBSD__ -+#include -+#if __FreeBSD_version < 700042 -+#define HACK_AROUND_NONREENTRANT_INITXPCOM -+#endif -+#endif - - #ifdef HACK_AROUND_NONREENTRANT_INITXPCOM - // XXX hack class to clean up XPCOM when this module is unloaded Index: files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.cpp =================================================================== RCS file: files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.cpp diff -N files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.cpp --- files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.cpp 2 Feb 2006 13:16:54 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ ---- extensions/typeaheadfind/src/nsTypeAheadFind.cpp.orig Wed Nov 19 01:20:47 2003 -+++ extensions/typeaheadfind/src/nsTypeAheadFind.cpp Tue Feb 10 02:52:26 2004 -@@ -323,11 +323,11 @@ - prefBranch->GetBoolPref("accessibility.typeaheadfind.startlinksonly", - &mStartLinksOnlyPref); - -- PRBool isSoundEnabled = PR_TRUE; -+ mIsSoundEnabled = PR_TRUE; - prefBranch->GetBoolPref("accessibility.typeaheadfind.enablesound", -- &isSoundEnabled); -+ &mIsSoundEnabled); - nsXPIDLCString soundStr; -- if (isSoundEnabled) { -+ if (mIsSoundEnabled && mIsSoundEnabled) { - prefBranch->GetCharPref("accessibility.typeaheadfind.soundURL", - getter_Copies(soundStr)); - } -@@ -758,7 +758,7 @@ - } - else { - // No find string to backspace in! -- if (mIsBackspaceProtectOn) { -+ if (mIsBackspaceProtectOn && mIsSoundEnabled) { - // This flag should be on only if the last key was a backspace. - // It keeps us from accidentally hitting backspace too many times and - // going back in history when we really just wanted to clear -@@ -1012,7 +1012,9 @@ - - // Error sound (don't fire when backspace is pressed, they're - // trying to correct the mistake!) -- PlayNotFoundSound(); -+ if (mIsSoundEnabled) { -+ PlayNotFoundSound(); -+ } - - // Remove bad character from buffer, so we can continue typing from - // last matched character -@@ -1059,7 +1061,7 @@ - void - nsTypeAheadFind::PlayNotFoundSound() - { -- if (mNotFoundSoundURL.IsEmpty()) // no sound -+ if (mNotFoundSoundURL.IsEmpty() || !mIsSoundEnabled) // no sound - return; - if (!mSoundInterface) { - mSoundInterface = do_CreateInstance("@mozilla.org/sound;1"); Index: files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.h =================================================================== RCS file: files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.h diff -N files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.h --- files/patch-extensions_typeaheadfind_src_nsTypeAheadFind.h 2 Feb 2006 13:16:54 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ ---- extensions/typeaheadfind/src/nsTypeAheadFind.h.orig Fri May 23 22:00:33 2003 -+++ extensions/typeaheadfind/src/nsTypeAheadFind.h Mon Feb 9 22:21:43 2004 -@@ -194,6 +194,9 @@ - - nsCString mNotFoundSoundURL; - -+ // Move the sound enabled boolean out for all methods to access. -+ PRBool mIsSoundEnabled; -+ - // PRBool's are used instead of PRPackedBool's where the address of the - // boolean variable is getting passed into a method. For example: - // GetBoolPref("accessibility.typeaheadfind.linksonly", &mLinksOnlyPref); Index: files/patch-ff-331088 =================================================================== RCS file: files/patch-ff-331088 diff -N files/patch-ff-331088 --- files/patch-ff-331088 23 Feb 2009 20:40:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,154 +0,0 @@ ---- .pc/331088-candidate.patch/layout/forms/nsFileControlFrame.cpp 2009-01-07 16:46:32.000000000 +0100 -+++ layout/forms/nsFileControlFrame.cpp 2009-01-07 17:02:13.000000000 +0100 -@@ -257,35 +257,37 @@ nsFileControlFrame::ScrollIntoView(nsPre - NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE,NS_PRESSHELL_SCROLL_IF_NOT_VISIBLE); - } - } - } - - /** - * This is called when our browse button is clicked - */ --nsresult --nsFileControlFrame::MouseClick(nsIDOMEvent* aMouseEvent) -+NS_IMETHODIMP -+nsFileControlFrame::MouseListener::MouseClick(nsIDOMEvent* aMouseEvent) - { -+ NS_ASSERTION(mFrame, "We should have been unregistered"); -+ - // only allow the left button - nsCOMPtr mouseEvent = do_QueryInterface(aMouseEvent); - if (mouseEvent) { - PRUint16 whichButton; - if (NS_SUCCEEDED(mouseEvent->GetButton(&whichButton))) { - if (whichButton != 0) { - return NS_OK; - } - } - } - - - nsresult result; - - // Get parent nsIDOMWindowInternal object. -- nsIContent* content = GetContent(); -+ nsIContent* content = mFrame->GetContent(); - if (!content) - return NS_ERROR_FAILURE; - - nsCOMPtr doc = content->GetDocument(); - if (!doc) - return NS_ERROR_FAILURE; - - nsCOMPtr parentWindow = -@@ -304,17 +306,17 @@ nsFileControlFrame::MouseClick(nsIDOMEve - if (NS_FAILED(result)) - return result; - - // Set filter "All Files" - filePicker->AppendFilters(nsIFilePicker::filterAll); - - // Set default directry and filename - nsAutoString defaultName; -- GetProperty(nsHTMLAtoms::value, defaultName); -+ mFrame->GetProperty(nsHTMLAtoms::value, defaultName); - - nsCOMPtr currentFile = do_CreateInstance("@mozilla.org/file/local;1"); - if (currentFile && !defaultName.IsEmpty()) { - result = currentFile->InitWithPath(defaultName); - if (NS_SUCCEEDED(result)) { - nsAutoString leafName; - currentFile->GetLeafName(leafName); - if (!leafName.IsEmpty()) { -@@ -328,46 +330,46 @@ nsFileControlFrame::MouseClick(nsIDOMEve - nsCOMPtr parentLocalFile = do_QueryInterface(parentFile, &result); - if (parentLocalFile) - filePicker->SetDisplayDirectory(parentLocalFile); - } - } - } - - // Tell our textframe to remember the currently focused value -- mTextFrame->InitFocusedValue(); -+ mFrame->mTextFrame->InitFocusedValue(); - - // Open dialog - PRInt16 mode; - result = filePicker->Show(&mode); - if (NS_FAILED(result)) - return result; - if (mode == nsIFilePicker::returnCancel) - return NS_OK; - -- if (!mTextFrame) { -+ if (!mFrame) { - // We got destroyed while the filepicker was up. Don't do anything here. - return NS_OK; - } - - // Set property - nsCOMPtr localFile; - result = filePicker->GetFile(getter_AddRefs(localFile)); - if (localFile) { - nsAutoString unicodePath; - result = localFile->GetPath(unicodePath); - if (!unicodePath.IsEmpty()) { -- mTextFrame->SetProperty(mPresContext, nsHTMLAtoms::value, unicodePath); -- nsCOMPtr fileControl = do_QueryInterface(mContent); -+ mFrame->mTextFrame->SetProperty(mFrame->mPresContext, nsHTMLAtoms::value, unicodePath); -+ nsCOMPtr fileControl = do_QueryInterface(content); - if (fileControl) { - fileControl->SetFileName(unicodePath, PR_FALSE); - } - - // May need to fire an onchange here -- mTextFrame->CheckFireOnChange(); -+ mFrame->mTextFrame->CheckFireOnChange(); - return NS_OK; - } - } - - return NS_FAILED(result) ? result : NS_ERROR_FAILURE; - } - - -@@ -660,18 +662,8 @@ nsFileControlFrame::OnContentReset() - return NS_OK; - } - - //////////////////////////////////////////////////////////// - // Mouse listener implementation - - NS_IMPL_ISUPPORTS1(nsFileControlFrame::MouseListener, nsIDOMMouseListener) - --NS_IMETHODIMP --nsFileControlFrame::MouseListener::MouseClick(nsIDOMEvent* aMouseEvent) --{ -- if (mFrame) { -- return mFrame->MouseClick(aMouseEvent); -- } -- -- return NS_OK; --} -- ---- .pc/331088-candidate.patch/layout/forms/nsFileControlFrame.h 2009-01-07 17:18:55.000000000 +0100 -+++ layout/forms/nsFileControlFrame.h 2009-01-07 17:19:00.000000000 +0100 -@@ -142,18 +142,16 @@ protected: - NS_IMETHOD MouseOver(nsIDOMEvent* aMouseEvent) { return NS_OK; } - NS_IMETHOD MouseOut(nsIDOMEvent* aMouseEvent) { return NS_OK; } - NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent) { return NS_OK; } - - private: - nsFileControlFrame* mFrame; - }; - -- nsresult MouseClick(nsIDOMEvent* aMouseEvent); -- - virtual PRIntn GetSkipSides() const; - - /** - * The text frame (populated on initial reflow). - * @see nsFileControlFrame::Reflow - */ - nsNewFrame* mTextFrame; - /** Index: files/patch-ff-380418 =================================================================== RCS file: files/patch-ff-380418 diff -N files/patch-ff-380418 --- files/patch-ff-380418 15 Feb 2009 18:20:47 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,66 +0,0 @@ ---- .pc/380418-candidate.patch/content/base/src/nsXMLHttpRequest.cpp 2009-01-05 03:48:53.000000000 +0100 -+++ content/base/src/nsXMLHttpRequest.cpp 2009-01-05 03:54:08.000000000 +0100 -@@ -762,16 +762,28 @@ nsXMLHttpRequest::GetAllResponseHeaders( - /* ACString getResponseHeader (in AUTF8String header); */ - NS_IMETHODIMP - nsXMLHttpRequest::GetResponseHeader(const nsACString& header, - nsACString& _retval) - { - nsresult rv = NS_OK; - _retval.Truncate(); - -+ // See bug #380418. Hide "Set-Cookie" headers from non-chrome scripts. -+ PRBool chrome = PR_FALSE; // default to false in case IsCapabilityEnabled fails -+ nsIScriptSecurityManager *secMan = nsContentUtils::GetSecurityManager(); -+ secMan->IsCapabilityEnabled("UniversalXPConnect", &chrome); -+ if (!chrome && -+ (header.LowerCaseEqualsASCII("set-cookie") || -+ header.LowerCaseEqualsASCII("set-cookie2"))) { -+ NS_WARNING("blocked access to response header"); -+ _retval.SetIsVoid(PR_TRUE); -+ return NS_OK; -+ } -+ - nsCOMPtr httpChannel = GetCurrentHttpChannel(); - - if (!mDenyResponseDataAccess && httpChannel) { - rv = httpChannel->GetResponseHeader(header, _retval); - } - - if (rv == NS_ERROR_NOT_AVAILABLE) { - // Means no header -@@ -2183,20 +2195,30 @@ nsXMLHttpRequest::AppendReachableList(ns - } - - - NS_IMPL_ISUPPORTS1(nsXMLHttpRequest::nsHeaderVisitor, nsIHttpHeaderVisitor) - - NS_IMETHODIMP nsXMLHttpRequest:: - nsHeaderVisitor::VisitHeader(const nsACString &header, const nsACString &value) - { -- mHeaders.Append(header); -- mHeaders.Append(": "); -- mHeaders.Append(value); -- mHeaders.Append('\n'); -+ // See bug #380418. Hide "Set-Cookie" headers from non-chrome scripts. -+ PRBool chrome = PR_FALSE; // default to false in case IsCapabilityEnabled fails -+ nsIScriptSecurityManager *secMan = nsContentUtils::GetSecurityManager(); -+ secMan->IsCapabilityEnabled("UniversalXPConnect", &chrome); -+ if (!chrome && -+ (header.LowerCaseEqualsASCII("set-cookie") || -+ header.LowerCaseEqualsASCII("set-cookie2"))) { -+ NS_WARNING("blocked access to response header"); -+ } else { -+ mHeaders.Append(header); -+ mHeaders.Append(": "); -+ mHeaders.Append(value); -+ mHeaders.Append('\n'); -+ } - return NS_OK; - } - - // DOM event class to handle progress notifications - nsXMLHttpProgressEvent::nsXMLHttpProgressEvent(nsIDOMEvent * aInner, PRUint64 aCurrentProgress, PRUint64 aMaxProgress) - { - mInner = aInner; - mCurProgress = aCurrentProgress; Index: files/patch-ff-401042 =================================================================== RCS file: files/patch-ff-401042 diff -N files/patch-ff-401042 --- files/patch-ff-401042 23 Feb 2009 20:40:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,57 +0,0 @@ ---- .pc/401042-backport.patch/layout/generic/nsInlineFrame.cpp 2009-01-05 02:55:09.000000000 +0100 -+++ layout/generic/nsInlineFrame.cpp 2009-01-05 02:56:08.000000000 +0100 -@@ -576,27 +576,52 @@ nsInlineFrame::ReflowFrames(nsPresContex - ReparentFloatsForInlineChild(irs.mLineContainer, frame, PR_FALSE); - } - frame->SetParent(this); - // We also need to check if frame has a next-in-flow. It it does, then set - // its parent frame pointer, too. Otherwise, if we reflow frame and it's - // complete we'll fail when deleting its next-in-flow which is no longer - // needed. This scenario doesn't happen often, but it can happen - nsIFrame* nextInFlow = frame->GetNextInFlow(); -- while (nextInFlow) { -+ for ( ; nextInFlow; nextInFlow = nextInFlow->GetNextInFlow()) { - // Since we only do lazy setting of parent pointers for the frame's - // initial reflow, this frame can't have a next-in-flow. That means - // the continuing child frame must be in our child list as well. If - // not, then something is wrong - NS_ASSERTION(mFrames.ContainsFrame(nextInFlow), "unexpected flow"); - if (havePrevBlock) { - ReparentFloatsForInlineChild(irs.mLineContainer, nextInFlow, PR_FALSE); - } - nextInFlow->SetParent(this); -- nextInFlow = nextInFlow->GetNextInFlow(); -+ } -+ -+ // Fix the parent pointer for ::first-letter child frame next-in-flows, -+ // so nsFirstLetterFrame::Reflow can destroy them safely (bug 401042). -+ nsIFrame* realFrame = nsPlaceholderFrame::GetRealFrameFor(frame); -+ if (realFrame->GetType() == nsLayoutAtoms::letterFrame) { -+ nsIFrame* child = realFrame->GetFirstChild(nsnull); -+ if (child) { -+ nsIFrame* nextInFlow = child->GetNextInFlow(); -+ for ( ; nextInFlow; nextInFlow = nextInFlow->GetNextInFlow()) { -+ if (mFrames.ContainsFrame(nextInFlow)) { -+ nextInFlow->SetParent(this); -+ } -+ else { -+#ifdef DEBUG -+ // Once we find a next-in-flow that isn't ours none of the -+ // remaining next-in-flows should be either. -+ for ( ; nextInFlow; nextInFlow = nextInFlow->GetNextInFlow()) { -+ NS_ASSERTION(!mFrames.ContainsFrame(nextInFlow), -+ "unexpected letter frame flow"); -+ } -+#endif -+ break; -+ } -+ } -+ } - } - } - rv = ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus); - if (NS_FAILED(rv)) { - done = PR_TRUE; - break; - } - if (NS_INLINE_IS_BREAK(aStatus) || Index: files/patch-ff-414540 =================================================================== RCS file: files/patch-ff-414540 diff -N files/patch-ff-414540 --- files/patch-ff-414540 8 Mar 2009 22:16:15 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,118 +0,0 @@ -diff -up mozilla/rdf/base/src/Makefile.in.414540 mozilla/rdf/base/src/Makefile.in ---- rdf/base/src/Makefile.in.414540 2005-06-24 09:49:43.000000000 +0200 -+++ rdf/base/src/Makefile.in 2009-02-20 22:48:06.000000000 +0100 -@@ -49,6 +49,9 @@ LIBXUL_LIBRARY = 1 - REQUIRES = xpcom \ - string \ - rdfutil \ -+ js \ -+ caps \ -+ xpconnect \ - necko \ - content \ - htmlparser \ -diff -up mozilla/rdf/base/src/nsRDFXMLDataSource.cpp.414540 mozilla/rdf/base/src/nsRDFXMLDataSource.cpp ---- rdf/base/src/nsRDFXMLDataSource.cpp.414540 2005-06-24 09:49:43.000000000 +0200 -+++ rdf/base/src/nsRDFXMLDataSource.cpp 2009-02-20 23:20:55.000000000 +0100 -@@ -122,6 +122,9 @@ - #include "prlog.h" - #include "nsNameSpaceMap.h" - #include "nsCRT.h" -+#include "nsIScriptSecurityManager.h" -+#include "nsIChannelEventSink.h" -+#include "nsNetUtil.h" - - #include "rdfIDataSource.h" - -@@ -218,7 +221,9 @@ class RDFXMLDataSourceImpl : public nsIR - public nsIRDFXMLSink, - public nsIRDFXMLSource, - public nsIStreamListener, -- public rdfIDataSource -+ public rdfIDataSource, -+ public nsIInterfaceRequestor, -+ public nsIChannelEventSink - { - protected: - enum LoadState { -@@ -389,6 +394,12 @@ public: - // nsIStreamListener - NS_DECL_NSISTREAMLISTENER - -+ // nsIInterfaceRequestor -+ NS_DECL_NSIINTERFACEREQUESTOR -+ -+ // nsIChannelEventSink -+ NS_DECL_NSICHANNELEVENTSINK -+ - // rdfIDataSource - NS_IMETHOD VisitAllSubjects(rdfITripleVisitor *aVisitor) { - nsresult rv; -@@ -537,15 +548,23 @@ RDFXMLDataSourceImpl::~RDFXMLDataSourceI - } - - --NS_IMPL_ISUPPORTS7(RDFXMLDataSourceImpl, -+NS_IMPL_ISUPPORTS9(RDFXMLDataSourceImpl, - nsIRDFDataSource, - nsIRDFRemoteDataSource, - nsIRDFXMLSink, - nsIRDFXMLSource, - nsIRequestObserver, - nsIStreamListener, -- rdfIDataSource) -- -+ rdfIDataSource, -+ nsIInterfaceRequestor, -+ nsIChannelEventSink) -+ -+// nsIInterfaceRequestor -+NS_IMETHODIMP -+RDFXMLDataSourceImpl::GetInterface(const nsIID& aIID, void** aSink) -+{ -+ return QueryInterface(aIID, aSink); -+} - - nsresult - RDFXMLDataSourceImpl::BlockingParse(nsIURI* aURL, nsIStreamListener* aConsumer) -@@ -924,6 +943,31 @@ RDFXMLDataSourceImpl::SetReadOnly(PRBool - - #include "nsITimelineService.h" - -+// nsIChannelEventSink -+ -+NS_IMETHODIMP -+RDFXMLDataSourceImpl::OnChannelRedirect(nsIChannel *aOldChannel, -+ nsIChannel *aNewChannel, -+ PRUint32 aFlags) -+{ -+ NS_PRECONDITION(aNewChannel, "Redirecting to null channel?"); -+ -+ nsresult rv; -+ nsCOMPtr secMan = -+ do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ nsCOMPtr oldURI; -+ rv = aOldChannel->GetURI(getter_AddRefs(oldURI)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ nsCOMPtr newURI; -+ rv = aNewChannel->GetURI(getter_AddRefs(newURI)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ return secMan->CheckSameOriginURI(oldURI, newURI); -+} -+ - NS_IMETHODIMP - RDFXMLDataSourceImpl::Refresh(PRBool aBlocking) - { -@@ -972,7 +1016,7 @@ RDFXMLDataSourceImpl::Refresh(PRBool aBl - } - else { - // Null LoadGroup ? -- rv = NS_OpenURI(this, nsnull, mURL, nsnull); -+ rv = NS_OpenURI(this, nsnull, mURL, nsnull, nsnull, this); - if (NS_FAILED(rv)) return rv; - - // So we don't try to issue two asynchronous loads at once. Index: files/patch-ff-437142 =================================================================== RCS file: files/patch-ff-437142 diff -N files/patch-ff-437142 --- files/patch-ff-437142 23 Feb 2009 20:40:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,116 +0,0 @@ ---- .pc/437142_backport_att350047.patch/layout/base/nsCSSFrameConstructor.cpp 2009-01-26 12:09:32.000000000 +0100 -+++ layout/base/nsCSSFrameConstructor.cpp 2009-01-26 12:10:17.000000000 +0100 -@@ -9902,17 +9902,19 @@ nsCSSFrameConstructor::ContentRemoved(ns - nsFrameManager *frameManager = mPresShell->FrameManager(); - nsPresContext *presContext = mPresShell->GetPresContext(); - nsresult rv = NS_OK; - - // Find the child frame that maps the content - nsIFrame* childFrame; - mPresShell->GetPrimaryFrameFor(aChild, &childFrame); - -- if (! childFrame) { -+ if (!childFrame || childFrame->GetContent() != aChild) { -+ // XXXbz the GetContent() != aChild check is needed due to bug 135040. -+ // Remove it once that's fixed. - frameManager->ClearUndisplayedContentIn(aChild, aContainer); - } - - // When the last item is removed from a select, - // we need to add a pseudo frame so select gets sized as the best it can - // so here we see if it is a select and then we get the number of options - if (aContainer && childFrame) { - nsCOMPtr selectElement = do_QueryInterface(aContainer); -@@ -9991,17 +9993,19 @@ nsCSSFrameConstructor::ContentRemoved(ns - // First update the containing blocks structure by removing the - // existing letter frames. This makes the subsequent logic - // simpler. - RemoveLetterFrames(presContext, mPresShell, frameManager, - containingBlock); - - // Recover childFrame and parentFrame - mPresShell->GetPrimaryFrameFor(aChild, &childFrame); -- if (!childFrame) { -+ if (!childFrame || childFrame->GetContent() != aChild) { -+ // XXXbz the GetContent() != aChild check is needed due to bug 135040. -+ // Remove it once that's fixed. - frameManager->ClearUndisplayedContentIn(aChild, aContainer); - return NS_OK; - } - parentFrame = childFrame->GetParent(); - - #ifdef NOISY_FIRST_LETTER - printf(" ==> revised parentFrame="); - nsFrame::ListTag(stdout, parentFrame); -@@ -10502,16 +10506,24 @@ nsCSSFrameConstructor::ProcessRestyledFr - } - - index = count; - while (0 <= --index) { - nsIFrame* frame; - nsIContent* content; - nsChangeHint hint; - aChangeList.ChangeAt(index, frame, content, hint); -+ if (frame && frame->GetContent() != content) { -+ // XXXbz this is due to image maps messing with the primary frame map. -+ // See bug 135040. Remove this block once that's fixed. -+ frame = nsnull; -+ if (!(hint & nsChangeHint_ReconstructFrame)) { -+ continue; -+ } -+ } - - // skip any frame that has been destroyed due to a ripple effect - if (frame) { - nsresult res; - - propTable->GetProperty(frame, nsLayoutAtoms::changeListProperty, &res); - - if (NS_PROPTABLE_PROP_NOT_THERE == res) -@@ -10567,16 +10579,21 @@ nsCSSFrameConstructor::ProcessRestyledFr - return NS_OK; - } - - void - nsCSSFrameConstructor::RestyleElement(nsIContent *aContent, - nsIFrame *aPrimaryFrame, - nsChangeHint aMinHint) - { -+ if (aPrimaryFrame && aPrimaryFrame->GetContent() != aContent) { -+ // XXXbz this is due to image maps messing with the primary frame mapping. -+ // See bug 135040. We can remove this block once that's fixed. -+ aPrimaryFrame = nsnull; -+ } - #ifdef ACCESSIBILITY - nsIAtom *prevRenderedFrameType = nsnull; - if (mPresShell->IsAccessibilityActive()) { - prevRenderedFrameType = GetRenderedFrameType(aPrimaryFrame); - } - #endif - if (aMinHint & nsChangeHint_ReconstructFrame) { - RecreateFramesForContent(aContent); ---- .pc/437142_backport_att350047.patch/layout/generic/nsImageMap.cpp 2009-01-26 12:09:32.000000000 +0100 -+++ layout/generic/nsImageMap.cpp 2009-01-26 12:10:17.000000000 +0100 -@@ -895,16 +895,22 @@ nsImageMap::AddArea(nsIContent* aArea) - return NS_ERROR_OUT_OF_MEMORY; - - //Add focus listener to track area focus changes - nsCOMPtr rec(do_QueryInterface(aArea)); - if (rec) { - rec->AddEventListenerByIID(this, NS_GET_IID(nsIDOMFocusListener)); - } - -+ -+ // This is a nasty hack. It needs to go away: see bug 135040. Once this is -+ // removed, the code added to nsCSSFrameConstructor::RestyleElement, -+ // nsCSSFrameConstructor::ContentRemoved (both hacks there), and -+ // nsCSSFrameConstructor::ProcessRestyledFrames to work around this issue can -+ // be removed. - mPresShell->FrameManager()->SetPrimaryFrameFor(aArea, mImageFrame); - aArea->SetMayHaveFrame(PR_TRUE); - NS_ASSERTION(aArea->MayHaveFrame(), "SetMayHaveFrame failed?"); - - area->ParseCoords(coords); - mAreas.AppendElement(area); - return NS_OK; - } Index: files/patch-ff-449006 =================================================================== RCS file: files/patch-ff-449006 diff -N files/patch-ff-449006 --- files/patch-ff-449006 23 Feb 2009 20:40:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,1173 +0,0 @@ -diff --git a/editor/txmgr/src/nsTransactionItem.cpp b/editor/txmgr/src/nsTransactionItem.cpp ---- editor/txmgr/src/nsTransactionItem.cpp -+++ editor/txmgr/src/nsTransactionItem.cpp -@@ -35,31 +35,51 @@ - * - * ***** END LICENSE BLOCK ***** */ - - #include "nsITransaction.h" - #include "nsTransactionStack.h" - #include "nsTransactionManager.h" - #include "nsTransactionItem.h" - #include "nsCOMPtr.h" -+#include "nsAutoPtr.h" - - nsTransactionItem::nsTransactionItem(nsITransaction *aTransaction) - : mTransaction(aTransaction), mUndoStack(0), mRedoStack(0) - { - } - - nsTransactionItem::~nsTransactionItem() - { - if (mRedoStack) - delete mRedoStack; - - if (mUndoStack) - delete mUndoStack; -+} - -- NS_IF_RELEASE(mTransaction); -+nsrefcnt -+nsTransactionItem::AddRef() -+{ -+ ++mRefCnt; -+ NS_LOG_ADDREF(this, mRefCnt, "nsTransactionItem", -+ sizeof(nsTransactionItem)); -+ return mRefCnt; -+} -+ -+nsrefcnt -+nsTransactionItem::Release() { -+ --mRefCnt; -+ NS_LOG_RELEASE(this, mRefCnt, "nsTransactionItem"); -+ if (mRefCnt == 0) { -+ mRefCnt = 1; -+ delete this; -+ return 0; -+ } -+ return mRefCnt; - } - - nsresult - nsTransactionItem::AddChild(nsTransactionItem *aTransactionItem) - { - if (!aTransactionItem) - return NS_ERROR_NULL_POINTER; - -@@ -75,17 +95,17 @@ nsTransactionItem::AddChild(nsTransactio - } - - nsresult - nsTransactionItem::GetTransaction(nsITransaction **aTransaction) - { - if (!aTransaction) - return NS_ERROR_NULL_POINTER; - -- *aTransaction = mTransaction; -+ NS_IF_ADDREF(*aTransaction = mTransaction); - - return NS_OK; - } - - nsresult - nsTransactionItem::GetIsBatch(PRBool *aIsBatch) - { - if (!aIsBatch) -@@ -202,17 +222,17 @@ nsTransactionItem::UndoTransaction(nsTra - } - - return NS_OK; - } - - nsresult - nsTransactionItem::UndoChildren(nsTransactionManager *aTxMgr) - { -- nsTransactionItem *item; -+ nsRefPtr item; - nsresult result = NS_OK; - PRInt32 sz = 0; - - if (mUndoStack) { - if (!mRedoStack && mUndoStack) { - mRedoStack = new nsTransactionRedoStack(); - if (!mRedoStack) - return NS_ERROR_OUT_OF_MEMORY; -@@ -220,25 +240,25 @@ nsTransactionItem::UndoChildren(nsTransa - - /* Undo all of the transaction items children! */ - result = mUndoStack->GetSize(&sz); - - if (NS_FAILED(result)) - return result; - - while (sz-- > 0) { -- result = mUndoStack->Peek(&item); -+ result = mUndoStack->Peek(getter_AddRefs(item)); - - if (NS_FAILED(result)) { - return result; - } - -- nsITransaction *t = 0; -+ nsCOMPtr t; - -- result = item->GetTransaction(&t); -+ result = item->GetTransaction(getter_AddRefs(t)); - - if (NS_FAILED(result)) { - return result; - } - - PRBool doInterrupt = PR_FALSE; - - result = aTxMgr->WillUndoNotify(t, &doInterrupt); -@@ -249,17 +269,17 @@ nsTransactionItem::UndoChildren(nsTransa - - if (doInterrupt) { - return NS_OK; - } - - result = item->UndoTransaction(aTxMgr); - - if (NS_SUCCEEDED(result)) { -- result = mUndoStack->Pop(&item); -+ result = mUndoStack->Pop(getter_AddRefs(item)); - - if (NS_SUCCEEDED(result)) { - result = mRedoStack->Push(item); - - /* XXX: If we got an error here, I doubt we can recover! - * XXX: Should we just push the item back on the undo stack? - */ - } -@@ -276,16 +296,17 @@ nsTransactionItem::UndoChildren(nsTransa - return result; - } - - nsresult - nsTransactionItem::RedoTransaction(nsTransactionManager *aTxMgr) - { - nsresult result; - -+ nsCOMPtr kungfuDeathGrip(mTransaction); - if (mTransaction) { - result = mTransaction->RedoTransaction(); - - if (NS_FAILED(result)) - return result; - } - - result = RedoChildren(aTxMgr); -@@ -296,40 +317,40 @@ nsTransactionItem::RedoTransaction(nsTra - } - - return NS_OK; - } - - nsresult - nsTransactionItem::RedoChildren(nsTransactionManager *aTxMgr) - { -- nsTransactionItem *item; -+ nsRefPtr item; - nsresult result = NS_OK; - PRInt32 sz = 0; - - if (!mRedoStack) - return NS_OK; - - /* Redo all of the transaction items children! */ - result = mRedoStack->GetSize(&sz); - - if (NS_FAILED(result)) - return result; - - - while (sz-- > 0) { -- result = mRedoStack->Peek(&item); -+ result = mRedoStack->Peek(getter_AddRefs(item)); - - if (NS_FAILED(result)) { - return result; - } - -- nsITransaction *t = 0; -+ nsCOMPtr t; - -- result = item->GetTransaction(&t); -+ result = item->GetTransaction(getter_AddRefs(t)); - - if (NS_FAILED(result)) { - return result; - } - - PRBool doInterrupt = PR_FALSE; - - result = aTxMgr->WillRedoNotify(t, &doInterrupt); -@@ -340,17 +361,17 @@ nsTransactionItem::RedoChildren(nsTransa - - if (doInterrupt) { - return NS_OK; - } - - result = item->RedoTransaction(aTxMgr); - - if (NS_SUCCEEDED(result)) { -- result = mRedoStack->Pop(&item); -+ result = mRedoStack->Pop(getter_AddRefs(item)); - - if (NS_SUCCEEDED(result)) { - result = mUndoStack->Push(item); - - // XXX: If we got an error here, I doubt we can recover! - // XXX: Should we just push the item back on the redo stack? - } - } -diff --git a/editor/txmgr/src/nsTransactionItem.h b/editor/txmgr/src/nsTransactionItem.h ---- editor/txmgr/src/nsTransactionItem.h -+++ editor/txmgr/src/nsTransactionItem.h -@@ -33,31 +33,36 @@ - * 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 nsTransactionItem_h__ - #define nsTransactionItem_h__ - --class nsITransaction; -+#include "nsITransaction.h" -+#include "nsCOMPtr.h" -+ - class nsTransactionStack; - class nsTransactionRedoStack; - class nsTransactionManager; - - class nsTransactionItem - { -- nsITransaction *mTransaction; -- nsTransactionStack *mUndoStack; -- nsTransactionRedoStack *mRedoStack; -+ nsCOMPtr mTransaction; -+ nsTransactionStack *mUndoStack; -+ nsTransactionRedoStack *mRedoStack; -+ nsAutoRefCnt mRefCnt; - - public: - - nsTransactionItem(nsITransaction *aTransaction); - virtual ~nsTransactionItem(); -+ nsrefcnt AddRef(); -+ nsrefcnt Release(); - - virtual nsresult AddChild(nsTransactionItem *aTransactionItem); - virtual nsresult GetTransaction(nsITransaction **aTransaction); - virtual nsresult GetIsBatch(PRBool *aIsBatch); - virtual nsresult GetNumberOfChildren(PRInt32 *aNumChildren); - virtual nsresult GetChild(PRInt32 aIndex, nsTransactionItem **aChild); - - virtual nsresult DoTransaction(void); -diff --git a/editor/txmgr/src/nsTransactionList.cpp b/editor/txmgr/src/nsTransactionList.cpp ---- editor/txmgr/src/nsTransactionList.cpp -+++ editor/txmgr/src/nsTransactionList.cpp -@@ -95,24 +95,24 @@ NS_IMETHODIMP nsTransactionList::ItemIsB - - *aIsBatch = PR_FALSE; - - nsCOMPtr txMgr = do_QueryReferent(mTxnMgr); - - if (!txMgr) - return NS_ERROR_FAILURE; - -- nsTransactionItem *item = 0; -+ nsRefPtr item; - - nsresult result = NS_ERROR_FAILURE; - - if (mTxnStack) -- result = mTxnStack->GetItem(aIndex, &item); -+ result = mTxnStack->GetItem(aIndex, getter_AddRefs(item)); - else if (mTxnItem) -- result = mTxnItem->GetChild(aIndex, &item); -+ result = mTxnItem->GetChild(aIndex, getter_AddRefs(item)); - - if (NS_FAILED(result)) - return result; - - if (!item) - return NS_ERROR_FAILURE; - - return item->GetIsBatch(aIsBatch); -@@ -126,62 +126,55 @@ NS_IMETHODIMP nsTransactionList::GetItem - - *aItem = 0; - - nsCOMPtr txMgr = do_QueryReferent(mTxnMgr); - - if (!txMgr) - return NS_ERROR_FAILURE; - -- nsTransactionItem *item = 0; -+ nsRefPtr item; - - nsresult result = NS_ERROR_FAILURE; - - if (mTxnStack) -- result = mTxnStack->GetItem(aIndex, &item); -+ result = mTxnStack->GetItem(aIndex, getter_AddRefs(item)); - else if (mTxnItem) -- result = mTxnItem->GetChild(aIndex, &item); -+ result = mTxnItem->GetChild(aIndex, getter_AddRefs(item)); - - if (NS_FAILED(result)) - return result; - - if (!item) - return NS_ERROR_FAILURE; - -- result = item->GetTransaction(aItem); -- -- if (NS_FAILED(result)) -- return result; -- -- NS_IF_ADDREF(*aItem); -- -- return NS_OK; -+ return item->GetTransaction(aItem); - } - - /* long getNumChildrenForItem (in long aIndex); */ - NS_IMETHODIMP nsTransactionList::GetNumChildrenForItem(PRInt32 aIndex, PRInt32 *aNumChildren) - { - if (!aNumChildren) - return NS_ERROR_NULL_POINTER; - - *aNumChildren = 0; - - nsCOMPtr txMgr = do_QueryReferent(mTxnMgr); - - if (!txMgr) - return NS_ERROR_FAILURE; - -- nsTransactionItem *item = 0; -+ nsRefPtr item; - - nsresult result = NS_ERROR_FAILURE; - - if (mTxnStack) -- result = mTxnStack->GetItem(aIndex, &item); -+ result = mTxnStack->GetItem(aIndex, getter_AddRefs(item)); - else if (mTxnItem) -- result = mTxnItem->GetChild(aIndex, &item); -+ result = mTxnItem->GetChild(aIndex, getter_AddRefs(item)); - - if (NS_FAILED(result)) - return result; - - if (!item) - return NS_ERROR_FAILURE; - - return item->GetNumberOfChildren(aNumChildren); -@@ -195,24 +188,24 @@ NS_IMETHODIMP nsTransactionList::GetChil - - *aTxnList = 0; - - nsCOMPtr txMgr = do_QueryReferent(mTxnMgr); - - if (!txMgr) - return NS_ERROR_FAILURE; - -- nsTransactionItem *item = 0; -+ nsRefPtr item; - - nsresult result = NS_ERROR_FAILURE; - - if (mTxnStack) -- result = mTxnStack->GetItem(aIndex, &item); -+ result = mTxnStack->GetItem(aIndex, getter_AddRefs(item)); - else if (mTxnItem) -- result = mTxnItem->GetChild(aIndex, &item); -+ result = mTxnItem->GetChild(aIndex, getter_AddRefs(item)); - - if (NS_FAILED(result)) - return result; - - if (!item) - return NS_ERROR_FAILURE; - - *aTxnList = (nsITransactionList *)new nsTransactionList(txMgr, item); -diff --git a/editor/txmgr/src/nsTransactionList.h b/editor/txmgr/src/nsTransactionList.h ---- editor/txmgr/src/nsTransactionList.h -+++ editor/txmgr/src/nsTransactionList.h -@@ -35,33 +35,34 @@ - * - * ***** END LICENSE BLOCK ***** */ - - #ifndef nsTransactionList_h__ - #define nsTransactionList_h__ - - #include "nsWeakReference.h" - #include "nsITransactionList.h" -+#include "nsTransactionItem.h" -+#include "nsAutoPtr.h" - - class nsITransaction; - class nsITransactionManager; --class nsTransactionItem; - class nsTransactionStack; - class nsTransactionRedoStack; - - /** implementation of a transaction list object. - * - */ - class nsTransactionList : public nsITransactionList - { - private: - -- nsWeakPtr mTxnMgr; -- nsTransactionStack *mTxnStack; -- nsTransactionItem *mTxnItem; -+ nsWeakPtr mTxnMgr; -+ nsTransactionStack *mTxnStack; -+ nsRefPtr mTxnItem; - - public: - - nsTransactionList(nsITransactionManager *aTxnMgr, nsTransactionStack *aTxnStack); - nsTransactionList(nsITransactionManager *aTxnMgr, nsTransactionItem *aTxnItem); - - virtual ~nsTransactionList(); - -diff --git a/editor/txmgr/src/nsTransactionManager.cpp b/editor/txmgr/src/nsTransactionManager.cpp ---- editor/txmgr/src/nsTransactionManager.cpp -+++ editor/txmgr/src/nsTransactionManager.cpp -@@ -38,17 +38,17 @@ - #include "nsITransaction.h" - #include "nsITransactionListener.h" - - #include "nsTransactionItem.h" - #include "nsTransactionStack.h" - #include "nsVoidArray.h" - #include "nsTransactionManager.h" - #include "nsTransactionList.h" -- -+#include "nsAutoPtr.h" - #include "nsCOMPtr.h" - - #define LOCK_TX_MANAGER(mgr) (mgr)->Lock() - #define UNLOCK_TX_MANAGER(mgr) (mgr)->Unlock() - - - nsTransactionManager::nsTransactionManager(PRInt32 aMaxTransactionCount) - : mMaxTransactionCount(aMaxTransactionCount), mListeners(0) -@@ -148,54 +148,54 @@ nsTransactionManager::DoTransaction(nsIT - - return result; - } - - NS_IMETHODIMP - nsTransactionManager::UndoTransaction() - { - nsresult result = NS_OK; -- nsTransactionItem *tx = 0; -+ nsRefPtr tx; - - LOCK_TX_MANAGER(this); - - // It is illegal to call UndoTransaction() while the transaction manager is - // executing a transaction's DoTransaction() method! If this happens, - // the UndoTransaction() request is ignored, and we return NS_ERROR_FAILURE. - -- result = mDoStack.Peek(&tx); -+ result = mDoStack.Peek(getter_AddRefs(tx)); - - if (NS_FAILED(result)) { - UNLOCK_TX_MANAGER(this); - return result; - } - - if (tx) { - UNLOCK_TX_MANAGER(this); - return NS_ERROR_FAILURE; - } - - // Peek at the top of the undo stack. Don't remove the transaction - // until it has successfully completed. -- result = mUndoStack.Peek(&tx); -+ result = mUndoStack.Peek(getter_AddRefs(tx)); - - if (NS_FAILED(result)) { - UNLOCK_TX_MANAGER(this); - return result; - } - - // Bail if there's nothing on the stack. - if (!tx) { - UNLOCK_TX_MANAGER(this); - return NS_OK; - } - -- nsITransaction *t = 0; -+ nsCOMPtr t; - -- result = tx->GetTransaction(&t); -+ result = tx->GetTransaction(getter_AddRefs(t)); - - if (NS_FAILED(result)) { - UNLOCK_TX_MANAGER(this); - return result; - } - - PRBool doInterrupt = PR_FALSE; - -@@ -209,17 +209,17 @@ nsTransactionManager::UndoTransaction() - if (doInterrupt) { - UNLOCK_TX_MANAGER(this); - return NS_OK; - } - - result = tx->UndoTransaction(this); - - if (NS_SUCCEEDED(result)) { -- result = mUndoStack.Pop(&tx); -+ result = mUndoStack.Pop(getter_AddRefs(tx)); - - if (NS_SUCCEEDED(result)) - result = mRedoStack.Push(tx); - } - - nsresult result2 = DidUndoNotify(t, result); - - if (NS_SUCCEEDED(result)) -@@ -229,54 +229,54 @@ nsTransactionManager::UndoTransaction() - - return result; - } - - NS_IMETHODIMP - nsTransactionManager::RedoTransaction() - { - nsresult result = NS_OK; -- nsTransactionItem *tx = 0; -+ nsRefPtr tx; - - LOCK_TX_MANAGER(this); - - // It is illegal to call RedoTransaction() while the transaction manager is - // executing a transaction's DoTransaction() method! If this happens, - // the RedoTransaction() request is ignored, and we return NS_ERROR_FAILURE. - -- result = mDoStack.Peek(&tx); -+ result = mDoStack.Peek(getter_AddRefs(tx)); - - if (NS_FAILED(result)) { - UNLOCK_TX_MANAGER(this); - return result; - } - - if (tx) { - UNLOCK_TX_MANAGER(this); - return NS_ERROR_FAILURE; - } - - // Peek at the top of the redo stack. Don't remove the transaction - // until it has successfully completed. -- result = mRedoStack.Peek(&tx); -+ result = mRedoStack.Peek(getter_AddRefs(tx)); - - if (NS_FAILED(result)) { - UNLOCK_TX_MANAGER(this); - return result; - } - - // Bail if there's nothing on the stack. - if (!tx) { - UNLOCK_TX_MANAGER(this); - return NS_OK; - } - -- nsITransaction *t = 0; -+ nsCOMPtr t; - -- result = tx->GetTransaction(&t); -+ result = tx->GetTransaction(getter_AddRefs(t)); - - if (NS_FAILED(result)) { - UNLOCK_TX_MANAGER(this); - return result; - } - - PRBool doInterrupt = PR_FALSE; - -@@ -290,17 +290,17 @@ nsTransactionManager::RedoTransaction() - if (doInterrupt) { - UNLOCK_TX_MANAGER(this); - return NS_OK; - } - - result = tx->RedoTransaction(this); - - if (NS_SUCCEEDED(result)) { -- result = mRedoStack.Pop(&tx); -+ result = mRedoStack.Pop(getter_AddRefs(tx)); - - if (NS_SUCCEEDED(result)) - result = mUndoStack.Push(tx); - } - - nsresult result2 = DidRedoNotify(t, result); - - if (NS_SUCCEEDED(result)) -@@ -368,42 +368,42 @@ nsTransactionManager::BeginBatch() - UNLOCK_TX_MANAGER(this); - - return result; - } - - NS_IMETHODIMP - nsTransactionManager::EndBatch() - { -- nsTransactionItem *tx = 0; -- nsITransaction *ti = 0; -+ nsRefPtr tx; -+ nsCOMPtr ti; - nsresult result; - - LOCK_TX_MANAGER(this); - - // XXX: Need to add some mechanism to detect the case where the transaction - // at the top of the do stack isn't the dummy transaction, so we can - // throw an error!! This can happen if someone calls EndBatch() within - // the DoTransaction() method of a transaction. - // - // For now, we can detect this case by checking the value of the - // dummy transaction's mTransaction field. If it is our dummy - // transaction, it should be NULL. This may not be true in the - // future when we allow users to execute a transaction when beginning - // a batch!!!! - -- result = mDoStack.Peek(&tx); -+ result = mDoStack.Peek(getter_AddRefs(tx)); - - if (NS_FAILED(result)) { - UNLOCK_TX_MANAGER(this); - return result; - } - - if (tx) -- tx->GetTransaction(&ti); -+ tx->GetTransaction(getter_AddRefs(ti)); - - if (!tx || ti) { - UNLOCK_TX_MANAGER(this); - return NS_ERROR_FAILURE; - } - - PRBool doInterrupt = PR_FALSE; - -@@ -467,28 +467,28 @@ nsTransactionManager::GetMaxTransactionC - - return NS_OK; - } - - NS_IMETHODIMP - nsTransactionManager::SetMaxTransactionCount(PRInt32 aMaxCount) - { - PRInt32 numUndoItems = 0, numRedoItems = 0, total = 0; -- nsTransactionItem *tx = 0; -+ nsRefPtr tx; - nsresult result; - - LOCK_TX_MANAGER(this); - - // It is illegal to call SetMaxTransactionCount() while the transaction - // manager is executing a transaction's DoTransaction() method because - // the undo and redo stacks might get pruned! If this happens, the - // SetMaxTransactionCount() request is ignored, and we return - // NS_ERROR_FAILURE. - -- result = mDoStack.Peek(&tx); -+ result = mDoStack.Peek(getter_AddRefs(tx)); - - if (NS_FAILED(result)) { - UNLOCK_TX_MANAGER(this); - return result; - } - - if (tx) { - UNLOCK_TX_MANAGER(this); -@@ -529,107 +529,97 @@ nsTransactionManager::SetMaxTransactionC - UNLOCK_TX_MANAGER(this); - return result; - } - - // Try getting rid of some transactions on the undo stack! Start at - // the bottom of the stack and pop towards the top. - - while (numUndoItems > 0 && (numRedoItems + numUndoItems) > aMaxCount) { -- tx = 0; -- result = mUndoStack.PopBottom(&tx); -+ result = mUndoStack.PopBottom(getter_AddRefs(tx)); - - if (NS_FAILED(result) || !tx) { - UNLOCK_TX_MANAGER(this); - return result; - } -- -- delete tx; - - --numUndoItems; - } - - // If necessary, get rid of some transactions on the redo stack! Start at - // the bottom of the stack and pop towards the top. - - while (numRedoItems > 0 && (numRedoItems + numUndoItems) > aMaxCount) { -- tx = 0; -- result = mRedoStack.PopBottom(&tx); -+ result = mRedoStack.PopBottom(getter_AddRefs(tx)); - - if (NS_FAILED(result) || !tx) { - UNLOCK_TX_MANAGER(this); - return result; - } -- -- delete tx; - - --numRedoItems; - } - - mMaxTransactionCount = aMaxCount; - - UNLOCK_TX_MANAGER(this); - - return result; - } - - NS_IMETHODIMP - nsTransactionManager::PeekUndoStack(nsITransaction **aTransaction) - { -- nsTransactionItem *tx = 0; -+ nsRefPtr tx; - nsresult result; - - if (!aTransaction) - return NS_ERROR_NULL_POINTER; - - *aTransaction = 0; - - LOCK_TX_MANAGER(this); - -- result = mUndoStack.Peek(&tx); -+ result = mUndoStack.Peek(getter_AddRefs(tx)); - - if (NS_FAILED(result) || !tx) { - UNLOCK_TX_MANAGER(this); - return result; - } - - result = tx->GetTransaction(aTransaction); - - UNLOCK_TX_MANAGER(this); - -- NS_IF_ADDREF(*aTransaction); -- - return result; - } - - NS_IMETHODIMP - nsTransactionManager::PeekRedoStack(nsITransaction **aTransaction) - { -- nsTransactionItem *tx = 0; -+ nsRefPtr tx; - nsresult result; - - if (!aTransaction) - return NS_ERROR_NULL_POINTER; - - *aTransaction = 0; - - LOCK_TX_MANAGER(this); - -- result = mRedoStack.Peek(&tx); -+ result = mRedoStack.Peek(getter_AddRefs(tx)); - - if (NS_FAILED(result) || !tx) { - UNLOCK_TX_MANAGER(this); - return result; - } - - result = tx->GetTransaction(aTransaction); - - UNLOCK_TX_MANAGER(this); -- -- NS_IF_ADDREF(*aTransaction); - - return result; - } - - NS_IMETHODIMP - nsTransactionManager::GetUndoList(nsITransactionList **aTransactionList) - { - if (!aTransactionList) -@@ -1039,109 +1029,101 @@ nsTransactionManager::DidMergeNotify(nsI - } - - return result; - } - - nsresult - nsTransactionManager::BeginTransaction(nsITransaction *aTransaction) - { -- nsTransactionItem *tx; - nsresult result = NS_OK; - - // No need for LOCK/UNLOCK_TX_MANAGER() calls since the calling routine - // should have done this already! - -- NS_IF_ADDREF(aTransaction); -- - // XXX: POSSIBLE OPTIMIZATION - // We could use a factory that pre-allocates/recycles transaction items. -- tx = new nsTransactionItem(aTransaction); -+ nsRefPtr tx = new nsTransactionItem(aTransaction); - - if (!tx) { -- NS_IF_RELEASE(aTransaction); - return NS_ERROR_OUT_OF_MEMORY; - } - - result = mDoStack.Push(tx); - - if (NS_FAILED(result)) { -- delete tx; - return result; - } - - result = tx->DoTransaction(); - - if (NS_FAILED(result)) { -- mDoStack.Pop(&tx); -- delete tx; -+ mDoStack.Pop(getter_AddRefs(tx)); - return result; - } - - return NS_OK; - } - - nsresult - nsTransactionManager::EndTransaction() - { -- nsITransaction *tint = 0; -- nsTransactionItem *tx = 0; -+ nsCOMPtr tint; -+ nsRefPtr tx; - nsresult result = NS_OK; - - // No need for LOCK/UNLOCK_TX_MANAGER() calls since the calling routine - // should have done this already! - -- result = mDoStack.Pop(&tx); -+ result = mDoStack.Pop(getter_AddRefs(tx)); - - if (NS_FAILED(result) || !tx) - return result; - -- result = tx->GetTransaction(&tint); -+ result = tx->GetTransaction(getter_AddRefs(tint)); - - if (NS_FAILED(result)) { - // XXX: What do we do with the transaction item at this point? - return result; - } - - if (!tint) { - PRInt32 nc = 0; - - // If we get here, the transaction must be a dummy batch transaction - // created by BeginBatch(). If it contains no children, get rid of it! - - tx->GetNumberOfChildren(&nc); - - if (!nc) { -- delete tx; - return result; - } - } - - // Check if the transaction is transient. If it is, there's nothing - // more to do, just return. - - PRBool isTransient = PR_FALSE; - - if (tint) - result = tint->GetIsTransient(&isTransient); - - if (NS_FAILED(result) || isTransient || !mMaxTransactionCount) { - // XXX: Should we be clearing the redo stack if the transaction - // is transient and there is nothing on the do stack? -- delete tx; - return result; - } - -- nsTransactionItem *top = 0; -+ nsRefPtr top; - - // Check if there is a transaction on the do stack. If there is, - // the current transaction is a "sub" transaction, and should - // be added to the transaction at the top of the do stack. - -- result = mDoStack.Peek(&top); -+ result = mDoStack.Peek(getter_AddRefs(top)); - if (top) { - result = top->AddChild(tx); - - // XXX: What do we do if this fails? - - return result; - } - -@@ -1152,23 +1134,23 @@ nsTransactionManager::EndTransaction() - if (NS_FAILED(result)) { - // XXX: What do we do if this fails? - } - - // Check if we can coalesce this transaction with the one at the top - // of the undo stack. - - top = 0; -- result = mUndoStack.Peek(&top); -+ result = mUndoStack.Peek(getter_AddRefs(top)); - - if (tint && top) { - PRBool didMerge = PR_FALSE; -- nsITransaction *topTransaction = 0; -+ nsCOMPtr topTransaction; - -- result = top->GetTransaction(&topTransaction); -+ result = top->GetTransaction(getter_AddRefs(topTransaction)); - - if (topTransaction) { - - PRBool doInterrupt = PR_FALSE; - - result = WillMergeNotify(topTransaction, tint, &doInterrupt); - - if (NS_FAILED(result)) -@@ -1182,39 +1164,35 @@ nsTransactionManager::EndTransaction() - if (NS_SUCCEEDED(result)) - result = result2; - - if (NS_FAILED(result)) { - // XXX: What do we do if this fails? - } - - if (didMerge) { -- delete tx; - return result; - } - } - } - } - - // Check to see if we've hit the max level of undo. If so, - // pop the bottom transaction off the undo stack and release it! - - PRInt32 sz = 0; - - result = mUndoStack.GetSize(&sz); - - if (mMaxTransactionCount > 0 && sz >= mMaxTransactionCount) { -- nsTransactionItem *overflow = 0; -+ nsRefPtr overflow; - -- result = mUndoStack.PopBottom(&overflow); -+ result = mUndoStack.PopBottom(getter_AddRefs(overflow)); - - // XXX: What do we do in the case where this fails? -- -- if (overflow) -- delete overflow; - } - - // Push the transaction on the undo stack: - - result = mUndoStack.Push(tx); - - if (NS_FAILED(result)) { - // XXX: What do we do in the case where a clear fails? -diff --git a/editor/txmgr/src/nsTransactionStack.cpp b/editor/txmgr/src/nsTransactionStack.cpp ---- editor/txmgr/src/nsTransactionStack.cpp -+++ editor/txmgr/src/nsTransactionStack.cpp -@@ -34,38 +34,38 @@ - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - - #include "nsITransaction.h" - #include "nsTransactionItem.h" - #include "nsTransactionStack.h" - #include "nsCOMPtr.h" -+#include "nsAutoPtr.h" - - nsTransactionStack::nsTransactionStack() - : mQue(0) - { -- nsTransactionReleaseFunctor* theFunctor=new nsTransactionReleaseFunctor(); -- mQue.SetDeallocator(theFunctor); - } - - nsTransactionStack::~nsTransactionStack() - { - Clear(); - } - - nsresult - nsTransactionStack::Push(nsTransactionItem *aTransaction) - { - if (!aTransaction) - return NS_ERROR_NULL_POINTER; - - /* nsDeque's Push() method adds new items at the back - * of the deque. - */ -+ NS_ADDREF(aTransaction); - mQue.Push(aTransaction); - - return NS_OK; - } - - nsresult - nsTransactionStack::Pop(nsTransactionItem **aTransaction) - { -@@ -100,52 +100,51 @@ nsTransactionStack::Peek(nsTransactionIt - if (!aTransaction) - return NS_ERROR_NULL_POINTER; - - if (!mQue.GetSize()) { - *aTransaction = 0; - return NS_OK; - } - -- *aTransaction = (nsTransactionItem *)(mQue.Last()); -+ NS_IF_ADDREF(*aTransaction = static_cast(mQue.Last())); - - return NS_OK; - } - - nsresult - nsTransactionStack::GetItem(PRInt32 aIndex, nsTransactionItem **aTransaction) - { - if (!aTransaction) - return NS_ERROR_NULL_POINTER; - - if (aIndex < 0 || aIndex >= mQue.GetSize()) - return NS_ERROR_FAILURE; - -- *aTransaction = (nsTransactionItem *)(mQue.ObjectAt(aIndex)); -+ NS_IF_ADDREF(*aTransaction = -+ static_cast(mQue.ObjectAt(aIndex))); - - return NS_OK; - } - - nsresult - nsTransactionStack::Clear(void) - { -- nsTransactionItem *tx = 0; -+ nsRefPtr tx; - nsresult result = NS_OK; - - /* Pop all transactions off the stack and release them. */ - -- result = Pop(&tx); -+ result = Pop(getter_AddRefs(tx)); - - if (NS_FAILED(result)) - return result; - - while (tx) { -- delete tx; -- -- result = Pop(&tx); -+ result = Pop(getter_AddRefs(tx)); - - if (NS_FAILED(result)) - return result; - } - - return NS_OK; - } - -@@ -163,39 +162,30 @@ nsTransactionRedoStack::~nsTransactionRe - nsTransactionRedoStack::~nsTransactionRedoStack() - { - Clear(); - } - - nsresult - nsTransactionRedoStack::Clear(void) - { -- nsTransactionItem *tx = 0; -+ nsRefPtr tx; - nsresult result = NS_OK; - - /* When clearing a Redo stack, we have to clear from the - * bottom of the stack towards the top! - */ - -- result = PopBottom(&tx); -+ result = PopBottom(getter_AddRefs(tx)); - - if (NS_FAILED(result)) - return result; - - while (tx) { -- delete tx; -- -- result = PopBottom(&tx); -+ result = PopBottom(getter_AddRefs(tx)); - - if (NS_FAILED(result)) - return result; - } - - return NS_OK; - } - --void * --nsTransactionReleaseFunctor::operator()(void *aObject) --{ -- nsTransactionItem *item = (nsTransactionItem *)aObject; -- delete item; -- return 0; --} -diff --git a/editor/txmgr/src/nsTransactionStack.h b/editor/txmgr/src/nsTransactionStack.h ---- editor/txmgr/src/nsTransactionStack.h -+++ editor/txmgr/src/nsTransactionStack.h -@@ -37,25 +37,16 @@ - - #ifndef nsTransactionStack_h__ - #define nsTransactionStack_h__ - - #include "nsDeque.h" - - class nsTransactionItem; - --class nsTransactionReleaseFunctor : public nsDequeFunctor --{ --public: -- -- nsTransactionReleaseFunctor() {} -- virtual ~nsTransactionReleaseFunctor() {} -- virtual void *operator()(void *aObject); --}; -- - class nsTransactionStack - { - nsDeque mQue; - - public: - - nsTransactionStack(); - virtual ~nsTransactionStack(); Index: files/patch-ff-453736 =================================================================== RCS file: files/patch-ff-453736 diff -N files/patch-ff-453736 --- files/patch-ff-453736 22 Apr 2009 08:49:19 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ -diff -p -U 8 -r1.15 nsSVGScriptElement.cpp ---- content/svg/content/src/nsSVGScriptElement.cpp 28 Apr 2005 23:47:55 -0000 1.15 -+++ content/svg/content/src/nsSVGScriptElement.cpp 26 Feb 2009 21:03:08 -0000 -@@ -177,17 +177,40 @@ nsSVGScriptElement::Init() - } - - return NS_OK; - } - - //---------------------------------------------------------------------- - // nsIDOMNode methods - --NS_IMPL_DOM_CLONENODE_WITH_INIT(nsSVGScriptElement) -+nsresult -+nsSVGScriptElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) -+{ -+ *aReturn = nsnull; -+ -+ nsSVGScriptElement* it = new nsSVGScriptElement(mNodeInfo); -+ if (!it) { -+ return NS_ERROR_OUT_OF_MEMORY; -+ } -+ -+ nsCOMPtr kungFuDeathGrip(it); -+ -+ CopyInnerTo(it, aDeep); -+ -+ // The clone should be marked evaluated if we are. It should also be marked -+ // evaluated if we're evaluating, to handle the case when this script node's -+ // script clones the node. -+ it->mIsEvaluated = mIsEvaluated || mEvaluating; -+ it->mLineNumber = mLineNumber; -+ -+ kungFuDeathGrip.swap(*aReturn); -+ -+ return NS_OK; -+} - - //---------------------------------------------------------------------- - // nsIDOMSVGScriptElement methods - - /* attribute DOMString type; */ - NS_IMETHODIMP - nsSVGScriptElement::GetType(nsAString & aType) - { - Index: files/patch-ff-460425 =================================================================== RCS file: files/patch-ff-460425 diff -N files/patch-ff-460425 --- files/patch-ff-460425 15 Feb 2009 18:20:47 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,440 +0,0 @@ ---- .pc/460425_att352061-backport2.patch/content/base/src/nsSyncLoadService.cpp 2006-06-10 00:48:43.000000000 +0200 -+++ content/base/src/nsSyncLoadService.cpp 2009-01-30 12:39:37.000000000 +0100 -@@ -424,19 +424,28 @@ nsSyncLoader::OnChannelRedirect(nsIChann - nsresult rv = aOldChannel->GetURI(getter_AddRefs(oldURI)); // The original URI - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr newURI; - rv = aNewChannel->GetURI(getter_AddRefs(newURI)); // The new URI - NS_ENSURE_SUCCESS(rv, rv); - - rv = nsContentUtils::GetSecurityManager()->CheckSameOriginURI(oldURI, newURI); -+ NS_ENSURE_SUCCESS(rv, rv); - -+ nsCOMPtr newOrigURI; -+ rv = aNewChannel->GetOriginalURI(getter_AddRefs(newOrigURI)); - NS_ENSURE_SUCCESS(rv, rv); - -+ if (newOrigURI != newURI) { -+ rv = nsContentUtils::GetSecurityManager()-> -+ CheckSameOriginURI(oldURI, newOrigURI); -+ NS_ENSURE_SUCCESS(rv, rv); -+ } -+ - mChannel = aNewChannel; - - return NS_OK; - } - - NS_IMETHODIMP - nsSyncLoader::GetInterface(const nsIID & aIID, - void **aResult) ---- .pc/460425_att352061-backport2.patch/content/base/src/nsXMLHttpRequest.cpp 2009-01-28 17:30:42.000000000 +0100 -+++ content/base/src/nsXMLHttpRequest.cpp 2009-01-30 12:39:37.000000000 +0100 -@@ -2058,16 +2058,27 @@ nsXMLHttpRequest::OnChannelRedirect(nsIC - return rv; - - nsCOMPtr secMan = - do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv); - if (NS_FAILED(rv)) - return rv; - - rv = secMan->CheckSameOriginURI(oldURI, newURI); -+ -+ if (NS_SUCCEEDED(rv)) { -+ nsCOMPtr newOrigURI; -+ rv = aNewChannel->GetOriginalURI(getter_AddRefs(newOrigURI)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ if (newOrigURI != newURI) { -+ rv = secMan->CheckSameOriginURI(oldURI, newOrigURI); -+ } -+ } -+ - if (NS_FAILED(rv)) { - mDenyResponseDataAccess = PR_TRUE; - return rv; - } - } - - if (mChannelEventSink) { - nsresult rv = ---- .pc/460425_att352061-backport2.patch/content/xml/document/src/nsXMLDocument.cpp 2008-08-15 23:57:22.000000000 +0200 -+++ content/xml/document/src/nsXMLDocument.cpp 2009-01-30 12:39:37.000000000 +0100 -@@ -297,18 +297,34 @@ nsXMLDocument::OnChannelRedirect(nsIChan - nsCOMPtr oldURI; - nsresult rv = aOldChannel->GetURI(getter_AddRefs(oldURI)); - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr newURI; - rv = aNewChannel->GetURI(getter_AddRefs(newURI)); - NS_ENSURE_SUCCESS(rv, rv); - -- return nsContentUtils::GetSecurityManager()-> -+ rv = nsContentUtils::GetSecurityManager()-> - CheckSameOriginURI(oldURI, newURI); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ nsCOMPtr newOrigURI; -+ rv = aNewChannel->GetOriginalURI(getter_AddRefs(newOrigURI)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ if (newOrigURI != newURI) { -+ rv = nsContentUtils::GetSecurityManager()-> -+ CheckSameOriginURI(oldURI, newOrigURI); -+ } -+ -+ if (NS_FAILED(rv)) { -+ return rv; -+ } -+ -+ return NS_OK; - } - - NS_IMETHODIMP - nsXMLDocument::EvaluateFIXptr(const nsAString& aExpression, nsIDOMRange **aRange) - { - nsresult rv; - nsCOMPtr e = - do_CreateInstance("@mozilla.org/xmlextras/fixptrevaluator;1", &rv); ---- .pc/460425_att352061-backport2.patch/extensions/transformiix/source/xslt/txMozillaStylesheetCompiler.cpp 2006-07-07 03:06:03.000000000 +0200 -+++ extensions/transformiix/source/xslt/txMozillaStylesheetCompiler.cpp 2009-01-30 12:39:37.000000000 +0100 -@@ -383,17 +383,29 @@ txStylesheetSink::OnChannelRedirect(nsIC - nsCOMPtr oldURI; - rv = aOldChannel->GetURI(getter_AddRefs(oldURI)); // The original URI - NS_ENSURE_SUCCESS(rv, rv); - - nsCOMPtr newURI; - rv = aNewChannel->GetURI(getter_AddRefs(newURI)); // The new URI - NS_ENSURE_SUCCESS(rv, rv); - -- return secMan->CheckSameOriginURI(oldURI, newURI); -+ rv = secMan->CheckSameOriginURI(oldURI, newURI); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ nsCOMPtr newOrigURI; -+ rv = aNewChannel->GetOriginalURI(getter_AddRefs(newOrigURI)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ if (newOrigURI != newURI) { -+ rv = secMan->CheckSameOriginURI(oldURI, newOrigURI); -+ NS_ENSURE_SUCCESS(rv, rv); -+ } -+ -+ return NS_OK; - } - - NS_IMETHODIMP - txStylesheetSink::GetInterface(const nsIID& aIID, void** aResult) - { - if (aIID.Equals(NS_GET_IID(nsIAuthPrompt))) { - NS_ENSURE_ARG(aResult); - *aResult = nsnull; ---- .pc/460425_att352061-backport2.patch/extensions/xforms/nsXFormsInstanceElement.cpp 2008-07-27 02:35:16.000000000 +0200 -+++ extensions/xforms/nsXFormsInstanceElement.cpp 2009-01-30 12:39:37.000000000 +0100 -@@ -203,21 +203,25 @@ nsXFormsInstanceElement::GetInterface(co - NS_IMETHODIMP - nsXFormsInstanceElement::OnChannelRedirect(nsIChannel *OldChannel, - nsIChannel *aNewChannel, - PRUint32 aFlags) - { - NS_PRECONDITION(aNewChannel, "Redirect without a channel?"); - NS_PRECONDITION(!mLazy, "Loading an instance document for a lazy instance?"); - -- nsCOMPtr newURI; -+ nsCOMPtr newURI, newOrigURI; - nsresult rv = aNewChannel->GetURI(getter_AddRefs(newURI)); - NS_ENSURE_SUCCESS(rv, rv); -+ rv = aNewChannel->GetOriginalURI(getter_AddRefs(newOrigURI)); -+ NS_ENSURE_SUCCESS(rv, rv); - -- if (!nsXFormsUtils::CheckConnectionAllowed(mElement, newURI)) { -+ if (!nsXFormsUtils::CheckConnectionAllowed(mElement, newURI) || -+ (newOrigURI != newURI && -+ !nsXFormsUtils::CheckConnectionAllowed(mElement, newOrigURI))) { - const PRUnichar *strings[] = { NS_LITERAL_STRING("instance").get() }; - nsXFormsUtils::ReportError(NS_LITERAL_STRING("externalLinkLoadOrigin"), - strings, 1, mElement, mElement); - return NS_ERROR_ABORT; - } - - return NS_OK; - } ---- .pc/460425_att352061-backport2.patch/extensions/xforms/nsXFormsMessageElement.cpp 2008-03-04 23:47:45.000000000 +0100 -+++ extensions/xforms/nsXFormsMessageElement.cpp 2009-01-30 12:39:37.000000000 +0100 -@@ -1062,21 +1062,25 @@ nsXFormsMessageElement::GetInterface(con - - NS_IMETHODIMP - nsXFormsMessageElement::OnChannelRedirect(nsIChannel *OldChannel, - nsIChannel *aNewChannel, - PRUint32 aFlags) - { - NS_PRECONDITION(aNewChannel, "Redirect without a channel?"); - -- nsCOMPtr newURI; -+ nsCOMPtr newURI, newOrigURI; - nsresult rv = aNewChannel->GetURI(getter_AddRefs(newURI)); - NS_ENSURE_SUCCESS(rv, rv); -- -- if (!nsXFormsUtils::CheckConnectionAllowed(mElement, newURI)) { -+ rv = aNewChannel->GetOriginalURI(getter_AddRefs(newOrigURI)); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ if (!nsXFormsUtils::CheckConnectionAllowed(mElement, newURI) || -+ (newOrigURI != newURI && -+ !nsXFormsUtils::CheckConnectionAllowed(mElement, newOrigURI))) { - nsAutoString tagName; - mElement->GetLocalName(tagName); - const PRUnichar *strings[] = { tagName.get() }; - nsXFormsUtils::ReportError(NS_LITERAL_STRING("externalLinkLoadOrigin"), - strings, 1, mElement, mElement); - mStopType = eStopType_Security; - return NS_ERROR_ABORT; - } ---- .pc/460425_att352061-backport2.patch/extensions/xforms/nsXFormsSubmissionElement.cpp 2008-08-07 23:03:52.000000000 +0200 -+++ extensions/xforms/nsXFormsSubmissionElement.cpp 2009-01-30 12:39:37.000000000 +0100 -@@ -400,27 +400,30 @@ nsXFormsSubmissionElement::OnChannelRedi - nsIChannel *aNewChannel, - PRUint32 aFlags) - { - if (!mElement) { - return NS_OK; - } - - NS_PRECONDITION(aNewChannel, "Redirect without a channel?"); -- nsCOMPtr newURI; -+ nsCOMPtr newURI, newOrigURI; - nsresult rv = aNewChannel->GetURI(getter_AddRefs(newURI)); - NS_ENSURE_SUCCESS(rv, rv); -+ rv = aNewChannel->GetOriginalURI(getter_AddRefs(newOrigURI)); -+ NS_ENSURE_SUCCESS(rv, rv); - - NS_ENSURE_STATE(mElement); - nsCOMPtr domDoc; - mElement->GetOwnerDocument(getter_AddRefs(domDoc)); - nsCOMPtr doc(do_QueryInterface(domDoc)); - NS_ENSURE_STATE(doc); - -- if (!CheckSameOrigin(doc, newURI)) { -+ if (!CheckSameOrigin(doc, newURI) || -+ (newOrigURI != newURI && !CheckSameOrigin(doc, newOrigURI))) { - nsXFormsUtils::ReportError(NS_LITERAL_STRING("submitSendOrigin"), - mElement); - return NS_ERROR_ABORT; - } - - return NS_OK; - } - ---- .pc/460425_att352061-backport2.patch/netwerk/protocol/file/src/nsFileChannel.cpp 2008-10-29 06:22:55.000000000 +0100 -+++ netwerk/protocol/file/src/nsFileChannel.cpp 2009-01-30 12:44:19.000000000 +0100 -@@ -94,17 +94,16 @@ CopyProperties(const nsAString &key, nsI - void - nsFileChannel::HandleRedirect(nsIChannel* newChannel) - { - if (NS_SUCCEEDED(mStatus)) { - nsIURI* originalURI = mOriginalURI; - if (!originalURI) - originalURI = mURL; - -- newChannel->SetOriginalURI(originalURI); - newChannel->SetLoadGroup(mLoadGroup); - newChannel->SetNotificationCallbacks(mCallbacks); - newChannel->SetLoadFlags(mLoadFlags | LOAD_REPLACE); - - nsCOMPtr bag = do_QueryInterface(newChannel); - if (bag) - mPropertyHash.EnumerateRead(CopyProperties, bag.get()); - -@@ -119,17 +118,21 @@ nsFileChannel::HandleRedirect(nsIChannel - nsCOMPtr channelEventSink; - // Give our consumer a chance to observe/block this redirect. - NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup, - channelEventSink); - if (channelEventSink) { - rv = channelEventSink->OnChannelRedirect(this, newChannel, - redirectFlags); - if (NS_SUCCEEDED(rv)) { -- rv = newChannel->AsyncOpen(mListener, mListenerContext); -+ // Make sure to do this _after_ making all the OnChannelRedirect calls -+ nsCOMPtr origURI; -+ GetOriginalURI(getter_AddRefs(origURI)); -+ newChannel->SetOriginalURI(origURI); -+ rv = newChannel->AsyncOpen(mListener, mListenerContext); - } - } - } - - if (NS_FAILED(rv)) - Cancel(rv); - } - ---- .pc/460425_att352061-backport2.patch/netwerk/protocol/http/src/nsHttpChannel.cpp 2006-07-21 00:59:31.000000000 +0200 -+++ netwerk/protocol/http/src/nsHttpChannel.cpp 2009-01-30 12:39:37.000000000 +0100 -@@ -997,16 +997,19 @@ nsHttpChannel::ReplaceWithProxy(nsIProxy - return rv; - - // Inform consumers about this fake redirect - PRUint32 flags = nsIChannelEventSink::REDIRECT_INTERNAL; - rv = gHttpHandler->OnChannelRedirect(this, newChannel, flags); - if (NS_FAILED(rv)) - return rv; - -+ // Make sure to do this _after_ calling OnChannelRedirect -+ newChannel->SetOriginalURI(mOriginalURI); -+ - // open new channel - rv = newChannel->AsyncOpen(mListener, mListenerContext); - if (NS_FAILED(rv)) - return rv; - - mStatus = NS_BINDING_REDIRECTED; - mListener = nsnull; - mListenerContext = nsnull; -@@ -1906,17 +1909,16 @@ nsHttpChannel::SetupReplacementChannel(n - // SSL, then no need to inhibit persistent caching. however, if the - // original channel was not using SSL and has INHIBIT_PERSISTENT_CACHING - // set, then allow the flag to apply to the redirected channel as well. - // since we force set INHIBIT_PERSISTENT_CACHING on all HTTPS channels, - // we only need to check if the original channel was using SSL. - if (mConnectionInfo->UsingSSL()) - newLoadFlags &= ~INHIBIT_PERSISTENT_CACHING; - -- newChannel->SetOriginalURI(mOriginalURI); - newChannel->SetLoadGroup(mLoadGroup); - newChannel->SetNotificationCallbacks(mCallbacks); - newChannel->SetLoadFlags(newLoadFlags); - - nsCOMPtr httpChannel = do_QueryInterface(newChannel); - if (!httpChannel) - return NS_OK; // no other options to set - -@@ -2087,16 +2089,19 @@ nsHttpChannel::ProcessRedirection(PRUint - if (redirectType == 301) // Moved Permanently - redirectFlags = nsIChannelEventSink::REDIRECT_PERMANENT; - else - redirectFlags = nsIChannelEventSink::REDIRECT_TEMPORARY; - rv = gHttpHandler->OnChannelRedirect(this, newChannel, redirectFlags); - if (NS_FAILED(rv)) - return rv; - -+ // Make sure to do this _after_ calling OnChannelRedirect -+ newChannel->SetOriginalURI(mOriginalURI); -+ - // And now, the deprecated way - nsCOMPtr httpEventSink; - GetCallback(httpEventSink); - if (httpEventSink) { - // NOTE: nsIHttpEventSink is only used for compatibility with pre-1.8 - // versions. - rv = httpEventSink->OnRedirect(this, newChannel); - if (NS_FAILED(rv)) return rv; ---- .pc/460425_att352061-backport2.patch/uriloader/base/nsDocLoader.cpp 2006-02-06 20:52:11.000000000 +0100 -+++ uriloader/base/nsDocLoader.cpp 2009-01-30 12:39:37.000000000 +0100 -@@ -1397,25 +1397,16 @@ PRInt64 nsDocLoader::CalculateMaxProgres - } - - NS_IMETHODIMP nsDocLoader::OnChannelRedirect(nsIChannel *aOldChannel, - nsIChannel *aNewChannel, - PRUint32 aFlags) - { - if (aOldChannel) - { -- nsresult rv; -- nsCOMPtr oldURI, newURI; -- -- rv = aOldChannel->GetOriginalURI(getter_AddRefs(oldURI)); -- if (NS_FAILED(rv)) return rv; -- -- rv = aNewChannel->GetURI(getter_AddRefs(newURI)); -- if (NS_FAILED(rv)) return rv; -- - nsLoadFlags loadFlags = 0; - PRInt32 stateFlags = nsIWebProgressListener::STATE_REDIRECTING | - nsIWebProgressListener::STATE_IS_REQUEST; - - aOldChannel->GetLoadFlags(&loadFlags); - // If the document channel is being redirected, then indicate that the - // document is being redirected in the notification... - if (loadFlags & nsIChannel::LOAD_DOCUMENT_URI) ---- .pc/460425_att352061-backport2.patch/xpcom/io/nsLocalFileUnix.cpp 2008-10-29 06:06:16.000000000 +0100 -+++ xpcom/io/nsLocalFileUnix.cpp 2009-01-30 12:58:52.000000000 +0100 -@@ -1295,21 +1295,16 @@ nsLocalFile::IsReadable(PRBool *_retval) - - NS_IMETHODIMP - nsLocalFile::IsExecutable(PRBool *_retval) - { - CHECK_mPath(); - NS_ENSURE_ARG_POINTER(_retval); - struct stat buf; - -- if (IsDesktopFile()) { -- *_retval = PR_TRUE; -- return NS_OK; -- } -- - *_retval = (stat(mPath.get(), &buf) == 0); - if (*_retval || errno == EACCES) { - *_retval = *_retval && (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH )); - return NS_OK; - } - return NSRESULT_FOR_ERRNO(); - } - #else -@@ -1350,21 +1345,16 @@ nsLocalFile::IsReadable(PRBool *_retval) - } - - NS_IMETHODIMP - nsLocalFile::IsExecutable(PRBool *_retval) - { - CHECK_mPath(); - NS_ENSURE_ARG_POINTER(_retval); - -- if (IsDesktopFile()) { -- *_retval = PR_TRUE; -- return NS_OK; -- } -- - *_retval = (access(mPath.get(), X_OK) == 0); - if (*_retval || errno == EACCES) - return NS_OK; - return NSRESULT_FOR_ERRNO(); - } - #endif - NS_IMETHODIMP - nsLocalFile::IsDirectory(PRBool *_retval) -@@ -1780,18 +1770,8 @@ void - nsLocalFile::GlobalInit() - { - } - - void - nsLocalFile::GlobalShutdown() - { - } -- --PRBool --nsLocalFile::IsDesktopFile() --{ -- // Just needs to be good enough to match nsFileProtocolHandler::ReadURLFile -- nsCAutoString leafName; -- nsresult rv = GetNativeLeafName(leafName); -- return NS_FAILED(rv) || -- StringEndsWith(leafName, NS_LITERAL_CSTRING(".desktop")); --} ---- .pc/460425_att352061-backport2.patch/xpcom/io/nsLocalFileUnix.h 2009-01-30 12:58:27.000000000 +0100 -+++ xpcom/io/nsLocalFileUnix.h 2009-01-30 12:58:57.000000000 +0100 -@@ -122,13 +122,11 @@ protected: - - void InvalidateCache() { - mHaveCachedStat = PR_FALSE; - } - nsresult FillStatCache(); - - nsresult CreateAndKeepOpen(PRUint32 type, PRIntn flags, - PRUint32 permissions, PRFileDesc **_retval); -- -- PRBool IsDesktopFile(); - }; - - #endif /* _nsLocalFileUNIX_H_ */ Index: files/patch-ff-466937 =================================================================== RCS file: files/patch-ff-466937 diff -N files/patch-ff-466937 --- files/patch-ff-466937 15 Feb 2009 18:20:47 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,46 +0,0 @@ -Index: browser/components/sessionstore/src/nsSessionStore.js -=================================================================== -RCS file: /cvsroot/mozilla/browser/components/sessionstore/src/nsSessionStore.js,v -retrieving revision 1.5.2.54 -diff -u -8 -d -p -r1.5.2.54 nsSessionStore.js ---- browser/components/sessionstore/src/nsSessionStore.js 20 Nov 2008 22:12:06 -0000 1.5.2.54 -+++ browser/components/sessionstore/src/nsSessionStore.js 27 Nov 2008 21:00:18 -0000 -@@ -919,17 +919,18 @@ SessionStoreService.prototype = { - * @returns bool - */ - _saveTextData: function sss_saveTextData(aPanel, aTextarea) { - var wrappedTextarea = XPCNativeWrapper(aTextarea); - var id = wrappedTextarea.id ? "#" + wrappedTextarea.id : - wrappedTextarea.name; - if (!id - || !(wrappedTextarea instanceof Ci.nsIDOMHTMLTextAreaElement -- || wrappedTextarea instanceof Ci.nsIDOMHTMLInputElement && wrappedTextarea.type != "password")) { -+ || wrappedTextarea instanceof Ci.nsIDOMHTMLInputElement && -+ wrappedTextarea.type != "password" && wrappedTextarea.type != "file")) { - return false; // nothing to save - } - if (/^(?:\d+\|)+/.test(id)) { - // text could be restored into a subframe, so skip it (see bug 463206) - return false; - } - - if (!aPanel.__SS_text) { -@@ -1498,17 +1499,17 @@ SessionStoreService.prototype = { - - var textArray = this.__SS_restore_text ? this.__SS_restore_text.split(" ") : []; - function restoreTextData(aContent, aPrefix, aURL) { - textArray.forEach(function(aEntry) { - if (/^((?:\d+\|)*)(#?)([^\s=]+)=(.*)$/.test(aEntry) && - RegExp.$1 == aPrefix && hasExpectedURL(aContent.document, aURL)) { - var document = aContent.document; - var node = RegExp.$2 ? document.getElementById(RegExp.$3) : document.getElementsByName(RegExp.$3)[0] || null; -- if (node && "value" in node) { -+ if (node && "value" in node && node.type != "file") { - node.value = decodeURI(RegExp.$4); - - var event = document.createEvent("UIEvents"); - event.initUIEvent("input", true, true, aContent, 0); - node.dispatchEvent(event); - } - } - }); Index: files/patch-ff-473709 =================================================================== RCS file: files/patch-ff-473709 diff -N files/patch-ff-473709 --- files/patch-ff-473709 8 Mar 2009 22:16:15 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,29 +0,0 @@ -diff --git a/js/src/jsregexp.c b/js/src/jsregexp.c ---- js/src/jsregexp.c -+++ js/src/jsregexp.c -@@ -4148,20 +4148,22 @@ js_NewRegExpObject(JSContext *cx, JSToke - JSString *str; - JSObject *obj; - JSRegExp *re; - JSTempValueRooter tvr; - - str = js_NewStringCopyN(cx, chars, length, 0); - if (!str) - return NULL; -+ JS_PUSH_TEMP_ROOT_STRING(cx, str, &tvr); - re = js_NewRegExp(cx, ts, str, flags, JS_FALSE); -- if (!re) -- return NULL; -- JS_PUSH_TEMP_ROOT_STRING(cx, str, &tvr); -+ if (!re) { -+ JS_POP_TEMP_ROOT(cx, &tvr); -+ return NULL; -+ } - obj = js_NewObject(cx, &js_RegExpClass, NULL, NULL); - if (!obj || !JS_SetPrivate(cx, obj, re)) { - js_DestroyRegExp(cx, re); - obj = NULL; - } - if (obj && !js_SetLastIndex(cx, obj, 0)) - obj = NULL; - JS_POP_TEMP_ROOT(cx, &tvr); Index: files/patch-ff-474536 =================================================================== RCS file: files/patch-ff-474536 diff -N files/patch-ff-474536 --- files/patch-ff-474536 22 Apr 2009 08:49:19 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,28 +0,0 @@ -diff -U 8 -p -r3.181.2.104 jsinterp.c ---- js/src/jsinterp.c 20 Oct 2008 15:43:57 -0000 3.181.2.104 -+++ js/src/jsinterp.c 2 Apr 2009 14:44:48 -0000 -@@ -4722,21 +4722,21 @@ interrupt: - - /* - * Try to optimize a property we either just created, or found - * directly in the global object, that is permanent, has a slot, - * and has stub getter and setter, into a "fast global" accessed - * by the JSOP_*GVAR opcodes. - */ - if (atomIndex < script->numGlobalVars && -- (attrs & JSPROP_PERMANENT) && - obj2 == obj && - OBJ_IS_NATIVE(obj)) { - sprop = (JSScopeProperty *) prop; -- if (SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(obj)) && -+ if ((sprop->attrs & JSPROP_PERMANENT) && -+ SPROP_HAS_VALID_SLOT(sprop, OBJ_SCOPE(obj)) && - SPROP_HAS_STUB_GETTER(sprop) && - SPROP_HAS_STUB_SETTER(sprop)) { - /* - * Fast globals use fp->vars to map the global name's - * atomIndex to the permanent fp->varobj slot number, - * tagged as a jsval. The atomIndex for the global's - * name literal is identical to its fp->vars index. - */ - Index: files/patch-ff-475136 =================================================================== RCS file: files/patch-ff-475136 diff -N files/patch-ff-475136 --- files/patch-ff-475136 8 Mar 2009 22:16:15 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,108 +0,0 @@ -diff -up mozilla/content/base/src/nsStyleLinkElement.cpp.475136 mozilla/content/base/src/nsStyleLinkElement.cpp ---- content/base/src/nsStyleLinkElement.cpp.475136 2005-04-19 03:27:09.000000000 +0200 -+++ content/base/src/nsStyleLinkElement.cpp 2009-02-17 18:01:21.000000000 +0100 -@@ -63,10 +63,7 @@ nsStyleLinkElement::nsStyleLinkElement() - - nsStyleLinkElement::~nsStyleLinkElement() - { -- nsCOMPtr cssSheet = do_QueryInterface(mStyleSheet); -- if (cssSheet) { -- cssSheet->SetOwningNode(nsnull); -- } -+ nsStyleLinkElement::SetStyleSheet(nsnull); - } - - NS_IMETHODIMP -@@ -199,7 +196,7 @@ nsStyleLinkElement::UpdateStyleSheet(nsI - aOldDocument->BeginUpdate(UPDATE_STYLE); - aOldDocument->RemoveStyleSheet(mStyleSheet); - aOldDocument->EndUpdate(UPDATE_STYLE); -- mStyleSheet = nsnull; -+ nsStyleLinkElement::SetStyleSheet(nsnull); - } - - if (mDontLoadStyle || !mUpdatesEnabled) { -@@ -245,7 +242,7 @@ nsStyleLinkElement::UpdateStyleSheet(nsI - doc->BeginUpdate(UPDATE_STYLE); - doc->RemoveStyleSheet(mStyleSheet); - doc->EndUpdate(UPDATE_STYLE); -- mStyleSheet = nsnull; -+ nsStyleLinkElement::SetStyleSheet(nsnull); - } - - if (!uri && !isInline) { -diff -up mozilla/content/base/src/nsStyleLinkElement.h.475136 mozilla/content/base/src/nsStyleLinkElement.h ---- content/base/src/nsStyleLinkElement.h.475136 2004-09-09 19:32:34.000000000 +0200 -+++ content/base/src/nsStyleLinkElement.h 2009-02-17 18:12:08.000000000 +0100 -@@ -72,6 +72,7 @@ public: - - static void ParseLinkTypes(const nsAString& aTypes, nsStringArray& aResult); - -+ - protected: - virtual void GetStyleSheetURL(PRBool* aIsInline, - nsIURI** aURI) = 0; -@@ -79,13 +80,16 @@ protected: - nsAString& aType, - nsAString& aMedia, - PRBool* aIsAlternate) = 0; -+ nsIStyleSheet* GetStyleSheet() { return mStyleSheet; } - - -- nsCOMPtr mStyleSheet; - nsCOMPtr mParser; - PRPackedBool mDontLoadStyle; - PRPackedBool mUpdatesEnabled; - PRUint32 mLineNumber; -+ -+private: -+ nsCOMPtr mStyleSheet; - }; - - #endif /* nsStyleLinkElement_h___ */ -diff -up mozilla/content/html/content/src/nsHTMLLinkElement.cpp.475136 mozilla/content/html/content/src/nsHTMLLinkElement.cpp ---- content/html/content/src/nsHTMLLinkElement.cpp.475136 2005-08-10 22:21:42.000000000 +0200 -+++ content/html/content/src/nsHTMLLinkElement.cpp 2009-02-17 18:14:51.000000000 +0100 -@@ -159,7 +159,7 @@ NS_IMPL_DOM_CLONENODE(nsHTMLLinkElement) - NS_IMETHODIMP - nsHTMLLinkElement::GetDisabled(PRBool* aDisabled) - { -- nsCOMPtr ss(do_QueryInterface(mStyleSheet)); -+ nsCOMPtr ss(do_QueryInterface(GetStyleSheet())); - nsresult result = NS_OK; - - if (ss) { -@@ -174,7 +174,7 @@ nsHTMLLinkElement::GetDisabled(PRBool* a - NS_IMETHODIMP - nsHTMLLinkElement::SetDisabled(PRBool aDisabled) - { -- nsCOMPtr ss(do_QueryInterface(mStyleSheet)); -+ nsCOMPtr ss(do_QueryInterface(GetStyleSheet())); - nsresult result = NS_OK; - - if (ss) { -diff -up mozilla/content/html/content/src/nsHTMLStyleElement.cpp.475136 mozilla/content/html/content/src/nsHTMLStyleElement.cpp ---- content/html/content/src/nsHTMLStyleElement.cpp.475136 2005-04-19 00:58:30.000000000 +0200 -+++ content/html/content/src/nsHTMLStyleElement.cpp 2009-02-17 18:01:21.000000000 +0100 -@@ -141,8 +141,8 @@ nsHTMLStyleElement::GetDisabled(PRBool* - { - nsresult result = NS_OK; - -- if (mStyleSheet) { -- nsCOMPtr ss(do_QueryInterface(mStyleSheet)); -+ if (GetStyleSheet()) { -+ nsCOMPtr ss(do_QueryInterface(GetStyleSheet())); - - if (ss) { - result = ss->GetDisabled(aDisabled); -@@ -160,8 +160,8 @@ nsHTMLStyleElement::SetDisabled(PRBool a - { - nsresult result = NS_OK; - -- if (mStyleSheet) { -- nsCOMPtr ss(do_QueryInterface(mStyleSheet)); -+ if (GetStyleSheet()) { -+ nsCOMPtr ss(do_QueryInterface(GetStyleSheet())); - - if (ss) { - result = ss->SetDisabled(aDisabled); Index: files/patch-ff-479336 =================================================================== RCS file: files/patch-ff-479336 diff -N files/patch-ff-479336 --- files/patch-ff-479336 22 Apr 2009 08:49:19 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,13 +0,0 @@ -diff -up mozilla/modules/libpref/src/init/all.js.479336 mozilla/modules/libpref/src/init/all.js ---- modules/libpref/src/init/all.js.479336 2009-04-09 15:57:27.000000000 +0200 -+++ modules/libpref/src/init/all.js 2009-04-09 15:59:56.000000000 +0200 -@@ -631,7 +631,7 @@ pref("network.IDN.whitelist.org", true); - // attempt and so we always display the domain name as punycode. This would - // override the settings "network.IDN_show_punycode" and - // "network.IDN.whitelist.*". --pref("network.IDN.blacklist_chars", "\u0020\u00A0\u00BC\u00BD\u01C3\u0337\u0338\u05C3\u05F4\u06D4\u0702\u115F\u1160\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2024\u2027\u2028\u2029\u202F\u2039\u203A\u2044\u205F\u2154\u2155\u2156\u2159\u215A\u215B\u215F\u2215\u23AE\u29F6\u29F8\u2AFB\u2AFD\u2FF0\u2FF1\u2FF2\u2FF3\u2FF4\u2FF5\u2FF6\u2FF7\u2FF8\u2FF9\u2FFA\u2FFB\u3000\u3002\u3014\u3015\u3033\u3164\u321D\u321E\u33AE\u33AF\u33C6\u33DF\uFE14\uFE15\uFE3F\uFE5D\uFE5E\uFEFF\uFF0E\uFF0F\uFF61\uFFA0\uFFF9\uFFFA\uFFFB\uFFFC\uFFFD"); -+pref("network.IDN.blacklist_chars", "\u0020\u00A0\u00BC\u00BD\u00BE\u01C3\u02D0\u0337\u0338\u0589\u05C3\u05F4\u0609\u060A\u066A\u06D4\u0701\u0702\u0703\u0704\u115F\u1160\u1735\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u200B\u2024\u2027\u2028\u2029\u202F\u2039\u203A\u2041\u2044\u2052\u205F\u2153\u2154\u2155\u2156\u2157\u2158\u2159\u215A\u215B\u215C\u215D\u215E\u215F\u2215\u2236\u23AE\u2571\u29F6\u29F8\u2AFB\u2AFD\u2FF0\u2FF1\u2FF2\u2FF3\u2FF4\u2FF5\u2FF6\u2FF7\u2FF8\u2FF9\u2FFA\u2FFB\u3000\u3002\u3014\u3015\u3033\u3164\u321D\u321E\u33AE\u33AF\u33C6\u33DF\uA789\uFE14\uFE15\uFE3F\uFE5D\uFE5E\uFEFF\uFF0E\uFF0F\uFF61\uFFA0\uFFF9\uFFFA\uFFFB\uFFFC\uFFFD"); - - // This preference specifies a list of domains for which DNS lookups will be - // IPv4 only. Works around broken DNS servers which can't handle IPv6 lookups - Index: files/patch-ff-479413 =================================================================== RCS file: files/patch-ff-479413 diff -N files/patch-ff-479413 --- files/patch-ff-479413 13 Jun 2009 07:05:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,1184 +0,0 @@ -Index: netwerk/base/src/nsStandardURL.cpp -=================================================================== -RCS file: /cvsroot/mozilla/netwerk/base/src/nsStandardURL.cpp,v -retrieving revision 1.82.4.12 -diff -u -9 -p -r1.82.4.12 nsStandardURL.cpp ---- netwerk/base/src/nsStandardURL.cpp 7 Aug 2008 21:24:18 -0000 1.82.4.12 -+++ netwerk/base/src/nsStandardURL.cpp 3 Jun 2009 09:48:29 -0000 -@@ -52,25 +52,23 @@ - #include "nsIPrefBranch2.h" - #include "nsIIDNService.h" - #include "nsNetUtil.h" - #include "prlog.h" - #include "nsAutoPtr.h" - - static NS_DEFINE_CID(kThisImplCID, NS_THIS_STANDARDURL_IMPL_CID); - static NS_DEFINE_CID(kStandardURLCID, NS_STANDARDURL_CID); - --nsIIDNService *nsStandardURL::gIDN = nsnull; -+nsIIDNService_MOZILLA_1_8_BRANCH *nsStandardURL::gIDN = nsnull; - nsICharsetConverterManager *nsStandardURL::gCharsetMgr = nsnull; - PRBool nsStandardURL::gInitialized = PR_FALSE; - PRBool nsStandardURL::gEscapeUTF8 = PR_TRUE; - PRBool nsStandardURL::gAlwaysEncodeInUTF8 = PR_TRUE; --PRBool nsStandardURL::gShowPunycode = PR_FALSE; --nsIPrefBranch *nsStandardURL::gIDNWhitelistPrefBranch = nsnull; - - #if defined(PR_LOGGING) - // - // setenv NSPR_LOG_MODULES nsStandardURL:5 - // - static PRLogModuleInfo *gStandardURLLog; - #endif - #define LOG(args) PR_LOG(gStandardURLLog, PR_LOG_DEBUG, args) - #define LOG_ENABLED() PR_LOG_TEST(gStandardURLLog, PR_LOG_DEBUG) -@@ -131,20 +129,18 @@ end: - } - - //---------------------------------------------------------------------------- - // nsStandardURL::nsPrefObserver - //---------------------------------------------------------------------------- - - #define NS_NET_PREF_ESCAPEUTF8 "network.standard-url.escape-utf8" - #define NS_NET_PREF_ENABLEIDN "network.enableIDN" - #define NS_NET_PREF_ALWAYSENCODEINUTF8 "network.standard-url.encode-utf8" --#define NS_NET_PREF_SHOWPUNYCODE "network.IDN_show_punycode" --#define NS_NET_PREF_IDNWHITELIST "network.IDN.whitelist." - - NS_IMPL_ISUPPORTS1(nsStandardURL::nsPrefObserver, nsIObserver) - - NS_IMETHODIMP nsStandardURL:: - nsPrefObserver::Observe(nsISupports *subject, - const char *topic, - const PRUnichar *data) - { - if (!strcmp(topic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) { -@@ -298,38 +294,28 @@ nsStandardURL::~nsStandardURL() - void - nsStandardURL::InitGlobalObjects() - { - nsCOMPtr prefBranch( do_GetService(NS_PREFSERVICE_CONTRACTID) ); - if (prefBranch) { - nsCOMPtr obs( new nsPrefObserver() ); - prefBranch->AddObserver(NS_NET_PREF_ESCAPEUTF8, obs.get(), PR_FALSE); - prefBranch->AddObserver(NS_NET_PREF_ALWAYSENCODEINUTF8, obs.get(), PR_FALSE); - prefBranch->AddObserver(NS_NET_PREF_ENABLEIDN, obs.get(), PR_FALSE); -- prefBranch->AddObserver(NS_NET_PREF_SHOWPUNYCODE, obs.get(), PR_FALSE); - - PrefsChanged(prefBranch, nsnull); -- -- nsCOMPtr prefs = do_QueryInterface(prefBranch); -- if (prefs) { -- nsCOMPtr branch; -- if (NS_SUCCEEDED(prefs->GetBranch( NS_NET_PREF_IDNWHITELIST, -- getter_AddRefs(branch) ))) -- NS_ADDREF(gIDNWhitelistPrefBranch = branch); -- } - } - } - - void - nsStandardURL::ShutdownGlobalObjects() - { - NS_IF_RELEASE(gIDN); - NS_IF_RELEASE(gCharsetMgr); -- NS_IF_RELEASE(gIDNWhitelistPrefBranch); - } - - //---------------------------------------------------------------------------- - // nsStandardURL - //---------------------------------------------------------------------------- - - void - nsStandardURL::Clear() - { -@@ -378,45 +364,35 @@ nsStandardURL::EscapeIPv6(const char *ho - return PR_FALSE; - } - - PRBool - nsStandardURL::NormalizeIDN(const nsCSubstring &host, nsCString &result) - { - // If host is ACE, then convert to UTF-8. Else, if host is already UTF-8, - // then make sure it is normalized per IDN. - -- // this function returns PR_TRUE iff it writes something to |result|. -+ // this function returns PR_TRUE if normalization succeeds. - - // NOTE: As a side-effect this function sets mHostEncoding. While it would - // be nice to avoid side-effects in this function, the implementation of - // this function is already somewhat bound to the behavior of the - // callsites. Anyways, this function exists to avoid code duplication, so - // side-effects abound :-/ - - NS_ASSERTION(mHostEncoding == eEncoding_ASCII, "unexpected default encoding"); - -- if (IsASCII(host)) { -- PRBool isACE; -- if (gIDN && -- NS_SUCCEEDED(gIDN->IsACE(host, &isACE)) && isACE && -- NS_SUCCEEDED(ACEtoDisplayIDN(host, result))) { -+ PRBool isASCII; -+ if (gIDN && -+ NS_SUCCEEDED(gIDN->ConvertToDisplayIDN(host, &isASCII, result))) { -+ if (!isASCII) - mHostEncoding = eEncoding_UTF8; -- return PR_TRUE; -- } -- } -- else { -- mHostEncoding = eEncoding_UTF8; -- if (gIDN && NS_SUCCEEDED(UTF8toDisplayIDN(host, result))) { -- // normalization could result in an ASCII only hostname -- if (IsASCII(result)) -- mHostEncoding = eEncoding_ASCII; -- return PR_TRUE; -- } -+ -+ return PR_TRUE; - } - - result.Truncate(); - return PR_FALSE; - } - - void - nsStandardURL::CoalescePath(netCoalesceFlags coalesceFlag, char *path) - { -@@ -819,98 +795,40 @@ nsStandardURL::PrefsChanged(nsIPrefBranc - LOG(("nsStandardURL::PrefsChanged [pref=%s]\n", pref)); - - #define PREF_CHANGED(p) ((pref == nsnull) || !strcmp(pref, p)) - #define GOT_PREF(p, b) (NS_SUCCEEDED(prefs->GetBoolPref(p, &b))) - - if (PREF_CHANGED(NS_NET_PREF_ENABLEIDN)) { - NS_IF_RELEASE(gIDN); - if (GOT_PREF(NS_NET_PREF_ENABLEIDN, val) && val) { - // initialize IDN -- nsCOMPtr serv(do_GetService(NS_IDNSERVICE_CONTRACTID)); -+ nsCOMPtr -+ serv(do_GetService(NS_IDNSERVICE_CONTRACTID)); - if (serv) - NS_ADDREF(gIDN = serv.get()); - } - LOG(("IDN support %s\n", gIDN ? "enabled" : "disabled")); - } - - if (PREF_CHANGED(NS_NET_PREF_ESCAPEUTF8)) { - if (GOT_PREF(NS_NET_PREF_ESCAPEUTF8, val)) - gEscapeUTF8 = val; - LOG(("escape UTF-8 %s\n", gEscapeUTF8 ? "enabled" : "disabled")); - } - - if (PREF_CHANGED(NS_NET_PREF_ALWAYSENCODEINUTF8)) { - if (GOT_PREF(NS_NET_PREF_ALWAYSENCODEINUTF8, val)) - gAlwaysEncodeInUTF8 = val; - LOG(("encode in UTF-8 %s\n", gAlwaysEncodeInUTF8 ? "enabled" : "disabled")); - } -- -- if (PREF_CHANGED(NS_NET_PREF_SHOWPUNYCODE)) { -- if (GOT_PREF(NS_NET_PREF_SHOWPUNYCODE, val)) -- gShowPunycode = val; -- LOG(("show punycode %s\n", gShowPunycode ? "enabled" : "disabled")); -- } - #undef PREF_CHANGED - #undef GOT_PREF - } -- --/* static */ nsresult --nsStandardURL::ACEtoDisplayIDN(const nsCSubstring &host, nsCString &result) --{ -- if (gShowPunycode || !IsInWhitelist(host)) { -- result = host; -- return NS_OK; -- } -- -- return gIDN->ConvertACEtoUTF8(host, result); --} -- --/* static */ nsresult --nsStandardURL::UTF8toDisplayIDN(const nsCSubstring &host, nsCString &result) --{ -- // We have to normalize the hostname before testing against the domain -- // whitelist. See bug 315411. -- -- nsCAutoString temp; -- if (gShowPunycode || NS_FAILED(gIDN->Normalize(host, temp))) -- return gIDN->ConvertUTF8toACE(host, result); -- -- PRBool isACE = PR_FALSE; -- gIDN->IsACE(temp, &isACE); -- -- // If host is converted to ACE by the normalizer, then the host may contain -- // unsafe characters. See bug 283016, bug 301694, and bug 309311. -- -- if (!isACE && !IsInWhitelist(temp)) -- return gIDN->ConvertUTF8toACE(temp, result); -- -- result = temp; -- return NS_OK; --} -- --/* static */ PRBool --nsStandardURL::IsInWhitelist(const nsCSubstring &host) --{ -- PRInt32 pos; -- PRBool safe; -- -- // XXX This code uses strings inefficiently. -- -- if (gIDNWhitelistPrefBranch && -- (pos = nsCAutoString(host).RFind(".")) != kNotFound && -- NS_SUCCEEDED(gIDNWhitelistPrefBranch-> -- GetBoolPref(nsCAutoString(Substring(host, pos + 1)).get(), -- &safe))) -- return safe; -- -- return PR_FALSE; --} -- - //---------------------------------------------------------------------------- - // nsStandardURL::nsISupports - //---------------------------------------------------------------------------- - - NS_IMPL_ADDREF(nsStandardURL) - NS_IMPL_RELEASE(nsStandardURL) - - NS_INTERFACE_MAP_BEGIN(nsStandardURL) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIStandardURL) -Index: netwerk/base/src/nsStandardURL.h -=================================================================== -RCS file: /cvsroot/mozilla/netwerk/base/src/nsStandardURL.h,v -retrieving revision 1.28.4.1 -diff -u -9 -p -r1.28.4.1 nsStandardURL.h ---- netwerk/base/src/nsStandardURL.h 13 Sep 2005 18:23:14 -0000 1.28.4.1 -+++ netwerk/base/src/nsStandardURL.h 3 Jun 2009 09:48:29 -0000 -@@ -49,19 +49,19 @@ - #include "nsIURLParser.h" - #include "nsIUnicodeEncoder.h" - #include "nsIObserver.h" - #include "nsIIOService.h" - #include "nsCOMPtr.h" - #include "nsURLHelper.h" - - class nsIBinaryInputStream; - class nsIBinaryOutputStream; --class nsIIDNService; -+class nsIIDNService_MOZILLA_1_8_BRANCH; - class nsICharsetConverterManager; - class nsIPrefBranch; - - //----------------------------------------------------------------------------- - // standard URL implementation - //----------------------------------------------------------------------------- - - class nsStandardURL : public nsIFileURL - , public nsIStandardURL -@@ -213,23 +213,18 @@ private: - void ShiftFromQuery(PRInt32 diff) { mQuery.mPos += diff; ShiftFromRef(diff); } - void ShiftFromRef(PRInt32 diff) { mRef.mPos += diff; } - - // fastload helper functions - nsresult ReadSegment(nsIBinaryInputStream *, URLSegment &); - nsresult WriteSegment(nsIBinaryOutputStream *, const URLSegment &); - - static void PrefsChanged(nsIPrefBranch *prefs, const char *pref); - -- // IDN routines -- static nsresult ACEtoDisplayIDN(const nsCSubstring &in, nsCString &out); -- static nsresult UTF8toDisplayIDN(const nsCSubstring &in, nsCString &out); -- static PRBool IsInWhitelist(const nsCSubstring &host); -- - // mSpec contains the normalized version of the URL spec (UTF-8 encoded). - nsCString mSpec; - PRInt32 mDefaultPort; - PRInt32 mPort; - - // url parts (relative to mSpec) - URLSegment mScheme; - URLSegment mAuthority; - URLSegment mUsername; -@@ -262,25 +257,23 @@ private: - - PRUint32 mHostEncoding : 2; // eEncoding_xxx - PRUint32 mSpecEncoding : 2; // eEncoding_xxx - PRUint32 mURLType : 2; // nsIStandardURL::URLTYPE_xxx - PRUint32 mMutable : 1; // nsIStandardURL::mutable - PRUint32 mSupportsFileURL : 1; // QI to nsIFileURL? - - // global objects. don't use COMPtr as its destructor will cause a - // coredump if we leak it. -- static nsIIDNService *gIDN; -+ static nsIIDNService_MOZILLA_1_8_BRANCH *gIDN; - static nsICharsetConverterManager *gCharsetMgr; - static PRBool gInitialized; - static PRBool gEscapeUTF8; - static PRBool gAlwaysEncodeInUTF8; -- static PRBool gShowPunycode; -- static nsIPrefBranch *gIDNWhitelistPrefBranch; - }; - - #define NS_THIS_STANDARDURL_IMPL_CID \ - { /* b8e3e97b-1ccd-4b45-af5a-79596770f5d7 */ \ - 0xb8e3e97b, \ - 0x1ccd, \ - 0x4b45, \ - {0xaf, 0x5a, 0x79, 0x59, 0x67, 0x70, 0xf5, 0xd7} \ - } -Index: netwerk/dns/public/nsIIDNService.idl -=================================================================== -RCS file: /cvsroot/mozilla/netwerk/dns/public/nsIIDNService.idl,v -retrieving revision 1.4 -diff -u -9 -p -r1.4 nsIIDNService.idl ---- netwerk/dns/public/nsIIDNService.idl 3 Apr 2004 07:32:18 -0000 1.4 -+++ netwerk/dns/public/nsIIDNService.idl 3 Jun 2009 09:48:29 -0000 -@@ -18,19 +18,21 @@ - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): bobj@netscape.com, - * brendan@mozilla.org, - * darin@netscape.com, - * ftang@netscape.com, - * gagan@netscape.com, - * nhotta@netscape.com, -- * william.tan@i-dns.net -+ * william.tan@i-dns.net, -+ * dwitte@stanford.edu, -+ * smontagu@smontagu.org - * - * - * 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 -@@ -83,9 +85,21 @@ interface nsIIDNService : nsISupports - */ - boolean isACE(in ACString input); - - /** - * Performs the unicode normalization needed for hostnames in IDN, - * for callers that want early normalization. - */ - AUTF8String normalize(in AUTF8String input); - }; -+ -+[scriptable, uuid(7be196fc-82fd-40d8-9d8c-6421faddeee9)] -+interface nsIIDNService_MOZILLA_1_8_BRANCH : nsIIDNService -+{ -+ /** -+ * Normalizes and converts a host to UTF-8 if the host is in the IDN -+ * whitelist, otherwise converts it to ACE. This is useful for display -+ * purposes and to ensure an encoding consistent with nsIURI::GetHost(). -+ * If the result is ASCII or ACE encoded, |isASCII| will be true. -+ */ -+ AUTF8String convertToDisplayIDN(in AUTF8String input, out boolean isASCII); -+}; -\ No newline at end of file -Index: netwerk/dns/src/nsIDNService.cpp -=================================================================== -RCS file: /cvsroot/mozilla/netwerk/dns/src/nsIDNService.cpp,v -retrieving revision 1.28.2.1 -diff -u -9 -p -r1.28.2.1 nsIDNService.cpp ---- netwerk/dns/src/nsIDNService.cpp 27 Aug 2008 07:36:26 -0000 1.28.2.1 -+++ netwerk/dns/src/nsIDNService.cpp 3 Jun 2009 09:48:29 -0000 -@@ -1,10 +1,10 @@ --/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - /* ***** 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, -@@ -51,43 +51,50 @@ - //----------------------------------------------------------------------------- - // RFC 1034 - 3.1. Name space specifications and terminology - static const PRUint32 kMaxDNSNodeLen = 63; - - //----------------------------------------------------------------------------- - - #define NS_NET_PREF_IDNTESTBED "network.IDN_testbed" - #define NS_NET_PREF_IDNPREFIX "network.IDN_prefix" - #define NS_NET_PREF_IDNBLACKLIST "network.IDN.blacklist_chars" -+#define NS_NET_PREF_SHOWPUNYCODE "network.IDN_show_punycode" -+#define NS_NET_PREF_IDNWHITELIST "network.IDN.whitelist." - - inline PRBool isOnlySafeChars(const nsAFlatString& in, - const nsAFlatString& blacklist) - { - return (blacklist.IsEmpty() || - in.FindCharInSet(blacklist) == kNotFound); - } - - //----------------------------------------------------------------------------- - // nsIDNService - //----------------------------------------------------------------------------- - - /* Implementation file */ - NS_IMPL_THREADSAFE_ISUPPORTS3(nsIDNService, -- nsIIDNService, -+ nsIIDNService_MOZILLA_1_8_BRANCH, - nsIObserver, - nsISupportsWeakReference) - - nsresult nsIDNService::Init() - { -- nsCOMPtr prefInternal(do_GetService(NS_PREFSERVICE_CONTRACTID)); -+ nsCOMPtr prefs(do_GetService(NS_PREFSERVICE_CONTRACTID)); -+ if (prefs) -+ prefs->GetBranch(NS_NET_PREF_IDNWHITELIST, getter_AddRefs(mIDNWhitelistPrefBranch)); -+ -+ nsCOMPtr prefInternal(do_QueryInterface(prefs)); - if (prefInternal) { - prefInternal->AddObserver(NS_NET_PREF_IDNTESTBED, this, PR_TRUE); - prefInternal->AddObserver(NS_NET_PREF_IDNPREFIX, this, PR_TRUE); - prefInternal->AddObserver(NS_NET_PREF_IDNBLACKLIST, this, PR_TRUE); -+ prefInternal->AddObserver(NS_NET_PREF_SHOWPUNYCODE, this, PR_TRUE); - prefsChanged(prefInternal, nsnull); - } - return NS_OK; - } - - NS_IMETHODIMP nsIDNService::Observe(nsISupports *aSubject, - const char *aTopic, - const PRUnichar *aData) - { -@@ -116,18 +123,23 @@ void nsIDNService::prefsChanged(nsIPrefB - nsCOMPtr blacklist; - nsresult rv = prefBranch->GetComplexValue(NS_NET_PREF_IDNBLACKLIST, - NS_GET_IID(nsISupportsString), - getter_AddRefs(blacklist)); - if (NS_SUCCEEDED(rv)) - blacklist->ToString(getter_Copies(mIDNBlacklist)); - else - mIDNBlacklist.Truncate(); - } -+ if (!pref || NS_LITERAL_STRING(NS_NET_PREF_SHOWPUNYCODE).Equals(pref)) { -+ PRBool val; -+ if (NS_SUCCEEDED(prefBranch->GetBoolPref(NS_NET_PREF_SHOWPUNYCODE, &val))) -+ mShowPunycode = val; -+ } - } - - nsIDNService::nsIDNService() - { - nsresult rv; - - // initialize to the official prefix (RFC 3490 "5. ACE prefix") - const char kIDNSPrefix[] = "xn--"; - strcpy(mACEPrefix, kIDNSPrefix); -@@ -148,18 +160,23 @@ nsIDNService::~nsIDNService() - idn_nameprep_destroy(mNamePrepHandle); - } - - /* ACString ConvertUTF8toACE (in AUTF8String input); */ - NS_IMETHODIMP nsIDNService::ConvertUTF8toACE(const nsACString & input, nsACString & ace) - { - // protect against bogus input - NS_ENSURE_TRUE(IsUTF8(input), NS_ERROR_UNEXPECTED); - -+ return UTF8toACE(input, ace, PR_TRUE); -+} -+ -+nsresult nsIDNService::UTF8toACE(const nsACString & input, nsACString & ace, PRBool allowUnassigned) -+{ - nsresult rv; - NS_ConvertUTF8toUCS2 ustr(input); - - // map ideographic period to ASCII period etc. - normalizeFullStops(ustr); - - - PRUint32 len, offset; - len = 0; -@@ -169,45 +186,53 @@ NS_IMETHODIMP nsIDNService::ConvertUTF8t - nsAString::const_iterator start, end; - ustr.BeginReading(start); - ustr.EndReading(end); - ace.Truncate(); - - // encode nodes if non ASCII - while (start != end) { - len++; - if (*start++ == (PRUnichar)'.') { -- rv = stringPrepAndACE(Substring(ustr, offset, len - 1), encodedBuf); -+ rv = stringPrepAndACE(Substring(ustr, offset, len - 1), encodedBuf, -+ allowUnassigned); - NS_ENSURE_SUCCESS(rv, rv); - - ace.Append(encodedBuf); - ace.Append('.'); - offset += len; - len = 0; - } - } - - // add extra node for multilingual test bed - if (mMultilingualTestBed) - ace.AppendLiteral("mltbd."); - // encode the last node if non ASCII - if (len) { -- rv = stringPrepAndACE(Substring(ustr, offset, len), encodedBuf); -+ rv = stringPrepAndACE(Substring(ustr, offset, len), encodedBuf, -+ allowUnassigned); - NS_ENSURE_SUCCESS(rv, rv); - - ace.Append(encodedBuf); - } - - return NS_OK; - } - - /* [noscript] string ConvertACEtoUTF8 (in string input); */ - NS_IMETHODIMP nsIDNService::ConvertACEtoUTF8(const nsACString & input, nsACString & _retval) - { -+ return ACEtoUTF8(input, _retval, PR_TRUE); -+} -+ -+nsresult nsIDNService::ACEtoUTF8(const nsACString & input, nsACString & _retval, -+ PRBool allowUnassigned) -+{ - // RFC 3490 - 4.2 ToUnicode - // ToUnicode never fails. If any step fails, then the original input - // sequence is returned immediately in that step. - - if (!IsASCII(input)) { - _retval.Assign(input); - return NS_OK; - } - -@@ -217,32 +242,34 @@ NS_IMETHODIMP nsIDNService::ConvertACEto - nsACString::const_iterator start, end; - input.BeginReading(start); - input.EndReading(end); - _retval.Truncate(); - - // loop and decode nodes - while (start != end) { - len++; - if (*start++ == '.') { -- if (NS_FAILED(decodeACE(Substring(input, offset, len - 1), decodedBuf))) { -+ if (NS_FAILED(decodeACE(Substring(input, offset, len - 1), decodedBuf, -+ allowUnassigned))) { - _retval.Assign(input); - return NS_OK; - } - - _retval.Append(decodedBuf); - _retval.Append('.'); - offset += len; - len = 0; - } - } - // decode the last node - if (len) { -- if (NS_FAILED(decodeACE(Substring(input, offset, len), decodedBuf))) -+ if (NS_FAILED(decodeACE(Substring(input, offset, len), decodedBuf, -+ allowUnassigned))) - _retval.Assign(input); - else - _retval.Append(decodedBuf); - } - - return NS_OK; - } - - /* boolean encodedInACE (in ACString input); */ -@@ -266,30 +293,100 @@ NS_IMETHODIMP nsIDNService::IsACE(const - - NS_IMETHODIMP nsIDNService::Normalize(const nsACString & input, nsACString & output) - { - // protect against bogus input - NS_ENSURE_TRUE(IsUTF8(input), NS_ERROR_UNEXPECTED); - - NS_ConvertUTF8toUTF16 inUTF16(input); - normalizeFullStops(inUTF16); - -- nsAutoString outUTF16; -- nsresult rv = stringPrep(inUTF16, outUTF16); -- if (NS_FAILED(rv)) -- return rv; -+ // pass the domain name to stringprep label by label -+ nsAutoString outUTF16, outLabel; -+ -+ PRUint32 len = 0, offset = 0; -+ nsresult rv; -+ nsAString::const_iterator start, end; -+ inUTF16.BeginReading(start); -+ inUTF16.EndReading(end); -+ -+ while (start != end) { -+ len++; -+ if (*start++ == PRUnichar('.')) { -+ rv = stringPrep(Substring(inUTF16, offset, len - 1), outLabel, PR_TRUE); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ outUTF16.Append(outLabel); -+ outUTF16.Append(PRUnichar('.')); -+ offset += len; -+ len = 0; -+ } -+ } -+ if (len) { -+ rv = stringPrep(Substring(inUTF16, offset, len), outLabel, PR_TRUE); -+ NS_ENSURE_SUCCESS(rv, rv); -+ -+ outUTF16.Append(outLabel); -+ } - - CopyUTF16toUTF8(outUTF16, output); - if (!isOnlySafeChars(outUTF16, mIDNBlacklist)) - return ConvertUTF8toACE(output, output); - - return NS_OK; - } - -+NS_IMETHODIMP nsIDNService::ConvertToDisplayIDN(const nsACString & input, PRBool * _isASCII, nsACString & _retval) -+{ -+ // If host is ACE, then convert to UTF-8 if the host is in the IDN whitelist. -+ // Else, if host is already UTF-8, then make sure it is normalized per IDN. -+ -+ nsresult rv; -+ -+ if (IsASCII(input)) { -+ // first, canonicalize the host to lowercase, for whitelist lookup -+ _retval = input; -+ ToLowerCase(_retval); -+ -+ PRBool isACE; -+ IsACE(_retval, &isACE); -+ -+ if (isACE && !mShowPunycode && isInWhitelist(_retval)) { -+ // ACEtoUTF8() can't fail, but might return the original ACE string -+ nsCAutoString temp(_retval); -+ ACEtoUTF8(temp, _retval, PR_FALSE); -+ *_isASCII = IsASCII(_retval); -+ } else { -+ *_isASCII = PR_TRUE; -+ } -+ } else { -+ if (mShowPunycode && NS_SUCCEEDED(ConvertUTF8toACE(input, _retval))) { -+ *_isASCII = PR_TRUE; -+ return NS_OK; -+ } -+ -+ // We have to normalize the hostname before testing against the domain -+ // whitelist. See bug 315411. -+ rv = Normalize(input, _retval); -+ if (NS_FAILED(rv)) return rv; -+ -+ // normalization could result in an ASCII-only hostname. alternatively, if -+ // the host is converted to ACE by the normalizer, then the host may contain -+ // unsafe characters, so leave it ACE encoded. see bug 283016, bug 301694, and bug 309311. -+ *_isASCII = IsASCII(_retval); -+ if (!*_isASCII && !isInWhitelist(_retval)) { -+ *_isASCII = PR_TRUE; -+ return ConvertUTF8toACE(_retval, _retval); -+ } -+ } -+ -+ return NS_OK; -+} -+ - //----------------------------------------------------------------------------- - - static void utf16ToUcs4(const nsAString& in, PRUint32 *out, PRUint32 outBufLen, PRUint32 *outLen) - { - PRUint32 i = 0; - nsAString::const_iterator start, end; - in.BeginReading(start); - in.EndReading(end); - -@@ -404,19 +501,24 @@ static nsresult encodeToRACE(const char* - // 3) Prohibit -- Check for any characters that are not allowed in the - // output. If any are found, return an error. This is described in section - // 5. - // - // 4) Check bidi -- Possibly check for right-to-left characters, and if any - // are found, make sure that the whole string satisfies the requirements - // for bidirectional strings. If the string does not satisfy the requirements - // for bidirectional strings, return an error. This is described in section 6. - // --nsresult nsIDNService::stringPrep(const nsAString& in, nsAString& out) -+// 5) Check unassigned code points -- If allowUnassigned is false, check for -+// any unassigned Unicode points and if any are found return an error. -+// This is described in section 7. -+// -+nsresult nsIDNService::stringPrep(const nsAString& in, nsAString& out, -+ PRBool allowUnassigned) - { - if (!mNamePrepHandle || !mNormalizer) - return NS_ERROR_FAILURE; - - nsresult rv = NS_OK; - PRUint32 ucs4Buf[kMaxDNSNodeLen + 1]; - PRUint32 ucs4Len; - utf16ToUcs4(in, ucs4Buf, kMaxDNSNodeLen, &ucs4Len); - -@@ -446,50 +548,59 @@ nsresult nsIDNService::stringPrep(const - if (idn_err != idn_success || found) - return NS_ERROR_FAILURE; - - // check bidi - idn_err = idn_nameprep_isvalidbidi(mNamePrepHandle, - (const PRUint32 *) ucs4Buf, &found); - if (idn_err != idn_success || found) - return NS_ERROR_FAILURE; - -+ if (!allowUnassigned) { -+ // check unassigned code points -+ idn_err = idn_nameprep_isunassigned(mNamePrepHandle, -+ (const PRUint32 *) ucs4Buf, &found); -+ if (idn_err != idn_success || found) -+ return NS_ERROR_FAILURE; -+ } -+ - // set the result string - out.Assign(normlizedStr); - - return rv; - } - - nsresult nsIDNService::encodeToACE(const nsAString& in, nsACString& out) - { - // RACE encode is supported for existing testing environment - if (!strcmp("bq--", mACEPrefix)) - return encodeToRACE(mACEPrefix, in, out); - - // use punycoce - return punycode(mACEPrefix, in, out); - } - --nsresult nsIDNService::stringPrepAndACE(const nsAString& in, nsACString& out) -+nsresult nsIDNService::stringPrepAndACE(const nsAString& in, nsACString& out, -+ PRBool allowUnassigned) - { - nsresult rv = NS_OK; - - out.Truncate(); - - if (in.Length() > kMaxDNSNodeLen) { - NS_ERROR("IDN node too large"); - return NS_ERROR_FAILURE; - } - - if (IsASCII(in)) - CopyUCS2toASCII(in, out); - else { - nsAutoString strPrep; -- rv = stringPrep(in, strPrep); -+ rv = stringPrep(in, strPrep, allowUnassigned); - if (NS_SUCCEEDED(rv)) { - if (IsASCII(strPrep)) - CopyUCS2toASCII(strPrep, out); - else - rv = encodeToACE(strPrep, out); - } - } - - if (out.Length() > kMaxDNSNodeLen) { -@@ -522,19 +633,20 @@ void nsIDNService::normalizeFullStops(ns - break; - default: - break; - } - start++; - index++; - } - } - --nsresult nsIDNService::decodeACE(const nsACString& in, nsACString& out) -+nsresult nsIDNService::decodeACE(const nsACString& in, nsACString& out, -+ PRBool allowUnassigned) - { - PRBool isAce; - IsACE(in, &isAce); - if (!isAce) { - out.Assign(in); - return NS_OK; - } - - // RFC 3490 - 4.2 ToUnicode -@@ -558,17 +670,39 @@ nsresult nsIDNService::decodeACE(const n - nsAutoString utf16; - ucs4toUtf16(output, utf16); - delete [] output; - if (!isOnlySafeChars(utf16, mIDNBlacklist)) - return NS_ERROR_FAILURE; - CopyUTF16toUTF8(utf16, out); - - // Validation: encode back to ACE and compare the strings - nsCAutoString ace; -- nsresult rv = ConvertUTF8toACE(out, ace); -+ nsresult rv = UTF8toACE(out, ace, allowUnassigned); - NS_ENSURE_SUCCESS(rv, rv); - - if (!ace.Equals(in, nsCaseInsensitiveCStringComparator())) - return NS_ERROR_FAILURE; - - return NS_OK; - } -+ -+PRBool nsIDNService::isInWhitelist(const nsACString &host) -+{ -+ if (mIDNWhitelistPrefBranch) { -+ nsCAutoString tld(host); -+ // make sure the host is ACE for lookup and check that there are no -+ // unassigned codepoints -+ if (!IsASCII(tld) && NS_FAILED(UTF8toACE(tld, tld, PR_FALSE))) { -+ return PR_FALSE; -+ } -+ -+ tld.Trim("."); -+ PRInt32 pos = tld.RFind("."); -+ -+ PRBool safe; -+ if (pos != kNotFound && -+ NS_SUCCEEDED(mIDNWhitelistPrefBranch->GetBoolPref(tld.get() + pos + 1, &safe))) -+ return safe; -+ } -+ -+ return PR_FALSE; -+} -Index: netwerk/dns/src/nsIDNService.h -=================================================================== -RCS file: /cvsroot/mozilla/netwerk/dns/src/nsIDNService.h,v -retrieving revision 1.8 -diff -u -9 -p -r1.8 nsIDNService.h ---- netwerk/dns/src/nsIDNService.h 22 Jul 2005 15:07:33 -0000 1.8 -+++ netwerk/dns/src/nsIDNService.h 3 Jun 2009 09:48:30 -0000 -@@ -1,10 +1,10 @@ --/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ - /* ***** 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, -@@ -49,39 +49,50 @@ - - class nsIPrefBranch; - - //----------------------------------------------------------------------------- - // nsIDNService - //----------------------------------------------------------------------------- - - #define kACEPrefixLen 4 - --class nsIDNService : public nsIIDNService, -+class nsIDNService : public nsIIDNService_MOZILLA_1_8_BRANCH, - public nsIObserver, - public nsSupportsWeakReference - { - public: - NS_DECL_ISUPPORTS - NS_DECL_NSIIDNSERVICE -+ NS_DECL_NSIIDNSERVICE_MOZILLA_1_8_BRANCH - NS_DECL_NSIOBSERVER - - nsIDNService(); - virtual ~nsIDNService(); - - nsresult Init(); - - private: - void normalizeFullStops(nsAString& s); -- nsresult stringPrepAndACE(const nsAString& in, nsACString& out); -+ nsresult stringPrepAndACE(const nsAString& in, nsACString& out, -+ PRBool allowUnassigned); - nsresult encodeToACE(const nsAString& in, nsACString& out); -- nsresult stringPrep(const nsAString& in, nsAString& out); -- nsresult decodeACE(const nsACString& in, nsACString& out); -+ nsresult stringPrep(const nsAString& in, nsAString& out, -+ PRBool allowUnassigned); -+ nsresult decodeACE(const nsACString& in, nsACString& out, -+ PRBool allowUnassigned); -+ nsresult UTF8toACE(const nsACString& in, nsACString& out, -+ PRBool allowUnassigned); -+ nsresult ACEtoUTF8(const nsACString& in, nsACString& out, -+ PRBool allowUnassigned); -+ PRBool isInWhitelist(const nsACString &host); - void prefsChanged(nsIPrefBranch *prefBranch, const PRUnichar *pref); - -- PRBool mMultilingualTestBed; // if true generates extra node for mulitlingual testbed -+ PRBool mMultilingualTestBed; // if true generates extra node for multilingual testbed - idn_nameprep_t mNamePrepHandle; - nsCOMPtr mNormalizer; - char mACEPrefix[kACEPrefixLen+1]; - nsXPIDLString mIDNBlacklist; -+ PRBool mShowPunycode; -+ nsCOMPtr mIDNWhitelistPrefBranch; - }; - - #endif // nsIDNService_h__ -Index: netwerk/test/Makefile.in -=================================================================== -RCS file: /cvsroot/mozilla/netwerk/test/Makefile.in,v -retrieving revision 1.85.2.7 -diff -u -9 -p -r1.85.2.7 Makefile.in ---- netwerk/test/Makefile.in 27 Jun 2006 20:27:29 -0000 1.85.2.7 -+++ netwerk/test/Makefile.in 3 Jun 2009 09:48:31 -0000 -@@ -97,20 +97,23 @@ _UNIT_FILES = unit/test_all.sh \ - unit/head.js \ - unit/head_http_server.js \ - unit/tail.js \ - unit/test_protocolproxyservice.js \ - unit/test_http_headers.js \ - unit/test_cookie_header.js \ - unit/test_parse_content_type.js \ - unit/test_event_sink.js \ - unit/test_content_sniffer.js \ -+ unit/test_idnservice.js \ - unit/test_bug331825.js \ - unit/test_bug336501.js \ -+ unit/test_bug427957.js \ -+ unit/test_bug479413.js \ - $(NULL) - libs:: $(_UNIT_FILES) - $(INSTALL) $^ $(DIST)/bin/necko_unit_tests - - check:: - $(RUN_TEST_PROGRAM) $(DIST)/bin/necko_unit_tests/test_all.sh - - _RES_FILES = urlparse.dat \ - urlparse_unx.dat \ -Index: netwerk/test/unit/test_bug427957.js -=================================================================== -RCS file: netwerk/test/unit/test_bug427957.js -diff -N netwerk/test/unit/test_bug427957.js ---- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ netwerk/test/unit/test_bug427957.js 3 Jun 2009 09:48:31 -0000 -@@ -0,0 +1,100 @@ -+/** -+ * Test for Bidi restrictions on IDNs from RFC 3454 -+ */ -+ -+var Cc = Components.classes; -+var Ci = Components.interfaces; -+var idnService; -+ -+function expected_pass(inputIDN) -+{ -+ var isASCII = {}; -+ var displayIDN = idnService.convertToDisplayIDN(inputIDN, isASCII); -+ do_check_eq(displayIDN, inputIDN); -+} -+ -+function expected_fail(inputIDN) -+{ -+ var isASCII = {}; -+ var displayIDN = ""; -+ -+ try { -+ displayIDN = idnService.convertToDisplayIDN(inputIDN, isASCII); -+ } -+ catch(e) {} -+ -+ do_check_neq(displayIDN, inputIDN); -+} -+ -+function run_test() { -+ // add an IDN whitelist pref -+ var pbi = Cc["@mozilla.org/preferences-service;1"] -+ .getService(Ci.nsIPrefBranch2); -+ pbi.setBoolPref("network.IDN.whitelist.com", true); -+ -+ idnService = Cc["@mozilla.org/network/idn-service;1"] -+ .getService(Ci.nsIIDNService_MOZILLA_1_8_BRANCH); -+ /* -+ * In any profile that specifies bidirectional character handling, all -+ * three of the following requirements MUST be met: -+ * -+ * 1) The characters in section 5.8 MUST be prohibited. -+ */ -+ -+ // 0340; COMBINING GRAVE TONE MARK -+ expected_fail("foo\u0340bar.com"); -+ // 0341; COMBINING ACUTE TONE MARK -+ expected_fail("foo\u0341bar.com"); -+ // 200E; LEFT-TO-RIGHT MARK -+ expected_fail("foo\200ebar.com"); -+ // 200F; RIGHT-TO-LEFT MARK -+ // Note: this is an RTL IDN so that it doesn't fail test 2) below -+ expected_fail("\u200f\u0645\u062B\u0627\u0644.\u0622\u0632\u0645\u0627\u06CC\u0634\u06CC"); -+ // 202A; LEFT-TO-RIGHT EMBEDDING -+ expected_fail("foo\u202abar.com"); -+ // 202B; RIGHT-TO-LEFT EMBEDDING -+ expected_fail("foo\u202bbar.com"); -+ // 202C; POP DIRECTIONAL FORMATTING -+ expected_fail("foo\u202cbar.com"); -+ // 202D; LEFT-TO-RIGHT OVERRIDE -+ expected_fail("foo\u202dbar.com"); -+ // 202E; RIGHT-TO-LEFT OVERRIDE -+ expected_fail("foo\u202ebar.com"); -+ // 206A; INHIBIT SYMMETRIC SWAPPING -+ expected_fail("foo\u206abar.com"); -+ // 206B; ACTIVATE SYMMETRIC SWAPPING -+ expected_fail("foo\u206bbar.com"); -+ // 206C; INHIBIT ARABIC FORM SHAPING -+ expected_fail("foo\u206cbar.com"); -+ // 206D; ACTIVATE ARABIC FORM SHAPING -+ expected_fail("foo\u206dbar.com"); -+ // 206E; NATIONAL DIGIT SHAPES -+ expected_fail("foo\u206ebar.com"); -+ // 206F; NOMINAL DIGIT SHAPES -+ expected_fail("foo\u206fbar.com"); -+ -+ /* -+ * 2) If a string contains any RandALCat character, the string MUST NOT -+ * contain any LCat character. -+ */ -+ -+ // www.מיץpetel.com is invalid -+ expected_fail("www.\u05DE\u05D9\u05E5petel.com"); -+ // But www.מיץפטל.com is fine because the ltr and rtl characters are in -+ // different labels -+ expected_pass("www.\u05DE\u05D9\u05E5\u05E4\u05D8\u05DC.com"); -+ -+ /* -+ * 3) If a string contains any RandALCat character, a RandALCat -+ * character MUST be the first character of the string, and a -+ * RandALCat character MUST be the last character of the string. -+ */ -+ -+ // www.1מיץ.com is invalid -+ expected_fail("www.1\u05DE\u05D9\u05E5.com"); -+ // www.מיץ1.com is invalid -+ expected_fail("www.\u05DE\u05D9\u05E51.com"); -+ // But www.מיץ1פטל.com is fine -+ expected_pass("www.\u05DE\u05D9\u05E51\u05E4\u05D8\u05DC.com"); -+} -+ -Index: netwerk/test/unit/test_bug479413.js -=================================================================== -RCS file: netwerk/test/unit/test_bug479413.js -diff -N netwerk/test/unit/test_bug479413.js ---- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ netwerk/test/unit/test_bug479413.js 3 Jun 2009 09:48:31 -0000 -@@ -0,0 +1,60 @@ -+/** -+ * Test for unassigned code points in IDNs (RFC 3454 section 7) -+ */ -+ -+const Cc = Components.classes; -+const Ci = Components.interfaces; -+var idnService; -+ -+function expected_pass(inputIDN) -+{ -+ var isASCII = {}; -+ var displayIDN = idnService.convertToDisplayIDN(inputIDN, isASCII); -+ do_check_eq(displayIDN, inputIDN); -+} -+ -+function expected_fail(inputIDN) -+{ -+ var isASCII = {}; -+ var displayIDN = ""; -+ -+ try { -+ displayIDN = idnService.convertToDisplayIDN(inputIDN, isASCII); -+ } -+ catch(e) {} -+ -+ do_check_neq(displayIDN, inputIDN); -+} -+ -+function run_test() { -+ // add an IDN whitelist pref -+ var pbi = Cc["@mozilla.org/preferences-service;1"] -+ .getService(Ci.nsIPrefBranch2); -+ var whitelistPref = "network.IDN.whitelist.com"; -+ -+ pbi.setBoolPref(whitelistPref, true); -+ -+ idnService = Cc["@mozilla.org/network/idn-service;1"] -+ .getService(Ci.nsIIDNService_MOZILLA_1_8_BRANCH); -+ -+ // assigned code point -+ expected_pass("foo\u0101bar.com"); -+ -+ // assigned code point in punycode. Should *fail* because the URL will be -+ // converted to Unicode for display -+ expected_fail("xn--foobar-5za.com"); -+ -+ // unassigned code point -+ expected_fail("foo\u3040bar.com"); -+ -+ // unassigned code point in punycode. Should *pass* because the URL will not -+ // be converted to Unicode -+ expected_pass("xn--foobar-533e.com"); -+ -+ // code point assigned since Unicode 3.0 -+ // XXX This test will unexpectedly pass when we update to IDNAbis -+ expected_fail("foo\u0370bar.com"); -+ -+ // reset the pref -+ pbi.clearUserPref(whitelistPref); -+} -Index: netwerk/test/unit/test_idnservice.js -=================================================================== -RCS file: netwerk/test/unit/test_idnservice.js -diff -N netwerk/test/unit/test_idnservice.js ---- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ netwerk/test/unit/test_idnservice.js 3 Jun 2009 09:48:31 -0000 -@@ -0,0 +1,48 @@ -+// Tests nsIIDNService -+ -+var reference = [ -+ // The 3rd element indicates whether the second element -+ // is ACE-encoded -+ ["asciihost", "asciihost", false], -+ ["b\u00FCcher", "xn--bcher-kva", true] -+ ]; -+ -+function run_test() { -+ var idnService = Components.classes["@mozilla.org/network/idn-service;1"] -+ .getService(Components.interfaces.nsIIDNService_MOZILLA_1_8_BRANCH); -+ -+ for (var i = 0; i < reference.length; ++i) { -+ dump("Testing " + reference[i] + "\n"); -+ // We test the following: -+ // - Converting UTF-8 to ACE and back gives us the expected answer -+ // - Converting the ASCII string UTF-8 -> ACE leaves the string unchanged -+ // - isACE returns true when we expect it to (third array elem true) -+ do_check_eq(idnService.convertUTF8toACE(reference[i][0]), reference[i][1]); -+ do_check_eq(idnService.convertUTF8toACE(reference[i][1]), reference[i][1]); -+ do_check_eq(idnService.convertACEtoUTF8(reference[i][1]), reference[i][0]); -+ do_check_eq(idnService.isACE(reference[i][1]), reference[i][2]); -+ } -+ -+ // add an IDN whitelist pref -+ var pbi = Components.classes["@mozilla.org/preferences-service;1"] -+ .getService(Components.interfaces.nsIPrefBranch2); -+ pbi.setBoolPref("network.IDN.whitelist.es", true); -+ -+ // check convertToDisplayIDN against the whitelist -+ var isASCII = {}; -+ do_check_eq(idnService.convertToDisplayIDN("b\u00FCcher.es", isASCII), "b\u00FCcher.es"); -+ do_check_eq(isASCII.value, false); -+ do_check_eq(idnService.convertToDisplayIDN("xn--bcher-kva.es", isASCII), "b\u00FCcher.es"); -+ do_check_eq(isASCII.value, false); -+ do_check_eq(idnService.convertToDisplayIDN("b\u00FCcher.uk", isASCII), "xn--bcher-kva.uk"); -+ do_check_eq(isASCII.value, true); -+ do_check_eq(idnService.convertToDisplayIDN("xn--bcher-kva.uk", isASCII), "xn--bcher-kva.uk"); -+ do_check_eq(isASCII.value, true); -+ -+ // check ACE TLD's are handled by the whitelist -+ pbi.setBoolPref("network.IDN.whitelist.xn--k-dha", true); -+ do_check_eq(idnService.convertToDisplayIDN("test.\u00FCk", isASCII), "test.\u00FCk"); -+ do_check_eq(isASCII.value, false); -+ do_check_eq(idnService.convertToDisplayIDN("test.xn--k-dha", isASCII), "test.\u00FCk"); -+ do_check_eq(isASCII.value, false); -+} Index: files/patch-ff-479560 =================================================================== RCS file: files/patch-ff-479560 diff -N files/patch-ff-479560 --- files/patch-ff-479560 13 Jun 2009 07:05:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,69 +0,0 @@ -diff -up mozilla/js/src/xpconnect/src/xpcprivate.h.479560 mozilla/js/src/xpconnect/src/xpcprivate.h ---- js/src/xpconnect/src/xpcprivate.h.479560 2008-03-22 09:04:17.000000000 +0100 -+++ js/src/xpconnect/src/xpcprivate.h 2009-05-13 14:56:10.000000000 +0200 -@@ -2167,7 +2167,7 @@ private: - nsXPCWrappedJSClass(XPCCallContext& ccx, REFNSIID aIID, - nsIInterfaceInfo* aInfo); - -- JSObject* NewOutObject(JSContext* cx); -+ JSObject* NewOutObject(JSContext* cx, JSObject* scope); - - JSBool IsReflectable(uint16 i) const - {return (JSBool)(mDescriptors[i/32] & (1 << (i%32)));} -diff -up mozilla/js/src/xpconnect/src/xpcwrappedjsclass.cpp.479560 mozilla/js/src/xpconnect/src/xpcwrappedjsclass.cpp ---- js/src/xpconnect/src/xpcwrappedjsclass.cpp.479560 2007-06-30 01:21:28.000000000 +0200 -+++ js/src/xpconnect/src/xpcwrappedjsclass.cpp 2009-05-13 14:51:35.000000000 +0200 -@@ -1338,7 +1338,7 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWra - if(param.IsOut()) - { - // create an 'out' object -- JSObject* out_obj = NewOutObject(cx); -+ JSObject* out_obj = NewOutObject(cx, obj); - if(!out_obj) - { - retval = NS_ERROR_OUT_OF_MEMORY; -@@ -1706,9 +1706,9 @@ nsXPCWrappedJSClass::GetInterfaceName() - } - - JSObject* --nsXPCWrappedJSClass::NewOutObject(JSContext* cx) -+nsXPCWrappedJSClass::NewOutObject(JSContext* cx, JSObject* scope) - { -- return JS_NewObject(cx, nsnull, nsnull, nsnull); -+ return JS_NewObject(cx, nsnull, nsnull, JS_GetGlobalForObject(cx, scope)); - } - - -diff -up mozilla/js/src/jsapi.c.old mozilla/js/src/jsapi.c ---- js/src/jsapi.c.old 2009-05-13 15:13:20.000000000 +0200 -+++ js/src/jsapi.c 2009-05-13 15:13:32.000000000 +0200 -@@ -122,6 +122,16 @@ JS_GetPositiveInfinityValue(JSContext *c - return DOUBLE_TO_JSVAL(cx->runtime->jsPositiveInfinity); - } - -+JS_PUBLIC_API(JSObject *) -+JS_GetGlobalForObject(JSContext *cx, JSObject *obj) -+{ -+ JSObject *parent; -+ -+ while ((parent = OBJ_GET_PARENT(cx, obj)) != NULL) -+ obj = parent; -+ return obj; -+} -+ - JS_PUBLIC_API(jsval) - JS_GetEmptyStringValue(JSContext *cx) - { -diff -up mozilla/js/src/jsapi.h.old mozilla/js/src/jsapi.h ---- js/src/jsapi.h.old 2009-05-13 15:13:20.000000000 +0200 -+++ js/src/jsapi.h 2009-05-13 15:13:32.000000000 +0200 -@@ -668,6 +668,9 @@ JS_DumpNamedRoots(JSRuntime *rt, - void *data); - #endif - -+extern JS_PUBLIC_API(JSObject *) -+JS_GetGlobalForObject(JSContext *cx, JSObject *obj); -+ - /* - * Call JS_MapGCRoots to map the GC's roots table using map(rp, name, data). - * The root is pointed at by rp; if the root is unnamed, name is null; data is Index: files/patch-ff-479880 =================================================================== RCS file: files/patch-ff-479880 diff -N files/patch-ff-479880 --- files/patch-ff-479880 13 Jun 2009 07:05:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,145 +0,0 @@ -? 1.8.patch -Index: nsHttpChannel.cpp -=================================================================== -RCS file: /cvsroot/mozilla/netwerk/protocol/http/src/nsHttpChannel.cpp,v -retrieving revision 1.256.2.22 -diff -U 8 -p -p -r1.256.2.22 nsHttpChannel.cpp ---- netwerk/protocol/http/src/nsHttpChannel.cpp 20 Jul 2006 22:59:31 -0000 1.256.2.22 -+++ netwerk/protocol/http/src/nsHttpChannel.cpp 28 May 2009 20:20:06 -0000 -@@ -755,24 +755,92 @@ nsHttpChannel::CallOnStartRequest() - - // install stream converter if required - ApplyContentConversions(); - - return rv; - } - - nsresult -+nsHttpChannel::ProcessFailedSSLConnect(PRUint32 httpStatus) -+{ -+ // Failure to set up SSL proxy tunnel means one of the following: -+ // 1) Proxy wants authorization, or forbids. -+ // 2) DNS at proxy couldn't resolve target URL. -+ // 3) Proxy connection to target failed or timed out. -+ // 4) Eve noticed our proxy CONNECT, and is replying with malicious HTML. -+ // -+ // Our current architecture will parse response content with the -+ // permission of the target URL! Given #4, we must avoid rendering the -+ // body of the reply, and instead give the user a (hopefully helpful) -+ // boilerplate error page, based on just the HTTP status of the reply. -+ -+ NS_ABORT_IF_FALSE(mConnectionInfo->UsingSSL(), -+ "SSL connect failed but not using SSL?"); -+ nsresult rv; -+ switch (httpStatus) -+ { -+ case 403: // HTTP/1.1: "Forbidden" -+ case 407: // ProcessAuthentication() failed -+ case 501: // HTTP/1.1: "Not Implemented" -+ // user sees boilerplate Mozilla "Proxy Refused Connection" page. -+ rv = NS_ERROR_PROXY_CONNECTION_REFUSED; -+ break; -+ // Squid sends 404 if DNS fails (regular 404 from target is tunneled) -+ case 404: // HTTP/1.1: "Not Found" -+ // RFC 2616: "some deployed proxies are known to return 400 or 500 when -+ // DNS lookups time out." (Squid uses 500 if it runs out of sockets: so -+ // we have a conflict here). -+ case 400: // HTTP/1.1 "Bad Request" -+ case 500: // HTTP/1.1: "Internal Server Error" -+ /* User sees: "Address Not Found: Firefox can't find the server at -+ * www.foo.com." -+ */ -+ rv = NS_ERROR_UNKNOWN_HOST; -+ break; -+ case 502: // HTTP/1.1: "Bad Gateway" (invalid resp from target server) -+ // Squid returns 503 if target request fails for anything but DNS. -+ case 503: // HTTP/1.1: "Service Unavailable" -+ /* User sees: "Failed to Connect: -+ * Firefox can't establish a connection to the server at -+ * www.foo.com. Though the site seems valid, the browser -+ * was unable to establish a connection." -+ */ -+ rv = NS_ERROR_CONNECTION_REFUSED; -+ break; -+ // RFC 2616 uses 504 for both DNS and target timeout, so not clear what to -+ // do here: picking target timeout, as DNS covered by 400/404/500 -+ case 504: // HTTP/1.1: "Gateway Timeout" -+ // user sees: "Network Timeout: The server at www.foo.com -+ // is taking too long to respond." -+ rv = NS_ERROR_NET_TIMEOUT; -+ break; -+ // Confused proxy server or malicious response -+ default: -+ rv = NS_ERROR_PROXY_CONNECTION_REFUSED; -+ break; -+ } -+ LOG(("Cancelling failed SSL proxy connection [this=%x httpStatus=%u]\n", -+ this, httpStatus)); -+ Cancel(rv); -+ return rv; -+} -+ -+nsresult - nsHttpChannel::ProcessResponse() - { - nsresult rv; - PRUint32 httpStatus = mResponseHead->Status(); - - LOG(("nsHttpChannel::ProcessResponse [this=%x httpStatus=%u]\n", - this, httpStatus)); - -+ if (mTransaction->SSLConnectFailed() && httpStatus != 407) -+ return ProcessFailedSSLConnect(httpStatus); -+ - // notify "http-on-examine-response" observers - gHttpHandler->OnExamineResponse(this); - - // set cookies, if any exist; done after OnExamineResponse to allow those - // observers to modify the cookie response headers - SetCookie(mResponseHead->PeekHeader(nsHttp::Set_Cookie)); - - // handle unused username and password in url (see bug 232567) -@@ -837,16 +905,18 @@ nsHttpChannel::ProcessResponse() - rv = ProcessNormal(); - } - break; - case 401: - case 407: - rv = ProcessAuthentication(httpStatus); - if (NS_FAILED(rv)) { - LOG(("ProcessAuthentication failed [rv=%x]\n", rv)); -+ if (mTransaction->SSLConnectFailed()) -+ return ProcessFailedSSLConnect(httpStatus); - CheckForSuperfluousAuth(); - rv = ProcessNormal(); - } - break; - case 412: // Precondition failed - case 416: // Invalid range - if (mResuming) { - Cancel(NS_ERROR_ENTITY_CHANGED); -Index: nsHttpChannel.h -=================================================================== -RCS file: /cvsroot/mozilla/netwerk/protocol/http/src/nsHttpChannel.h,v -retrieving revision 1.70.4.5 -diff -U 8 -p -p -r1.70.4.5 nsHttpChannel.h ---- netwerk/protocol/http/src/nsHttpChannel.h 27 Jun 2006 20:27:29 -0000 1.70.4.5 -+++ netwerk/protocol/http/src/nsHttpChannel.h 28 May 2009 20:20:06 -0000 -@@ -155,16 +155,17 @@ private: - nsresult SetupTransaction(); - void AddCookiesToRequest(); - void ApplyContentConversions(); - nsresult CallOnStartRequest(); - nsresult ProcessResponse(); - nsresult ProcessNormal(); - nsresult ProcessNotModified(); - nsresult ProcessRedirection(PRUint32 httpStatus); -+ nsresult ProcessFailedSSLConnect(PRUint32 httpStatus); - nsresult ProcessAuthentication(PRUint32 httpStatus); - PRBool ResponseWouldVary(); - - // redirection specific methods - void HandleAsyncRedirect(); - void HandleAsyncNotModified(); - nsresult PromptTempRedirect(); - nsresult SetupReplacementChannel(nsIURI *, nsIChannel *, PRBool preserveMethod); Index: files/patch-ff-485217 =================================================================== RCS file: files/patch-ff-485217 diff -N files/patch-ff-485217 --- files/patch-ff-485217 29 Mar 2009 16:00:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,27 +0,0 @@ -Bug 485217 - Pop the eval context before returning. r+sr=peterv - -diff --git a/extensions/transformiix/source/xslt/functions/txKeyFunctionCall.cpp b/extensions/transformiix/source/xslt/functions/txKeyFunctionCall.cpp ---- extensions/transformiix/source/xslt/functions/txKeyFunctionCall.cpp -+++ extensions/transformiix/source/xslt/functions/txKeyFunctionCall.cpp -@@ -408,20 +408,19 @@ nsresult txXSLKey::testNode(const txXPat - if (key->matchPattern->matches(aNode, &aEs)) { - txSingleNodeContext evalContext(aNode, &aEs); - nsresult rv = aEs.pushEvalContext(&evalContext); - NS_ENSURE_SUCCESS(rv, rv); - - nsRefPtr exprResult; - rv = key->useExpr->evaluate(&evalContext, - getter_AddRefs(exprResult)); -+ aEs.popEvalContext(); - NS_ENSURE_SUCCESS(rv, rv); - -- aEs.popEvalContext(); -- - if (exprResult->getResultType() == txAExprResult::NODESET) { - txNodeSet* res = NS_STATIC_CAST(txNodeSet*, - NS_STATIC_CAST(txAExprResult*, - exprResult)); - PRInt32 i; - for (i = 0; i < res->size(); ++i) { - val.Truncate(); - txXPathNodeUtils::appendNodeValue(res->get(i), val); Index: files/patch-ff-485286 =================================================================== RCS file: files/patch-ff-485286 diff -N files/patch-ff-485286 --- files/patch-ff-485286 29 Mar 2009 16:00:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,40 +0,0 @@ -Bug 485286 - Allocate all of these consistently. r+sr=peterv/sicking a=ss - -diff --git a/extensions/transformiix/source/xslt/functions/txKeyFunctionCall.cpp b/extensions/transformiix/source/xslt/functions/txKeyFunctionCall.cpp ---- extensions/transformiix/source/xslt/functions/txKeyFunctionCall.cpp -+++ extensions/transformiix/source/xslt/functions/txKeyFunctionCall.cpp -@@ -401,26 +401,30 @@ nsresult txXSLKey::testNode(const txXPat - txExecutionState& aEs) - { - nsAutoString val; - txListIterator iter(&mKeys); - while (iter.hasNext()) - { - Key* key = (Key*)iter.next(); - if (key->matchPattern->matches(aNode, &aEs)) { -- txSingleNodeContext evalContext(aNode, &aEs); -- nsresult rv = aEs.pushEvalContext(&evalContext); -+ txSingleNodeContext *evalContext = -+ new txSingleNodeContext(aNode, &aEs); -+ NS_ENSURE_TRUE(evalContext, NS_ERROR_OUT_OF_MEMORY); -+ -+ nsresult rv = aEs.pushEvalContext(evalContext); - NS_ENSURE_SUCCESS(rv, rv); - - nsRefPtr exprResult; -- rv = key->useExpr->evaluate(&evalContext, -+ rv = key->useExpr->evaluate(evalContext, - getter_AddRefs(exprResult)); -- aEs.popEvalContext(); - NS_ENSURE_SUCCESS(rv, rv); - -+ delete aEs.popEvalContext(); -+ - if (exprResult->getResultType() == txAExprResult::NODESET) { - txNodeSet* res = NS_STATIC_CAST(txNodeSet*, - NS_STATIC_CAST(txAExprResult*, - exprResult)); - PRInt32 i; - for (i = 0; i < res->size(); ++i) { - val.Truncate(); - txXPathNodeUtils::appendNodeValue(res->get(i), val); Index: files/patch-ff-489131 =================================================================== RCS file: files/patch-ff-489131 diff -N files/patch-ff-489131 --- files/patch-ff-489131 13 Jun 2009 07:05:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,29 +0,0 @@ -diff -U12 -up mozilla/content/base/src/nsContentUtils.cpp.489131 mozilla/content/base/src/nsContentUtils.cpp ---- content/base/src/nsContentUtils.cpp.489131 2009-05-14 13:30:53.000000000 +0200 -+++ content/base/src/nsContentUtils.cpp 2009-05-14 13:30:53.000000000 +0200 -@@ -2310,24 +2310,25 @@ nsCxPusher::Push(nsISupports *aCurrentTa - if (mScx) { - NS_ERROR("Whaaa! No double pushing with nsCxPusher::Push()!"); - - return PR_FALSE; - } - - nsCOMPtr sgo; - nsCOMPtr content(do_QueryInterface(aCurrentTarget)); - nsCOMPtr document; - - if (content) { - document = content->GetOwnerDoc(); -+ NS_ENSURE_TRUE(document, PR_FALSE); - } - - if (!document) { - document = do_QueryInterface(aCurrentTarget); - } - - if (document) { - nsCOMPtr branch3doc = - do_QueryInterface(document); - NS_ASSERTION(branch3doc, - "Document must implement nsIDocument_MOZILLA_1_8_BRANCH3!!!"); - PRBool hasHadScriptObject = PR_TRUE; Index: files/patch-ff-491801 =================================================================== RCS file: files/patch-ff-491801 diff -N files/patch-ff-491801 --- files/patch-ff-491801 13 Jun 2009 07:05:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,91 +0,0 @@ -Index: netwerk/base/src/nsURLParsers.cpp -=================================================================== -RCS file: /cvsroot/mozilla/netwerk/base/src/nsURLParsers.cpp,v -retrieving revision 1.32 -diff -p -u -6 -r1.32 nsURLParsers.cpp ---- netwerk/base/src/nsURLParsers.cpp 24 Nov 2008 22:46:16 -0000 1.32 -+++ netwerk/base/src/nsURLParsers.cpp 8 May 2009 01:31:15 -0000 -@@ -385,12 +385,23 @@ nsBaseURLParser::ParseFileName(const cha - } - - //---------------------------------------------------------------------------- - // nsNoAuthURLParser implementation - //---------------------------------------------------------------------------- - -+NS_IMETHODIMP -+nsNoAuthURLParser::ParseAuthority(const char *auth, PRInt32 authLen, -+ PRUint32 *usernamePos, PRInt32 *usernameLen, -+ PRUint32 *passwordPos, PRInt32 *passwordLen, -+ PRUint32 *hostnamePos, PRInt32 *hostnameLen, -+ PRInt32 *port) -+{ -+ NS_NOTREACHED("Shouldn't parse auth in a NoAuthURL!"); -+ return NS_ERROR_UNEXPECTED; -+} -+ - void - nsNoAuthURLParser::ParseAfterScheme(const char *spec, PRInt32 specLen, - PRUint32 *authPos, PRInt32 *authLen, - PRUint32 *pathPos, PRInt32 *pathLen) - { - NS_PRECONDITION(specLen >= 0, "unexpected"); -@@ -416,17 +427,17 @@ nsNoAuthURLParser::ParseAfterScheme(cons - break; - } - #endif - p = (const char *) memchr(spec + 2, '/', specLen - 2); - } - if (p) { -- SET_RESULT(auth, 2, p - (spec + 2)); -+ SET_RESULT(auth, 0, -1); - SET_RESULT(path, p - spec, specLen - (p - spec)); - } - else { -- SET_RESULT(auth, 2, specLen - 2); -+ SET_RESULT(auth, 0, -1); - SET_RESULT(path, 0, -1); - } - return; - } - default: - pos = 2; -Index: netwerk/base/src/nsURLParsers.h -=================================================================== -RCS file: /cvsroot/mozilla/netwerk/base/src/nsURLParsers.h,v -retrieving revision 1.4 -diff -p -u -6 -r1.4 nsURLParsers.h ---- netwerk/base/src/nsURLParsers.h 18 Apr 2004 21:59:09 -0000 1.4 -+++ netwerk/base/src/nsURLParsers.h 8 May 2009 01:31:15 -0000 -@@ -67,25 +67,31 @@ protected: - // file:/foo/bar.txt (treated equivalently) - // file:///foo/bar.txt - // - // eg. file:////foo/bar.txt (UNC-filepath = \\foo\bar.txt) - // - // XXX except in this case: --// file://foo/bar.txt (foo is authority) -+// file://foo/bar.txt (the authority "foo" is ignored) - //---------------------------------------------------------------------------- - - class nsNoAuthURLParser : public nsBaseURLParser - { - public: - #if defined(XP_WIN) || defined(XP_OS2) - NS_IMETHOD ParseFilePath(const char *, PRInt32, - PRUint32 *, PRInt32 *, - PRUint32 *, PRInt32 *, - PRUint32 *, PRInt32 *); - #endif - -+ NS_IMETHOD ParseAuthority(const char *auth, PRInt32 authLen, -+ PRUint32 *usernamePos, PRInt32 *usernameLen, -+ PRUint32 *passwordPos, PRInt32 *passwordLen, -+ PRUint32 *hostnamePos, PRInt32 *hostnameLen, -+ PRInt32 *port); -+ - void ParseAfterScheme(const char *spec, PRInt32 specLen, - PRUint32 *authPos, PRInt32 *authLen, - PRUint32 *pathPos, PRInt32 *pathLen); - }; - - //---------------------------------------------------------------------------- Index: files/patch-js-src-Makefile.in =================================================================== RCS file: files/patch-js-src-Makefile.in diff -N files/patch-js-src-Makefile.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-js-src-Makefile.in 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,11 @@ +--- js/src/Makefile.in.orig 2009-05-11 15:21:19.000000000 +0200 ++++ js/src/Makefile.in 2009-05-11 15:21:34.000000000 +0200 +@@ -427,7 +427,7 @@ + endif # WINNT + + ifeq ($(OS_ARCH),FreeBSD) +-EXTRA_LIBS += -pthread ++EXTRA_LIBS += -pthread -lc + endif + ifeq ($(OS_ARCH),IRIX) + ifdef USE_N32 Index: files/patch-js-src-config-mkdepend_Makefile.in =================================================================== RCS file: files/patch-js-src-config-mkdepend_Makefile.in diff -N files/patch-js-src-config-mkdepend_Makefile.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-js-src-config-mkdepend_Makefile.in 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,11 @@ +--- js/src/config/mkdepend/Makefile.in.orig 2009-04-28 08:17:55.069074748 +0000 ++++ js/src/config/mkdepend/Makefile.in 2009-04-28 08:18:44.897081100 +0000 +@@ -72,7 +72,7 @@ + + include $(topsrcdir)/config/rules.mk + +-HOST_CFLAGS += -DINCLUDEDIR=\"/usr/include\" -DOBJSUFFIX=\".$(OBJ_SUFFIX)\" ++HOST_CFLAGS += -DINCLUDEDIR=\"%%LOCALBASE%%/include\" -DOBJSUFFIX=\".$(OBJ_SUFFIX)\" -I/usr/local/include + + ifdef GNU_CC + _GCCDIR = $(shell $(CC) -print-file-name=include) Index: files/patch-js-src-config_config.mk =================================================================== RCS file: files/patch-js-src-config_config.mk diff -N files/patch-js-src-config_config.mk --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-js-src-config_config.mk 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,10 @@ +--- js/src/config/config.mk.orig 2009-08-07 00:49:23.000000000 +0200 ++++ js/src/config/config.mk 2009-08-09 20:50:05.000000000 +0200 +@@ -506,6 +506,7 @@ + -I$(srcdir) \ + -I. \ + -I$(DIST)/include -I$(DIST)/include/nsprpub \ ++ -I%%LOCALBASE%%/include \ + $(if $(LIBXUL_SDK),-I$(LIBXUL_SDK)/include -I$(LIBXUL_SDK)/include/nsprpub) \ + $(OS_INCLUDES) \ + $(NULL) Index: files/patch-js-src-configure.in =================================================================== RCS file: files/patch-js-src-configure.in diff -N files/patch-js-src-configure.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-js-src-configure.in 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,13 @@ +--- js/src/configure.in.orig 2009-09-21 00:26:58.000000000 +0200 ++++ js/src/configure.in 2009-10-08 07:00:27.000000000 +0200 +@@ -2456,10 +2456,6 @@ + ENABLE_JIT=1 + NANOJIT_ARCH=ARM + ;; +-sparc*-*) +- ENABLE_JIT=1 +- NANOJIT_ARCH=Sparc +- ;; + esac + + MOZ_ARG_DISABLE_BOOL(jit, Index: files/patch-js-src-jslock.cpp =================================================================== RCS file: files/patch-js-src-jslock.cpp diff -N files/patch-js-src-jslock.cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-js-src-jslock.cpp 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,18 @@ +--- js/src/jslock.cpp.orig 2009-10-07 20:15:38.000000000 +0200 ++++ js/src/jslock.cpp 2009-10-07 21:36:14.000000000 +0200 +@@ -160,8 +160,13 @@ + unsigned int res; + + __asm__ __volatile__ ( +- "stbar\n" +- "cas [%1],%2,%3\n" ++ "membar #StoreLoad | #LoadLoad\n" ++# if defined (__sparc64__) ++ "casx [%1],%2,%3\n" ++# else ++ "cas [%1],%2,%3\n" /* 32-bit version */ ++# endif ++ "membar #StoreLoad | #LoadLoad\n" + "cmp %2,%3\n" + "be,a 1f\n" + "mov 1,%0\n" Index: files/patch-js_src_Makefile.in =================================================================== RCS file: files/patch-js_src_Makefile.in diff -N files/patch-js_src_Makefile.in --- files/patch-js_src_Makefile.in 1 Nov 2006 13:20:11 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,10 +0,0 @@ ---- js/src/Makefile.in.orig Wed Oct 18 09:23:09 2006 -+++ js/src/Makefile.in Wed Oct 18 09:27:27 2006 -@@ -244,6 +244,7 @@ - endif - - LDFLAGS += $(pathsubst -l%,$(NSPR_STATIC_PATH)/%.a,$(NSPR_LIBS)) -+LDFLAGS += -lc - - # BeOS and HP-UX do not require the extra linking of "-lm" - ifeq (,$(filter BeOS HP-UX WINNT WINCE OpenVMS,$(OS_ARCH))) Index: files/patch-js_src_jsnum.c =================================================================== RCS file: files/patch-js_src_jsnum.c diff -N files/patch-js_src_jsnum.c --- files/patch-js_src_jsnum.c 6 Nov 2006 23:26:20 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,28 +0,0 @@ ---- js/src/jsnum.c.orig Sun Nov 5 18:37:07 2006 -+++ js/src/jsnum.c Sun Nov 5 18:42:31 2006 -@@ -45,6 +45,9 @@ - #if defined(XP_WIN) || defined(XP_OS2) - #include - #endif -+#if defined(__FreeBSD__) -+#include -+#endif - #include - #include - #include -@@ -532,7 +535,15 @@ static jsdouble NaN; - - #else - -+#if defined(__FreeBSD__) && __FreeBSD_version >= 601000 -+#include -+#define FIX_FPU() (fedisableexcept(FE_ALL_EXCEPT)) -+ -+#else -+ - #define FIX_FPU() ((void)0) -+ -+#endif /* defined(__FreeBSD__) && __FreeBSD_version >= 503000 */ - - #endif - Index: files/patch-js_src_jsnum.cpp =================================================================== RCS file: files/patch-js_src_jsnum.cpp diff -N files/patch-js_src_jsnum.cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-js_src_jsnum.cpp 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,29 @@ +--- js/src/jsnum.cpp.orig 2009-10-14 18:03:30.000000000 +0200 ++++ js/src/jsnum.cpp 2009-10-15 21:49:44.000000000 +0200 +@@ -43,6 +43,9 @@ + /* + * JS number type and wrapper class. + */ ++#if defined(__FreeBSD__) ++#include ++#endif + #ifdef XP_OS2 + #define _PC_53 PC_53 + #define _MCW_EM MCW_EM +@@ -691,8 +694,16 @@ + + #else + ++#if defined(__FreeBSD__) && __FreeBSD_version >= 601000 ++#include ++#define FIX_FPU() (fedisableexcept(FE_ALL_EXCEPT)) ++ ++#else ++ + #define FIX_FPU() ((void)0) + ++#endif /* defined(__FreeBSD__) && __FreeBSD_version >= 503000 */ ++ + #endif + + JSBool Index: files/patch-js_src_liveconnect_nsISecureLiveconnect.h =================================================================== RCS file: files/patch-js_src_liveconnect_nsISecureLiveconnect.h diff -N files/patch-js_src_liveconnect_nsISecureLiveconnect.h --- files/patch-js_src_liveconnect_nsISecureLiveconnect.h 10 Oct 2007 00:15:32 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ ---- js/src/liveconnect/nsISecureLiveconnect.h.orig 2007-10-09 20:03:00.000000000 -0400 -+++ js/src/liveconnect/nsISecureLiveconnect.h 2007-10-09 20:03:50.000000000 -0400 -@@ -51,7 +51,11 @@ - #include "nsIFactory.h" - #include "jni.h" - -+#if JS_BYTES_PER_WORD == 8 -+typedef jlong jsobject; -+#else - typedef jint jsobject; -+#endif - - class nsISecureLiveconnect : public nsISupports { - public: Index: files/patch-layout_generic_Makefile.in =================================================================== RCS file: files/patch-layout_generic_Makefile.in diff -N files/patch-layout_generic_Makefile.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-layout_generic_Makefile.in 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,14 @@ +--- layout/generic/Makefile.in.orig 2009-08-07 00:49:41.000000000 +0200 ++++ layout/generic/Makefile.in 2009-08-09 20:54:53.000000000 +0200 +@@ -187,9 +187,10 @@ + -I$(srcdir)/../../content/base/src \ + -I$(srcdir)/../../content/html/content/src \ + -I$(srcdir)/../../dom/base \ +- $(MOZ_CAIRO_CFLAGS) \ + $(NULL) + ++CXXFLAGS += $(MOZ_CAIRO_CFLAGS) ++ + ifdef MOZ_ENABLE_GTK2 + CXXFLAGS += $(MOZ_GTK2_CFLAGS) + endif Index: files/patch-libm =================================================================== RCS file: files/patch-libm diff -N files/patch-libm --- files/patch-libm 10 Nov 2006 07:03:50 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,9 +0,0 @@ ---- js/Makefile.in Sun Mar 23 14:36:00 2003 -+++ js/Makefile.in Thu Aug 4 23:08:06 2005 -@@ -46,5 +46,5 @@ - # - --DIRS = src/fdlibm src -+DIRS = src - - include $(topsrcdir)/config/rules.mk Index: files/patch-media-libsydneyaudio-include-sydney_audio.h =================================================================== RCS file: files/patch-media-libsydneyaudio-include-sydney_audio.h diff -N files/patch-media-libsydneyaudio-include-sydney_audio.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-media-libsydneyaudio-include-sydney_audio.h 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,11 @@ +--- media/libsydneyaudio/include/sydney_audio.h.orgi 2009-04-10 12:24:01.000000000 +0200 ++++ media/libsydneyaudio/include/sydney_audio.h 2009-04-10 12:24:30.000000000 +0200 +@@ -73,7 +73,7 @@ + # endif + #elif defined(WIN32) + # define SA_LITTLE_ENDIAN 1 +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) || defined(__FreeBSD__) + # if defined(__BIG_ENDIAN__) + # define SA_BIG_ENDIAN 1 + # else Index: files/patch-media_liboggz_include_oggz_oggz_off_t_generated.h =================================================================== RCS file: files/patch-media_liboggz_include_oggz_oggz_off_t_generated.h diff -N files/patch-media_liboggz_include_oggz_oggz_off_t_generated.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-media_liboggz_include_oggz_oggz_off_t_generated.h 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,11 @@ +--- media/liboggz/include/oggz/oggz_off_t_generated.h.orig 2009-08-07 00:49:53.000000000 +0200 ++++ media/liboggz/include/oggz/oggz_off_t_generated.h 2009-08-09 20:57:55.000000000 +0200 +@@ -59,7 +59,7 @@ + + #include + +-#if defined(__APPLE__) || defined(SOLARIS) || defined(OS2) ++#if defined(__APPLE__) || defined(SOLARIS) || defined(OS2) || defined (__FreeBSD__) + typedef off_t oggz_off_t; + #else + typedef loff_t oggz_off_t; Index: files/patch-modules_libpref_src_init_all.js =================================================================== RCS file: files/patch-modules_libpref_src_init_all.js diff -N files/patch-modules_libpref_src_init_all.js --- files/patch-modules_libpref_src_init_all.js 1 May 2006 22:47:05 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,53 +0,0 @@ ---- modules/libpref/src/init/all.js.orig Mon Feb 13 22:58:15 2006 -+++ modules/libpref/src/init/all.js Tue May 2 00:32:55 2006 -@@ -1883,33 +1883,33 @@ - - // th - --pref("font.name.serif.tr", "Times"); --pref("font.name.sans-serif.tr", "Helvetica"); --pref("font.name.monospace.tr", "Courier"); -+pref("font.name.serif.tr", "serif"); -+pref("font.name.sans-serif.tr", "sans-serif"); -+pref("font.name.monospace.tr", "monospace"); - - pref("font.name.serif.x-baltic", "serif"); - pref("font.name.sans-serif.x-baltic", "sans-serif"); - pref("font.name.monospace.x-baltic", "monospace"); - --pref("font.name.serif.x-central-euro", "Times"); --pref("font.name.sans-serif.x-central-euro", "Helvetica"); --pref("font.name.monospace.x-central-euro", "Courier"); -+pref("font.name.serif.x-central-euro", "serif"); -+pref("font.name.sans-serif.x-central-euro", "sans-serif"); -+pref("font.name.monospace.x-central-euro", "monospace"); - - pref("font.name.serif.x-cyrillic", "serif"); - pref("font.name.sans-serif.x-cyrillic", "sans-serif"); - pref("font.name.monospace.x-cyrillic", "monospace"); - --pref("font.name.serif.x-unicode", "Times"); --pref("font.name.sans-serif.x-unicode", "Helvetica"); --pref("font.name.monospace.x-unicode", "Courier"); -- --pref("font.name.serif.x-user-def", "Times"); --pref("font.name.sans-serif.x-user-def", "Helvetica"); --pref("font.name.monospace.x-user-def", "Courier"); -- --pref("font.name.serif.x-western", "Times"); --pref("font.name.sans-serif.x-western", "Helvetica"); --pref("font.name.monospace.x-western", "Courier"); -+pref("font.name.serif.x-unicode", "serif"); -+pref("font.name.sans-serif.x-unicode", "sans-serif"); -+pref("font.name.monospace.x-unicode", "monospace"); -+ -+pref("font.name.serif.x-user-def", "serif"); -+pref("font.name.sans-serif.x-user-def", "sans-serif"); -+pref("font.name.monospace.x-user-def", "monospace"); -+ -+pref("font.name.serif.x-western", "serif"); -+pref("font.name.sans-serif.x-western", "sans-serif"); -+pref("font.name.monospace.x-western", "monospace"); - - pref("font.name.serif.zh-CN", "serif"); - pref("font.name.sans-serif.zh-CN", "sans-serif"); Index: files/patch-security-coreconf-FreeBSD.mk =================================================================== RCS file: /home/pcvs/ports/www/firefox/files/patch-security-coreconf-FreeBSD.mk,v retrieving revision 1.6 diff -u -u -r1.6 patch-security-coreconf-FreeBSD.mk --- files/patch-security-coreconf-FreeBSD.mk 10 Nov 2006 07:03:50 -0000 1.6 +++ files/patch-security-coreconf-FreeBSD.mk 3 Feb 2010 23:26:05 -0000 @@ -1,19 +1,31 @@ ---- security/coreconf/FreeBSD.mk.orig Mon Sep 25 18:26:23 2006 -+++ security/coreconf/FreeBSD.mk Mon Sep 25 18:27:03 2006 -@@ -45,8 +45,12 @@ +--- security/coreconf/FreeBSD.mk.orig 2009-11-09 01:34:19.000000000 +0100 ++++ security/coreconf/FreeBSD.mk 2009-11-11 18:15:55.000000000 +0100 +@@ -45,8 +45,24 @@ ifeq ($(OS_TEST),alpha) CPU_ARCH = alpha else +ifeq ($(OS_TEST),amd64) +CPU_ARCH = amd64 ++else ++ifeq ($(OS_TEST),ia64) ++CPU_ARCH = ia64 ++else ++ifeq ($(OS_TEST),powerpc) ++CPU_ARCH = powerpc ++else ++ifeq ($(OS_TEST),sparc64) ++CPU_ARCH = sparc64 +else CPU_ARCH = x86 endif +endif ++endif ++endif ++endif - OS_CFLAGS = $(DSO_CFLAGS) -ansi -Wall -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK + OS_CFLAGS = $(DSO_CFLAGS) -ansi -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK -@@ -73,7 +77,7 @@ +@@ -73,7 +89,7 @@ DLL_SUFFIX = so.1.0 endif @@ -22,3 +34,9 @@ ifdef MAPFILE MKSHLIB += -Wl,--version-script,$(MAPFILE) endif +@@ -82,4 +98,4 @@ + + G++INCLUDES = -I/usr/include/g++ + +-INCLUDES += -I/usr/X11R6/include ++#INCLUDES += -I/usr/local/include Index: files/patch-sysnss =================================================================== RCS file: files/patch-sysnss diff -N files/patch-sysnss --- files/patch-sysnss 17 Jul 2008 20:12:26 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,182 +0,0 @@ ---- Makefile.in Tue Sep 14 16:59:40 2004 -+++ Makefile.in Tue Aug 2 08:26:55 2005 -@@ -102,6 +102,4 @@ - # tier 1 - 3rd party individual libraries - # --tier_1_dirs += dbm -- - ifndef MOZ_NATIVE_JPEG - tier_1_dirs += jpeg ---- security/manager/ssl/src/Makefile.in.orig Mon Aug 14 19:22:52 2006 -+++ security/manager/ssl/src/Makefile.in Thu Aug 31 15:17:20 2006 -@@ -124,19 +124,19 @@ - pipboot \ - $(NULL) - --EXTRA_DEPS = $(NSS_DEP_LIBS) - - DEFINES += -DNSS_ENABLE_ECC - - # Use local includes because they are inserted before INCLUDES - # so that Mozilla's nss.h is used, not glibc's --LOCAL_INCLUDES += $(NSS_CFLAGS) -+LOCAL_INCLUDES += -I%%LOCALBASE%%/include/nss/nss - - EXTRA_DSO_LDOPTS += \ - $(MOZ_UNICHARUTIL_LIBS) \ - $(MOZ_COMPONENT_LIBS) \ - $(MOZ_JS_LIBS) \ - $(NSS_LIBS) \ -+ $(LOCAL_INCLUDES) \ - $(NULL) - - include $(topsrcdir)/config/rules.mk ---- security/manager/Makefile.in.orig 2008-05-23 19:45:26.000000000 -0400 -+++ security/manager/Makefile.in 2008-07-17 14:59:30.000000000 -0400 -@@ -54,22 +54,13 @@ PACKAGE_VARS += \ - SSL3_LIB \ - SOFTOKEN3_LIB \ - SOFTOKEN3_CHK \ -- LOADABLE_ROOT_MODULE \ - HAVE_FREEBL_LIBS \ - HAVE_FREEBL_LIBS_32 \ - HAVE_FREEBL_LIBS_32INT64 \ - HAVE_FREEBL_LIBS_64 \ - $(NULL) -- --LOADABLE_ROOT_MODULE = $(DLL_PREFIX)nssckbi$(DLL_SUFFIX) - endif - --NSS3_LIB = $(DLL_PREFIX)nss3$(DLL_SUFFIX) --SMIME3_LIB = $(DLL_PREFIX)smime3$(DLL_SUFFIX) --SSL3_LIB = $(DLL_PREFIX)ssl3$(DLL_SUFFIX) --SOFTOKEN3_LIB = $(DLL_PREFIX)softokn3$(DLL_SUFFIX) --SOFTOKEN3_CHK = $(DLL_PREFIX)softokn3.chk -- - # Default - HAVE_FREEBL_LIBS = 1 - -@@ -218,11 +209,6 @@ export:: .nss.cleaned - .nss.cleaned: .nss.checkout - ifndef MOZ_NATIVE_NSS - $(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean -- $(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean --ifndef SKIP_CHK -- $(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean -- $(MAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean --endif - touch $@ - endif - -@@ -249,55 +235,6 @@ else - cd $(DIST)/lib; cp -f $(LIB_PREFIX)mozdbm_s.$(LIB_SUFFIX) $(LIB_PREFIX)dbm.$(LIB_SUFFIX); $(RANLIB) $(LIB_PREFIX)dbm.$(LIB_SUFFIX) - endif - ifndef MOZ_NATIVE_NSS -- $(MAKE) -C $(topsrcdir)/security/nss/lib/util $(DEFAULT_GMAKE_FLAGS) clean -- $(MAKE) -C $(topsrcdir)/security/nss-fips/lib $(DEFAULT_GMAKE_FLAGS) export -- $(MAKE) -C $(topsrcdir)/security/nss-fips/lib/util $(DEFAULT_GMAKE_FLAGS) libs -- $(MAKE) -C $(topsrcdir)/security/nss-fips/lib/freebl $(DEFAULT_GMAKE_FLAGS) libs -- $(MAKE) -C $(topsrcdir)/security/nss-fips/lib/softoken $(DEFAULT_GMAKE_FLAGS) libs -- $(MAKE) -C $(topsrcdir)/security/nss-fips/lib/util $(DEFAULT_GMAKE_FLAGS) clean -- # In NSS 3.11.8-3.11.9, lib/ssl/derive.c includes cmd/lib/secutil.h. -- $(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) export -- $(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) DIRS="util base dev pki pki1 certdb certhigh pk11wrap cryptohi nss ssl pkcs12 pkcs7 smime crmf jar ckfw ckfw/builtins" --ifndef SKIP_CHK -- $(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) -- $(MAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) --endif -- $(INSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DIST)/bin --ifndef SKIP_CHK -- $(INSTALL) -m 644 $(DIST)/lib/$(SOFTOKEN3_CHK) $(DIST)/bin --endif -- $(INSTALL) -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DIST)/bin -- $(INSTALL) -m 755 $(DIST)/lib/$(NSS3_LIB) $(DIST)/bin -- $(INSTALL) -m 755 $(DIST)/lib/$(SSL3_LIB) $(DIST)/bin -- $(INSTALL) -m 755 $(DIST)/lib/$(SMIME3_LIB) $(DIST)/bin --ifdef HAVE_FREEBL_LIBS --ifndef SKIP_CHK -- $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_CHK) $(DIST)/bin --endif -- $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_LIB) $(DIST)/bin --endif --ifdef HAVE_FREEBL_LIBS_32 --ifndef SKIP_CHK -- $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_32INT_CHK) $(DIST)/bin -- $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_32FPU_CHK) $(DIST)/bin --endif -- $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT_LIB) $(DIST)/bin -- $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32FPU_LIB) $(DIST)/bin --endif --ifdef HAVE_FREEBL_LIBS_32INT64 --ifndef SKIP_CHK -- $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_32INT64_CHK) $(DIST)/bin --endif -- $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT64_LIB) $(DIST)/bin --endif --ifdef HAVE_FREEBL_LIBS_64 --ifndef SKIP_CHK -- $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_64INT_CHK) $(DIST)/bin -- $(INSTALL) -m 644 $(DIST)/lib/$(FREEBL_64FPU_CHK) $(DIST)/bin --endif -- $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_64INT_LIB) $(DIST)/bin -- $(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_64FPU_LIB) $(DIST)/bin --endif - endif - $(MAKE) -C boot $@ - $(MAKE) -C ssl $@ -@@ -308,42 +245,6 @@ endif - - install:: - ifndef MOZ_NATIVE_NSS -- $(SYSINSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DESTDIR)$(mozappdir) --ifndef SKIP_CHK -- $(SYSINSTALL) -m 644 $(DIST)/lib/$(SOFTOKEN3_CHK) $(DESTDIR)$(mozappdir) --endif -- $(SYSINSTALL) -m 755 $(DIST)/lib/$(SOFTOKEN3_LIB) $(DESTDIR)$(mozappdir) -- $(SYSINSTALL) -m 755 $(DIST)/lib/$(NSS3_LIB) $(DESTDIR)$(mozappdir) -- $(SYSINSTALL) -m 755 $(DIST)/lib/$(SSL3_LIB) $(DESTDIR)$(mozappdir) -- $(SYSINSTALL) -m 755 $(DIST)/lib/$(SMIME3_LIB) $(DESTDIR)$(mozappdir) --ifdef HAVE_FREEBL_LIBS --ifndef SKIP_CHK -- $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_CHK) $(DESTDIR)$(mozappdir) --endif -- $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_LIB) $(DESTDIR)$(mozappdir) --endif --ifdef HAVE_FREEBL_LIBS_32 --ifndef SKIP_CHK -- $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_32INT_CHK) $(DESTDIR)$(mozappdir) -- $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_32FPU_CHK) $(DESTDIR)$(mozappdir) --endif -- $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT_LIB) $(DESTDIR)$(mozappdir) -- $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32FPU_LIB) $(DESTDIR)$(mozappdir) --endif --ifdef HAVE_FREEBL_LIBS_32INT64 --ifndef SKIP_CHK -- $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_32INT64_CHK) $(DESTDIR)$(mozappdir) --endif -- $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_32INT64_LIB) $(DESTDIR)$(mozappdir) --endif --ifdef HAVE_FREEBL_LIBS_64 --ifndef SKIP_CHK -- $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_64INT_CHK) $(DESTDIR)$(mozappdir) -- $(SYSINSTALL) -m 644 $(DIST)/lib/$(FREEBL_64FPU_CHK) $(DESTDIR)$(mozappdir) --endif -- $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_64INT_LIB) $(DESTDIR)$(mozappdir) -- $(SYSINSTALL) -m 755 $(DIST)/lib/$(FREEBL_64FPU_LIB) $(DESTDIR)$(mozappdir) --endif - endif - $(MAKE) -C boot $@ - $(MAKE) -C ssl $@ -@@ -360,12 +261,6 @@ ifdef MOZ_XUL - $(MAKE) -C pki $@ - endif - ifndef MOZ_NATIVE_NSS -- $(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean -- $(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean --ifndef SKIP_CHK -- $(MAKE) -C $(topsrcdir)/security/nss/cmd/lib $(DEFAULT_GMAKE_FLAGS) clean -- $(MAKE) -C $(topsrcdir)/security/nss/cmd/shlibsign $(DEFAULT_GMAKE_FLAGS) clean --endif - endif - - echo-requires-recursive:: Index: files/patch-toolkit_xre_Makefile.in =================================================================== RCS file: files/patch-toolkit_xre_Makefile.in diff -N files/patch-toolkit_xre_Makefile.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-toolkit_xre_Makefile.in 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,8 @@ +--- toolkit/xre/Makefile.in.orig 2007-09-10 10:31:53.000000000 -0400 ++++ toolkit/xre/Makefile.in 2007-09-10 10:35:00.000000000 -0400 +@@ -263,5 +263,3 @@ + libs:: platform.ini + $(INSTALL) $^ $(DIST)/bin + +-install:: +- $(INSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir) Index: files/patch-toolkit_xre_nsXREDirProvider.cpp =================================================================== RCS file: files/patch-toolkit_xre_nsXREDirProvider.cpp diff -N files/patch-toolkit_xre_nsXREDirProvider.cpp --- files/patch-toolkit_xre_nsXREDirProvider.cpp 19 Feb 2006 22:23:03 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,19 +0,0 @@ ---- toolkit/xre/nsXREDirProvider.cpp.orig Tue Oct 4 11:46:26 2005 -+++ toolkit/xre/nsXREDirProvider.cpp Sun Feb 5 23:54:31 2006 -@@ -820,6 +820,7 @@ - - char* appNameFolder = nsnull; - char profileFolderName[MAXPATHLEN] = "."; -+ char temp[MAXPATHLEN]; - - // Offset 1 for the outermost folder to make it hidden (i.e. using the ".") - char* writing = profileFolderName + 1; -@@ -829,7 +830,6 @@ - rv = localDir->AppendNative(nsDependentCString(profileFolderName)); - NS_ENSURE_SUCCESS(rv, rv); - -- char temp[MAXPATHLEN]; - GetProfileFolderName(temp, gAppData->name); - appNameFolder = temp; - } - Index: files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp =================================================================== RCS file: files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp diff -N files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp --- files/patch-uriloader_exthandler_unix_nsGNOMERegistry.cpp 25 Feb 2005 07:51:58 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,29 +0,0 @@ ---- uriloader/exthandler/unix/nsGNOMERegistry.cpp.orig Fri Dec 24 04:30:00 2004 -+++ uriloader/exthandler/unix/nsGNOMERegistry.cpp Fri Dec 24 04:34:05 2004 -@@ -143,7 +143,7 @@ - PR_END_MACRO - - // Attempt to open libgconf -- gconfLib = LoadVersionedLibrary("gconf-2", ".4"); -+ gconfLib = PR_LoadLibrary("libgconf-2.so"); - ENSURE_LIB(gconfLib); - - GET_LIB_FUNCTION(gconf, gconf_client_get_default); -@@ -151,7 +151,7 @@ - GET_LIB_FUNCTION(gconf, gconf_client_get_bool); - - // Attempt to open libgnome -- gnomeLib = LoadVersionedLibrary("gnome-2", ".0"); -+ gnomeLib = PR_LoadLibrary("libgnome-2.so"); - ENSURE_LIB(gnomeLib); - - GET_LIB_FUNCTION(gnome, gnome_url_show); -@@ -160,7 +160,7 @@ - GET_LIB_FUNCTION(gnome, gnome_program_get); - - // Attempt to open libgnomevfs -- vfsLib = LoadVersionedLibrary("gnomevfs-2", ".0"); -+ vfsLib = PR_LoadLibrary("libgnomevfs-2.so"); - ENSURE_LIB(vfsLib); - - GET_LIB_FUNCTION(vfs, gnome_vfs_mime_type_from_name); Index: files/patch-xpcom-reflect-xptcall-src-md-unix-Makefile.in =================================================================== RCS file: files/patch-xpcom-reflect-xptcall-src-md-unix-Makefile.in diff -N files/patch-xpcom-reflect-xptcall-src-md-unix-Makefile.in --- files/patch-xpcom-reflect-xptcall-src-md-unix-Makefile.in 2 Feb 2006 13:16:54 -0000 1.7 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,54 +0,0 @@ ---- xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig Thu Aug 14 21:00:23 2003 -+++ xpcom/reflect/xptcall/src/md/unix/Makefile.in Sun Feb 1 15:06:40 2004 -@@ -49,6 +49,9 @@ - ifeq (86,$(findstring 86,$(OS_TEST))) - CPPSRCS := xptcinvoke_unixish_x86.cpp xptcstubs_unixish_x86.cpp - endif -+ifeq (amd64,$(OS_TEST)) -+CPPSRCS := xptcinvoke_x86_64_linux.cpp xptcstubs_x86_64_linux.cpp -+endif - endif - # - # New code for Linux, et. al., with gcc -@@ -60,7 +63,7 @@ - endif - endif - # IA64 Linux --ifneq (,$(filter Linux,$(OS_ARCH))) -+ifneq (,$(filter Linux FreeBSD,$(OS_ARCH))) - ifneq (,$(findstring ia64,$(OS_TEST))) - CPPSRCS := xptcinvoke_ipf64.cpp xptcstubs_ipf64.cpp - ASFILES := xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s -@@ -106,9 +109,15 @@ - ASFILES := xptcinvoke_asm_osf1_alpha.s xptcstubs_asm_osf1_alpha.s - endif - # -+# FreeBSD/Alpha -+# -+ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDalpha) -+CPPSRCS := xptcinvoke_freebsd_alpha.cpp xptcstubs_freebsd_alpha.cpp -+endif -+# - # Linux/Alpha - # --ifneq (,$(filter Linuxalpha FreeBSDalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST))) -+ifneq (,$(filter Linuxalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST))) - CPPSRCS := xptcinvoke_linux_alpha.cpp xptcstubs_linux_alpha.cpp - endif - # -@@ -294,6 +303,15 @@ - ifeq ($(OS_ARCH)$(OS_TEST),NetBSDsparc) - CPPSRCS := xptcinvoke_sparc_netbsd.cpp xptcstubs_sparc_netbsd.cpp - ASFILES := xptcinvoke_asm_sparc_netbsd.s xptcstubs_asm_sparc_netbsd.s -+endif -+# -+# FreeBSD/SPARC64 -+# -+ifeq ($(OS_ARCH),FreeBSD) -+ifneq (,$(findstring sparc,$(OS_TEST))) -+CPPSRCS := xptcinvoke_sparc64_freebsd.cpp xptcstubs_sparc64_freebsd.cpp -+ASFILES := xptcinvoke_asm_sparc64_freebsd.s xptcstubs_asm_sparcv9_solaris.s -+endif - endif - # - # Solaris/SPARC Index: files/patch-xpcom-reflect-xptcall-src-xptcprivate.h =================================================================== RCS file: files/patch-xpcom-reflect-xptcall-src-xptcprivate.h diff -N files/patch-xpcom-reflect-xptcall-src-xptcprivate.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-xpcom-reflect-xptcall-src-xptcprivate.h 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,20 @@ +--- xpcom/reflect/xptcall/src/xptcprivate.h.orig 2009-11-09 21:43:49.000000000 -0800 ++++ xpcom/reflect/xptcall/src/xptcprivate.h 2009-11-09 21:44:05.000000000 -0800 +@@ -45,7 +45,7 @@ + + class xptiInterfaceEntry; + +-#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__)) ++#if !defined(__ia64) + #define STUB_ENTRY(n) NS_IMETHOD Stub##n() = 0; + #else + #define STUB_ENTRY(n) NS_IMETHOD Stub##n(PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64) = 0; +@@ -62,7 +62,7 @@ + #undef STUB_ENTRY + #undef SENTINEL_ENTRY + +-#if !defined(__ia64) || (!defined(__hpux) && !defined(__linux__)) ++#if !defined(__ia64) + #define STUB_ENTRY(n) NS_IMETHOD Stub##n(); + #else + #define STUB_ENTRY(n) NS_IMETHOD Stub##n(PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64,PRUint64); Index: files/patch-xpcom-reflect-xptinfo-src-xptiInterfaceInfoManager.cpp =================================================================== RCS file: files/patch-xpcom-reflect-xptinfo-src-xptiInterfaceInfoManager.cpp diff -N files/patch-xpcom-reflect-xptinfo-src-xptiInterfaceInfoManager.cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-xpcom-reflect-xptinfo-src-xptiInterfaceInfoManager.cpp 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,20 @@ +--- xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp.orig ++++ xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp +@@ -633,10 +633,17 @@ IndexOfDirectoryOfFile(nsISupportsArray* + aSearchPath->QueryElementAt(i, NS_GET_IID(nsIFile), + getter_AddRefs(current)); + NS_ASSERTION(current, "broken search path! bad element"); ++#if 0 ++ // XXX #if 0'd because this breaks ++ // xptiInterfaceInfoManager::DoFullValidationMergeFromFileList() ++ // causing ff failing to start when there are symlinks in .xpt ++ // file paths, like those from addons when /home is a symlink. ++ + // nsIFile::Equals basically compares path strings so normalize + // before the comparison. + parent->Normalize(); + current->Normalize(); ++#endif + PRBool same; + if (NS_SUCCEEDED(parent->Equals(current, &same)) && same) + return (int) i; Index: files/patch-xpcom_reflect_xptcall_src_md_unix_Makefile.in =================================================================== RCS file: files/patch-xpcom_reflect_xptcall_src_md_unix_Makefile.in diff -N files/patch-xpcom_reflect_xptcall_src_md_unix_Makefile.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-xpcom_reflect_xptcall_src_md_unix_Makefile.in 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,74 @@ +--- xpcom/reflect/xptcall/src/md/unix/Makefile.in.orig 2009-09-16 04:41:25.000000000 +0200 ++++ xpcom/reflect/xptcall/src/md/unix/Makefile.in 2009-10-03 21:30:21.000000000 +0200 +@@ -73,6 +73,9 @@ + DEFINES += -DKEEP_STACK_16_BYTE_ALIGNED + CPPSRCS := xptcinvoke_unixish_x86.cpp xptcstubs_unixish_x86.cpp + endif ++ifeq (x86_64,$(OS_TEST)) ++CPPSRCS := xptcinvoke_x86_64_linux.cpp xptcstubs_x86_64_linux.cpp ++endif + endif + endif + +@@ -96,7 +99,7 @@ + endif + endif + # IA64 Linux +-ifneq (,$(filter Linux,$(OS_ARCH))) ++ifneq (,$(filter Linux FreeBSD,$(OS_ARCH))) + ifneq (,$(findstring ia64,$(OS_TEST))) + CPPSRCS := xptcinvoke_ipf64.cpp xptcstubs_ipf64.cpp + ASFILES := xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s +@@ -111,8 +114,8 @@ + # + # FreeBSD/amd64 + # +-ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDx86_64) +-CPPSRCS := xptcinvoke_amd64_linux.cpp xptcstubs_amd64_linux.cpp ++ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDamd64) ++CPPSRCS := xptcinvoke_amd64_openbsd.cpp xptcstubs_amd64_openbsd.cpp + endif + # + # BeOS/Intel (uses the same unixish_x86 code) +@@ -165,9 +168,15 @@ + ASFILES := xptcinvoke_asm_osf1_alpha.s xptcstubs_asm_osf1_alpha.s + endif + # ++# FreeBSD/Alpha ++# ++ifeq ($(OS_ARCH)$(OS_TEST),FreeBSDalpha) ++CPPSRCS := xptcinvoke_freebsd_alpha.cpp xptcstubs_freebsd_alpha.cpp ++endif ++# + # Linux/Alpha + # +-ifneq (,$(filter Linuxalpha FreeBSDalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST))) ++ifneq (,$(filter Linuxalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST))) + CPPSRCS := xptcinvoke_linux_alpha.cpp xptcstubs_linux_alpha.cpp + endif + # +@@ -322,7 +331,7 @@ + # + # Linux/PPC + # +-ifeq ($(OS_ARCH)$(OS_TEST),Linuxpowerpc) ++ifneq (,$(filter Linuxpowerpc FreeBSDpowerpc,$(OS_ARCH)$(OS_TEST))) + CPPSRCS := xptcinvoke_ppc_linux.cpp xptcstubs_ppc_linux.cpp + ASFILES := xptcinvoke_asm_ppc_linux.s xptcstubs_asm_ppc_linux.s + AS := $(CC) -c -x assembler-with-cpp +@@ -400,6 +409,15 @@ + ASFILES := xptcinvoke_asm_sparc_netbsd.s xptcstubs_asm_sparc_netbsd.s + endif + # ++# FreeBSD/SPARC64 ++# ++ifeq ($(OS_ARCH),FreeBSD) ++ifneq (,$(findstring sparc,$(OS_TEST))) ++CPPSRCS := xptcinvoke_sparc64_openbsd.cpp xptcstubs_sparc64_openbsd.cpp ++ASFILES := xptcinvoke_asm_sparc64_openbsd.s xptcstubs_asm_sparc64_openbsd.s ++endif ++endif ++# + # OpenBSD/SPARC + # + ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDsparc) Index: files/patch-xptcall-alpha =================================================================== RCS file: files/patch-xptcall-alpha diff -N files/patch-xptcall-alpha --- files/patch-xptcall-alpha 2 Feb 2006 13:16:54 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,459 +0,0 @@ ---- xpcom/reflect/xptcall/src/md/unix/xptcinvoke_freebsd_alpha.cpp.orig Tue May 27 01:37:25 2003 -+++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_freebsd_alpha.cpp Tue May 27 01:37:00 2003 -@@ -0,0 +1,184 @@ -+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* ***** BEGIN LICENSE BLOCK ***** -+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1 -+ * -+ * The contents of this file are subject to the Netscape 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/NPL/ -+ * -+ * 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 -+ * Netscape Communications Corporation. -+ * Portions created by the Initial Developer are Copyright (C) 1998 -+ * 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 NPL, 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 NPL, the GPL or the LGPL. -+ * -+ * ***** END LICENSE BLOCK ***** */ -+ -+/* Platform specific code to invoke XPCOM methods on native objects */ -+ -+/* contributed by Glen Nakamura */ -+ -+#include "xptcprivate.h" -+ -+/* Prototype specifies unmangled function name and disables unused warning */ -+static void -+invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s) -+__asm__("invoke_copy_to_stack") __attribute__((unused)); -+ -+static void -+invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s) -+{ -+ const PRUint8 NUM_ARG_REGS = 6-1; // -1 for "this" pointer -+ -+ for(PRUint32 i = 0; i < paramCount; i++, d++, s++) -+ { -+ if(s->IsPtrData()) -+ { -+ *d = (PRUint64)s->ptr; -+ continue; -+ } -+ switch(s->type) -+ { -+ case nsXPTType::T_I8 : *d = (PRUint64)s->val.i8; break; -+ case nsXPTType::T_I16 : *d = (PRUint64)s->val.i16; break; -+ case nsXPTType::T_I32 : *d = (PRUint64)s->val.i32; break; -+ case nsXPTType::T_I64 : *d = (PRUint64)s->val.i64; break; -+ case nsXPTType::T_U8 : *d = (PRUint64)s->val.u8; break; -+ case nsXPTType::T_U16 : *d = (PRUint64)s->val.u16; break; -+ case nsXPTType::T_U32 : *d = (PRUint64)s->val.u32; break; -+ case nsXPTType::T_U64 : *d = (PRUint64)s->val.u64; break; -+ case nsXPTType::T_FLOAT : -+ if(i < NUM_ARG_REGS) -+ { -+ // convert floats to doubles if they are to be passed -+ // via registers so we can just deal with doubles later -+ union { PRUint64 u64; double d; } t; -+ t.d = (double)s->val.f; -+ *d = t.u64; -+ } -+ else -+ // otherwise copy to stack normally -+ *d = (PRUint64)s->val.u32; -+ break; -+ case nsXPTType::T_DOUBLE : *d = (PRUint64)s->val.u64; break; -+ case nsXPTType::T_BOOL : *d = (PRUint64)s->val.b; break; -+ case nsXPTType::T_CHAR : *d = (PRUint64)s->val.c; break; -+ case nsXPTType::T_WCHAR : *d = (PRUint64)s->val.wc; break; -+ default: -+ // all the others are plain pointer types -+ *d = (PRUint64)s->val.p; -+ break; -+ } -+ } -+} -+ -+/* -+ * XPTC_PUBLIC_API(nsresult) -+ * XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, -+ * PRUint32 paramCount, nsXPTCVariant* params, void* vt) -+ */ -+__asm__( -+ "#### XPTC_InvokeByIndex ####\n" -+".text\n\t" -+ ".align 5\n\t" -+ ".globl XPTC_InvokeByIndex\n\t" -+ ".ent XPTC_InvokeByIndex\n" -+"XPTC_InvokeByIndex:\n\t" -+ ".frame $15,32,$26,0\n\t" -+ ".mask 0x4008000,-32\n\t" -+ "ldgp $29,0($27)\n" -+"$XPTC_InvokeByIndex..ng:\n\t" -+ "subq $30,32,$30\n\t" -+ "stq $26,0($30)\n\t" -+ "stq $15,8($30)\n\t" -+ "bis $30,$30,$15\n\t" -+ ".prologue 1\n\t" -+ -+ /* -+ * Allocate enough stack space to hold the greater of 6 or "paramCount"+1 -+ * parameters. (+1 for "this" pointer) Room for at least 6 parameters -+ * is required for storage of those passed via registers. -+ */ -+ -+ "bis $31,5,$2\n\t" /* count = MAX(5, "paramCount") */ -+ "cmplt $2,$18,$1\n\t" -+ "cmovne $1,$18,$2\n\t" -+ "s8addq $2,16,$1\n\t" /* room for count+1 params (8 bytes each) */ -+ "bic $1,15,$1\n\t" /* stack space is rounded up to 0 % 16 */ -+ "subq $30,$1,$30\n\t" -+ -+ "stq $16,0($30)\n\t" /* save "that" (as "this" pointer) */ -+ "stq $17,16($15)\n\t" /* save "methodIndex" */ -+ -+ "addq $30,8,$16\n\t" /* pass stack pointer */ -+ "bis $18,$18,$17\n\t" /* pass "paramCount" */ -+ "bis $19,$19,$18\n\t" /* pass "params" */ -+ "bsr $26,$invoke_copy_to_stack..ng\n\t" /* call invoke_copy_to_stack */ -+ -+ /* -+ * Copy the first 6 parameters to registers and remove from stack frame. -+ * Both the integer and floating point registers are set for each parameter -+ * except the first which is the "this" pointer. (integer only) -+ * The floating point registers are all set as doubles since the -+ * invoke_copy_to_stack function should have converted the floats. -+ */ -+ "ldq $16,0($30)\n\t" /* integer registers */ -+ "ldq $17,8($30)\n\t" -+ "ldq $18,16($30)\n\t" -+ "ldq $19,24($30)\n\t" -+ "ldq $20,32($30)\n\t" -+ "ldq $21,40($30)\n\t" -+ "ldt $f17,8($30)\n\t" /* floating point registers */ -+ "ldt $f18,16($30)\n\t" -+ "ldt $f19,24($30)\n\t" -+ "ldt $f20,32($30)\n\t" -+ "ldt $f21,40($30)\n\t" -+ -+ "addq $30,48,$30\n\t" /* remove params from stack */ -+ -+ /* -+ * Call the virtual function with the constructed stack frame. -+ */ -+ "bis $16,$16,$1\n\t" /* load "this" */ -+ "ldq $2,16($15)\n\t" /* load "methodIndex" */ -+ "ldq $1,0($1)\n\t" /* load vtable */ -+#if 0 -+ "s8addq $2,16,$2\n\t" /* vtable index = "methodIndex" * 8 + 16 */ -+#else -+ "mulq $2, 8, $2\n\t" -+ "addq $2, 0, $2\n\t" /* vtable index = "methodIndex" * 16 + 24 */ -+#endif -+ "addq $1,$2,$1\n\t" -+ "ldq $27,0($1)\n\t" /* load address of function */ -+ "jsr $26,($27),0\n\t" /* call virtual function */ -+ "ldgp $29,0($26)\n\t" -+ -+ "bis $15,$15,$30\n\t" -+ "ldq $26,0($30)\n\t" -+ "ldq $15,8($30)\n\t" -+ "addq $30,32,$30\n\t" -+ "ret $31,($26),1\n\t" -+ ".end XPTC_InvokeByIndex" -+ ); -+ ---- xpcom/reflect/xptcall/src/md/unix/xptcstubs_freebsd_alpha.cpp.orig Tue May 27 01:37:30 2003 -+++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_freebsd_alpha.cpp Tue May 27 01:37:04 2003 -@@ -0,0 +1,269 @@ -+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* ***** BEGIN LICENSE BLOCK ***** -+ * Version: NPL 1.1/GPL 2.0/LGPL 2.1 -+ * -+ * The contents of this file are subject to the Netscape 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/NPL/ -+ * -+ * 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 -+ * Netscape Communications Corporation. -+ * Portions created by the Initial Developer are Copyright (C) 1999 -+ * 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 NPL, 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 NPL, the GPL or the LGPL. -+ * -+ * ***** END LICENSE BLOCK ***** */ -+ -+/* Implement shared vtbl methods. */ -+ -+/* contributed by Glen Nakamura */ -+ -+#include -+#include -+#include "xptcprivate.h" -+ -+/* Prototype specifies unmangled function name and disables unused warning */ -+static nsresult -+PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint64* args) -+__asm__("PrepareAndDispatch") __attribute__((unused)); -+ -+static nsresult -+PrepareAndDispatch(nsXPTCStubBase* self, uint32 methodIndex, PRUint64* args) -+{ -+ const PRUint8 PARAM_BUFFER_COUNT = 16; -+ const PRUint8 NUM_ARG_REGS = 6-1; // -1 for "this" pointer -+ -+ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; -+ nsXPTCMiniVariant* dispatchParams = NULL; -+ nsIInterfaceInfo* iface_info = NULL; -+ const nsXPTMethodInfo* info; -+ PRUint8 paramCount; -+ PRUint8 i; -+ nsresult result = NS_ERROR_FAILURE; -+ -+ NS_ASSERTION(self,"no self"); -+ -+ self->GetInterfaceInfo(&iface_info); -+ NS_ASSERTION(iface_info,"no interface info"); -+ -+ iface_info->GetMethodInfo(PRUint16(methodIndex), &info); -+ NS_ASSERTION(info,"no interface info"); -+ -+ paramCount = info->GetParamCount(); -+ -+ // setup variant array pointer -+ if(paramCount > PARAM_BUFFER_COUNT) -+ dispatchParams = new nsXPTCMiniVariant[paramCount]; -+ else -+ dispatchParams = paramBuffer; -+ NS_ASSERTION(dispatchParams,"no place for params"); -+ -+ // args[0] to args[NUM_ARG_REGS] hold floating point register values -+ PRUint64* ap = args + NUM_ARG_REGS; -+ for(i = 0; i < paramCount; i++, ap++) -+ { -+ const nsXPTParamInfo& param = info->GetParam(i); -+ const nsXPTType& type = param.GetType(); -+ nsXPTCMiniVariant* dp = &dispatchParams[i]; -+ -+ if(param.IsOut() || !type.IsArithmetic()) -+ { -+ dp->val.p = (void*) *ap; -+ continue; -+ } -+ // else -+ switch(type) -+ { -+ case nsXPTType::T_I8 : dp->val.i8 = (PRInt8) *ap; break; -+ case nsXPTType::T_I16 : dp->val.i16 = (PRInt16) *ap; break; -+ case nsXPTType::T_I32 : dp->val.i32 = (PRInt32) *ap; break; -+ case nsXPTType::T_I64 : dp->val.i64 = (PRInt64) *ap; break; -+ case nsXPTType::T_U8 : dp->val.u8 = (PRUint8) *ap; break; -+ case nsXPTType::T_U16 : dp->val.u16 = (PRUint16) *ap; break; -+ case nsXPTType::T_U32 : dp->val.u32 = (PRUint32) *ap; break; -+ case nsXPTType::T_U64 : dp->val.u64 = (PRUint64) *ap; break; -+ case nsXPTType::T_FLOAT : -+ if(i < NUM_ARG_REGS) -+ { -+ // floats passed via registers are stored as doubles -+ // in the first NUM_ARG_REGS entries in args -+ dp->val.u64 = (PRUint64) args[i]; -+ dp->val.f = (float) dp->val.d; // convert double to float -+ } -+ else -+ dp->val.u32 = (PRUint32) *ap; -+ break; -+ case nsXPTType::T_DOUBLE : -+ // doubles passed via registers are also stored -+ // in the first NUM_ARG_REGS entries in args -+ dp->val.u64 = (i < NUM_ARG_REGS) ? args[i] : *ap; -+ break; -+ case nsXPTType::T_BOOL : dp->val.b = (PRBool) *ap; break; -+ case nsXPTType::T_CHAR : dp->val.c = (char) *ap; break; -+ case nsXPTType::T_WCHAR : dp->val.wc = (PRUnichar) *ap; break; -+ default: -+ NS_ASSERTION(0, "bad type"); -+ break; -+ } -+ } -+ -+ result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams); -+ -+ NS_RELEASE(iface_info); -+ -+ if(dispatchParams != paramBuffer) -+ delete [] dispatchParams; -+ -+ return result; -+} -+ -+/* -+ * SharedStub() -+ * Collects arguments and calls PrepareAndDispatch. The "methodIndex" is -+ * passed to this function via $1 to preserve the argument registers. -+ */ -+__asm__( -+ "#### SharedStub ####\n" -+".text\n\t" -+ ".align 5\n\t" -+ ".ent SharedStub\n" -+"SharedStub:\n\t" -+ ".frame $30,96,$26,0\n\t" -+ ".mask 0x4000000,-96\n\t" -+ "ldgp $29,0($27)\n" -+"$SharedStub..ng:\n\t" -+ "subq $30,96,$30\n\t" -+ "stq $26,0($30)\n\t" -+ ".prologue 1\n\t" -+ -+ /* -+ * Store arguments passed via registers to the stack. -+ * Floating point registers are stored as doubles and converted -+ * to floats in PrepareAndDispatch if necessary. -+ */ -+ "stt $f17,16($30)\n\t" /* floating point registers */ -+ "stt $f18,24($30)\n\t" -+ "stt $f19,32($30)\n\t" -+ "stt $f20,40($30)\n\t" -+ "stt $f21,48($30)\n\t" -+ "stq $17,56($30)\n\t" /* integer registers */ -+ "stq $18,64($30)\n\t" -+ "stq $19,72($30)\n\t" -+ "stq $20,80($30)\n\t" -+ "stq $21,88($30)\n\t" -+ -+ /* -+ * Call PrepareAndDispatch function. -+ */ -+ "bis $1,$1,$17\n\t" /* pass "methodIndex" */ -+ "addq $30,16,$18\n\t" /* pass "args" */ -+ "bsr $26,$PrepareAndDispatch..ng\n\t" -+ -+ "ldq $26,0($30)\n\t" -+ "addq $30,96,$30\n\t" -+ "ret $31,($26),1\n\t" -+ ".end SharedStub" -+ ); -+ -+#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */ -+/* -+ * nsresult nsXPTCStubBase::Stub##n() -+ * Sets register $1 to "methodIndex" and jumps to SharedStub. -+ */ -+#define STUB_ENTRY(n) \ -+__asm__( \ -+ "#### Stub"#n" ####\n" \ -+".text\n\t" \ -+ ".align 5\n\t" \ -+ ".globl _ZN14nsXPTCStubBase5Stub"#n"Ev\n\t" \ -+ ".ent _ZN14nsXPTCStubBase5Stub"#n"Ev\n" \ -+"_ZN14nsXPTCStubBase5Stub"#n"Ev:\n\t" \ -+ ".frame $30,0,$26,0\n\t" \ -+ "ldgp $29,0($27)\n" \ -+"$_ZN14nsXPTCStubBase5Stub"#n"Ev..ng:\n\t" \ -+ ".prologue 1\n\t" \ -+ "lda $1,"#n"\n\t" \ -+ "br $31,$SharedStub..ng\n\t" \ -+ ".end _ZN14nsXPTCStubBase5Stub"#n"Ev" \ -+ ); \ -+__asm__( \ -+ "#### Stub"#n" ####\n" \ -+".text\n\t" \ -+ ".align 5\n\t" \ -+ ".globl _ZN14nsXPTCStubBase6Stub"#n"Ev\n\t" \ -+ ".ent _ZN14nsXPTCStubBase6Stub"#n"Ev\n" \ -+"_ZN14nsXPTCStubBase6Stub"#n"Ev:\n\t" \ -+ ".frame $30,0,$26,0\n\t" \ -+ "ldgp $29,0($27)\n" \ -+"$_ZN14nsXPTCStubBase6Stub"#n"Ev..ng:\n\t" \ -+ ".prologue 1\n\t" \ -+ "lda $1,"#n"\n\t" \ -+ "br $31,$SharedStub..ng\n\t" \ -+ ".end _ZN14nsXPTCStubBase6Stub"#n"Ev" \ -+ ); \ -+__asm__( \ -+ "#### Stub"#n" ####\n" \ -+".text\n\t" \ -+ ".align 5\n\t" \ -+ ".globl _ZN14nsXPTCStubBase7Stub"#n"Ev\n\t" \ -+ ".ent _ZN14nsXPTCStubBase7Stub"#n"Ev\n" \ -+"_ZN14nsXPTCStubBase7Stub"#n"Ev:\n\t" \ -+ ".frame $30,0,$26,0\n\t" \ -+ "ldgp $29,0($27)\n" \ -+"$_ZN14nsXPTCStubBase7Stub"#n"Ev..ng:\n\t" \ -+ ".prologue 1\n\t" \ -+ "lda $1,"#n"\n\t" \ -+ "br $31,$SharedStub..ng\n\t" \ -+ ".end _ZN14nsXPTCStubBase7Stub"#n"Ev" \ -+ ); -+#else -+/* -+ * nsresult nsXPTCStubBase::Stub##n() -+ * Sets register $1 to "methodIndex" and jumps to SharedStub. -+ */ -+#define STUB_ENTRY(n) \ -+nsresult nsXPTCStubBase::Stub##n() \ -+{ \ -+ nsresult result; \ -+__asm__ __volatile__( \ -+ "ldah $29,0($27)\n\t" \ -+ "lda $29,0($29)\n\t" \ -+ "lda $1, "#n"\n\t" \ -+ "br $31, $SharedStub..ng\n\t" \ -+ "mov $0, %0\n\t" \ -+ : "=r" (result) \ -+ ); \ -+ return result; \ -+} -+#endif -+ -+#define SENTINEL_ENTRY(n) \ -+nsresult nsXPTCStubBase::Sentinel##n() \ -+{ \ -+ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ -+ return NS_ERROR_NOT_IMPLEMENTED; \ -+} -+ -+#include "xptcstubsdef.inc" -+ Index: files/patch-xptcall-sparc64 =================================================================== RCS file: files/patch-xptcall-sparc64 diff -N files/patch-xptcall-sparc64 --- files/patch-xptcall-sparc64 2 Feb 2006 13:16:54 -0000 1.6 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,327 +0,0 @@ ---- /dev/null Mon May 26 13:22:00 2003 -+++ xpcom/reflect/xptcall/src/md/unix/xptcstubs_sparc64_freebsd.cpp Mon May 26 04:12:55 2003 -@@ -0,0 +1,123 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -+ * -+ * 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 Netscape -+ * Communications Corporation. Portions created by Netscape are -+ * Copyright (C) 2001 Netscape Communications Corporation. All -+ * Rights Reserved. -+ * -+ * Contributor(s): -+ * Stuart Parmenter -+ */ -+ -+/* Implement shared vtbl methods. */ -+ -+#include "xptcprivate.h" -+ -+#if defined(sparc) || defined(__sparc__) -+ -+extern "C" nsresult -+PrepareAndDispatch(nsXPTCStubBase* self, PRUint64 methodIndex, PRUint64* args) -+{ -+ -+#define PARAM_BUFFER_COUNT 16 -+ -+ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT]; -+ nsXPTCMiniVariant* dispatchParams = NULL; -+ nsIInterfaceInfo* iface_info = NULL; -+ const nsXPTMethodInfo* info; -+ PRUint8 paramCount; -+ PRUint8 i; -+ nsresult result = NS_ERROR_FAILURE; -+ -+ NS_ASSERTION(self,"no self"); -+ -+ self->GetInterfaceInfo(&iface_info); -+ NS_ASSERTION(iface_info,"no interface info"); -+ -+ iface_info->GetMethodInfo(PRUint16(methodIndex), &info); -+ NS_ASSERTION(info,"no interface info"); -+ -+ paramCount = info->GetParamCount(); -+ -+ // setup variant array pointer -+ if(paramCount > PARAM_BUFFER_COUNT) -+ dispatchParams = new nsXPTCMiniVariant[paramCount]; -+ else -+ dispatchParams = paramBuffer; -+ NS_ASSERTION(dispatchParams,"no place for params"); -+ -+ PRUint64* ap = args; -+ for(i = 0; i < paramCount; i++, ap++) -+ { -+ const nsXPTParamInfo& param = info->GetParam(i); -+ const nsXPTType& type = param.GetType(); -+ nsXPTCMiniVariant* dp = &dispatchParams[i]; -+ -+ if(param.IsOut() || !type.IsArithmetic()) -+ { -+ dp->val.p = (void*) *ap; -+ continue; -+ } -+ // else -+ switch(type) -+ { -+ case nsXPTType::T_I8 : dp->val.i8 = *((PRInt64*) ap); break; -+ case nsXPTType::T_I16 : dp->val.i16 = *((PRInt64*) ap); break; -+ case nsXPTType::T_I32 : dp->val.i32 = *((PRInt64*) ap); break; -+ case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); break; -+ case nsXPTType::T_U64 : dp->val.u64 = *((PRUint64*) ap); break; -+ case nsXPTType::T_I64 : dp->val.i64 = *((PRInt64*) ap); break; -+ case nsXPTType::T_U8 : dp->val.u8 = *((PRUint64*) ap); break; -+ case nsXPTType::T_U16 : dp->val.u16 = *((PRUint64*)ap); break; -+ case nsXPTType::T_U32 : dp->val.u32 = *((PRUint64*)ap); break; -+ case nsXPTType::T_FLOAT : dp->val.f = ((float*) ap)[1]; break; -+ case nsXPTType::T_BOOL : dp->val.b = *((PRInt64*) ap); break; -+ case nsXPTType::T_CHAR : dp->val.c = *((PRUint64*) ap); break; -+ case nsXPTType::T_WCHAR : dp->val.wc = *((PRInt64*) ap); break; -+ default: -+ NS_ASSERTION(0, "bad type"); -+ break; -+ } -+ } -+ -+ result = self->CallMethod((PRUint16)methodIndex, info, dispatchParams); -+ -+ NS_RELEASE(iface_info); -+ -+ if(dispatchParams != paramBuffer) -+ delete [] dispatchParams; -+ -+ return result; -+} -+ -+extern "C" int SharedStub(int, int*); -+ -+#define STUB_ENTRY(n) \ -+nsresult nsXPTCStubBase::Stub##n() \ -+{ \ -+ int dummy; /* defeat tail-call optimization */ \ -+ return SharedStub(n, &dummy); \ -+} -+ -+#define SENTINEL_ENTRY(n) \ -+nsresult nsXPTCStubBase::Sentinel##n() \ -+{ \ -+ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \ -+ return NS_ERROR_NOT_IMPLEMENTED; \ -+} -+ -+#include "xptcstubsdef.inc" -+ -+#endif /* sparc || __sparc__ */ ---- /dev/null Mon May 26 13:22:00 2003 -+++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc64_freebsd.s Mon May 26 04:06:09 2003 -@@ -0,0 +1,104 @@ -+/* -*- Mode: asm; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -+ * -+ * 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 Netscape -+ * Communications Corporation. Portions created by Netscape are -+ * Copyright (C) 2001 Netscape Communications Corporation. All -+ * Rights Reserved. -+ * -+ * Contributor(s): -+ * Stuart Parmenter -+ * Chris Seawood -+ */ -+ -+/* -+ Platform specific code to invoke XPCOM methods on native objects -+ for sparcv9 Solaris. -+ -+ See the SPARC Compliance Definition (SCD) Chapter 3 -+ for more information about what is going on here, including -+ the use of BIAS (0x7ff). -+ The SCD is available from http://www.sparc.com/. -+*/ -+ -+ .global XPTC_InvokeByIndex -+ .type XPTC_InvokeByIndex, #function -+ -+/* -+ XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex, -+ PRUint32 paramCount, nsXPTCVariant* params); -+ -+*/ -+XPTC_InvokeByIndex: -+ save %sp,-(128 + 64),%sp ! room for the register window and -+ ! struct pointer, rounded up to 0 % 64 -+ sll %i2,4,%l0 ! assume the worst case -+ ! paramCount * 2 * 8 bytes -+ cmp %l0, 0 ! are there any args? If not, -+ be .invoke ! no need to copy args to stack -+ nop -+ -+ sub %sp,%l0,%sp ! create the additional stack space -+ add %sp,0x7ff+136,%o0 ! step past the register window, the -+ ! struct result pointer and the 'this' slot -+ mov %i2,%o1 ! paramCount -+ call invoke_copy_to_stack -+ mov %i3,%o2 ! params -+ -+! -+! load arguments from stack into the outgoing registers -+! BIAS is 0x7ff (2047) -+! -+ -+! load the %o1..5 64bit (extended word) output registers registers -+ ldx [%sp + 0x7ff + 136],%o1 ! %i1 -+ ldx [%sp + 0x7ff + 144],%o2 ! %i2 -+ ldx [%sp + 0x7ff + 152],%o3 ! %i3 -+ ldx [%sp + 0x7ff + 160],%o4 ! %i4 -+ ldx [%sp + 0x7ff + 168],%o5 ! %i5 -+ -+! load the even number double registers starting with %d2 -+ ldd [%sp + 0x7ff + 136],%f2 -+ ldd [%sp + 0x7ff + 144],%f4 -+ ldd [%sp + 0x7ff + 152],%f6 -+ ldd [%sp + 0x7ff + 160],%f8 -+ ldd [%sp + 0x7ff + 168],%f10 -+ ldd [%sp + 0x7ff + 176],%f12 -+ ldd [%sp + 0x7ff + 184],%f14 -+ ldd [%sp + 0x7ff + 192],%f16 -+ ldd [%sp + 0x7ff + 200],%f18 -+ ldd [%sp + 0x7ff + 208],%f20 -+ ldd [%sp + 0x7ff + 216],%f22 -+ ldd [%sp + 0x7ff + 224],%f24 -+ ldd [%sp + 0x7ff + 232],%f26 -+ ldd [%sp + 0x7ff + 240],%f28 -+ ldd [%sp + 0x7ff + 248],%f30 -+ -+! -+! calculate the target address from the vtable -+! -+.invoke: -+ sll %i1,3,%l0 ! index *= 8 -+! add %l0,16,%l0 ! there are 2 extra entries in the vTable (16bytes) -+ ldx [%i0],%l1 ! *that --> address of vtable -+ ldx [%l0 + %l1],%l0 ! that->vtable[index * 8 + 16] --> address -+ -+ jmpl %l0,%o7 ! call the routine -+ mov %i0,%o0 ! move 'this' pointer to out register -+ -+ mov %o0,%i0 ! propagate return value -+ ret -+ restore -+ -+ .size XPTC_InvokeByIndex, .-XPTC_InvokeByIndex ---- /dev/null Mon May 26 14:00:00 2003 -+++ xpcom/reflect/xptcall/src/md/unix/xptcinvoke_sparc64_freebsd.cpp Mon May 26 14:00:49 2003 -@@ -0,0 +1,91 @@ -+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -+ * -+ * 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 Netscape -+ * Communications Corporation. Portions created by Netscape are -+ * Copyright (C) 2001 Netscape Communications Corporation. All -+ * Rights Reserved. -+ * -+ * Contributor(s): -+ * Stuart Parmenter -+ * Chris Seawood -+ */ -+ -+ -+/* Platform specific code to invoke XPCOM methods on native objects */ -+ -+#include "xptcprivate.h" -+ -+#if !defined(__sparc) && !defined(__sparc__) -+#error "This code is for Sparc only" -+#endif -+ -+/* Prototype specifies unmangled function name */ -+extern "C" PRUint64 -+invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s); -+ -+extern "C" PRUint64 -+invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount, nsXPTCVariant* s) -+{ -+ /* -+ We need to copy the parameters for this function to locals and use them -+ from there since the parameters occupy the same stack space as the stack -+ we're trying to populate. -+ */ -+ PRUint64 *l_d = d; -+ nsXPTCVariant *l_s = s; -+ PRUint64 l_paramCount = paramCount; -+ PRUint64 regCount = 0; // return the number of registers to load from the stack -+ -+ for(PRUint64 i = 0; i < l_paramCount; i++, l_d++, l_s++) -+ { -+ if (regCount < 5) regCount++; -+ -+ if (l_s->IsPtrData()) -+ { -+ *l_d = (PRUint64)l_s->ptr; -+ continue; -+ } -+ switch (l_s->type) -+ { -+ case nsXPTType::T_I8 : *((PRInt64*)l_d) = l_s->val.i8; break; -+ case nsXPTType::T_I16 : *((PRInt64*)l_d) = l_s->val.i16; break; -+ case nsXPTType::T_I32 : *((PRInt64*)l_d) = l_s->val.i32; break; -+ case nsXPTType::T_I64 : *((PRInt64*)l_d) = l_s->val.i64; break; -+ -+ case nsXPTType::T_U8 : *((PRUint64*)l_d) = l_s->val.u8; break; -+ case nsXPTType::T_U16 : *((PRUint64*)l_d) = l_s->val.u16; break; -+ case nsXPTType::T_U32 : *((PRUint64*)l_d) = l_s->val.u32; break; -+ case nsXPTType::T_U64 : *((PRUint64*)l_d) = l_s->val.u64; break; -+ -+ /* in the case of floats, we want to put the bits in to the -+ 64bit space right justified... floats in the paramter array on -+ sparcv9 use odd numbered registers.. %f1, %f3, so we have to skip -+ the space that would be occupied by %f0, %f2, etc. -+ */ -+ case nsXPTType::T_FLOAT : *(((float*)l_d) + 1) = l_s->val.f; break; -+ case nsXPTType::T_DOUBLE: *((double*)l_d) = l_s->val.d; break; -+ case nsXPTType::T_BOOL : *((PRInt64*)l_d) = l_s->val.b; break; -+ case nsXPTType::T_CHAR : *((PRUint64*)l_d) = l_s->val.c; break; -+ case nsXPTType::T_WCHAR : *((PRInt64*)l_d) = l_s->val.wc; break; -+ -+ default: -+ // all the others are plain pointer types -+ *((void**)l_d) = l_s->val.p; -+ break; -+ } -+ } -+ -+ return regCount; -+} Index: files/releng6_pulseaudio =================================================================== RCS file: files/releng6_pulseaudio diff -N files/releng6_pulseaudio --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/releng6_pulseaudio 3 Feb 2010 23:26:05 -0000 @@ -0,0 +1,32 @@ +--- media/libsydneyaudio/src/Makefile.in.orig 2009-08-11 17:22:08.000000000 +0200 ++++ media/libsydneyaudio/src/Makefile.in 2009-08-11 17:22:36.000000000 +0200 +@@ -45,6 +45,12 @@ + LIBRARY_NAME = sydneyaudio + FORCE_STATIC_LIB= 1 + ++ifeq ($(OS_ARCH),FreeBSD) ++CSRCS = \ ++ sydney_audio_pulseaudio.c \ ++ $(NULL) ++endif ++ + ifeq ($(OS_ARCH),Linux) + CSRCS = \ + sydney_audio_alsa.c \ +--- toolkit/library/Makefile.in.orig 2009-08-11 17:22:45.000000000 +0200 ++++ toolkit/library/Makefile.in 2009-08-11 17:23:22.000000000 +0200 +@@ -231,12 +231,12 @@ + endif + + ifeq (gtk2,$(MOZ_WIDGET_TOOLKIT)) +-EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XEXT_LIBS) $(XCOMPOSITE_LIBS) $(MOZ_PANGO_LIBS) $(MOZ_GTK2_LIBS) $(XT_LIBS) -lgthread-2.0 ++EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XEXT_LIBS) $(XCOMPOSITE_LIBS) $(MOZ_PANGO_LIBS) $(MOZ_GTK2_LIBS) $(XT_LIBS) -lgthread-2.0 -lpulse -lpthread + EXTRA_DSO_LDOPTS += $(FT2_LIBS) + endif + + ifeq (qt,$(MOZ_WIDGET_TOOLKIT)) +-EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XT_LIBS) $(MOZ_QT_LIBS) -lgthread-2.0 ++EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XT_LIBS) $(MOZ_QT_LIBS) -lgthread-2.0 -lpulse -lpthread + EXTRA_DSO_LDOPTS += $(FT2_LIBS) + endif +