mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge inbound to m-c
This commit is contained in:
commit
452f25917a
@ -5,6 +5,8 @@
|
||||
|
||||
#include "imgIContainer.h"
|
||||
#include "imgIRequest.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsIDOMElement.h"
|
||||
#include "nsIDOMHTMLImageElement.h"
|
||||
#include "nsIImageLoadingContent.h"
|
||||
@ -55,6 +57,8 @@
|
||||
#define NS_TASKBAR_CONTRACTID "@mozilla.org/windows-taskbar;1"
|
||||
|
||||
using mozilla::IsWin8OrLater;
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::gfx;
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsWindowsShellService, nsIWindowsShellService, nsIShellService)
|
||||
|
||||
@ -749,21 +753,30 @@ WriteBitmap(nsIFile* aFile, imgIContainer* aImage)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
nsRefPtr<gfxASurface> surface =
|
||||
nsRefPtr<gfxASurface> thebesSurface =
|
||||
aImage->GetFrame(imgIContainer::FRAME_FIRST,
|
||||
imgIContainer::FLAG_SYNC_DECODE);
|
||||
NS_ENSURE_TRUE(surface, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(thebesSurface, NS_ERROR_FAILURE);
|
||||
|
||||
nsRefPtr<gfxImageSurface> image(surface->GetAsReadableARGB32ImageSurface());
|
||||
NS_ENSURE_TRUE(image, NS_ERROR_FAILURE);
|
||||
nsRefPtr<gfxImageSurface> thebesImageSurface =
|
||||
thebesSurface->GetAsReadableARGB32ImageSurface();
|
||||
NS_ENSURE_TRUE(thebesImageSurface, NS_ERROR_FAILURE);
|
||||
|
||||
int32_t width = image->Width();
|
||||
int32_t height = image->Height();
|
||||
RefPtr<DataSourceSurface> dataSurface =
|
||||
thebesImageSurface->CopyToB8G8R8A8DataSourceSurface();
|
||||
NS_ENSURE_TRUE(dataSurface, NS_ERROR_FAILURE);
|
||||
|
||||
uint8_t* bits = image->Data();
|
||||
uint32_t length = image->GetDataSize();
|
||||
uint32_t bpr = uint32_t(image->Stride());
|
||||
int32_t bitCount = bpr/width;
|
||||
DataSourceSurface::MappedSurface map;
|
||||
dataSurface->Map(DataSourceSurface::MapType::READ, &map);
|
||||
if (!map.mData) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
int32_t width = dataSurface->GetSize().width;
|
||||
int32_t height = dataSurface->GetSize().height;
|
||||
int32_t bytesPerPixel = 4 * sizeof(uint8_t);
|
||||
uint32_t bytesPerRow = bytesPerPixel * width;
|
||||
uint32_t length = map.mStride * height;
|
||||
|
||||
// initialize these bitmap structs which we will later
|
||||
// serialize directly to the head of the bitmap file
|
||||
@ -772,9 +785,9 @@ WriteBitmap(nsIFile* aFile, imgIContainer* aImage)
|
||||
bmi.biWidth = width;
|
||||
bmi.biHeight = height;
|
||||
bmi.biPlanes = 1;
|
||||
bmi.biBitCount = (WORD)bitCount*8;
|
||||
bmi.biBitCount = (WORD)bytesPerPixel*8;
|
||||
bmi.biCompression = BI_RGB;
|
||||
bmi.biSizeImage = length;
|
||||
bmi.biSizeImage = bytesPerRow * height;
|
||||
bmi.biXPelsPerMeter = 0;
|
||||
bmi.biYPelsPerMeter = 0;
|
||||
bmi.biClrUsed = 0;
|
||||
@ -804,9 +817,9 @@ WriteBitmap(nsIFile* aFile, imgIContainer* aImage)
|
||||
// show bitmaps with negative heights for top-to-bottom
|
||||
uint32_t i = length;
|
||||
do {
|
||||
i -= bpr;
|
||||
stream->Write(((const char*)bits) + i, bpr, &written);
|
||||
if (written == bpr) {
|
||||
i -= map.mStride;
|
||||
stream->Write(((const char*)map.mData) + i, bytesPerRow, &written);
|
||||
if (written == bytesPerRow) {
|
||||
rv = NS_OK;
|
||||
} else {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
|
641
build/autoconf/config.guess
vendored
641
build/autoconf/config.guess
vendored
@ -1,14 +1,12 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright 1992-2014 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2009-08-19'
|
||||
timestamp='2014-02-12'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
@ -17,26 +15,22 @@ timestamp='2009-08-19'
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
|
||||
# Originally written by Per Bothner. Please send patches (context
|
||||
# diff format) to <config-patches@gnu.org> and include a ChangeLog
|
||||
# entry.
|
||||
# the same distribution terms that you use for the rest of that
|
||||
# program. This Exception is an additional permission under section 7
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
# Originally written by Per Bothner.
|
||||
#
|
||||
# You can get the latest version of this script from:
|
||||
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
|
||||
#
|
||||
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
|
||||
|
||||
|
||||
me=`echo "$0" | sed -e 's,.*/,,'`
|
||||
|
||||
@ -56,8 +50,7 @@ version="\
|
||||
GNU config.guess ($timestamp)
|
||||
|
||||
Originally written by Per Bothner.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
Copyright 1992-2014 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@ -139,12 +132,33 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
case "${UNAME_SYSTEM}" in
|
||||
Linux|GNU|GNU/*)
|
||||
# If the system lacks a compiler, then just pick glibc.
|
||||
# We could probably try harder.
|
||||
LIBC=gnu
|
||||
|
||||
eval $set_cc_for_build
|
||||
cat <<-EOF > $dummy.c
|
||||
#include <features.h>
|
||||
#if defined(__UCLIBC__)
|
||||
LIBC=uclibc
|
||||
#elif defined(__dietlibc__)
|
||||
LIBC=dietlibc
|
||||
#else
|
||||
LIBC=gnu
|
||||
#endif
|
||||
EOF
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
|
||||
;;
|
||||
esac
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
*:NetBSD:*:*)
|
||||
# NetBSD (nbsd) targets should (where applicable) match one or
|
||||
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
|
||||
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
|
||||
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
|
||||
# switched to ELF, *-*-netbsd* would select the old
|
||||
# object file format. This provides both forward
|
||||
@ -180,7 +194,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
os=netbsd
|
||||
os=netbsd
|
||||
;;
|
||||
esac
|
||||
# The OS release
|
||||
@ -201,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
|
||||
echo "${machine}-${os}${release}"
|
||||
exit ;;
|
||||
*:Bitrig:*:*)
|
||||
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
|
||||
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:OpenBSD:*:*)
|
||||
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
|
||||
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
|
||||
@ -223,7 +241,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||
;;
|
||||
*5.*)
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
|
||||
;;
|
||||
esac
|
||||
# According to Compaq, /usr/sbin/psrinfo has been available on
|
||||
@ -269,7 +287,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# A Xn.n version is an unreleased experimental baselevel.
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
exit ;;
|
||||
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
|
||||
exitcode=$?
|
||||
trap '' 0
|
||||
exit $exitcode ;;
|
||||
Alpha\ *:Windows_NT*:*)
|
||||
# How do we know it's Interix rather than the generic POSIX subsystem?
|
||||
# Should we change UNAME_MACHINE based on the output of uname instead
|
||||
@ -295,12 +316,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
echo s390-ibm-zvmoe
|
||||
exit ;;
|
||||
*:OS400:*:*)
|
||||
echo powerpc-ibm-os400
|
||||
echo powerpc-ibm-os400
|
||||
exit ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
arm:riscos:*:*|arm:RISCOS:*:*)
|
||||
arm*:riscos:*:*|arm*:RISCOS:*:*)
|
||||
echo arm-unknown-riscos
|
||||
exit ;;
|
||||
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
|
||||
@ -333,6 +354,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit ;;
|
||||
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
|
||||
echo i386-pc-auroraux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
|
||||
eval $set_cc_for_build
|
||||
SUN_ARCH="i386"
|
||||
@ -391,23 +415,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
# MiNT. But MiNT is downward compatible to TOS, so this should
|
||||
# be no problem.
|
||||
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
exit ;;
|
||||
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
echo m68k-atari-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
|
||||
echo m68k-milan-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
echo m68k-milan-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
|
||||
echo m68k-hades-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
echo m68k-hades-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
echo m68k-unknown-mint${UNAME_RELEASE}
|
||||
exit ;;
|
||||
m68k:machten:*:*)
|
||||
echo m68k-apple-machten${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@ -477,8 +501,8 @@ EOF
|
||||
echo m88k-motorola-sysv3
|
||||
exit ;;
|
||||
AViiON:dgux:*:*)
|
||||
# DG/UX returns AViiON for all architectures
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
# DG/UX returns AViiON for all architectures
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
|
||||
then
|
||||
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
|
||||
@ -491,7 +515,7 @@ EOF
|
||||
else
|
||||
echo i586-dg-dgux${UNAME_RELEASE}
|
||||
fi
|
||||
exit ;;
|
||||
exit ;;
|
||||
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
|
||||
echo m88k-dolphin-sysv3
|
||||
exit ;;
|
||||
@ -548,7 +572,7 @@ EOF
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit ;;
|
||||
*:AIX:*:[456])
|
||||
*:AIX:*:[4567])
|
||||
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
|
||||
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
@ -591,52 +615,52 @@ EOF
|
||||
9000/[678][0-9][0-9])
|
||||
if [ -x /usr/bin/getconf ]; then
|
||||
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
|
||||
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
|
||||
case "${sc_cpu_version}" in
|
||||
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
|
||||
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
|
||||
532) # CPU_PA_RISC2_0
|
||||
case "${sc_kernel_bits}" in
|
||||
32) HP_ARCH="hppa2.0n" ;;
|
||||
64) HP_ARCH="hppa2.0w" ;;
|
||||
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
|
||||
case "${sc_cpu_version}" in
|
||||
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
|
||||
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
|
||||
532) # CPU_PA_RISC2_0
|
||||
case "${sc_kernel_bits}" in
|
||||
32) HP_ARCH="hppa2.0n" ;;
|
||||
64) HP_ARCH="hppa2.0w" ;;
|
||||
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
|
||||
esac ;;
|
||||
esac
|
||||
esac ;;
|
||||
esac
|
||||
fi
|
||||
if [ "${HP_ARCH}" = "" ]; then
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
|
||||
#define _HPUX_SOURCE
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#define _HPUX_SOURCE
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
long bits = sysconf(_SC_KERNEL_BITS);
|
||||
#endif
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
int main ()
|
||||
{
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
long bits = sysconf(_SC_KERNEL_BITS);
|
||||
#endif
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
|
||||
case CPU_PA_RISC2_0:
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
switch (bits)
|
||||
{
|
||||
case 64: puts ("hppa2.0w"); break;
|
||||
case 32: puts ("hppa2.0n"); break;
|
||||
default: puts ("hppa2.0"); break;
|
||||
} break;
|
||||
#else /* !defined(_SC_KERNEL_BITS) */
|
||||
puts ("hppa2.0"); break;
|
||||
#endif
|
||||
default: puts ("hppa1.0"); break;
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
|
||||
case CPU_PA_RISC2_0:
|
||||
#if defined(_SC_KERNEL_BITS)
|
||||
switch (bits)
|
||||
{
|
||||
case 64: puts ("hppa2.0w"); break;
|
||||
case 32: puts ("hppa2.0n"); break;
|
||||
default: puts ("hppa2.0"); break;
|
||||
} break;
|
||||
#else /* !defined(_SC_KERNEL_BITS) */
|
||||
puts ("hppa2.0"); break;
|
||||
#endif
|
||||
default: puts ("hppa1.0"); break;
|
||||
}
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
|
||||
test -z "$HP_ARCH" && HP_ARCH=hppa
|
||||
@ -727,22 +751,22 @@ EOF
|
||||
exit ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit ;;
|
||||
exit ;;
|
||||
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
|
||||
echo c34-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
|
||||
echo c38-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
|
||||
echo c4-convex-bsd
|
||||
exit ;;
|
||||
exit ;;
|
||||
CRAY*Y-MP:*:*:*)
|
||||
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
|
||||
exit ;;
|
||||
@ -766,14 +790,14 @@ EOF
|
||||
exit ;;
|
||||
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
|
||||
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit ;;
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
|
||||
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit ;;
|
||||
5000:UNIX_System_V:4.*:*)
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
|
||||
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
|
||||
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
|
||||
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
|
||||
exit ;;
|
||||
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
@ -785,34 +809,39 @@ EOF
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:FreeBSD:*:*)
|
||||
case ${UNAME_MACHINE} in
|
||||
pc98)
|
||||
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
||||
case ${UNAME_PROCESSOR} in
|
||||
amd64)
|
||||
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
|
||||
esac
|
||||
exit ;;
|
||||
i*:CYGWIN*:*)
|
||||
echo ${UNAME_MACHINE}-pc-cygwin
|
||||
exit ;;
|
||||
*:MINGW64*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw64
|
||||
exit ;;
|
||||
*:MINGW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-mingw32
|
||||
exit ;;
|
||||
i*:MSYS*:*)
|
||||
echo ${UNAME_MACHINE}-pc-msys
|
||||
exit ;;
|
||||
i*:windows32*:*)
|
||||
# uname -m includes "-pc" on this system.
|
||||
echo ${UNAME_MACHINE}-mingw32
|
||||
# uname -m includes "-pc" on this system.
|
||||
echo ${UNAME_MACHINE}-mingw32
|
||||
exit ;;
|
||||
i*:PW*:*)
|
||||
echo ${UNAME_MACHINE}-pc-pw32
|
||||
exit ;;
|
||||
*:Interix*:[3456]*)
|
||||
case ${UNAME_MACHINE} in
|
||||
*:Interix*:*)
|
||||
case ${UNAME_MACHINE} in
|
||||
x86)
|
||||
echo i586-pc-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
EM64T | authenticamd | genuineintel)
|
||||
authenticamd | genuineintel | EM64T)
|
||||
echo x86_64-unknown-interix${UNAME_RELEASE}
|
||||
exit ;;
|
||||
IA64)
|
||||
@ -845,45 +874,81 @@ EOF
|
||||
exit ;;
|
||||
*:GNU:*:*)
|
||||
# the GNU system
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit ;;
|
||||
*:GNU/*:*:*)
|
||||
# other systems with GNU libc and userland
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
|
||||
exit ;;
|
||||
i*86:Minix:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-minix
|
||||
exit ;;
|
||||
aarch64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
aarch64_be:Linux:*:*)
|
||||
UNAME_MACHINE=aarch64_be
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
EV56) UNAME_MACHINE=alphaev56 ;;
|
||||
PCA56) UNAME_MACHINE=alphapca56 ;;
|
||||
PCA57) UNAME_MACHINE=alphapca56 ;;
|
||||
EV6) UNAME_MACHINE=alphaev6 ;;
|
||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep -q ld.so.1
|
||||
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
arc:Linux:*:* | arceb:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
arm*:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_EABI__
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
|
||||
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
|
||||
| grep -q __ARM_PCS_VFP
|
||||
then
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
|
||||
fi
|
||||
fi
|
||||
exit ;;
|
||||
avr32*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
cris:Linux:*:*)
|
||||
echo cris-axis-linux-gnu
|
||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
||||
exit ;;
|
||||
crisv32:Linux:*:*)
|
||||
echo crisv32-axis-linux-gnu
|
||||
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
|
||||
exit ;;
|
||||
frv:Linux:*:*)
|
||||
echo frv-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
hexagon:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
|
||||
exit ;;
|
||||
ia64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
m32r*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
m68*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
mips:Linux:*:* | mips64:Linux:*:*)
|
||||
eval $set_cc_for_build
|
||||
@ -901,123 +966,65 @@ EOF
|
||||
#endif
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^CPU/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
|
||||
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
|
||||
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
|
||||
;;
|
||||
or1k:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
or32:Linux:*:*)
|
||||
echo or32-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-gnu
|
||||
exit ;;
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-gnu
|
||||
exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
EV56) UNAME_MACHINE=alphaev56 ;;
|
||||
PCA56) UNAME_MACHINE=alphapca56 ;;
|
||||
PCA57) UNAME_MACHINE=alphapca56 ;;
|
||||
EV6) UNAME_MACHINE=alphaev6 ;;
|
||||
EV67) UNAME_MACHINE=alphaev67 ;;
|
||||
EV68*) UNAME_MACHINE=alphaev68 ;;
|
||||
esac
|
||||
objdump --private-headers /bin/sh | grep -q ld.so.1
|
||||
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
padre:Linux:*:*)
|
||||
echo sparc-unknown-linux-gnu
|
||||
echo sparc-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
parisc:Linux:*:* | hppa:Linux:*:*)
|
||||
# Look for CPU level
|
||||
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
|
||||
PA7*) echo hppa1.1-unknown-linux-gnu ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-gnu ;;
|
||||
*) echo hppa-unknown-linux-gnu ;;
|
||||
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
|
||||
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
|
||||
*) echo hppa-unknown-linux-${LIBC} ;;
|
||||
esac
|
||||
exit ;;
|
||||
parisc64:Linux:*:* | hppa64:Linux:*:*)
|
||||
echo hppa64-unknown-linux-gnu
|
||||
ppc64:Linux:*:*)
|
||||
echo powerpc64-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppc:Linux:*:*)
|
||||
echo powerpc-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppc64le:Linux:*:*)
|
||||
echo powerpc64le-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
ppcle:Linux:*:*)
|
||||
echo powerpcle-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
s390:Linux:*:* | s390x:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-ibm-linux
|
||||
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
|
||||
exit ;;
|
||||
sh64*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
sh*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
sparc:Linux:*:* | sparc64:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
tile*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
vax:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-dec-linux-gnu
|
||||
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
|
||||
exit ;;
|
||||
x86_64:Linux:*:*)
|
||||
echo x86_64-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
xtensa*:Linux:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-linux-gnu
|
||||
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
|
||||
exit ;;
|
||||
i*86:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us. cd to the root directory to prevent
|
||||
# problems with other programs or directories called `ld' in the path.
|
||||
# Set LC_ALL=C to ensure ld outputs messages in English.
|
||||
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
|
||||
| sed -ne '/supported targets:/!d
|
||||
s/[ ][ ]*/ /g
|
||||
s/.*supported targets: *//
|
||||
s/ .*//
|
||||
p'`
|
||||
case "$ld_supported_targets" in
|
||||
elf32-i386)
|
||||
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
|
||||
;;
|
||||
esac
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
eval $set_cc_for_build
|
||||
sed 's/^ //' << EOF >$dummy.c
|
||||
#include <features.h>
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
LIBC=gnu
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
# else
|
||||
LIBC=gnulibc1
|
||||
# endif
|
||||
#else
|
||||
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
LIBC=gnu
|
||||
#else
|
||||
LIBC=gnuaout
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __dietlibc__
|
||||
LIBC=dietlibc
|
||||
#endif
|
||||
EOF
|
||||
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
|
||||
/^LIBC/{
|
||||
s: ::g
|
||||
p
|
||||
}'`"
|
||||
test x"${LIBC}" != x && {
|
||||
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
|
||||
exit
|
||||
}
|
||||
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
|
||||
;;
|
||||
i*86:DYNIX/ptx:4*:*)
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
|
||||
# earlier versions are messed up and put the nodename in both
|
||||
@ -1025,11 +1032,11 @@ EOF
|
||||
echo i386-sequent-sysv4
|
||||
exit ;;
|
||||
i*86:UNIX_SV:4.2MP:2.*)
|
||||
# Unixware is an offshoot of SVR4, but it has its own version
|
||||
# number series starting with 2...
|
||||
# I am not positive that other SVR4 systems won't match this,
|
||||
# Unixware is an offshoot of SVR4, but it has its own version
|
||||
# number series starting with 2...
|
||||
# I am not positive that other SVR4 systems won't match this,
|
||||
# I just have to hope. -- rms.
|
||||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
# Use sysv4.2uw... so that sysv4* matches it.
|
||||
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
|
||||
exit ;;
|
||||
i*86:OS/2:*:*)
|
||||
@ -1061,7 +1068,7 @@ EOF
|
||||
fi
|
||||
exit ;;
|
||||
i*86:*:5:[678]*)
|
||||
# UnixWare 7.x, OpenUNIX and OpenServer 6.
|
||||
# UnixWare 7.x, OpenUNIX and OpenServer 6.
|
||||
case `/bin/uname -X | grep "^Machine"` in
|
||||
*486*) UNAME_MACHINE=i486 ;;
|
||||
*Pentium) UNAME_MACHINE=i586 ;;
|
||||
@ -1089,13 +1096,13 @@ EOF
|
||||
exit ;;
|
||||
pc:*:*:*)
|
||||
# Left here for compatibility:
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i586.
|
||||
# uname -m prints for DJGPP always 'pc', but it prints nothing about
|
||||
# the processor, so we play safe by assuming i586.
|
||||
# Note: whatever this is, it MUST be the same as what config.sub
|
||||
# prints for the "djgpp" host, or else GDB configury will decide that
|
||||
# this is a cross-build.
|
||||
echo i586-pc-msdosdjgpp
|
||||
exit ;;
|
||||
exit ;;
|
||||
Intel:Mach:3*:*)
|
||||
echo i386-pc-mach3
|
||||
exit ;;
|
||||
@ -1130,8 +1137,8 @@ EOF
|
||||
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
|
||||
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
|
||||
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& { echo i486-ncr-sysv4; exit; } ;;
|
||||
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& { echo i486-ncr-sysv4; exit; } ;;
|
||||
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
|
||||
OS_REL='.3'
|
||||
test -r /etc/.relid \
|
||||
@ -1174,10 +1181,10 @@ EOF
|
||||
echo ns32k-sni-sysv
|
||||
fi
|
||||
exit ;;
|
||||
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit ;;
|
||||
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||
echo i586-unisys-sysv4
|
||||
exit ;;
|
||||
*:UNIX_System_V:4*:FTX*)
|
||||
# From Gerald Hewes <hewes@openmarket.com>.
|
||||
# How about differentiating between stratus architectures? -djm
|
||||
@ -1203,11 +1210,11 @@ EOF
|
||||
exit ;;
|
||||
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
|
||||
if [ -d /usr/nec ]; then
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
echo mips-nec-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo mips-unknown-sysv${UNAME_RELEASE}
|
||||
echo mips-unknown-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit ;;
|
||||
exit ;;
|
||||
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
|
||||
echo powerpc-be-beos
|
||||
exit ;;
|
||||
@ -1220,6 +1227,9 @@ EOF
|
||||
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
|
||||
echo i586-pc-haiku
|
||||
exit ;;
|
||||
x86_64:Haiku:*:*)
|
||||
echo x86_64-unknown-haiku
|
||||
exit ;;
|
||||
SX-4:SUPER-UX:*:*)
|
||||
echo sx4-nec-superux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
@ -1246,13 +1256,31 @@ EOF
|
||||
exit ;;
|
||||
*:Darwin:*:*)
|
||||
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
|
||||
case $UNAME_PROCESSOR in
|
||||
i386) eval $set_cc_for_build
|
||||
if $CC_FOR_BUILD -E -dM -x c /dev/null | grep __LP64__>/dev/null 2>&1 ; then
|
||||
UNAME_PROCESSOR=x86_64
|
||||
fi ;;
|
||||
unknown) UNAME_PROCESSOR=powerpc ;;
|
||||
esac
|
||||
eval $set_cc_for_build
|
||||
if test "$UNAME_PROCESSOR" = unknown ; then
|
||||
UNAME_PROCESSOR=powerpc
|
||||
fi
|
||||
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
|
||||
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
|
||||
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
|
||||
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
|
||||
grep IS_64BIT_ARCH >/dev/null
|
||||
then
|
||||
case $UNAME_PROCESSOR in
|
||||
i386) UNAME_PROCESSOR=x86_64 ;;
|
||||
powerpc) UNAME_PROCESSOR=powerpc64 ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
elif test "$UNAME_PROCESSOR" = i386 ; then
|
||||
# Avoid executing cc on OS X 10.9, as it ships with a stub
|
||||
# that puts up a graphical alert prompting to install
|
||||
# developer tools. Any system running Mac OS X 10.7 or
|
||||
# later (Darwin 11 and later) is required to have a 64-bit
|
||||
# processor. This is not true of the ARM version of Darwin
|
||||
# that Apple uses in portable devices.
|
||||
UNAME_PROCESSOR=x86_64
|
||||
fi
|
||||
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:procnto*:*:* | *:QNX:[0123456789]*:*)
|
||||
@ -1266,7 +1294,10 @@ EOF
|
||||
*:QNX:*:4*)
|
||||
echo i386-pc-qnx
|
||||
exit ;;
|
||||
NSE-?:NONSTOP_KERNEL:*:*)
|
||||
NEO-?:NONSTOP_KERNEL:*:*)
|
||||
echo neo-tandem-nsk${UNAME_RELEASE}
|
||||
exit ;;
|
||||
NSE-*:NONSTOP_KERNEL:*:*)
|
||||
echo nse-tandem-nsk${UNAME_RELEASE}
|
||||
exit ;;
|
||||
NSR-?:NONSTOP_KERNEL:*:*)
|
||||
@ -1311,13 +1342,13 @@ EOF
|
||||
echo pdp10-unknown-its
|
||||
exit ;;
|
||||
SEI:*:*:SEIUX)
|
||||
echo mips-sei-seiux${UNAME_RELEASE}
|
||||
echo mips-sei-seiux${UNAME_RELEASE}
|
||||
exit ;;
|
||||
*:DragonFly:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit ;;
|
||||
*:*VMS:*:*)
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
||||
case "${UNAME_MACHINE}" in
|
||||
A*) echo alpha-dec-vms ; exit ;;
|
||||
I*) echo ia64-dec-vms ; exit ;;
|
||||
@ -1335,159 +1366,11 @@ EOF
|
||||
i*86:AROS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-aros
|
||||
exit ;;
|
||||
x86_64:VMkernel:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-esx
|
||||
exit ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||
|
||||
eval $set_cc_for_build
|
||||
cat >$dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
# include <sys/utsname.h>
|
||||
#endif
|
||||
main ()
|
||||
{
|
||||
#if defined (sony)
|
||||
#if defined (MIPSEB)
|
||||
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
|
||||
I don't know.... */
|
||||
printf ("mips-sony-bsd\n"); exit (0);
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
printf ("m68k-sony-newsos%s\n",
|
||||
#ifdef NEWSOS4
|
||||
"4"
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__arm) && defined (__acorn) && defined (__unix)
|
||||
printf ("arm-acorn-riscix\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (hp300) && !defined (hpux)
|
||||
printf ("m68k-hp-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (NeXT)
|
||||
#if !defined (__ARCHITECTURE__)
|
||||
#define __ARCHITECTURE__ "m68k"
|
||||
#endif
|
||||
int version;
|
||||
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
||||
if (version < 4)
|
||||
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
|
||||
else
|
||||
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
|
||||
exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (MULTIMAX) || defined (n16)
|
||||
#if defined (UMAXV)
|
||||
printf ("ns32k-encore-sysv\n"); exit (0);
|
||||
#else
|
||||
#if defined (CMU)
|
||||
printf ("ns32k-encore-mach\n"); exit (0);
|
||||
#else
|
||||
printf ("ns32k-encore-bsd\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__386BSD__)
|
||||
printf ("i386-pc-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (sequent)
|
||||
#if defined (i386)
|
||||
printf ("i386-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#if defined (ns32000)
|
||||
printf ("ns32k-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (_SEQUENT_)
|
||||
struct utsname un;
|
||||
|
||||
uname(&un);
|
||||
|
||||
if (strncmp(un.version, "V2", 2) == 0) {
|
||||
printf ("i386-sequent-ptx2\n"); exit (0);
|
||||
}
|
||||
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
|
||||
printf ("i386-sequent-ptx1\n"); exit (0);
|
||||
}
|
||||
printf ("i386-sequent-ptx\n"); exit (0);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (vax)
|
||||
# if !defined (ultrix)
|
||||
# include <sys/param.h>
|
||||
# if defined (BSD)
|
||||
# if BSD == 43
|
||||
printf ("vax-dec-bsd4.3\n"); exit (0);
|
||||
# else
|
||||
# if BSD == 199006
|
||||
printf ("vax-dec-bsd4.3reno\n"); exit (0);
|
||||
# else
|
||||
printf ("vax-dec-bsd\n"); exit (0);
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
printf ("vax-dec-bsd\n"); exit (0);
|
||||
# endif
|
||||
# else
|
||||
printf ("vax-dec-ultrix\n"); exit (0);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined (alliant) && defined (i860)
|
||||
printf ("i860-alliant-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
exit (1);
|
||||
}
|
||||
EOF
|
||||
|
||||
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
|
||||
{ echo "$SYSTEM_NAME"; exit; }
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
|
||||
|
||||
# Convex versions that predate uname can use getsysinfo(1)
|
||||
|
||||
if [ -x /usr/convex/getsysinfo ]
|
||||
then
|
||||
case `getsysinfo -f cpu_type` in
|
||||
c1*)
|
||||
echo c1-convex-bsd
|
||||
exit ;;
|
||||
c2*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit ;;
|
||||
c34*)
|
||||
echo c34-convex-bsd
|
||||
exit ;;
|
||||
c38*)
|
||||
echo c38-convex-bsd
|
||||
exit ;;
|
||||
c4*)
|
||||
echo c4-convex-bsd
|
||||
exit ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
cat >&2 <<EOF
|
||||
$0: unable to guess system type
|
||||
|
||||
|
293
build/autoconf/config.sub
vendored
293
build/autoconf/config.sub
vendored
@ -1,38 +1,31 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||
# Free Software Foundation, Inc.
|
||||
# Copyright 1992-2014 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2011-01-03'
|
||||
timestamp='2014-01-01'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
# the same distribution terms that you use for the rest of that
|
||||
# program. This Exception is an additional permission under section 7
|
||||
# of the GNU General Public License, version 3 ("GPLv3").
|
||||
|
||||
|
||||
# Please send patches to <config-patches@gnu.org>. Submit a context
|
||||
# diff and a properly formatted GNU ChangeLog entry.
|
||||
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
|
||||
#
|
||||
# Configuration subroutine to validate and canonicalize a configuration type.
|
||||
# Supply the specified configuration type as an argument.
|
||||
@ -75,8 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
|
||||
version="\
|
||||
GNU config.sub ($timestamp)
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
Copyright 1992-2014 Free Software Foundation, Inc.
|
||||
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
@ -123,10 +115,11 @@ esac
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
|
||||
uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | \
|
||||
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
|
||||
knetbsd*-gnu* | netbsd*-gnu* | \
|
||||
kopensolaris*-gnu* | \
|
||||
storm-chaos* | os2-emx* | rtmk-nova* | wince-winmo*)
|
||||
storm-chaos* | os2-emx* | rtmk-nova*)
|
||||
os=-$maybe_os
|
||||
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
|
||||
;;
|
||||
@ -152,12 +145,12 @@ case $os in
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple | -axis | -knuth | -cray | -microblaze)
|
||||
-apple | -axis | -knuth | -cray | -microblaze*)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-bluegene*)
|
||||
os=-cnk
|
||||
-bluegene*)
|
||||
os=-cnk
|
||||
;;
|
||||
-sim | -cisco | -oki | -wec | -winbond)
|
||||
os=
|
||||
@ -173,10 +166,10 @@ case $os in
|
||||
os=-chorusos
|
||||
basic_machine=$1
|
||||
;;
|
||||
-chorusrdb)
|
||||
os=-chorusrdb
|
||||
-chorusrdb)
|
||||
os=-chorusrdb
|
||||
basic_machine=$1
|
||||
;;
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
@ -221,6 +214,12 @@ case $os in
|
||||
-isc*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-lynx*178)
|
||||
os=-lynxos178
|
||||
;;
|
||||
-lynx*5)
|
||||
os=-lynxos5
|
||||
;;
|
||||
-lynx*)
|
||||
os=-lynxos
|
||||
;;
|
||||
@ -245,20 +244,28 @@ case $basic_machine in
|
||||
# Some are omitted here because they have special meanings below.
|
||||
1750a | 580 \
|
||||
| a29k \
|
||||
| aarch64 | aarch64_be \
|
||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
|
||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
|
||||
| am33_2.0 \
|
||||
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
|
||||
| arc | arceb \
|
||||
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
|
||||
| avr | avr32 \
|
||||
| be32 | be64 \
|
||||
| bfin \
|
||||
| c4x | clipper \
|
||||
| c4x | c8051 | clipper \
|
||||
| d10v | d30v | dlx | dsp16xx \
|
||||
| epiphany \
|
||||
| fido | fr30 | frv \
|
||||
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||
| hexagon \
|
||||
| i370 | i860 | i960 | ia64 \
|
||||
| ip2k | iq2000 \
|
||||
| k1om \
|
||||
| le32 | le64 \
|
||||
| lm32 \
|
||||
| m32c | m32r | m32rle | m68000 | m68k | m88k \
|
||||
| maxq | mb | microblaze | mcore | mep | metag \
|
||||
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
|
||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
||||
| mips16 \
|
||||
| mips64 | mips64el \
|
||||
@ -276,32 +283,45 @@ case $basic_machine in
|
||||
| mipsisa64r2 | mipsisa64r2el \
|
||||
| mipsisa64sb1 | mipsisa64sb1el \
|
||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
||||
| mipsr5900 | mipsr5900el \
|
||||
| mipstx39 | mipstx39el \
|
||||
| mn10200 | mn10300 \
|
||||
| moxie \
|
||||
| mt \
|
||||
| msp430 \
|
||||
| nios | nios2 \
|
||||
| nds32 | nds32le | nds32be \
|
||||
| nios | nios2 | nios2eb | nios2el \
|
||||
| ns16k | ns32k \
|
||||
| or32 \
|
||||
| open8 \
|
||||
| or1k | or32 \
|
||||
| pdp10 | pdp11 | pj | pjl \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
|
||||
| powerpc | powerpc64 | powerpc64le | powerpcle \
|
||||
| pyramid \
|
||||
| rl78 | rx \
|
||||
| score \
|
||||
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
|
||||
| sh64 | sh64le \
|
||||
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
|
||||
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
|
||||
| spu | strongarm \
|
||||
| tahoe | thumb | tic4x | tic80 | tron \
|
||||
| v850 | v850e \
|
||||
| spu \
|
||||
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
|
||||
| ubicom32 \
|
||||
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
|
||||
| we32k \
|
||||
| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
|
||||
| x86 | xc16x | xstormy16 | xtensa \
|
||||
| z8k | z80)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12)
|
||||
# Motorola 68HC11/12.
|
||||
c54x)
|
||||
basic_machine=tic54x-unknown
|
||||
;;
|
||||
c55x)
|
||||
basic_machine=tic55x-unknown
|
||||
;;
|
||||
c6x)
|
||||
basic_machine=tic6x-unknown
|
||||
;;
|
||||
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
@ -311,6 +331,21 @@ case $basic_machine in
|
||||
basic_machine=mt-unknown
|
||||
;;
|
||||
|
||||
strongarm | thumb | xscale)
|
||||
basic_machine=arm-unknown
|
||||
;;
|
||||
xgate)
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-none
|
||||
;;
|
||||
xscaleeb)
|
||||
basic_machine=armeb-unknown
|
||||
;;
|
||||
|
||||
xscaleel)
|
||||
basic_machine=armel-unknown
|
||||
;;
|
||||
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
@ -325,25 +360,31 @@ case $basic_machine in
|
||||
# Recognize the basic CPU types with company name.
|
||||
580-* \
|
||||
| a29k-* \
|
||||
| aarch64-* | aarch64_be-* \
|
||||
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
|
||||
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
|
||||
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
|
||||
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
|
||||
| avr-* | avr32-* \
|
||||
| be32-* | be64-* \
|
||||
| bfin-* | bs2000-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
|
||||
| clipper-* | craynv-* | cydra-* \
|
||||
| c[123]* | c30-* | [cjt]90-* | c4x-* \
|
||||
| c8051-* | clipper-* | craynv-* | cydra-* \
|
||||
| d10v-* | d30v-* | dlx-* \
|
||||
| elxsi-* \
|
||||
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
|
||||
| h8300-* | h8500-* \
|
||||
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
|
||||
| hexagon-* \
|
||||
| i*86-* | i860-* | i960-* | ia64-* \
|
||||
| ip2k-* | iq2000-* \
|
||||
| k1om-* \
|
||||
| le32-* | le64-* \
|
||||
| lm32-* \
|
||||
| m32c-* | m32r-* | m32rle-* \
|
||||
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
|
||||
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
|
||||
| microblaze-* | microblazeel-* \
|
||||
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
|
||||
| mips16-* \
|
||||
| mips64-* | mips64el-* \
|
||||
@ -361,28 +402,34 @@ case $basic_machine in
|
||||
| mipsisa64r2-* | mipsisa64r2el-* \
|
||||
| mipsisa64sb1-* | mipsisa64sb1el-* \
|
||||
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
|
||||
| mipsr5900-* | mipsr5900el-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| mmix-* \
|
||||
| mt-* \
|
||||
| msp430-* \
|
||||
| nios-* | nios2-* \
|
||||
| nds32-* | nds32le-* | nds32be-* \
|
||||
| nios-* | nios2-* | nios2eb-* | nios2el-* \
|
||||
| none-* | np1-* | ns16k-* | ns32k-* \
|
||||
| open8-* \
|
||||
| orion-* \
|
||||
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
|
||||
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
|
||||
| pyramid-* \
|
||||
| romp-* | rs6000-* \
|
||||
| rl78-* | romp-* | rs6000-* | rx-* \
|
||||
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
|
||||
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
|
||||
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
|
||||
| sparclite-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
|
||||
| tahoe-* | thumb-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
|
||||
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
|
||||
| tahoe-* \
|
||||
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
|
||||
| tile*-* \
|
||||
| tron-* \
|
||||
| v850-* | v850e-* | vax-* \
|
||||
| ubicom32-* \
|
||||
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
|
||||
| vax-* \
|
||||
| we32k-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
|
||||
| x86-* | x86_64-* | xc16x-* | xps100-* \
|
||||
| xstormy16-* | xtensa*-* \
|
||||
| ymp-* \
|
||||
| z8k-* | z80-*)
|
||||
@ -407,7 +454,7 @@ case $basic_machine in
|
||||
basic_machine=a29k-amd
|
||||
os=-udi
|
||||
;;
|
||||
abacus)
|
||||
abacus)
|
||||
basic_machine=abacus-unknown
|
||||
;;
|
||||
adobe68k)
|
||||
@ -477,11 +524,20 @@ case $basic_machine in
|
||||
basic_machine=powerpc-ibm
|
||||
os=-cnk
|
||||
;;
|
||||
c54x-*)
|
||||
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c55x-*)
|
||||
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c6x-*)
|
||||
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
c90)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
cegcc)
|
||||
cegcc)
|
||||
basic_machine=arm-unknown
|
||||
os=-cegcc
|
||||
;;
|
||||
@ -513,7 +569,7 @@ case $basic_machine in
|
||||
basic_machine=craynv-cray
|
||||
os=-unicosmp
|
||||
;;
|
||||
cr16)
|
||||
cr16 | cr16-*)
|
||||
basic_machine=cr16-unknown
|
||||
os=-elf
|
||||
;;
|
||||
@ -671,7 +727,6 @@ case $basic_machine in
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i*86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
@ -729,11 +784,15 @@ case $basic_machine in
|
||||
basic_machine=ns32k-utek
|
||||
os=-sysv
|
||||
;;
|
||||
microblaze)
|
||||
microblaze*)
|
||||
basic_machine=microblaze-xilinx
|
||||
;;
|
||||
mingw64)
|
||||
basic_machine=x86_64-pc
|
||||
os=-mingw64
|
||||
;;
|
||||
mingw32)
|
||||
basic_machine=i386-pc
|
||||
basic_machine=i686-pc
|
||||
os=-mingw32
|
||||
;;
|
||||
mingw32ce)
|
||||
@ -768,10 +827,18 @@ case $basic_machine in
|
||||
ms1-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
|
||||
;;
|
||||
msys)
|
||||
basic_machine=i686-pc
|
||||
os=-msys
|
||||
;;
|
||||
mvs)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
nacl)
|
||||
basic_machine=le32-unknown
|
||||
os=-nacl
|
||||
;;
|
||||
ncr3000)
|
||||
basic_machine=i486-ncr
|
||||
os=-sysv4
|
||||
@ -836,6 +903,12 @@ case $basic_machine in
|
||||
np1)
|
||||
basic_machine=np1-gould
|
||||
;;
|
||||
neo-tandem)
|
||||
basic_machine=neo-tandem
|
||||
;;
|
||||
nse-tandem)
|
||||
basic_machine=nse-tandem
|
||||
;;
|
||||
nsr-tandem)
|
||||
basic_machine=nsr-tandem
|
||||
;;
|
||||
@ -918,9 +991,10 @@ case $basic_machine in
|
||||
;;
|
||||
power) basic_machine=power-ibm
|
||||
;;
|
||||
ppc) basic_machine=powerpc-unknown
|
||||
ppc | ppcbe) basic_machine=powerpc-unknown
|
||||
;;
|
||||
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
ppc-* | ppcbe-*)
|
||||
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
ppcle | powerpclittle | ppc-le | powerpc-little)
|
||||
basic_machine=powerpcle-unknown
|
||||
@ -945,7 +1019,11 @@ case $basic_machine in
|
||||
basic_machine=i586-unknown
|
||||
os=-pw32
|
||||
;;
|
||||
rdos)
|
||||
rdos | rdos64)
|
||||
basic_machine=x86_64-pc
|
||||
os=-rdos
|
||||
;;
|
||||
rdos32)
|
||||
basic_machine=i386-pc
|
||||
os=-rdos
|
||||
;;
|
||||
@ -1014,6 +1092,9 @@ case $basic_machine in
|
||||
basic_machine=i860-stratus
|
||||
os=-sysv4
|
||||
;;
|
||||
strongarm-* | thumb-*)
|
||||
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
sun2)
|
||||
basic_machine=m68000-sun
|
||||
;;
|
||||
@ -1070,20 +1151,8 @@ case $basic_machine in
|
||||
basic_machine=t90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
tic54x | c54x*)
|
||||
basic_machine=tic54x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic55x | c55x*)
|
||||
basic_machine=tic55x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tic6x | c6x*)
|
||||
basic_machine=tic6x-unknown
|
||||
os=-coff
|
||||
;;
|
||||
tile*)
|
||||
basic_machine=tile-unknown
|
||||
basic_machine=$basic_machine-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
tx39)
|
||||
@ -1153,6 +1222,9 @@ case $basic_machine in
|
||||
xps | xps100)
|
||||
basic_machine=xps100-honeywell
|
||||
;;
|
||||
xscale-* | xscalee[bl]-*)
|
||||
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
|
||||
;;
|
||||
ymp)
|
||||
basic_machine=ymp-cray
|
||||
os=-unicos
|
||||
@ -1250,9 +1322,12 @@ esac
|
||||
if [ x"$os" != x"" ]
|
||||
then
|
||||
case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-auroraux)
|
||||
os=-auroraux
|
||||
;;
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
;;
|
||||
@ -1274,21 +1349,22 @@ case $os in
|
||||
# -sysv* is not here because it comes later, after sysvr4.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -kopensolaris* \
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
|
||||
| -sym* | -kopensolaris* | -plan9* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* | -aros* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
|
||||
| -openbsd* | -solidbsd* \
|
||||
| -bitrig* | -openbsd* | -solidbsd* \
|
||||
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
|
||||
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -chorusos* | -chorusrdb* | -cegcc* \
|
||||
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
|
||||
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -mingw64* | -linux-gnu* \
|
||||
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
|
||||
| -uxpv* | -beos* | -mpeix* | -udk* \
|
||||
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
|
||||
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
|
||||
@ -1296,7 +1372,7 @@ case $os in
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -winmo*)
|
||||
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
@ -1335,12 +1411,9 @@ case $os in
|
||||
-opened*)
|
||||
os=-openedition
|
||||
;;
|
||||
-os400*)
|
||||
-os400*)
|
||||
os=-os400
|
||||
;;
|
||||
-wince-winmo*)
|
||||
os=-wince-winmo
|
||||
;;
|
||||
-wince*)
|
||||
os=-wince
|
||||
;;
|
||||
@ -1387,7 +1460,7 @@ case $os in
|
||||
-sinix*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-tpf*)
|
||||
-tpf*)
|
||||
os=-tpf
|
||||
;;
|
||||
-triton*)
|
||||
@ -1423,9 +1496,6 @@ case $os in
|
||||
-aros*)
|
||||
os=-aros
|
||||
;;
|
||||
-kaos*)
|
||||
os=-kaos
|
||||
;;
|
||||
-zvmoe)
|
||||
os=-zvmoe
|
||||
;;
|
||||
@ -1435,6 +1505,8 @@ case $os in
|
||||
-android*)
|
||||
os=-android
|
||||
;;
|
||||
-nacl*)
|
||||
;;
|
||||
-none)
|
||||
;;
|
||||
*)
|
||||
@ -1457,10 +1529,10 @@ else
|
||||
# system, and we'll never get to this point.
|
||||
|
||||
case $basic_machine in
|
||||
score-*)
|
||||
score-*)
|
||||
os=-elf
|
||||
;;
|
||||
spu-*)
|
||||
spu-*)
|
||||
os=-elf
|
||||
;;
|
||||
*-acorn)
|
||||
@ -1472,8 +1544,23 @@ case $basic_machine in
|
||||
arm*-semi)
|
||||
os=-aout
|
||||
;;
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
c4x-* | tic4x-*)
|
||||
os=-coff
|
||||
;;
|
||||
c8051-*)
|
||||
os=-elf
|
||||
;;
|
||||
hexagon-*)
|
||||
os=-elf
|
||||
;;
|
||||
tic54x-*)
|
||||
os=-coff
|
||||
;;
|
||||
tic55x-*)
|
||||
os=-coff
|
||||
;;
|
||||
tic6x-*)
|
||||
os=-coff
|
||||
;;
|
||||
# This must come before the *-dec entry.
|
||||
pdp10-*)
|
||||
@ -1493,14 +1580,11 @@ case $basic_machine in
|
||||
;;
|
||||
m68000-sun)
|
||||
os=-sunos3
|
||||
# This also exists in the configure program, but was not the
|
||||
# default.
|
||||
# os=-sunos4
|
||||
;;
|
||||
m68*-cisco)
|
||||
os=-aout
|
||||
;;
|
||||
mep-*)
|
||||
mep-*)
|
||||
os=-elf
|
||||
;;
|
||||
mips*-cisco)
|
||||
@ -1509,6 +1593,9 @@ case $basic_machine in
|
||||
mips*-*)
|
||||
os=-elf
|
||||
;;
|
||||
or1k-*)
|
||||
os=-elf
|
||||
;;
|
||||
or32-*)
|
||||
os=-coff
|
||||
;;
|
||||
@ -1527,7 +1614,7 @@ case $basic_machine in
|
||||
*-ibm)
|
||||
os=-aix
|
||||
;;
|
||||
*-knuth)
|
||||
*-knuth)
|
||||
os=-mmixware
|
||||
;;
|
||||
*-wec)
|
||||
|
@ -1144,7 +1144,7 @@ case "$OS_TEST" in
|
||||
CPU_ARCH=x86
|
||||
;;
|
||||
|
||||
powerpc64 | ppc64)
|
||||
powerpc64 | ppc64 | powerpc64le | ppc64le)
|
||||
CPU_ARCH=ppc64
|
||||
;;
|
||||
|
||||
|
@ -96,6 +96,7 @@ GST_FUNC(LIBGSTVIDEO, gst_video_format_get_component_width)
|
||||
GST_FUNC(LIBGSTVIDEO, gst_video_format_get_pixel_stride)
|
||||
GST_FUNC(LIBGSTVIDEO, gst_video_format_get_row_stride)
|
||||
GST_FUNC(LIBGSTVIDEO, gst_video_format_parse_caps)
|
||||
GST_FUNC(LIBGSTVIDEO, gst_video_parse_caps_pixel_aspect_ratio)
|
||||
#else
|
||||
|
||||
GST_FUNC(LIBGSTAPP, gst_app_sink_pull_sample)
|
||||
|
@ -994,6 +994,7 @@ void GStreamerReader::VideoPreroll()
|
||||
/* The first video buffer has reached the video sink. Get width and height */
|
||||
LOG(PR_LOG_DEBUG, "Video preroll");
|
||||
GstPad* sinkpad = gst_element_get_static_pad(GST_ELEMENT(mVideoAppSink), "sink");
|
||||
int PARNumerator, PARDenominator;
|
||||
#if GST_VERSION_MAJOR >= 1
|
||||
GstCaps* caps = gst_pad_get_current_caps(sinkpad);
|
||||
memset (&mVideoInfo, 0, sizeof (mVideoInfo));
|
||||
@ -1001,15 +1002,34 @@ void GStreamerReader::VideoPreroll()
|
||||
mFormat = mVideoInfo.finfo->format;
|
||||
mPicture.width = mVideoInfo.width;
|
||||
mPicture.height = mVideoInfo.height;
|
||||
PARNumerator = GST_VIDEO_INFO_PAR_N(&mVideoInfo);
|
||||
PARDenominator = GST_VIDEO_INFO_PAR_D(&mVideoInfo);
|
||||
#else
|
||||
GstCaps* caps = gst_pad_get_negotiated_caps(sinkpad);
|
||||
gst_video_format_parse_caps(caps, &mFormat, &mPicture.width, &mPicture.height);
|
||||
if (!gst_video_parse_caps_pixel_aspect_ratio(caps, &PARNumerator, &PARDenominator)) {
|
||||
PARNumerator = 1;
|
||||
PARDenominator = 1;
|
||||
}
|
||||
#endif
|
||||
GstStructure* structure = gst_caps_get_structure(caps, 0);
|
||||
gst_structure_get_fraction(structure, "framerate", &fpsNum, &fpsDen);
|
||||
NS_ASSERTION(mPicture.width && mPicture.height, "invalid video resolution");
|
||||
mInfo.mVideo.mDisplay = ThebesIntSize(mPicture.Size());
|
||||
mInfo.mVideo.mHasVideo = true;
|
||||
|
||||
// Calculate display size according to pixel aspect ratio.
|
||||
nsIntRect pictureRect(0, 0, mPicture.width, mPicture.height);
|
||||
nsIntSize frameSize = nsIntSize(mPicture.width, mPicture.height);
|
||||
nsIntSize displaySize = nsIntSize(mPicture.width, mPicture.height);
|
||||
ScaleDisplayByAspectRatio(displaySize, float(PARNumerator) / float(PARDenominator));
|
||||
|
||||
// If video frame size is overflow, stop playing.
|
||||
if (IsValidVideoRegion(frameSize, pictureRect, displaySize)) {
|
||||
GstStructure* structure = gst_caps_get_structure(caps, 0);
|
||||
gst_structure_get_fraction(structure, "framerate", &fpsNum, &fpsDen);
|
||||
mInfo.mVideo.mDisplay = ThebesIntSize(displaySize.ToIntSize());
|
||||
mInfo.mVideo.mHasVideo = true;
|
||||
} else {
|
||||
LOG(PR_LOG_DEBUG, "invalid video region");
|
||||
Eos();
|
||||
}
|
||||
gst_caps_unref(caps);
|
||||
gst_object_unref(sinkpad);
|
||||
}
|
||||
|
@ -1420,6 +1420,13 @@ DOMInterfaces = {
|
||||
'headerFile': 'WebGLVertexArray.h'
|
||||
},
|
||||
|
||||
'WebrtcGlobalInformation': {
|
||||
'nativeType': 'mozilla::dom::WebrtcGlobalInformation',
|
||||
'headerFile': 'WebrtcGlobalInformation.h',
|
||||
'wrapperCache': False,
|
||||
'concrete': False,
|
||||
},
|
||||
|
||||
'WebSocket': {
|
||||
'headerFile': 'WebSocket.h',
|
||||
},
|
||||
|
@ -634,11 +634,6 @@ TabChild::HandlePossibleViewportChange()
|
||||
metrics.mScrollId = viewId;
|
||||
}
|
||||
|
||||
metrics.mDisplayPort = AsyncPanZoomController::CalculatePendingDisplayPort(
|
||||
// The page must have been refreshed in some way such as a new document or
|
||||
// new CSS viewport, so we know that there's no velocity, acceleration, and
|
||||
// we have no idea how long painting will take.
|
||||
metrics, ScreenPoint(0.0f, 0.0f), 0.0);
|
||||
metrics.mCumulativeResolution = metrics.mZoom / metrics.mDevPixelsPerCSSPixel * ScreenToLayerScale(1);
|
||||
// This is the root layer, so the cumulative resolution is the same
|
||||
// as the resolution.
|
||||
@ -659,6 +654,14 @@ TabChild::HandlePossibleViewportChange()
|
||||
}
|
||||
metrics.mScrollableRect = CSSRect(CSSPoint(), pageSize);
|
||||
|
||||
// Calculate a display port _after_ having a scrollable rect because the
|
||||
// display port is clamped to the scrollable rect.
|
||||
metrics.mDisplayPort = AsyncPanZoomController::CalculatePendingDisplayPort(
|
||||
// The page must have been refreshed in some way such as a new document or
|
||||
// new CSS viewport, so we know that there's no velocity, acceleration, and
|
||||
// we have no idea how long painting will take.
|
||||
metrics, ScreenPoint(0.0f, 0.0f), 0.0);
|
||||
|
||||
// Force a repaint with these metrics. This, among other things, sets the
|
||||
// displayport, so we start with async painting.
|
||||
ProcessUpdateFrame(metrics);
|
||||
|
@ -14,7 +14,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "PeerConnectionIdp",
|
||||
"resource://gre/modules/media/PeerConnectionIdp.jsm");
|
||||
|
||||
const PC_CONTRACT = "@mozilla.org/dom/peerconnection;1";
|
||||
const WEBRTC_GLOBAL_CONTRACT = "@mozilla.org/dom/webrtcglobalinformation1";
|
||||
const PC_OBS_CONTRACT = "@mozilla.org/dom/peerconnectionobserver;1";
|
||||
const PC_ICE_CONTRACT = "@mozilla.org/dom/rtcicecandidate;1";
|
||||
const PC_SESSION_CONTRACT = "@mozilla.org/dom/rtcsessiondescription;1";
|
||||
@ -23,7 +22,6 @@ const PC_STATS_CONTRACT = "@mozilla.org/dom/rtcstatsreport;1";
|
||||
const PC_IDENTITY_CONTRACT = "@mozilla.org/dom/rtcidentityassertion;1";
|
||||
|
||||
const PC_CID = Components.ID("{00e0e20d-1494-4776-8e0e-0f0acbea3c79}");
|
||||
const WEBRTC_GLOBAL_CID = Components.ID("{f6063d11-f467-49ad-9765-e7923050dc08}");
|
||||
const PC_OBS_CID = Components.ID("{d1748d4c-7f6a-4dc5-add6-d55b7678537e}");
|
||||
const PC_ICE_CID = Components.ID("{02b9970c-433d-4cc2-923d-f7028ac66073}");
|
||||
const PC_SESSION_CID = Components.ID("{1775081b-b62d-4954-8ffe-a067bbf508a7}");
|
||||
@ -124,72 +122,9 @@ GlobalPCList.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
getStatsForEachPC: function(callback, errorCallback) {
|
||||
function getStatsFromPC(pcref) {
|
||||
try {
|
||||
pcref.get().getStatsInternal(null, callback, errorCallback);
|
||||
} catch (e) {
|
||||
errorCallback("Some error getting stats from PC: " + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
for (let winId in this._list) {
|
||||
if (this._list.hasOwnProperty(winId)) {
|
||||
this.removeNullRefs(winId);
|
||||
if (this._list[winId]) {
|
||||
this._list[winId].forEach(getStatsFromPC);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// TODO(bcampen@mozilla.com): Handle this with a global object in c++
|
||||
// (Bug 958221)
|
||||
getLoggingFromFirstPC: function(pattern, callback, errorCallback) {
|
||||
for (let winId in this._list) {
|
||||
this.removeNullRefs(winId);
|
||||
if (this._list[winId]) {
|
||||
// We expect removeNullRefs to not leave us with an empty array here
|
||||
let pcref = this._list[winId][0];
|
||||
pcref.get().getLogging(pattern, callback, errorCallback);
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
let _globalPCList = new GlobalPCList();
|
||||
|
||||
function WebrtcGlobalInformation() {
|
||||
}
|
||||
WebrtcGlobalInformation.prototype = {
|
||||
classDescription: "WebrtcGlobalInformation",
|
||||
classID: WEBRTC_GLOBAL_CID,
|
||||
contractID: WEBRTC_GLOBAL_CONTRACT,
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports]),
|
||||
|
||||
getAllStats: function(successCallback, failureCallback) {
|
||||
// TODO(bcampen@mozilla.com): Move the work of fanout into c++, and
|
||||
// only callback once. (Bug 958221)
|
||||
if (_globalPCList) {
|
||||
_globalPCList.getStatsForEachPC(successCallback, failureCallback);
|
||||
} else {
|
||||
failureCallback("No global PeerConnection list");
|
||||
}
|
||||
},
|
||||
|
||||
getLogs: function(pattern, callback, errorCallback) {
|
||||
if (_globalPCList) {
|
||||
_globalPCList.getLoggingFromFirstPC(pattern, callback, errorCallback);
|
||||
} else {
|
||||
errorCallback("No global PeerConnection list");
|
||||
}
|
||||
},
|
||||
|
||||
getCandPairLogs: function(candPairId, callback, errorCallback) {
|
||||
this.getLogs('CAND-PAIR(' + candPairId + ')', callback, errorCallback);
|
||||
},
|
||||
};
|
||||
|
||||
function RTCIceCandidate() {
|
||||
this.candidate = this.sdpMid = this.sdpMLineIndex = null;
|
||||
}
|
||||
@ -325,8 +260,6 @@ function RTCPeerConnection() {
|
||||
this._onCreateAnswerFailure = null;
|
||||
this._onGetStatsSuccess = null;
|
||||
this._onGetStatsFailure = null;
|
||||
this._onGetLoggingSuccess = null;
|
||||
this._onGetLoggingFailure = null;
|
||||
|
||||
this._pendingType = null;
|
||||
this._localType = null;
|
||||
@ -922,39 +855,16 @@ RTCPeerConnection.prototype = {
|
||||
getStats: function(selector, onSuccess, onError) {
|
||||
this._queueOrRun({
|
||||
func: this._getStats,
|
||||
args: [selector, onSuccess, onError, false],
|
||||
args: [selector, onSuccess, onError],
|
||||
wait: true
|
||||
});
|
||||
},
|
||||
|
||||
getStatsInternal: function(selector, onSuccess, onError) {
|
||||
this._queueOrRun({
|
||||
func: this._getStats,
|
||||
args: [selector, onSuccess, onError, true],
|
||||
wait: true
|
||||
});
|
||||
},
|
||||
|
||||
_getStats: function(selector, onSuccess, onError, internal) {
|
||||
_getStats: function(selector, onSuccess, onError) {
|
||||
this._onGetStatsSuccess = onSuccess;
|
||||
this._onGetStatsFailure = onError;
|
||||
|
||||
this._impl.getStats(selector, internal);
|
||||
},
|
||||
|
||||
getLogging: function(pattern, onSuccess, onError) {
|
||||
this._queueOrRun({
|
||||
func: this._getLogging,
|
||||
args: [pattern, onSuccess, onError],
|
||||
wait: true
|
||||
});
|
||||
},
|
||||
|
||||
_getLogging: function(pattern, onSuccess, onError) {
|
||||
this._onGetLoggingSuccess = onSuccess;
|
||||
this._onGetLoggingFailure = onError;
|
||||
|
||||
this._impl.getLogging(pattern);
|
||||
this._impl.getStats(selector);
|
||||
},
|
||||
|
||||
createDataChannel: function(label, dict) {
|
||||
@ -1306,16 +1216,6 @@ PeerConnectionObserver.prototype = {
|
||||
this._dompc._executeNext();
|
||||
},
|
||||
|
||||
onGetLoggingSuccess: function(logs) {
|
||||
this.callCB(this._dompc._onGetLoggingSuccess, logs);
|
||||
this._dompc._executeNext();
|
||||
},
|
||||
|
||||
onGetLoggingError: function(code, message) {
|
||||
this.callCB(this._dompc._onGetLoggingFailure, new RTCError(code, message));
|
||||
this._dompc._executeNext();
|
||||
},
|
||||
|
||||
onAddStream: function(stream) {
|
||||
this.dispatchEvent(new this._dompc._win.MediaStreamEvent("addstream",
|
||||
{ stream: stream }));
|
||||
@ -1356,6 +1256,5 @@ this.NSGetFactory = XPCOMUtils.generateNSGetFactory(
|
||||
RTCPeerConnection,
|
||||
RTCStatsReport,
|
||||
RTCIdentityAssertion,
|
||||
PeerConnectionObserver,
|
||||
WebrtcGlobalInformation]
|
||||
PeerConnectionObserver]
|
||||
);
|
||||
|
@ -1,5 +1,4 @@
|
||||
component {00e0e20d-1494-4776-8e0e-0f0acbea3c79} PeerConnection.js
|
||||
component {f6063d11-f467-49ad-9765-e7923050dc08} PeerConnection.js
|
||||
component {d1748d4c-7f6a-4dc5-add6-d55b7678537e} PeerConnection.js
|
||||
component {02b9970c-433d-4cc2-923d-f7028ac66073} PeerConnection.js
|
||||
component {1775081b-b62d-4954-8ffe-a067bbf508a7} PeerConnection.js
|
||||
@ -8,7 +7,6 @@ component {7fe6e18b-0da3-4056-bf3b-440ef3809e06} PeerConnection.js
|
||||
component {1abc7499-3c54-43e0-bd60-686e2703f072} PeerConnection.js
|
||||
|
||||
contract @mozilla.org/dom/peerconnection;1 {00e0e20d-1494-4776-8e0e-0f0acbea3c79}
|
||||
contract @mozilla.org/dom/webrtcglobalinformation;1 {f6063d11-f467-49ad-9765-e7923050dc08}
|
||||
contract @mozilla.org/dom/peerconnectionobserver;1 {d1748d4c-7f6a-4dc5-add6-d55b7678537e}
|
||||
contract @mozilla.org/dom/rtcicecandidate;1 {02b9970c-433d-4cc2-923d-f7028ac66073}
|
||||
contract @mozilla.org/dom/rtcsessiondescription;1 {1775081b-b62d-4954-8ffe-a067bbf508a7}
|
||||
|
@ -36,13 +36,7 @@ interface PeerConnectionImpl {
|
||||
/* Stats call, calls either |onGetStatsSuccess| or |onGetStatsError| on our
|
||||
observer. (see the |PeerConnectionObserver| interface) */
|
||||
[Throws]
|
||||
void getStats(MediaStreamTrack? selector, boolean internalStats);
|
||||
|
||||
/* Scrapes the RLogRingbuffer, and calls either |onGetLoggingSuccess|
|
||||
or |onGetLoggingError| on our observer.
|
||||
(see the |PeerConnectionObserver| interface) */
|
||||
[Throws]
|
||||
void getLogging(DOMString pattern);
|
||||
void getStats(MediaStreamTrack? selector);
|
||||
|
||||
/* Adds the stream created by GetUserMedia */
|
||||
[Throws]
|
||||
|
@ -28,10 +28,6 @@ interface PeerConnectionObserver
|
||||
void onGetStatsSuccess(optional RTCStatsReportInternal report);
|
||||
void onGetStatsError(unsigned long name, DOMString message);
|
||||
|
||||
/* Logging callbacks */
|
||||
void onGetLoggingSuccess(sequence<DOMString> logs);
|
||||
void onGetLoggingError(unsigned long name, DOMString message);
|
||||
|
||||
/* Data channel callbacks */
|
||||
void notifyDataChannel(DataChannel channel);
|
||||
void notifyConnection();
|
||||
|
@ -135,11 +135,6 @@ interface mozRTCPeerConnection : EventTarget {
|
||||
RTCStatsCallback successCallback,
|
||||
RTCPeerConnectionErrorCallback failureCallback);
|
||||
|
||||
[ChromeOnly]
|
||||
void getStatsInternal (MediaStreamTrack? selector,
|
||||
RTCStatsCallback successCallback,
|
||||
RTCPeerConnectionErrorCallback failureCallback);
|
||||
|
||||
// Data channel.
|
||||
RTCDataChannel createDataChannel (DOMString label,
|
||||
optional RTCDataChannelInit dataChannelDict);
|
||||
@ -152,18 +147,3 @@ interface mozRTCPeerConnection : EventTarget {
|
||||
attribute EventHandler onpeeridentity;
|
||||
};
|
||||
|
||||
callback RTCLogCallback = void (sequence<DOMString> logMessages);
|
||||
|
||||
[JSImplementation="@mozilla.org/dom/webrtcglobalinformation;1",
|
||||
ChromeOnly,
|
||||
Constructor ()]
|
||||
interface WebrtcGlobalInformation {
|
||||
void getAllStats(RTCStatsCallback callback,
|
||||
RTCPeerConnectionErrorCallback errorCallback);
|
||||
void getCandPairLogs(DOMString candPairId,
|
||||
RTCLogCallback callback,
|
||||
RTCPeerConnectionErrorCallback errorCallback);
|
||||
void getLogs(DOMString pattern,
|
||||
RTCLogCallback callback,
|
||||
RTCPeerConnectionErrorCallback errorCallback);
|
||||
};
|
||||
|
25
dom/webidl/WebrtcGlobalInformation.webidl
Normal file
25
dom/webidl/WebrtcGlobalInformation.webidl
Normal file
@ -0,0 +1,25 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
dictionary WebrtcGlobalStatisticsReport {
|
||||
sequence<RTCStatsReportInternal> reports;
|
||||
};
|
||||
|
||||
callback WebrtcGlobalStatisticsCallback = void (WebrtcGlobalStatisticsReport reports);
|
||||
callback WebrtcGlobalLoggingCallback = void (sequence<DOMString> logMessages);
|
||||
|
||||
[ChromeOnly]
|
||||
interface WebrtcGlobalInformation {
|
||||
|
||||
[Throws]
|
||||
static void getAllStats(WebrtcGlobalStatisticsCallback callback);
|
||||
|
||||
[Throws]
|
||||
static void getLogging(DOMString pattern,
|
||||
WebrtcGlobalLoggingCallback callback);
|
||||
};
|
||||
|
||||
|
@ -470,6 +470,7 @@ if CONFIG['MOZ_WEBRTC']:
|
||||
'PeerConnectionImplEnums.webidl',
|
||||
'PeerConnectionObserver.webidl',
|
||||
'PeerConnectionObserverEnums.webidl',
|
||||
'WebrtcGlobalInformation.webidl',
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_WEBSPEECH']:
|
||||
|
@ -61,34 +61,45 @@ public:
|
||||
numPreSquares++;
|
||||
}
|
||||
mNumPowTablePreSquares = numPreSquares;
|
||||
for (int i = 0; i < sCacheSize; i++) {
|
||||
Float a = i / Float(sCacheSize - 1);
|
||||
for (size_t i = 0; i < sCacheSize; i++) {
|
||||
// sCacheSize is chosen in such a way that a takes values
|
||||
// from 0.0 to 1.0 inclusive.
|
||||
Float a = i / Float(1 << sCacheIndexPrecisionBits);
|
||||
MOZ_ASSERT(0.0f <= a && a <= 1.0f, "We only want to cache for bases between 0 and 1.");
|
||||
|
||||
for (int j = 0; j < mNumPowTablePreSquares; j++) {
|
||||
a = sqrt(a);
|
||||
}
|
||||
mPowTable[i] = uint16_t(pow(a, mExponent) * (1 << sOutputIntPrecisionBits));
|
||||
uint32_t cachedInt = pow(a, mExponent) * (1 << sOutputIntPrecisionBits);
|
||||
MOZ_ASSERT(cachedInt < (1 << (sizeof(mPowTable[i]) * 8)), "mPowCache integer type too small");
|
||||
|
||||
mPowTable[i] = cachedInt;
|
||||
}
|
||||
}
|
||||
|
||||
uint16_t Pow(uint16_t aBase)
|
||||
{
|
||||
// Results should be similar to what the following code would produce:
|
||||
// double x = double(aBase) / (1 << sInputIntPrecisionBits);
|
||||
// Float x = Float(aBase) / (1 << sInputIntPrecisionBits);
|
||||
// return uint16_t(pow(x, mExponent) * (1 << sOutputIntPrecisionBits));
|
||||
|
||||
MOZ_ASSERT(aBase <= (1 << sInputIntPrecisionBits), "aBase needs to be between 0 and 1!");
|
||||
|
||||
uint32_t a = aBase;
|
||||
for (int j = 0; j < mNumPowTablePreSquares; j++) {
|
||||
a = a * a >> sInputIntPrecisionBits;
|
||||
}
|
||||
static_assert(sCacheSize == (1 << sInputIntPrecisionBits >> 7), "please fix index calculation below");
|
||||
int i = a >> 7;
|
||||
uint32_t i = a >> (sInputIntPrecisionBits - sCacheIndexPrecisionBits);
|
||||
MOZ_ASSERT(i < sCacheSize, "out-of-bounds mPowTable access");
|
||||
return mPowTable[i];
|
||||
}
|
||||
|
||||
private:
|
||||
static const int sCacheSize = 256;
|
||||
static const int sInputIntPrecisionBits = 15;
|
||||
static const int sOutputIntPrecisionBits = 8;
|
||||
static const int sOutputIntPrecisionBits = 15;
|
||||
static const int sCacheIndexPrecisionBits = 7;
|
||||
|
||||
private:
|
||||
static const size_t sCacheSize = (1 << sCacheIndexPrecisionBits) + 1;
|
||||
|
||||
Float mExponent;
|
||||
int mNumPowTablePreSquares;
|
||||
@ -190,11 +201,43 @@ ClearDataSourceSurface(DataSourceSurface *aSurface)
|
||||
PodZero(data, numBytes);
|
||||
}
|
||||
|
||||
static ptrdiff_t
|
||||
DataOffset(DataSourceSurface* aSurface, IntPoint aPoint)
|
||||
// This check is safe against integer overflow.
|
||||
static bool
|
||||
SurfaceContainsPoint(SourceSurface* aSurface, const IntPoint& aPoint)
|
||||
{
|
||||
return aPoint.y * aSurface->Stride() +
|
||||
aPoint.x * BytesPerPixel(aSurface->GetFormat());
|
||||
IntSize size = aSurface->GetSize();
|
||||
return aPoint.x >= 0 && aPoint.x < size.width &&
|
||||
aPoint.y >= 0 && aPoint.y < size.height;
|
||||
}
|
||||
|
||||
static uint8_t*
|
||||
DataAtOffset(DataSourceSurface* aSurface, IntPoint aPoint)
|
||||
{
|
||||
if (!SurfaceContainsPoint(aSurface, aPoint)) {
|
||||
MOZ_CRASH("sample position needs to be inside surface!");
|
||||
}
|
||||
|
||||
MOZ_ASSERT(Factory::CheckSurfaceSize(aSurface->GetSize()),
|
||||
"surface size overflows - this should have been prevented when the surface was created");
|
||||
|
||||
uint8_t* data = aSurface->GetData() + aPoint.y * aSurface->Stride() +
|
||||
aPoint.x * BytesPerPixel(aSurface->GetFormat());
|
||||
|
||||
if (data < aSurface->GetData()) {
|
||||
MOZ_CRASH("out-of-range data access");
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
static bool
|
||||
IntRectOverflows(const IntRect& aRect)
|
||||
{
|
||||
CheckedInt<int32_t> xMost = aRect.x;
|
||||
xMost += aRect.width;
|
||||
CheckedInt<int32_t> yMost = aRect.y;
|
||||
yMost += aRect.height;
|
||||
return !xMost.isValid() || !yMost.isValid();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -205,16 +248,23 @@ static void
|
||||
CopyRect(DataSourceSurface* aSrc, DataSourceSurface* aDest,
|
||||
IntRect aSrcRect, IntPoint aDestPoint)
|
||||
{
|
||||
if (IntRectOverflows(aSrcRect) ||
|
||||
IntRectOverflows(IntRect(aDestPoint, aSrcRect.Size()))) {
|
||||
MOZ_CRASH("we should never be getting invalid rects at this point");
|
||||
}
|
||||
|
||||
MOZ_ASSERT(aSrc->GetFormat() == aDest->GetFormat(), "different surface formats");
|
||||
MOZ_ASSERT(IntRect(IntPoint(), aSrc->GetSize()).Contains(aSrcRect), "source rect too big for source surface");
|
||||
MOZ_ASSERT(IntRect(IntPoint(), aDest->GetSize()).Contains(aSrcRect - aSrcRect.TopLeft() + aDestPoint), "dest surface too small");
|
||||
uint8_t* sourceData = aSrc->GetData();
|
||||
uint32_t sourceStride = aSrc->Stride();
|
||||
uint8_t* destData = aDest->GetData();
|
||||
uint32_t destStride = aDest->Stride();
|
||||
|
||||
sourceData += DataOffset(aSrc, aSrcRect.TopLeft());
|
||||
destData += DataOffset(aDest, aDestPoint);
|
||||
if (aSrcRect.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t* sourceData = DataAtOffset(aSrc, aSrcRect.TopLeft());
|
||||
uint32_t sourceStride = aSrc->Stride();
|
||||
uint8_t* destData = DataAtOffset(aDest, aDestPoint);
|
||||
uint32_t destStride = aDest->Stride();
|
||||
|
||||
if (BytesPerPixel(aSrc->GetFormat()) == 4) {
|
||||
for (int32_t y = 0; y < aSrcRect.height; y++) {
|
||||
@ -245,10 +295,15 @@ CloneAligned(DataSourceSurface* aSource)
|
||||
static void
|
||||
FillRectWithPixel(DataSourceSurface *aSurface, const IntRect &aFillRect, IntPoint aPixelPos)
|
||||
{
|
||||
uint8_t* data = aSurface->GetData();
|
||||
uint8_t* sourcePixelData = data + DataOffset(aSurface, aPixelPos);
|
||||
MOZ_ASSERT(!IntRectOverflows(aFillRect));
|
||||
MOZ_ASSERT(IntRect(IntPoint(), aSurface->GetSize()).Contains(aFillRect),
|
||||
"aFillRect needs to be completely inside the surface");
|
||||
MOZ_ASSERT(SurfaceContainsPoint(aSurface, aPixelPos),
|
||||
"aPixelPos needs to be inside the surface");
|
||||
|
||||
int32_t stride = aSurface->Stride();
|
||||
data += DataOffset(aSurface, aFillRect.TopLeft());
|
||||
uint8_t* sourcePixelData = DataAtOffset(aSurface, aPixelPos);
|
||||
uint8_t* data = DataAtOffset(aSurface, aFillRect.TopLeft());
|
||||
int bpp = BytesPerPixel(aSurface->GetFormat());
|
||||
|
||||
// Fill the first row by hand.
|
||||
@ -273,10 +328,16 @@ FillRectWithVerticallyRepeatingHorizontalStrip(DataSourceSurface *aSurface,
|
||||
const IntRect &aFillRect,
|
||||
const IntRect &aSampleRect)
|
||||
{
|
||||
uint8_t* data = aSurface->GetData();
|
||||
MOZ_ASSERT(!IntRectOverflows(aFillRect));
|
||||
MOZ_ASSERT(!IntRectOverflows(aSampleRect));
|
||||
MOZ_ASSERT(IntRect(IntPoint(), aSurface->GetSize()).Contains(aFillRect),
|
||||
"aFillRect needs to be completely inside the surface");
|
||||
MOZ_ASSERT(IntRect(IntPoint(), aSurface->GetSize()).Contains(aSampleRect),
|
||||
"aSampleRect needs to be completely inside the surface");
|
||||
|
||||
int32_t stride = aSurface->Stride();
|
||||
uint8_t* sampleData = data + DataOffset(aSurface, aSampleRect.TopLeft());
|
||||
data += DataOffset(aSurface, aFillRect.TopLeft());
|
||||
uint8_t* sampleData = DataAtOffset(aSurface, aSampleRect.TopLeft());
|
||||
uint8_t* data = DataAtOffset(aSurface, aFillRect.TopLeft());
|
||||
if (BytesPerPixel(aSurface->GetFormat()) == 4) {
|
||||
for (int32_t y = 0; y < aFillRect.height; y++) {
|
||||
PodCopy((uint32_t*)data, (uint32_t*)sampleData, aFillRect.width);
|
||||
@ -295,10 +356,16 @@ FillRectWithHorizontallyRepeatingVerticalStrip(DataSourceSurface *aSurface,
|
||||
const IntRect &aFillRect,
|
||||
const IntRect &aSampleRect)
|
||||
{
|
||||
uint8_t* data = aSurface->GetData();
|
||||
MOZ_ASSERT(!IntRectOverflows(aFillRect));
|
||||
MOZ_ASSERT(!IntRectOverflows(aSampleRect));
|
||||
MOZ_ASSERT(IntRect(IntPoint(), aSurface->GetSize()).Contains(aFillRect),
|
||||
"aFillRect needs to be completely inside the surface");
|
||||
MOZ_ASSERT(IntRect(IntPoint(), aSurface->GetSize()).Contains(aSampleRect),
|
||||
"aSampleRect needs to be completely inside the surface");
|
||||
|
||||
int32_t stride = aSurface->Stride();
|
||||
uint8_t* sampleData = data + DataOffset(aSurface, aSampleRect.TopLeft());
|
||||
data += DataOffset(aSurface, aFillRect.TopLeft());
|
||||
uint8_t* sampleData = DataAtOffset(aSurface, aSampleRect.TopLeft());
|
||||
uint8_t* data = DataAtOffset(aSurface, aFillRect.TopLeft());
|
||||
if (BytesPerPixel(aSurface->GetFormat()) == 4) {
|
||||
for (int32_t y = 0; y < aFillRect.height; y++) {
|
||||
int32_t sampleColor = *((uint32_t*)sampleData);
|
||||
@ -321,6 +388,10 @@ FillRectWithHorizontallyRepeatingVerticalStrip(DataSourceSurface *aSurface,
|
||||
static void
|
||||
DuplicateEdges(DataSourceSurface* aSurface, const IntRect &aFromRect)
|
||||
{
|
||||
MOZ_ASSERT(!IntRectOverflows(aFromRect));
|
||||
MOZ_ASSERT(IntRect(IntPoint(), aSurface->GetSize()).Contains(aFromRect),
|
||||
"aFromRect needs to be completely inside the surface");
|
||||
|
||||
IntSize size = aSurface->GetSize();
|
||||
IntRect fill;
|
||||
IntRect sampleRect;
|
||||
@ -424,6 +495,13 @@ GetDataSurfaceInRect(SourceSurface *aSurface,
|
||||
ConvolveMatrixEdgeMode aEdgeMode)
|
||||
{
|
||||
MOZ_ASSERT(aSurface ? aSurfaceRect.Size() == aSurface->GetSize() : aSurfaceRect.IsEmpty());
|
||||
|
||||
if (IntRectOverflows(aSurfaceRect) || IntRectOverflows(aDestRect)) {
|
||||
// We can't rely on the intersection calculations below to make sense when
|
||||
// XMost() or YMost() overflow. Bail out.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IntRect sourceRect = aSurfaceRect;
|
||||
|
||||
if (sourceRect.IsEqualEdges(aDestRect)) {
|
||||
@ -567,9 +645,23 @@ FilterNodeSoftware::Draw(DrawTarget* aDrawTarget,
|
||||
|
||||
Rect renderRect = aSourceRect;
|
||||
renderRect.RoundOut();
|
||||
IntRect renderIntRect(int32_t(renderRect.x), int32_t(renderRect.y),
|
||||
int32_t(renderRect.width), int32_t(renderRect.height));
|
||||
IntRect outputRect = renderIntRect.Intersect(GetOutputRectInRect(renderIntRect));
|
||||
IntRect renderIntRect;
|
||||
if (!renderRect.ToIntRect(&renderIntRect)) {
|
||||
#ifdef DEBUG_DUMP_SURFACES
|
||||
printf("render rect overflowed, not painting anything\n");
|
||||
printf("</pre>\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
IntRect outputRect = GetOutputRectInRect(renderIntRect);
|
||||
if (IntRectOverflows(outputRect)) {
|
||||
#ifdef DEBUG_DUMP_SURFACES
|
||||
printf("output rect overflowed, not painting anything\n");
|
||||
printf("</pre>\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
RefPtr<DataSourceSurface> result;
|
||||
if (!outputRect.IsEmpty()) {
|
||||
@ -613,6 +705,11 @@ TemporaryRef<DataSourceSurface>
|
||||
FilterNodeSoftware::GetOutput(const IntRect &aRect)
|
||||
{
|
||||
MOZ_ASSERT(GetOutputRectInRect(aRect).Contains(aRect));
|
||||
|
||||
if (IntRectOverflows(aRect)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!mCachedRect.Contains(aRect)) {
|
||||
RequestRect(aRect);
|
||||
mCachedOutput = Render(mRequestedRect);
|
||||
@ -639,6 +736,10 @@ FilterNodeSoftware::RequestRect(const IntRect &aRect)
|
||||
void
|
||||
FilterNodeSoftware::RequestInputRect(uint32_t aInputEnumIndex, const IntRect &aRect)
|
||||
{
|
||||
if (IntRectOverflows(aRect)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int32_t inputIndex = InputIndex(aInputEnumIndex);
|
||||
if (inputIndex < 0 || (uint32_t)inputIndex >= NumberOfSetInputs()) {
|
||||
MOZ_CRASH();
|
||||
@ -668,6 +769,10 @@ FilterNodeSoftware::GetInputDataSourceSurface(uint32_t aInputEnumIndex,
|
||||
ConvolveMatrixEdgeMode aEdgeMode,
|
||||
const IntRect *aTransparencyPaddedSourceRect)
|
||||
{
|
||||
if (IntRectOverflows(aRect)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DUMP_SURFACES
|
||||
printf("<section><h1>GetInputDataSourceSurface with aRect: %d, %d, %d, %d</h1>\n",
|
||||
aRect.x, aRect.y, aRect.width, aRect.height);
|
||||
@ -766,6 +871,10 @@ IntRect
|
||||
FilterNodeSoftware::GetInputRectInRect(uint32_t aInputEnumIndex,
|
||||
const IntRect &aInRect)
|
||||
{
|
||||
if (IntRectOverflows(aInRect)) {
|
||||
return IntRect();
|
||||
}
|
||||
|
||||
int32_t inputIndex = InputIndex(aInputEnumIndex);
|
||||
if (inputIndex < 0 || (uint32_t)inputIndex >= NumberOfSetInputs()) {
|
||||
MOZ_CRASH();
|
||||
@ -980,7 +1089,11 @@ FilterNodeTransformSoftware::SourceRectForOutputRect(const IntRect &aRect)
|
||||
|
||||
Rect neededRect = inverted.TransformBounds(Rect(aRect));
|
||||
neededRect.RoundOut();
|
||||
return GetInputRectInRect(IN_TRANSFORM_IN, RoundedToInt(neededRect));
|
||||
IntRect neededIntRect;
|
||||
if (!neededRect.ToIntRect(&neededIntRect)) {
|
||||
return IntRect();
|
||||
}
|
||||
return GetInputRectInRect(IN_TRANSFORM_IN, neededIntRect);
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
@ -1032,7 +1145,11 @@ FilterNodeTransformSoftware::GetOutputRectInRect(const IntRect& aRect)
|
||||
|
||||
Rect outRect = mMatrix.TransformBounds(Rect(srcRect));
|
||||
outRect.RoundOut();
|
||||
return RoundedToInt(outRect).Intersect(aRect);
|
||||
IntRect outIntRect;
|
||||
if (!outRect.ToIntRect(&outIntRect)) {
|
||||
return IntRect();
|
||||
}
|
||||
return outIntRect.Intersect(aRect);
|
||||
}
|
||||
|
||||
FilterNodeMorphologySoftware::FilterNodeMorphologySoftware()
|
||||
@ -1091,12 +1208,10 @@ ApplyMorphology(const IntRect& aSourceRect, DataSourceSurface* aInput,
|
||||
}
|
||||
|
||||
int32_t sourceStride = aInput->Stride();
|
||||
uint8_t* sourceData = aInput->GetData();
|
||||
sourceData += DataOffset(aInput, destRect.TopLeft() - srcRect.TopLeft());
|
||||
uint8_t* sourceData = DataAtOffset(aInput, destRect.TopLeft() - srcRect.TopLeft());
|
||||
|
||||
int32_t tmpStride = tmp->Stride();
|
||||
uint8_t* tmpData = tmp->GetData();
|
||||
tmpData += DataOffset(tmp, destRect.TopLeft() - tmpRect.TopLeft());
|
||||
uint8_t* tmpData = DataAtOffset(tmp, destRect.TopLeft() - tmpRect.TopLeft());
|
||||
|
||||
FilterProcessing::ApplyMorphologyHorizontal(
|
||||
sourceData, sourceStride, tmpData, tmpStride, tmpRect, rx, aOperator);
|
||||
@ -1112,8 +1227,7 @@ ApplyMorphology(const IntRect& aSourceRect, DataSourceSurface* aInput,
|
||||
}
|
||||
|
||||
int32_t tmpStride = tmp->Stride();
|
||||
uint8_t* tmpData = tmp->GetData();
|
||||
tmpData += DataOffset(tmp, destRect.TopLeft() - tmpRect.TopLeft());
|
||||
uint8_t* tmpData = DataAtOffset(tmp, destRect.TopLeft() - tmpRect.TopLeft());
|
||||
|
||||
int32_t destStride = dest->Stride();
|
||||
uint8_t* destData = dest->GetData();
|
||||
@ -2281,14 +2395,13 @@ FilterNodeConvolveMatrixSoftware::DoRender(const IntRect& aRect,
|
||||
}
|
||||
ClearDataSourceSurface(target);
|
||||
|
||||
uint8_t* sourceData = input->GetData();
|
||||
IntPoint offset = aRect.TopLeft() - srcRect.TopLeft();
|
||||
|
||||
uint8_t* sourceData = DataAtOffset(input, offset);
|
||||
int32_t sourceStride = input->Stride();
|
||||
uint8_t* targetData = target->GetData();
|
||||
int32_t targetStride = target->Stride();
|
||||
|
||||
IntPoint offset = aRect.TopLeft() - srcRect.TopLeft();
|
||||
sourceData += DataOffset(input, offset);
|
||||
|
||||
// Why exactly are we reversing the kernel?
|
||||
std::vector<Float> kernel = ReversedVector(mKernelMatrix);
|
||||
kernel = ScaledVector(kernel, mDivisor);
|
||||
@ -2428,16 +2541,15 @@ FilterNodeDisplacementMapSoftware::Render(const IntRect& aRect)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint8_t* sourceData = input->GetData();
|
||||
IntPoint offset = aRect.TopLeft() - srcRect.TopLeft();
|
||||
|
||||
uint8_t* sourceData = DataAtOffset(input, offset);
|
||||
int32_t sourceStride = input->Stride();
|
||||
uint8_t* mapData = map->GetData();
|
||||
int32_t mapStride = map->Stride();
|
||||
uint8_t* targetData = target->GetData();
|
||||
int32_t targetStride = target->Stride();
|
||||
|
||||
IntPoint offset = aRect.TopLeft() - srcRect.TopLeft();
|
||||
sourceData += DataOffset(input, offset);
|
||||
|
||||
static const ptrdiff_t channelMap[4] = {
|
||||
B8G8R8A8_COMPONENT_BYTEOFFSET_R,
|
||||
B8G8R8A8_COMPONENT_BYTEOFFSET_G,
|
||||
@ -2897,8 +3009,9 @@ FilterNodeCropSoftware::SetAttribute(uint32_t aIndex,
|
||||
MOZ_ASSERT(aIndex == ATT_CROP_RECT);
|
||||
Rect srcRect = aSourceRect;
|
||||
srcRect.Round();
|
||||
mCropRect = IntRect(int32_t(srcRect.x), int32_t(srcRect.y),
|
||||
int32_t(srcRect.width), int32_t(srcRect.height));
|
||||
if (!srcRect.ToIntRect(&mCropRect)) {
|
||||
mCropRect = IntRect();
|
||||
}
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
@ -3152,8 +3265,7 @@ void
|
||||
SpotLightSoftware::Prepare()
|
||||
{
|
||||
mVectorFromFocusPointToLight = Normalized(mPointsAt - mPosition);
|
||||
const float radPerDeg = static_cast<float>(M_PI/180.0);
|
||||
mLimitingConeCos = std::max<double>(cos(mLimitingConeAngle * radPerDeg), 0.0);
|
||||
mLimitingConeCos = std::max<double>(cos(mLimitingConeAngle * M_PI/180.0), 0.0);
|
||||
mPowCache.CacheForExponent(mSpecularFocus);
|
||||
}
|
||||
|
||||
@ -3172,11 +3284,12 @@ SpotLightSoftware::GetColor(uint32_t aLightColor, const Point3D &aVectorToLight)
|
||||
};
|
||||
color = aLightColor;
|
||||
Float dot = -aVectorToLight.DotProduct(mVectorFromFocusPointToLight);
|
||||
int16_t doti = dot * (255 << 7);
|
||||
uint16_t tmp = mPowCache.Pow(doti) * (dot >= mLimitingConeCos);
|
||||
colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_R] = uint8_t((colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_R] * tmp) >> 8);
|
||||
colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_G] = uint8_t((colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_G] * tmp) >> 8);
|
||||
colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_B] = uint8_t((colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_B] * tmp) >> 8);
|
||||
uint16_t doti = dot * (dot >= 0) * (1 << PowCache::sInputIntPrecisionBits);
|
||||
uint32_t tmp = mPowCache.Pow(doti) * (dot >= mLimitingConeCos);
|
||||
MOZ_ASSERT(tmp <= (1 << PowCache::sOutputIntPrecisionBits), "pow() result must not exceed 1.0");
|
||||
colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_R] = uint8_t((colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_R] * tmp) >> PowCache::sOutputIntPrecisionBits);
|
||||
colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_G] = uint8_t((colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_G] * tmp) >> PowCache::sOutputIntPrecisionBits);
|
||||
colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_B] = uint8_t((colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_B] * tmp) >> PowCache::sOutputIntPrecisionBits);
|
||||
colorC[B8G8R8A8_COMPONENT_BYTEOFFSET_A] = 255;
|
||||
return color;
|
||||
}
|
||||
@ -3293,14 +3406,13 @@ FilterNodeLightingSoftware<LightType, LightingType>::DoRender(const IntRect& aRe
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint8_t* sourceData = input->GetData();
|
||||
IntPoint offset = aRect.TopLeft() - srcRect.TopLeft();
|
||||
|
||||
uint8_t* sourceData = DataAtOffset(input, offset);
|
||||
int32_t sourceStride = input->Stride();
|
||||
uint8_t* targetData = target->GetData();
|
||||
int32_t targetStride = target->Stride();
|
||||
|
||||
IntPoint offset = aRect.TopLeft() - srcRect.TopLeft();
|
||||
sourceData += DataOffset(input, offset);
|
||||
|
||||
uint32_t lightColor = ColorToBGRA(mColor);
|
||||
mLight.Prepare();
|
||||
mLighting.Prepare();
|
||||
@ -3404,22 +3516,22 @@ SpecularLightingSoftware::LightPixel(const Point3D &aNormal,
|
||||
Point3D vectorToEye(0, 0, 1);
|
||||
Point3D halfwayVector = Normalized(aVectorToLight + vectorToEye);
|
||||
Float dotNH = aNormal.DotProduct(halfwayVector);
|
||||
uint16_t dotNHi = uint16_t(dotNH * (dotNH >= 0) * (255 << 7));
|
||||
uint32_t specularNHi = mSpecularConstantInt * mPowCache.Pow(dotNHi);
|
||||
uint16_t dotNHi = uint16_t(dotNH * (dotNH >= 0) * (1 << PowCache::sInputIntPrecisionBits));
|
||||
uint32_t specularNHi = uint32_t(mSpecularConstantInt) * mPowCache.Pow(dotNHi) >> 8;
|
||||
|
||||
union {
|
||||
uint32_t bgra;
|
||||
uint8_t components[4];
|
||||
} color = { aColor };
|
||||
color.components[B8G8R8A8_COMPONENT_BYTEOFFSET_B] =
|
||||
umin(FilterProcessing::FastDivideBy255<uint16_t>(
|
||||
specularNHi * color.components[B8G8R8A8_COMPONENT_BYTEOFFSET_B] >> 8), 255U);
|
||||
umin(
|
||||
(specularNHi * color.components[B8G8R8A8_COMPONENT_BYTEOFFSET_B]) >> PowCache::sOutputIntPrecisionBits, 255U);
|
||||
color.components[B8G8R8A8_COMPONENT_BYTEOFFSET_G] =
|
||||
umin(FilterProcessing::FastDivideBy255<uint16_t>(
|
||||
specularNHi * color.components[B8G8R8A8_COMPONENT_BYTEOFFSET_G] >> 8), 255U);
|
||||
umin(
|
||||
(specularNHi * color.components[B8G8R8A8_COMPONENT_BYTEOFFSET_G]) >> PowCache::sOutputIntPrecisionBits, 255U);
|
||||
color.components[B8G8R8A8_COMPONENT_BYTEOFFSET_R] =
|
||||
umin(FilterProcessing::FastDivideBy255<uint16_t>(
|
||||
specularNHi * color.components[B8G8R8A8_COMPONENT_BYTEOFFSET_R] >> 8), 255U);
|
||||
umin(
|
||||
(specularNHi * color.components[B8G8R8A8_COMPONENT_BYTEOFFSET_R]) >> PowCache::sOutputIntPrecisionBits, 255U);
|
||||
|
||||
color.components[B8G8R8A8_COMPONENT_BYTEOFFSET_A] =
|
||||
umax(color.components[B8G8R8A8_COMPONENT_BYTEOFFSET_B],
|
||||
|
@ -187,7 +187,7 @@ UNIFIED_SOURCES += [
|
||||
|
||||
MSVC_ENABLE_PGO = True
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
FINAL_LIBRARY = 'gkmedias'
|
||||
|
||||
DEFINES['PACKAGE_VERSION'] = '"moz"'
|
||||
DEFINES['PACKAGE_BUGREPORT'] = '"http://bugzilla.mozilla.org/"'
|
||||
|
@ -60,7 +60,7 @@ SOURCES += [
|
||||
|
||||
MSVC_ENABLE_PGO = True
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
FINAL_LIBRARY = 'gkmedias'
|
||||
LOCAL_INCLUDES += [
|
||||
'../../cairo/src',
|
||||
]
|
||||
|
@ -10,70 +10,50 @@
|
||||
namespace mozilla {
|
||||
namespace gl {
|
||||
|
||||
void
|
||||
RectTriangles::AppendRectToCoordArray(InfallibleTArray<coord>& array,
|
||||
GLfloat x0, GLfloat y0,
|
||||
GLfloat x1, GLfloat y1)
|
||||
{
|
||||
coord* v = array.AppendElements(6);
|
||||
|
||||
v[0].x = x0; v[0].y = y0;
|
||||
v[1].x = x1; v[1].y = y0;
|
||||
v[2].x = x0; v[2].y = y1;
|
||||
v[3].x = x0; v[3].y = y1;
|
||||
v[4].x = x1; v[4].y = y0;
|
||||
v[5].x = x1; v[5].y = y1;
|
||||
}
|
||||
|
||||
void
|
||||
RectTriangles::addRect(GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1,
|
||||
GLfloat tx0, GLfloat ty0, GLfloat tx1, GLfloat ty1,
|
||||
bool flip_y /* = false */)
|
||||
{
|
||||
if (vertexCoords.IsEmpty() &&
|
||||
x0 == 0.0f && y0 == 0.0f && x1 == 1.0f && y1 == 1.0f) {
|
||||
mIsSimpleQuad = true;
|
||||
if (flip_y) {
|
||||
mTextureTransform = gfx3DMatrix::From2D(gfxMatrix(tx1 - tx0, 0, 0, ty0 - ty1, tx0, ty1));
|
||||
} else {
|
||||
mTextureTransform = gfx3DMatrix::From2D(gfxMatrix(tx1 - tx0, 0, 0, ty1 - ty0, tx0, ty0));
|
||||
}
|
||||
} else if (mIsSimpleQuad) {
|
||||
mIsSimpleQuad = false;
|
||||
mTextureTransform = gfx3DMatrix();
|
||||
}
|
||||
|
||||
vert_coord v;
|
||||
v.x = x0; v.y = y0;
|
||||
vertexCoords.AppendElement(v);
|
||||
v.x = x1; v.y = y0;
|
||||
vertexCoords.AppendElement(v);
|
||||
v.x = x0; v.y = y1;
|
||||
vertexCoords.AppendElement(v);
|
||||
|
||||
v.x = x0; v.y = y1;
|
||||
vertexCoords.AppendElement(v);
|
||||
v.x = x1; v.y = y0;
|
||||
vertexCoords.AppendElement(v);
|
||||
v.x = x1; v.y = y1;
|
||||
vertexCoords.AppendElement(v);
|
||||
|
||||
if (flip_y) {
|
||||
tex_coord t;
|
||||
t.u = tx0; t.v = ty1;
|
||||
texCoords.AppendElement(t);
|
||||
t.u = tx1; t.v = ty1;
|
||||
texCoords.AppendElement(t);
|
||||
t.u = tx0; t.v = ty0;
|
||||
texCoords.AppendElement(t);
|
||||
|
||||
t.u = tx0; t.v = ty0;
|
||||
texCoords.AppendElement(t);
|
||||
t.u = tx1; t.v = ty1;
|
||||
texCoords.AppendElement(t);
|
||||
t.u = tx1; t.v = ty0;
|
||||
texCoords.AppendElement(t);
|
||||
} else {
|
||||
tex_coord t;
|
||||
t.u = tx0; t.v = ty0;
|
||||
texCoords.AppendElement(t);
|
||||
t.u = tx1; t.v = ty0;
|
||||
texCoords.AppendElement(t);
|
||||
t.u = tx0; t.v = ty1;
|
||||
texCoords.AppendElement(t);
|
||||
|
||||
t.u = tx0; t.v = ty1;
|
||||
texCoords.AppendElement(t);
|
||||
t.u = tx1; t.v = ty0;
|
||||
texCoords.AppendElement(t);
|
||||
t.u = tx1; t.v = ty1;
|
||||
texCoords.AppendElement(t);
|
||||
std::swap(ty0, ty1);
|
||||
}
|
||||
AppendRectToCoordArray(mVertexCoords, x0, y0, x1, y1);
|
||||
AppendRectToCoordArray(mTexCoords, tx0, ty0, tx1, ty1);
|
||||
}
|
||||
|
||||
bool
|
||||
RectTriangles::isSimpleQuad(gfx3DMatrix& aOutTextureTransform) const
|
||||
{
|
||||
if (mVertexCoords.Length() == 6 &&
|
||||
mVertexCoords[0].x == 0.0f &&
|
||||
mVertexCoords[0].y == 0.0f &&
|
||||
mVertexCoords[5].x == 1.0f &&
|
||||
mVertexCoords[5].y == 1.0f)
|
||||
{
|
||||
GLfloat tx0 = mTexCoords[0].x;
|
||||
GLfloat ty0 = mTexCoords[0].y;
|
||||
GLfloat tx1 = mTexCoords[5].x;
|
||||
GLfloat ty1 = mTexCoords[5].y;
|
||||
aOutTextureTransform = gfx3DMatrix::From2D(gfxMatrix(tx1 - tx0, 0, 0, ty1 - ty0, tx0, ty0));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static GLfloat
|
||||
@ -216,4 +196,4 @@ DecomposeIntoNoRepeatTriangles(const nsIntRect& aTexCoordRect,
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,50 +19,45 @@ namespace gl {
|
||||
*/
|
||||
class RectTriangles {
|
||||
public:
|
||||
RectTriangles() : mIsSimpleQuad(false) { }
|
||||
typedef struct { GLfloat x,y; } coord;
|
||||
|
||||
// Always pass texture coordinates upright. If you want to flip the
|
||||
// texture coordinates emitted to the tex_coords array, set flip_y to
|
||||
// true.
|
||||
void addRect(GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1,
|
||||
GLfloat tx0, GLfloat ty0, GLfloat tx1, GLfloat ty1,
|
||||
bool flip_y = false);
|
||||
GLfloat tx0, GLfloat ty0, GLfloat tx1, GLfloat ty1,
|
||||
bool flip_y = false);
|
||||
|
||||
// Returns whether this object is made of only one rect that can be drawn
|
||||
// with a pre-buffered unity quad which has 0,0,1,1 as both vertex
|
||||
// positions and texture coordinates.
|
||||
// aOutTextureTransform returns the transform that maps 0,0,1,1 texture
|
||||
// coordinates to the correct ones.
|
||||
bool IsSimpleQuad(gfx3DMatrix& aOutTextureTransform) const {
|
||||
aOutTextureTransform = mTextureTransform;
|
||||
return mIsSimpleQuad;
|
||||
}
|
||||
bool isSimpleQuad(gfx3DMatrix& aOutTextureTransform) const;
|
||||
|
||||
/**
|
||||
* these return a float pointer to the start of each array respectively.
|
||||
* Use it for glVertexAttribPointer calls.
|
||||
* We can return nullptr if we choose to use Vertex Buffer Objects here.
|
||||
*/
|
||||
float* vertexPointer() {
|
||||
return &vertexCoords[0].x;
|
||||
InfallibleTArray<coord>& vertCoords() {
|
||||
return mVertexCoords;
|
||||
}
|
||||
|
||||
float* texCoordPointer() {
|
||||
return &texCoords[0].u;
|
||||
InfallibleTArray<coord>& texCoords() {
|
||||
return mTexCoords;
|
||||
}
|
||||
|
||||
unsigned int elements() {
|
||||
return vertexCoords.Length();
|
||||
return mVertexCoords.Length();
|
||||
}
|
||||
|
||||
typedef struct { GLfloat x,y; } vert_coord;
|
||||
typedef struct { GLfloat u,v; } tex_coord;
|
||||
private:
|
||||
// default is 4 rectangles, each made up of 2 triangles (3 coord vertices each)
|
||||
nsAutoTArray<vert_coord, 6> vertexCoords;
|
||||
nsAutoTArray<tex_coord, 6> texCoords;
|
||||
gfx3DMatrix mTextureTransform;
|
||||
bool mIsSimpleQuad;
|
||||
// Reserve inline storage for one quad (2 triangles, 3 coords).
|
||||
nsAutoTArray<coord, 6> mVertexCoords;
|
||||
nsAutoTArray<coord, 6> mTexCoords;
|
||||
|
||||
static void
|
||||
AppendRectToCoordArray(InfallibleTArray<coord>& array, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -87,4 +82,4 @@ void DecomposeIntoNoRepeatTriangles(const nsIntRect& aTexCoordRect,
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DecomposeIntoNoRepeatTriangles_h_
|
||||
#endif // DecomposeIntoNoRepeatTriangles_h_
|
||||
|
@ -136,11 +136,11 @@ GLBlitTextureImageHelper::BlitTextureImage(TextureImage *aSrc, const nsIntRect&
|
||||
|
||||
// now put the coords into the d[xy]0 .. d[xy]1 coordinate space
|
||||
// from the 0..1 that it comes out of decompose
|
||||
RectTriangles::vert_coord* v = (RectTriangles::vert_coord*)rects.vertexPointer();
|
||||
InfallibleTArray<RectTriangles::coord>& coords = rects.vertCoords();
|
||||
|
||||
for (unsigned int i = 0; i < rects.elements(); ++i) {
|
||||
v[i].x = (v[i].x * (dx1 - dx0)) + dx0;
|
||||
v[i].y = (v[i].y * (dy1 - dy0)) + dy0;
|
||||
for (unsigned int i = 0; i < coords.Length(); ++i) {
|
||||
coords[i].x = (coords[i].x * (dx1 - dx0)) + dx0;
|
||||
coords[i].y = (coords[i].y * (dy1 - dy0)) + dy0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,8 +149,8 @@ GLBlitTextureImageHelper::BlitTextureImage(TextureImage *aSrc, const nsIntRect&
|
||||
|
||||
mGL->fBindBuffer(LOCAL_GL_ARRAY_BUFFER, 0);
|
||||
|
||||
mGL->fVertexAttribPointer(0, 2, LOCAL_GL_FLOAT, LOCAL_GL_FALSE, 0, rects.vertexPointer());
|
||||
mGL->fVertexAttribPointer(1, 2, LOCAL_GL_FLOAT, LOCAL_GL_FALSE, 0, rects.texCoordPointer());
|
||||
mGL->fVertexAttribPointer(0, 2, LOCAL_GL_FLOAT, LOCAL_GL_FALSE, 0, rects.vertCoords().Elements());
|
||||
mGL->fVertexAttribPointer(1, 2, LOCAL_GL_FLOAT, LOCAL_GL_FALSE, 0, rects.texCoords().Elements());
|
||||
|
||||
mGL->fEnableVertexAttribArray(0);
|
||||
mGL->fEnableVertexAttribArray(1);
|
||||
|
@ -80,6 +80,7 @@ static void
|
||||
DrawQuads(GLContext *aGLContext,
|
||||
VBOArena &aVBOs,
|
||||
ShaderProgramOGL *aProg,
|
||||
GLenum aMode,
|
||||
RectTriangles &aRects)
|
||||
{
|
||||
NS_ASSERTION(aProg->HasInitialized(), "Shader program not correctly initialized");
|
||||
@ -89,8 +90,7 @@ DrawQuads(GLContext *aGLContext,
|
||||
aProg->AttribLocation(ShaderProgramOGL::TexCoordAttrib);
|
||||
bool texCoords = (texCoordAttribIndex != GLuint(-1));
|
||||
|
||||
GLsizei elements = aRects.elements();
|
||||
GLsizei bytes = elements * 2 * sizeof(GLfloat);
|
||||
GLsizei bytes = aRects.elements() * 2 * sizeof(GLfloat);
|
||||
|
||||
GLsizei total = bytes;
|
||||
if (texCoords) {
|
||||
@ -107,7 +107,7 @@ DrawQuads(GLContext *aGLContext,
|
||||
aGLContext->fBufferSubData(LOCAL_GL_ARRAY_BUFFER,
|
||||
0,
|
||||
bytes,
|
||||
aRects.vertexPointer());
|
||||
aRects.vertCoords().Elements());
|
||||
aGLContext->fEnableVertexAttribArray(vertAttribIndex);
|
||||
aGLContext->fVertexAttribPointer(vertAttribIndex,
|
||||
2, LOCAL_GL_FLOAT,
|
||||
@ -118,7 +118,7 @@ DrawQuads(GLContext *aGLContext,
|
||||
aGLContext->fBufferSubData(LOCAL_GL_ARRAY_BUFFER,
|
||||
bytes,
|
||||
bytes,
|
||||
aRects.texCoordPointer());
|
||||
aRects.texCoords().Elements());
|
||||
aGLContext->fEnableVertexAttribArray(texCoordAttribIndex);
|
||||
aGLContext->fVertexAttribPointer(texCoordAttribIndex,
|
||||
2, LOCAL_GL_FLOAT,
|
||||
@ -126,7 +126,7 @@ DrawQuads(GLContext *aGLContext,
|
||||
0, BUFFER_OFFSET(bytes));
|
||||
}
|
||||
|
||||
aGLContext->fDrawArrays(LOCAL_GL_TRIANGLES, 0, elements);
|
||||
aGLContext->fDrawArrays(aMode, 0, aRects.elements());
|
||||
|
||||
aGLContext->fDisableVertexAttribArray(vertAttribIndex);
|
||||
if (texCoords) {
|
||||
@ -489,7 +489,7 @@ CompositorOGL::BindAndDrawQuadWithTextureRect(ShaderProgramOGL *aProg,
|
||||
}
|
||||
|
||||
gfx3DMatrix textureTransform;
|
||||
if (rects.IsSimpleQuad(textureTransform)) {
|
||||
if (rects.isSimpleQuad(textureTransform)) {
|
||||
Matrix4x4 transform;
|
||||
ToMatrix4x4(aTextureTransform * textureTransform, transform);
|
||||
aProg->SetTextureTransform(transform);
|
||||
@ -498,7 +498,7 @@ CompositorOGL::BindAndDrawQuadWithTextureRect(ShaderProgramOGL *aProg,
|
||||
Matrix4x4 transform;
|
||||
ToMatrix4x4(aTextureTransform, transform);
|
||||
aProg->SetTextureTransform(transform);
|
||||
DrawQuads(mGLContext, mVBOs, aProg, rects);
|
||||
DrawQuads(mGLContext, mVBOs, aProg, LOCAL_GL_TRIANGLES, rects);
|
||||
}
|
||||
}
|
||||
|
||||
@ -626,8 +626,11 @@ CompositorOGL::clearFBRect(const gfx::Rect* aRect)
|
||||
return;
|
||||
}
|
||||
|
||||
// Map aRect to OGL coordinates, origin:bottom-left
|
||||
GLint y = mHeight - (aRect->y + aRect->height);
|
||||
|
||||
ScopedGLState scopedScissorTestState(mGLContext, LOCAL_GL_SCISSOR_TEST, true);
|
||||
ScopedScissorRect autoScissorRect(mGLContext, aRect->x, aRect->y, aRect->width, aRect->height);
|
||||
ScopedScissorRect autoScissorRect(mGLContext, aRect->x, y, aRect->width, aRect->height);
|
||||
mGLContext->fClearColor(0.0, 0.0, 0.0, 0.0);
|
||||
mGLContext->fClear(LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ if not CONFIG['INTEL_ARCHITECTURE'] and CONFIG['CPU_ARCH'] == 'arm' and CONFIG['
|
||||
|
||||
MSVC_ENABLE_PGO = True
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
FINAL_LIBRARY = 'gkmedias'
|
||||
LOCAL_INCLUDES += [
|
||||
'trunk/include/config',
|
||||
'trunk/include/core',
|
||||
@ -66,6 +66,13 @@ if (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android') or \
|
||||
CONFIG['MOZ_WIDGET_QT'] or \
|
||||
CONFIG['MOZ_WIDGET_GTK']:
|
||||
DEFINES['SK_FONTHOST_DOES_NOT_USE_FONTMGR'] = 1
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
DEFINES['SKIA_DLL'] = 1
|
||||
DEFINES['GR_DLL'] = 1
|
||||
|
||||
DEFINES['SKIA_IMPLEMENTATION'] = 1
|
||||
DEFINES['GR_IMPLEMENTATION'] = 1
|
||||
"""
|
||||
|
||||
import json
|
||||
|
@ -807,7 +807,7 @@ if not CONFIG['INTEL_ARCHITECTURE'] and CONFIG['CPU_ARCH'] == 'arm' and CONFIG['
|
||||
|
||||
MSVC_ENABLE_PGO = True
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
FINAL_LIBRARY = 'gkmedias'
|
||||
LOCAL_INCLUDES += [
|
||||
'trunk/include/config',
|
||||
'trunk/include/core',
|
||||
@ -847,5 +847,15 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3', 'qt', 'gonk', 'co
|
||||
if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSSE3']:
|
||||
DEFINES['SK_BUILD_SSSE3'] = 1
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
DEFINES['SKIA_DLL'] = 1
|
||||
|
||||
if (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android') or (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk') or (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa') or CONFIG['MOZ_WIDGET_GTK'] or CONFIG['MOZ_WIDGET_QT']:
|
||||
DEFINES['SK_FONTHOST_DOES_NOT_USE_FONTMGR'] = 1
|
||||
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
|
||||
DEFINES['SKIA_DLL'] = 1
|
||||
DEFINES['GR_DLL'] = 1
|
||||
|
||||
DEFINES['SKIA_IMPLEMENTATION'] = 1
|
||||
DEFINES['GR_IMPLEMENTATION'] = 1
|
||||
|
@ -112,8 +112,9 @@ public:
|
||||
|
||||
/**
|
||||
* Copy to a Moz2D DataSourceSurface.
|
||||
* Marked as virtual so that browsercomps can access this method.
|
||||
*/
|
||||
mozilla::TemporaryRef<mozilla::gfx::DataSourceSurface> CopyToB8G8R8A8DataSourceSurface();
|
||||
virtual mozilla::TemporaryRef<mozilla::gfx::DataSourceSurface> CopyToB8G8R8A8DataSourceSurface();
|
||||
|
||||
/* return new Subimage with pointing to original image starting from aRect.pos
|
||||
* and size of aRect.size. New subimage keeping current image reference
|
||||
|
@ -46,6 +46,12 @@ DisableFontActivation()
|
||||
mainBundleID = ::CFBundleGetIdentifier(mainBundle);
|
||||
}
|
||||
|
||||
// bug 969388 and bug 922590 - mainBundlID as null is sometimes problematic
|
||||
if (!mainBundleID) {
|
||||
NS_WARNING("missing bundle ID, packaging set up incorrectly");
|
||||
return;
|
||||
}
|
||||
|
||||
// if possible, fetch CTFontManagerSetAutoActivationSetting
|
||||
void (*CTFontManagerSetAutoActivationSettingPtr)
|
||||
(CFStringRef, AutoActivationSetting);
|
||||
|
@ -165,16 +165,22 @@
|
||||
|| defined(__POWERPC__) \
|
||||
|| defined(_M_PPC) \
|
||||
|| defined(__PPC)
|
||||
#if !defined(__ppc64__) && !defined(__PPC64__)
|
||||
#define WTF_CPU_PPC 1
|
||||
#endif
|
||||
#if !defined(__LITTLE_ENDIAN__)
|
||||
#define WTF_CPU_BIG_ENDIAN 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* WTF_CPU_PPC64 - PowerPC 64-bit */
|
||||
#if defined(__ppc64__) \
|
||||
|| defined(__PPC64__)
|
||||
#define WTF_CPU_PPC64 1
|
||||
#if !defined(__LITTLE_ENDIAN__)
|
||||
#define WTF_CPU_BIG_ENDIAN 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* WTF_CPU_SH4 - SuperH SH-4 */
|
||||
#if defined(__SH4__)
|
||||
|
@ -934,7 +934,7 @@ case "$OS_TEST" in
|
||||
CPU_ARCH=x86
|
||||
;;
|
||||
|
||||
powerpc64 | ppc64)
|
||||
powerpc64 | ppc64 | powerpc64le | ppc64le)
|
||||
CPU_ARCH=ppc64
|
||||
;;
|
||||
|
||||
|
12
js/src/ctypes/libffi/aclocal.m4
vendored
12
js/src/ctypes/libffi/aclocal.m4
vendored
@ -1282,7 +1282,7 @@ ia64-*-hpux*)
|
||||
rm -rf conftest*
|
||||
;;
|
||||
|
||||
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
|
||||
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
|
||||
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
# Find out which ABI we are using.
|
||||
echo 'int i;' > conftest.$ac_ext
|
||||
@ -1296,7 +1296,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_i386"
|
||||
;;
|
||||
ppc64-*linux*|powerpc64-*linux*)
|
||||
powerpc64le-*linux*)
|
||||
LD="${LD-ld} -m elf32lppclinux"
|
||||
;;
|
||||
powerpc64-*linux*)
|
||||
LD="${LD-ld} -m elf32ppclinux"
|
||||
;;
|
||||
s390x-*linux*)
|
||||
@ -1315,7 +1318,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_x86_64"
|
||||
;;
|
||||
ppc*-*linux*|powerpc*-*linux*)
|
||||
powerpcle-*linux*)
|
||||
LD="${LD-ld} -m elf64lppc"
|
||||
;;
|
||||
powerpc-*linux*)
|
||||
LD="${LD-ld} -m elf64ppc"
|
||||
;;
|
||||
s390*-*linux*|s390*-*tpf*)
|
||||
|
12
js/src/ctypes/libffi/configure
vendored
12
js/src/ctypes/libffi/configure
vendored
@ -6298,7 +6298,7 @@ ia64-*-hpux*)
|
||||
rm -rf conftest*
|
||||
;;
|
||||
|
||||
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
|
||||
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
|
||||
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
# Find out which ABI we are using.
|
||||
echo 'int i;' > conftest.$ac_ext
|
||||
@ -6316,7 +6316,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_i386"
|
||||
;;
|
||||
ppc64-*linux*|powerpc64-*linux*)
|
||||
powerpc64le-*linux*)
|
||||
LD="${LD-ld} -m elf32lppclinux"
|
||||
;;
|
||||
powerpc64-*linux*)
|
||||
LD="${LD-ld} -m elf32ppclinux"
|
||||
;;
|
||||
s390x-*linux*)
|
||||
@ -6335,7 +6338,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_x86_64"
|
||||
;;
|
||||
ppc*-*linux*|powerpc*-*linux*)
|
||||
powerpcle-*linux*)
|
||||
LD="${LD-ld} -m elf64lppc"
|
||||
;;
|
||||
powerpc-*linux*)
|
||||
LD="${LD-ld} -m elf64ppc"
|
||||
;;
|
||||
s390*-*linux*|s390*-*tpf*)
|
||||
|
12
js/src/ctypes/libffi/m4/libtool.m4
vendored
12
js/src/ctypes/libffi/m4/libtool.m4
vendored
@ -1267,7 +1267,7 @@ ia64-*-hpux*)
|
||||
rm -rf conftest*
|
||||
;;
|
||||
|
||||
x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
|
||||
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
|
||||
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
# Find out which ABI we are using.
|
||||
echo 'int i;' > conftest.$ac_ext
|
||||
@ -1281,7 +1281,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_i386"
|
||||
;;
|
||||
ppc64-*linux*|powerpc64-*linux*)
|
||||
powerpc64le-*linux*)
|
||||
LD="${LD-ld} -m elf32lppclinux"
|
||||
;;
|
||||
powerpc64-*linux*)
|
||||
LD="${LD-ld} -m elf32ppclinux"
|
||||
;;
|
||||
s390x-*linux*)
|
||||
@ -1300,7 +1303,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
|
||||
x86_64-*linux*)
|
||||
LD="${LD-ld} -m elf_x86_64"
|
||||
;;
|
||||
ppc*-*linux*|powerpc*-*linux*)
|
||||
powerpcle-*linux*)
|
||||
LD="${LD-ld} -m elf64lppc"
|
||||
;;
|
||||
powerpc-*linux*)
|
||||
LD="${LD-ld} -m elf64ppc"
|
||||
;;
|
||||
s390*-*linux*|s390*-*tpf*)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,8 @@
|
||||
/* -----------------------------------------------------------------*-C-*-
|
||||
ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc.
|
||||
Copyright (C) 2007, 2008 Free Software Foundation, Inc
|
||||
ffitarget.h - Copyright (c) 2012 Anthony Green
|
||||
Copyright (C) 2007, 2008, 2010 Free Software Foundation, Inc
|
||||
Copyright (c) 1996-2003 Red Hat, Inc.
|
||||
|
||||
Target configuration macros for PowerPC.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
@ -28,6 +30,10 @@
|
||||
#ifndef LIBFFI_TARGET_H
|
||||
#define LIBFFI_TARGET_H
|
||||
|
||||
#ifndef LIBFFI_H
|
||||
#error "Please do not include ffitarget.h directly into your source. Use ffi.h instead."
|
||||
#endif
|
||||
|
||||
/* ---- System specific configurations ----------------------------------- */
|
||||
|
||||
#if defined (POWERPC) && defined (__powerpc64__) /* linux64 */
|
||||
@ -57,18 +63,14 @@ typedef enum ffi_abi {
|
||||
FFI_LINUX64,
|
||||
FFI_LINUX,
|
||||
FFI_LINUX_SOFT_FLOAT,
|
||||
# ifdef POWERPC64
|
||||
# if defined(POWERPC64)
|
||||
FFI_DEFAULT_ABI = FFI_LINUX64,
|
||||
# else
|
||||
# if (!defined(__NO_FPRS__) && (__LDBL_MANT_DIG__ == 106))
|
||||
FFI_DEFAULT_ABI = FFI_LINUX,
|
||||
# else
|
||||
# ifdef __NO_FPRS__
|
||||
# elif defined(__NO_FPRS__)
|
||||
FFI_DEFAULT_ABI = FFI_LINUX_SOFT_FLOAT,
|
||||
# else
|
||||
# elif (__LDBL_MANT_DIG__ == 106)
|
||||
FFI_DEFAULT_ABI = FFI_LINUX,
|
||||
# else
|
||||
FFI_DEFAULT_ABI = FFI_GCC_SYSV,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -101,6 +103,10 @@ typedef enum ffi_abi {
|
||||
|
||||
#define FFI_CLOSURES 1
|
||||
#define FFI_NATIVE_RAW_API 0
|
||||
#if defined (POWERPC) || defined (POWERPC_FREEBSD)
|
||||
# define FFI_TARGET_SPECIFIC_VARIADIC 1
|
||||
# define FFI_EXTRA_CIF_FIELDS unsigned nfixedargs
|
||||
#endif
|
||||
|
||||
/* For additional types like the below, take care about the order in
|
||||
ppc_closures.S. They must follow after the FFI_TYPE_LAST. */
|
||||
@ -113,10 +119,19 @@ typedef enum ffi_abi {
|
||||
defined in ffi.c, to determine the exact return type and its size. */
|
||||
#define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 2)
|
||||
|
||||
#if defined(POWERPC64) || defined(POWERPC_AIX)
|
||||
#define FFI_TRAMPOLINE_SIZE 24
|
||||
#else /* POWERPC || POWERPC_AIX */
|
||||
#define FFI_TRAMPOLINE_SIZE 40
|
||||
/* Used by ELFv2 for homogenous structure returns. */
|
||||
#define FFI_V2_TYPE_FLOAT_HOMOG (FFI_TYPE_LAST + 1)
|
||||
#define FFI_V2_TYPE_DOUBLE_HOMOG (FFI_TYPE_LAST + 2)
|
||||
#define FFI_V2_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 3)
|
||||
|
||||
#if _CALL_ELF == 2
|
||||
# define FFI_TRAMPOLINE_SIZE 32
|
||||
#else
|
||||
# if defined(POWERPC64) || defined(POWERPC_AIX)
|
||||
# define FFI_TRAMPOLINE_SIZE 24
|
||||
# else /* POWERPC || POWERPC_AIX */
|
||||
# define FFI_TRAMPOLINE_SIZE 40
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef LIBFFI_ASM
|
||||
|
@ -30,16 +30,33 @@
|
||||
#include <ffi.h>
|
||||
|
||||
#ifdef __powerpc64__
|
||||
.hidden ffi_call_LINUX64, .ffi_call_LINUX64
|
||||
.globl ffi_call_LINUX64, .ffi_call_LINUX64
|
||||
.hidden ffi_call_LINUX64
|
||||
.globl ffi_call_LINUX64
|
||||
# if _CALL_ELF == 2
|
||||
.text
|
||||
ffi_call_LINUX64:
|
||||
addis %r2, %r12, .TOC.-ffi_call_LINUX64@ha
|
||||
addi %r2, %r2, .TOC.-ffi_call_LINUX64@l
|
||||
.localentry ffi_call_LINUX64, . - ffi_call_LINUX64
|
||||
# else
|
||||
.section ".opd","aw"
|
||||
.align 3
|
||||
ffi_call_LINUX64:
|
||||
# ifdef _CALL_LINUX
|
||||
.quad .L.ffi_call_LINUX64,.TOC.@tocbase,0
|
||||
.type ffi_call_LINUX64,@function
|
||||
.text
|
||||
.L.ffi_call_LINUX64:
|
||||
# else
|
||||
.hidden .ffi_call_LINUX64
|
||||
.globl .ffi_call_LINUX64
|
||||
.quad .ffi_call_LINUX64,.TOC.@tocbase,0
|
||||
.size ffi_call_LINUX64,24
|
||||
.type .ffi_call_LINUX64,@function
|
||||
.text
|
||||
.ffi_call_LINUX64:
|
||||
# endif
|
||||
# endif
|
||||
.LFB1:
|
||||
mflr %r0
|
||||
std %r28, -32(%r1)
|
||||
@ -54,22 +71,35 @@ ffi_call_LINUX64:
|
||||
mr %r31, %r5 /* flags, */
|
||||
mr %r30, %r6 /* rvalue, */
|
||||
mr %r29, %r7 /* function address. */
|
||||
/* Save toc pointer, not for the ffi_prep_args64 call, but for the later
|
||||
bctrl function call. */
|
||||
# if _CALL_ELF == 2
|
||||
std %r2, 24(%r1)
|
||||
# else
|
||||
std %r2, 40(%r1)
|
||||
# endif
|
||||
|
||||
/* Call ffi_prep_args64. */
|
||||
mr %r4, %r1
|
||||
# if defined _CALL_LINUX || _CALL_ELF == 2
|
||||
bl ffi_prep_args64
|
||||
# else
|
||||
bl .ffi_prep_args64
|
||||
# endif
|
||||
|
||||
ld %r0, 0(%r29)
|
||||
# if _CALL_ELF == 2
|
||||
mr %r12, %r29
|
||||
# else
|
||||
ld %r12, 0(%r29)
|
||||
ld %r2, 8(%r29)
|
||||
ld %r11, 16(%r29)
|
||||
|
||||
# endif
|
||||
/* Now do the call. */
|
||||
/* Set up cr1 with bits 4-7 of the flags. */
|
||||
mtcrf 0x40, %r31
|
||||
|
||||
/* Get the address to call into CTR. */
|
||||
mtctr %r0
|
||||
mtctr %r12
|
||||
/* Load all those argument registers. */
|
||||
ld %r3, -32-(8*8)(%r28)
|
||||
ld %r4, -32-(7*8)(%r28)
|
||||
@ -104,12 +134,17 @@ ffi_call_LINUX64:
|
||||
|
||||
/* This must follow the call immediately, the unwinder
|
||||
uses this to find out if r2 has been saved or not. */
|
||||
# if _CALL_ELF == 2
|
||||
ld %r2, 24(%r1)
|
||||
# else
|
||||
ld %r2, 40(%r1)
|
||||
# endif
|
||||
|
||||
/* Now, deal with the return value. */
|
||||
mtcrf 0x01, %r31
|
||||
bt- 30, .Ldone_return_value
|
||||
bt- 29, .Lfp_return_value
|
||||
bt 31, .Lstruct_return_value
|
||||
bt 30, .Ldone_return_value
|
||||
bt 29, .Lfp_return_value
|
||||
std %r3, 0(%r30)
|
||||
/* Fall through... */
|
||||
|
||||
@ -117,7 +152,7 @@ ffi_call_LINUX64:
|
||||
/* Restore the registers we used and return. */
|
||||
mr %r1, %r28
|
||||
ld %r0, 16(%r28)
|
||||
ld %r28, -32(%r1)
|
||||
ld %r28, -32(%r28)
|
||||
mtlr %r0
|
||||
ld %r29, -24(%r1)
|
||||
ld %r30, -16(%r1)
|
||||
@ -134,10 +169,48 @@ ffi_call_LINUX64:
|
||||
.Lfloat_return_value:
|
||||
stfs %f1, 0(%r30)
|
||||
b .Ldone_return_value
|
||||
|
||||
.Lstruct_return_value:
|
||||
bf 29, .Lsmall_struct
|
||||
bf 28, .Lfloat_homog_return_value
|
||||
stfd %f1, 0(%r30)
|
||||
stfd %f2, 8(%r30)
|
||||
stfd %f3, 16(%r30)
|
||||
stfd %f4, 24(%r30)
|
||||
stfd %f5, 32(%r30)
|
||||
stfd %f6, 40(%r30)
|
||||
stfd %f7, 48(%r30)
|
||||
stfd %f8, 56(%r30)
|
||||
b .Ldone_return_value
|
||||
|
||||
.Lfloat_homog_return_value:
|
||||
stfs %f1, 0(%r30)
|
||||
stfs %f2, 4(%r30)
|
||||
stfs %f3, 8(%r30)
|
||||
stfs %f4, 12(%r30)
|
||||
stfs %f5, 16(%r30)
|
||||
stfs %f6, 20(%r30)
|
||||
stfs %f7, 24(%r30)
|
||||
stfs %f8, 28(%r30)
|
||||
b .Ldone_return_value
|
||||
|
||||
.Lsmall_struct:
|
||||
std %r3, 0(%r30)
|
||||
std %r4, 8(%r30)
|
||||
b .Ldone_return_value
|
||||
|
||||
.LFE1:
|
||||
.long 0
|
||||
.byte 0,12,0,1,128,4,0,0
|
||||
# if _CALL_ELF == 2
|
||||
.size ffi_call_LINUX64,.-ffi_call_LINUX64
|
||||
# else
|
||||
# ifdef _CALL_LINUX
|
||||
.size ffi_call_LINUX64,.-.L.ffi_call_LINUX64
|
||||
# else
|
||||
.size .ffi_call_LINUX64,.-.ffi_call_LINUX64
|
||||
# endif
|
||||
# endif
|
||||
|
||||
.section .eh_frame,EH_FRAME_FLAGS,@progbits
|
||||
.Lframe1:
|
||||
@ -180,8 +253,8 @@ ffi_call_LINUX64:
|
||||
.uleb128 0x4
|
||||
.align 3
|
||||
.LEFDE1:
|
||||
#endif
|
||||
|
||||
#if defined __ELF__ && defined __linux__
|
||||
# if (defined __ELF__ && defined __linux__) || _CALL_ELF == 2
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
# endif
|
||||
#endif
|
||||
|
@ -32,66 +32,125 @@
|
||||
|
||||
#ifdef __powerpc64__
|
||||
FFI_HIDDEN (ffi_closure_LINUX64)
|
||||
FFI_HIDDEN (.ffi_closure_LINUX64)
|
||||
.globl ffi_closure_LINUX64, .ffi_closure_LINUX64
|
||||
.globl ffi_closure_LINUX64
|
||||
# if _CALL_ELF == 2
|
||||
.text
|
||||
ffi_closure_LINUX64:
|
||||
addis %r2, %r12, .TOC.-ffi_closure_LINUX64@ha
|
||||
addi %r2, %r2, .TOC.-ffi_closure_LINUX64@l
|
||||
.localentry ffi_closure_LINUX64, . - ffi_closure_LINUX64
|
||||
# else
|
||||
.section ".opd","aw"
|
||||
.align 3
|
||||
ffi_closure_LINUX64:
|
||||
# ifdef _CALL_LINUX
|
||||
.quad .L.ffi_closure_LINUX64,.TOC.@tocbase,0
|
||||
.type ffi_closure_LINUX64,@function
|
||||
.text
|
||||
.L.ffi_closure_LINUX64:
|
||||
# else
|
||||
FFI_HIDDEN (.ffi_closure_LINUX64)
|
||||
.globl .ffi_closure_LINUX64
|
||||
.quad .ffi_closure_LINUX64,.TOC.@tocbase,0
|
||||
.size ffi_closure_LINUX64,24
|
||||
.type .ffi_closure_LINUX64,@function
|
||||
.text
|
||||
.ffi_closure_LINUX64:
|
||||
.LFB1:
|
||||
# save general regs into parm save area
|
||||
std %r3, 48(%r1)
|
||||
std %r4, 56(%r1)
|
||||
std %r5, 64(%r1)
|
||||
std %r6, 72(%r1)
|
||||
mflr %r0
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if _CALL_ELF == 2
|
||||
# 32 byte special reg save area + 64 byte parm save area
|
||||
# + 64 byte retval area + 13*8 fpr save area + round to 16
|
||||
# define STACKFRAME 272
|
||||
# define PARMSAVE 32
|
||||
# define RETVAL PARMSAVE+64
|
||||
# else
|
||||
# 48 bytes special reg save area + 64 bytes parm save area
|
||||
# + 16 bytes retval area + 13*8 bytes fpr save area + round to 16
|
||||
# define STACKFRAME 240
|
||||
# define PARMSAVE 48
|
||||
# define RETVAL PARMSAVE+64
|
||||
# endif
|
||||
|
||||
.LFB1:
|
||||
# if _CALL_ELF == 2
|
||||
ld %r12, FFI_TRAMPOLINE_SIZE(%r11) # closure->cif
|
||||
mflr %r0
|
||||
lwz %r12, 28(%r12) # cif->flags
|
||||
mtcrf 0x40, %r12
|
||||
addi %r12, %r1, PARMSAVE
|
||||
bt 7, .Lparmsave
|
||||
# Our caller has not allocated a parameter save area.
|
||||
# We need to allocate one here and use it to pass gprs to
|
||||
# ffi_closure_helper_LINUX64.
|
||||
addi %r12, %r1, -STACKFRAME+PARMSAVE
|
||||
.Lparmsave:
|
||||
std %r0, 16(%r1)
|
||||
# Save general regs into parm save area
|
||||
std %r3, 0(%r12)
|
||||
std %r4, 8(%r12)
|
||||
std %r5, 16(%r12)
|
||||
std %r6, 24(%r12)
|
||||
std %r7, 32(%r12)
|
||||
std %r8, 40(%r12)
|
||||
std %r9, 48(%r12)
|
||||
std %r10, 56(%r12)
|
||||
|
||||
# load up the pointer to the parm save area
|
||||
mr %r5, %r12
|
||||
# else
|
||||
mflr %r0
|
||||
# Save general regs into parm save area
|
||||
# This is the parameter save area set up by our caller.
|
||||
std %r3, PARMSAVE+0(%r1)
|
||||
std %r4, PARMSAVE+8(%r1)
|
||||
std %r5, PARMSAVE+16(%r1)
|
||||
std %r6, PARMSAVE+24(%r1)
|
||||
std %r7, PARMSAVE+32(%r1)
|
||||
std %r8, PARMSAVE+40(%r1)
|
||||
std %r9, PARMSAVE+48(%r1)
|
||||
std %r10, PARMSAVE+56(%r1)
|
||||
|
||||
std %r7, 80(%r1)
|
||||
std %r8, 88(%r1)
|
||||
std %r9, 96(%r1)
|
||||
std %r10, 104(%r1)
|
||||
std %r0, 16(%r1)
|
||||
|
||||
# mandatory 48 bytes special reg save area + 64 bytes parm save area
|
||||
# + 16 bytes retval area + 13*8 bytes fpr save area + round to 16
|
||||
stdu %r1, -240(%r1)
|
||||
.LCFI0:
|
||||
# load up the pointer to the parm save area
|
||||
addi %r5, %r1, PARMSAVE
|
||||
# endif
|
||||
|
||||
# next save fpr 1 to fpr 13
|
||||
stfd %f1, 128+(0*8)(%r1)
|
||||
stfd %f2, 128+(1*8)(%r1)
|
||||
stfd %f3, 128+(2*8)(%r1)
|
||||
stfd %f4, 128+(3*8)(%r1)
|
||||
stfd %f5, 128+(4*8)(%r1)
|
||||
stfd %f6, 128+(5*8)(%r1)
|
||||
stfd %f7, 128+(6*8)(%r1)
|
||||
stfd %f8, 128+(7*8)(%r1)
|
||||
stfd %f9, 128+(8*8)(%r1)
|
||||
stfd %f10, 128+(9*8)(%r1)
|
||||
stfd %f11, 128+(10*8)(%r1)
|
||||
stfd %f12, 128+(11*8)(%r1)
|
||||
stfd %f13, 128+(12*8)(%r1)
|
||||
stfd %f1, -104+(0*8)(%r1)
|
||||
stfd %f2, -104+(1*8)(%r1)
|
||||
stfd %f3, -104+(2*8)(%r1)
|
||||
stfd %f4, -104+(3*8)(%r1)
|
||||
stfd %f5, -104+(4*8)(%r1)
|
||||
stfd %f6, -104+(5*8)(%r1)
|
||||
stfd %f7, -104+(6*8)(%r1)
|
||||
stfd %f8, -104+(7*8)(%r1)
|
||||
stfd %f9, -104+(8*8)(%r1)
|
||||
stfd %f10, -104+(9*8)(%r1)
|
||||
stfd %f11, -104+(10*8)(%r1)
|
||||
stfd %f12, -104+(11*8)(%r1)
|
||||
stfd %f13, -104+(12*8)(%r1)
|
||||
|
||||
# load up the pointer to the saved fpr registers */
|
||||
addi %r6, %r1, -104
|
||||
|
||||
# load up the pointer to the result storage
|
||||
addi %r4, %r1, -STACKFRAME+RETVAL
|
||||
|
||||
stdu %r1, -STACKFRAME(%r1)
|
||||
.LCFI0:
|
||||
|
||||
# set up registers for the routine that actually does the work
|
||||
# get the context pointer from the trampoline
|
||||
mr %r3, %r11
|
||||
|
||||
# now load up the pointer to the result storage
|
||||
addi %r4, %r1, 112
|
||||
|
||||
# now load up the pointer to the parameter save area
|
||||
# in the previous frame
|
||||
addi %r5, %r1, 240 + 48
|
||||
|
||||
# now load up the pointer to the saved fpr registers */
|
||||
addi %r6, %r1, 128
|
||||
mr %r3, %r11
|
||||
|
||||
# make the call
|
||||
# if defined _CALL_LINUX || _CALL_ELF == 2
|
||||
bl ffi_closure_helper_LINUX64
|
||||
# else
|
||||
bl .ffi_closure_helper_LINUX64
|
||||
# endif
|
||||
.Lret:
|
||||
|
||||
# now r3 contains the return type
|
||||
@ -100,10 +159,12 @@ ffi_closure_LINUX64:
|
||||
|
||||
# look up the proper starting point in table
|
||||
# by using return type as offset
|
||||
ld %r0, STACKFRAME+16(%r1)
|
||||
cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT
|
||||
bge .Lsmall
|
||||
mflr %r4 # move address of .Lret to r4
|
||||
sldi %r3, %r3, 4 # now multiply return type by 16
|
||||
addi %r4, %r4, .Lret_type0 - .Lret
|
||||
ld %r0, 240+16(%r1)
|
||||
add %r3, %r3, %r4 # add contents of table to table address
|
||||
mtctr %r3
|
||||
bctr # jump to it
|
||||
@ -116,85 +177,175 @@ ffi_closure_LINUX64:
|
||||
.Lret_type0:
|
||||
# case FFI_TYPE_VOID
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
nop
|
||||
# case FFI_TYPE_INT
|
||||
lwa %r3, 112+4(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lwa %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lwa %r3, RETVAL+4(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_FLOAT
|
||||
lfs %f1, 112+0(%r1)
|
||||
lfs %f1, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_DOUBLE
|
||||
lfd %f1, 112+0(%r1)
|
||||
lfd %f1, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_LONGDOUBLE
|
||||
lfd %f1, 112+0(%r1)
|
||||
lfd %f1, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
lfd %f2, 112+8(%r1)
|
||||
lfd %f2, RETVAL+8(%r1)
|
||||
b .Lfinish
|
||||
# case FFI_TYPE_UINT8
|
||||
lbz %r3, 112+7(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lbz %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lbz %r3, RETVAL+7(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_SINT8
|
||||
lbz %r3, 112+7(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lbz %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lbz %r3, RETVAL+7(%r1)
|
||||
# endif
|
||||
extsb %r3,%r3
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
# case FFI_TYPE_UINT16
|
||||
lhz %r3, 112+6(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lhz %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lhz %r3, RETVAL+6(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
.Lfinish:
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_SINT16
|
||||
lha %r3, 112+6(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lha %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lha %r3, RETVAL+6(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_UINT32
|
||||
lwz %r3, 112+4(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lwz %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lwz %r3, RETVAL+4(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_SINT32
|
||||
lwa %r3, 112+4(%r1)
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
lwa %r3, RETVAL+0(%r1)
|
||||
# else
|
||||
lwa %r3, RETVAL+4(%r1)
|
||||
# endif
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_UINT64
|
||||
ld %r3, 112+0(%r1)
|
||||
ld %r3, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_SINT64
|
||||
ld %r3, 112+0(%r1)
|
||||
ld %r3, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# case FFI_TYPE_STRUCT
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
nop
|
||||
# case FFI_TYPE_POINTER
|
||||
ld %r3, 112+0(%r1)
|
||||
ld %r3, RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1, %r1, 240
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# esac
|
||||
# case FFI_V2_TYPE_FLOAT_HOMOG
|
||||
lfs %f1, RETVAL+0(%r1)
|
||||
lfs %f2, RETVAL+4(%r1)
|
||||
lfs %f3, RETVAL+8(%r1)
|
||||
b .Lmorefloat
|
||||
# case FFI_V2_TYPE_DOUBLE_HOMOG
|
||||
lfd %f1, RETVAL+0(%r1)
|
||||
lfd %f2, RETVAL+8(%r1)
|
||||
lfd %f3, RETVAL+16(%r1)
|
||||
lfd %f4, RETVAL+24(%r1)
|
||||
mtlr %r0
|
||||
lfd %f5, RETVAL+32(%r1)
|
||||
lfd %f6, RETVAL+40(%r1)
|
||||
lfd %f7, RETVAL+48(%r1)
|
||||
lfd %f8, RETVAL+56(%r1)
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
.Lmorefloat:
|
||||
lfs %f4, RETVAL+12(%r1)
|
||||
mtlr %r0
|
||||
lfs %f5, RETVAL+16(%r1)
|
||||
lfs %f6, RETVAL+20(%r1)
|
||||
lfs %f7, RETVAL+24(%r1)
|
||||
lfs %f8, RETVAL+28(%r1)
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
.Lsmall:
|
||||
# ifdef __LITTLE_ENDIAN__
|
||||
ld %r3,RETVAL+0(%r1)
|
||||
mtlr %r0
|
||||
ld %r4,RETVAL+8(%r1)
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
# else
|
||||
# A struct smaller than a dword is returned in the low bits of r3
|
||||
# ie. right justified. Larger structs are passed left justified
|
||||
# in r3 and r4. The return value area on the stack will have
|
||||
# the structs as they are usually stored in memory.
|
||||
cmpldi %r3, FFI_V2_TYPE_SMALL_STRUCT + 7 # size 8 bytes?
|
||||
neg %r5, %r3
|
||||
ld %r3,RETVAL+0(%r1)
|
||||
blt .Lsmalldown
|
||||
mtlr %r0
|
||||
ld %r4,RETVAL+8(%r1)
|
||||
addi %r1, %r1, STACKFRAME
|
||||
blr
|
||||
.Lsmalldown:
|
||||
addi %r5, %r5, FFI_V2_TYPE_SMALL_STRUCT + 7
|
||||
mtlr %r0
|
||||
sldi %r5, %r5, 3
|
||||
addi %r1, %r1, STACKFRAME
|
||||
srd %r3, %r3, %r5
|
||||
blr
|
||||
# endif
|
||||
|
||||
.LFE1:
|
||||
.long 0
|
||||
.byte 0,12,0,1,128,0,0,0
|
||||
# if _CALL_ELF == 2
|
||||
.size ffi_closure_LINUX64,.-ffi_closure_LINUX64
|
||||
# else
|
||||
# ifdef _CALL_LINUX
|
||||
.size ffi_closure_LINUX64,.-.L.ffi_closure_LINUX64
|
||||
# else
|
||||
.size .ffi_closure_LINUX64,.-.ffi_closure_LINUX64
|
||||
# endif
|
||||
# endif
|
||||
|
||||
.section .eh_frame,EH_FRAME_FLAGS,@progbits
|
||||
.Lframe1:
|
||||
@ -223,14 +374,14 @@ ffi_closure_LINUX64:
|
||||
.byte 0x2 # DW_CFA_advance_loc1
|
||||
.byte .LCFI0-.LFB1
|
||||
.byte 0xe # DW_CFA_def_cfa_offset
|
||||
.uleb128 240
|
||||
.uleb128 STACKFRAME
|
||||
.byte 0x11 # DW_CFA_offset_extended_sf
|
||||
.uleb128 0x41
|
||||
.sleb128 -2
|
||||
.align 3
|
||||
.LEFDE1:
|
||||
#endif
|
||||
|
||||
#if defined __ELF__ && defined __linux__
|
||||
# if defined __ELF__ && defined __linux__
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
# endif
|
||||
#endif
|
||||
|
@ -122,43 +122,78 @@ ENTRY(ffi_closure_SYSV)
|
||||
blr
|
||||
|
||||
# case FFI_TYPE_FLOAT
|
||||
#ifndef __NO_FPRS__
|
||||
lfs %f1,112+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
#else
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
#endif
|
||||
blr
|
||||
|
||||
# case FFI_TYPE_DOUBLE
|
||||
#ifndef __NO_FPRS__
|
||||
lfd %f1,112+0(%r1)
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
#else
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
#endif
|
||||
blr
|
||||
|
||||
# case FFI_TYPE_LONGDOUBLE
|
||||
#ifndef __NO_FPRS__
|
||||
lfd %f1,112+0(%r1)
|
||||
lfd %f2,112+8(%r1)
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
#else
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
blr
|
||||
#endif
|
||||
|
||||
# case FFI_TYPE_UINT8
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
lbz %r3,112+0(%r1)
|
||||
#else
|
||||
lbz %r3,112+3(%r1)
|
||||
#endif
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
blr
|
||||
|
||||
# case FFI_TYPE_SINT8
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
lbz %r3,112+0(%r1)
|
||||
#else
|
||||
lbz %r3,112+3(%r1)
|
||||
#endif
|
||||
extsb %r3,%r3
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
|
||||
# case FFI_TYPE_UINT16
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
lhz %r3,112+0(%r1)
|
||||
#else
|
||||
lhz %r3,112+2(%r1)
|
||||
#endif
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
blr
|
||||
|
||||
# case FFI_TYPE_SINT16
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
lha %r3,112+0(%r1)
|
||||
#else
|
||||
lha %r3,112+2(%r1)
|
||||
#endif
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
blr
|
||||
@ -203,7 +238,7 @@ ENTRY(ffi_closure_SYSV)
|
||||
lwz %r3,112+0(%r1)
|
||||
lwz %r4,112+4(%r1)
|
||||
lwz %r5,112+8(%r1)
|
||||
bl .Luint128
|
||||
b .Luint128
|
||||
|
||||
# The return types below are only used when the ABI type is FFI_SYSV.
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 1. One byte struct.
|
||||
@ -220,9 +255,15 @@ ENTRY(ffi_closure_SYSV)
|
||||
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 3. Three byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
blr
|
||||
#else
|
||||
srwi %r3,%r3,8
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
#endif
|
||||
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 4. Four byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
@ -233,20 +274,35 @@ ENTRY(ffi_closure_SYSV)
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 5. Five byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
lwz %r4,112+4(%r1)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
#else
|
||||
li %r5,24
|
||||
b .Lstruct567
|
||||
#endif
|
||||
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 6. Six byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
lwz %r4,112+4(%r1)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
#else
|
||||
li %r5,16
|
||||
b .Lstruct567
|
||||
#endif
|
||||
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 7. Seven byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
lwz %r4,112+4(%r1)
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
#else
|
||||
li %r5,8
|
||||
b .Lstruct567
|
||||
#endif
|
||||
|
||||
# case FFI_SYSV_TYPE_SMALL_STRUCT + 8. Eight byte struct.
|
||||
lwz %r3,112+0(%r1)
|
||||
@ -254,6 +310,7 @@ ENTRY(ffi_closure_SYSV)
|
||||
mtlr %r0
|
||||
b .Lfinish
|
||||
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
.Lstruct567:
|
||||
subfic %r6,%r5,32
|
||||
srw %r4,%r4,%r5
|
||||
@ -263,6 +320,7 @@ ENTRY(ffi_closure_SYSV)
|
||||
mtlr %r0
|
||||
addi %r1,%r1,144
|
||||
blr
|
||||
#endif
|
||||
|
||||
.Luint128:
|
||||
lwz %r6,112+12(%r1)
|
||||
|
@ -83,6 +83,7 @@ ENTRY(ffi_call_SYSV)
|
||||
nop
|
||||
1:
|
||||
|
||||
#ifndef __NO_FPRS__
|
||||
/* Load all the FP registers. */
|
||||
bf- 6,2f
|
||||
lfd %f1,-16-(8*4)-(8*8)(%r28)
|
||||
@ -94,6 +95,7 @@ ENTRY(ffi_call_SYSV)
|
||||
lfd %f6,-16-(8*4)-(3*8)(%r28)
|
||||
lfd %f7,-16-(8*4)-(2*8)(%r28)
|
||||
lfd %f8,-16-(8*4)-(1*8)(%r28)
|
||||
#endif
|
||||
2:
|
||||
|
||||
/* Make the call. */
|
||||
@ -103,7 +105,9 @@ ENTRY(ffi_call_SYSV)
|
||||
mtcrf 0x01,%r31 /* cr7 */
|
||||
bt- 31,L(small_struct_return_value)
|
||||
bt- 30,L(done_return_value)
|
||||
#ifndef __NO_FPRS__
|
||||
bt- 29,L(fp_return_value)
|
||||
#endif
|
||||
stw %r3,0(%r30)
|
||||
bf+ 28,L(done_return_value)
|
||||
stw %r4,4(%r30)
|
||||
@ -124,6 +128,7 @@ L(done_return_value):
|
||||
lwz %r1,0(%r1)
|
||||
blr
|
||||
|
||||
#ifndef __NO_FPRS__
|
||||
L(fp_return_value):
|
||||
bf 28,L(float_return_value)
|
||||
stfd %f1,0(%r30)
|
||||
@ -134,21 +139,17 @@ L(fp_return_value):
|
||||
L(float_return_value):
|
||||
stfs %f1,0(%r30)
|
||||
b L(done_return_value)
|
||||
#endif
|
||||
|
||||
L(small_struct_return_value):
|
||||
extrwi %r6,%r31,2,19 /* number of bytes padding = shift/8 */
|
||||
mtcrf 0x02,%r31 /* copy flags to cr[24:27] (cr6) */
|
||||
extrwi %r5,%r31,5,19 /* r5 <- number of bits of padding */
|
||||
subfic %r6,%r6,4 /* r6 <- number of useful bytes in r3 */
|
||||
bf- 25,L(done_return_value) /* struct in r3 ? if not, done. */
|
||||
/* smst_one_register: */
|
||||
slw %r3,%r3,%r5 /* Left-justify value in r3 */
|
||||
mtxer %r6 /* move byte count to XER ... */
|
||||
stswx %r3,0,%r30 /* ... and store that many bytes */
|
||||
bf+ 26,L(done_return_value) /* struct in r3:r4 ? */
|
||||
add %r6,%r6,%r30 /* adjust pointer */
|
||||
stswi %r4,%r6,4 /* store last four bytes */
|
||||
b L(done_return_value)
|
||||
/*
|
||||
* The C code always allocates a properly-aligned 8-byte bounce
|
||||
* buffer to make this assembly code very simple. Just write out
|
||||
* r3 and r4 to the buffer to allow the C code to handle the rest.
|
||||
*/
|
||||
stw %r3, 0(%r30)
|
||||
stw %r4, 4(%r30)
|
||||
b L(done_return_value)
|
||||
|
||||
.LFE1:
|
||||
END(ffi_call_SYSV)
|
||||
|
@ -1,17 +1,21 @@
|
||||
// Error().stack (ScriptFrameIter) should not include frames from other contexts.
|
||||
function g() {
|
||||
evaluate("function h() {\nstack = Error().stack;\n };\n h();", {newContext: true});
|
||||
// Error().stack (ScriptFrameIter) is no longer context-bound.
|
||||
function beta() {
|
||||
evaluate("function gamma() {\nstack = Error().stack;\n };\n gamma();", {newContext: true});
|
||||
}
|
||||
function f() {
|
||||
g();
|
||||
function alpha() {
|
||||
beta();
|
||||
}
|
||||
f();
|
||||
assertEq(stack,
|
||||
"h@@evaluate:2:1\n" +
|
||||
"@@evaluate:4:2\n");
|
||||
alpha();
|
||||
assertEq(/alpha/.test(stack), true);
|
||||
assertEq(/beta/.test(stack), true);
|
||||
assertEq(/gamma/.test(stack), true);
|
||||
assertEq(/delta/.test(stack), false);
|
||||
|
||||
function k() {
|
||||
function delta() {
|
||||
evaluate("stack = Error().stack", {newContext: true});
|
||||
}
|
||||
k();
|
||||
assertEq(stack, "@@evaluate:1:1\n");
|
||||
delta();
|
||||
assertEq(/alpha/.test(stack), false);
|
||||
assertEq(/beta/.test(stack), false);
|
||||
assertEq(/gamma/.test(stack), false);
|
||||
assertEq(/delta/.test(stack), true);
|
||||
|
@ -1,16 +1,15 @@
|
||||
// Error().stack (ScriptFrameIter) should not see through JS_SaveFrameChain.
|
||||
function h() {
|
||||
// Error().stack (ScriptFrameIter) should see through JS_SaveFrameChain.
|
||||
function gamma() {
|
||||
stack = Error().stack;
|
||||
}
|
||||
function g() {
|
||||
evaluate("h()", {saveFrameChain: true});
|
||||
function beta() {
|
||||
evaluate("gamma()", {saveFrameChain: true});
|
||||
}
|
||||
function f() {
|
||||
g();
|
||||
function alpha() {
|
||||
beta();
|
||||
}
|
||||
f();
|
||||
var lines = stack.split("\n");
|
||||
assertEq(lines.length, 3);
|
||||
assertEq(lines[0].startsWith("h@"), true);
|
||||
assertEq(lines[1].startsWith("@@evaluate"), true);
|
||||
assertEq(lines[2], "");
|
||||
alpha();
|
||||
|
||||
assertEq(/alpha/.test(stack), true);
|
||||
assertEq(/beta/.test(stack), true);
|
||||
assertEq(/gamma/.test(stack), true);
|
||||
|
@ -14,11 +14,18 @@ function f() {
|
||||
}
|
||||
f();
|
||||
|
||||
// Integers which don't fit in a double value's mantissa aren't really integers.
|
||||
// Really big integers not representable with a double or uint64 are still integers.
|
||||
|
||||
var bigint = "" + Math.pow(2, 53);
|
||||
x[bigint] = "twelve";
|
||||
assertEq(x[bigint], "twelve");
|
||||
assertEq(x[bigint], undefined);
|
||||
|
||||
x["9999999999999999999999"] = "twelve";
|
||||
assertEq(x["9999999999999999999999"], undefined);
|
||||
|
||||
// Except when their toString() makes them not look like integers!
|
||||
x[9999999999999999999999] = "twelve";
|
||||
assertEq(x[9999999999999999999999], "twelve");
|
||||
|
||||
// Infinity and -Infinity maybe are supposed to be integers, but they aren't currently.
|
||||
|
||||
|
@ -66,9 +66,9 @@ for (constructor of constructors) {
|
||||
a[-10 >>> 0] = "twelve";
|
||||
assertEq(a[-10 >>> 0], undefined);
|
||||
|
||||
// Watch for overly large indexed properties.
|
||||
// Watch for really large indexed properties too.
|
||||
a[Math.pow(2, 53)] = "twelve";
|
||||
assertEq(a[Math.pow(2, 53)], "twelve");
|
||||
assertEq(a[Math.pow(2, 53)], undefined);
|
||||
|
||||
// Don't define old properties.
|
||||
Object.defineProperty(a, 5, {value: 3});
|
||||
|
@ -27,7 +27,7 @@
|
||||
# define IS_LITTLE_ENDIAN 1
|
||||
# undef IS_BIG_ENDIAN
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
#elif defined(__APPLE__) || defined(__powerpc__) || defined(__ppc__)
|
||||
# if __LITTLE_ENDIAN__
|
||||
# define IS_LITTLE_ENDIAN 1
|
||||
# undef IS_BIG_ENDIAN
|
||||
@ -89,8 +89,7 @@
|
||||
# endif
|
||||
|
||||
#elif defined(__sparc) || defined(__sparc__) || \
|
||||
defined(_POWER) || defined(__powerpc__) || \
|
||||
defined(__ppc__) || defined(__hppa) || \
|
||||
defined(_POWER) || defined(__hppa) || \
|
||||
defined(_MIPSEB) || defined(_BIG_ENDIAN)
|
||||
/* IA64 running HP-UX will have _BIG_ENDIAN defined.
|
||||
* IA64 running Linux will have endian.h and be handled above.
|
||||
|
@ -212,10 +212,8 @@ js::ComputeStackString(JSContext *cx)
|
||||
{
|
||||
RootedAtom atom(cx);
|
||||
SuppressErrorsGuard seg(cx);
|
||||
// We should get rid of the CURRENT_CONTEXT and STOP_AT_SAVED here.
|
||||
// See bug 960820.
|
||||
for (NonBuiltinScriptFrameIter i(cx, ScriptFrameIter::CURRENT_CONTEXT,
|
||||
ScriptFrameIter::STOP_AT_SAVED,
|
||||
for (NonBuiltinScriptFrameIter i(cx, ScriptFrameIter::ALL_CONTEXTS,
|
||||
ScriptFrameIter::GO_THROUGH_SAVED,
|
||||
cx->compartment()->principals);
|
||||
!i.done(); ++i)
|
||||
{
|
||||
|
@ -3760,7 +3760,7 @@ DefinePropertyOrElement(typename ExecutionModeTraits<mode>::ExclusiveContextType
|
||||
|
||||
// Don't define new indexed properties on typed arrays.
|
||||
if (obj->is<TypedArrayObject>()) {
|
||||
double index;
|
||||
uint64_t index;
|
||||
if (IsTypedArrayIndex(id, &index))
|
||||
return true;
|
||||
}
|
||||
@ -4002,9 +4002,9 @@ LookupOwnPropertyWithFlagsInline(ExclusiveContext *cx,
|
||||
// so that integer properties on the prototype are ignored even for out
|
||||
// of bounds accesses.
|
||||
if (obj->template is<TypedArrayObject>()) {
|
||||
double index;
|
||||
uint64_t index;
|
||||
if (IsTypedArrayIndex(id, &index)) {
|
||||
if (index >= 0 && index < obj->template as<TypedArrayObject>().length()) {
|
||||
if (index < obj->template as<TypedArrayObject>().length()) {
|
||||
objp.set(obj);
|
||||
MarkDenseOrTypedArrayElementFound<allowGC>(propp);
|
||||
}
|
||||
@ -4595,9 +4595,9 @@ LookupPropertyPureInline(JSObject *obj, jsid id, JSObject **objp, Shape **propp)
|
||||
}
|
||||
|
||||
if (current->is<TypedArrayObject>()) {
|
||||
double index;
|
||||
uint64_t index;
|
||||
if (IsTypedArrayIndex(id, &index)) {
|
||||
if (index >= 0 && index < obj->as<TypedArrayObject>().length()) {
|
||||
if (index < obj->as<TypedArrayObject>().length()) {
|
||||
*objp = current;
|
||||
MarkDenseOrTypedArrayElementFound<NoGC>(propp);
|
||||
} else {
|
||||
|
@ -2500,12 +2500,8 @@ js::AsTypedArrayBuffer(HandleValue v)
|
||||
}
|
||||
|
||||
bool
|
||||
js::StringIsTypedArrayIndex(JSLinearString *str, double *indexp)
|
||||
js::StringIsTypedArrayIndex(JSLinearString *str, uint64_t *indexp)
|
||||
{
|
||||
// Largest double (2^53 - 1) which can be exactly represented in the
|
||||
// mantissa of a double.
|
||||
static const double MAX_INTEGER = 9007199254740991;
|
||||
|
||||
const jschar *s = str->chars();
|
||||
const jschar *end = s + str->length();
|
||||
|
||||
@ -2522,7 +2518,7 @@ js::StringIsTypedArrayIndex(JSLinearString *str, double *indexp)
|
||||
if (!JS7_ISDEC(*s))
|
||||
return false;
|
||||
|
||||
double index = 0;
|
||||
uint64_t index = 0;
|
||||
uint32_t digit = JS7_UNDEC(*s++);
|
||||
|
||||
/* Don't allow leading zeros. */
|
||||
@ -2537,17 +2533,17 @@ js::StringIsTypedArrayIndex(JSLinearString *str, double *indexp)
|
||||
|
||||
digit = JS7_UNDEC(*s);
|
||||
|
||||
/* Watch for mantissa overflows. */
|
||||
if ((MAX_INTEGER - digit) / 10 < index)
|
||||
return false;
|
||||
|
||||
index = 10 * index + digit;
|
||||
/* Watch for overflows. */
|
||||
if ((UINT64_MAX - digit) / 10 < index)
|
||||
index = UINT64_MAX;
|
||||
else
|
||||
index = 10 * index + digit;
|
||||
}
|
||||
|
||||
if (negative)
|
||||
index = -index;
|
||||
|
||||
*indexp = index;
|
||||
*indexp = UINT64_MAX;
|
||||
else
|
||||
*indexp = index;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -140,11 +140,14 @@ IsTypedArrayBuffer(HandleValue v);
|
||||
ArrayBufferObject &
|
||||
AsTypedArrayBuffer(HandleValue v);
|
||||
|
||||
// Return value is whether the string is some integer. If the string is an
|
||||
// integer which is not representable as a uint64_t, the return value is true
|
||||
// and the resulting index is UINT64_MAX.
|
||||
bool
|
||||
StringIsTypedArrayIndex(JSLinearString *str, double *indexp);
|
||||
StringIsTypedArrayIndex(JSLinearString *str, uint64_t *indexp);
|
||||
|
||||
inline bool
|
||||
IsTypedArrayIndex(jsid id, double *indexp)
|
||||
IsTypedArrayIndex(jsid id, uint64_t *indexp)
|
||||
{
|
||||
if (JSID_IS_INT(id)) {
|
||||
int32_t i = JSID_TO_INT(id);
|
||||
@ -156,7 +159,13 @@ IsTypedArrayIndex(jsid id, double *indexp)
|
||||
if (MOZ_UNLIKELY(!JSID_IS_STRING(id)))
|
||||
return false;
|
||||
|
||||
return StringIsTypedArrayIndex(JSID_TO_ATOM(id), indexp);
|
||||
JSAtom *atom = JSID_TO_ATOM(id);
|
||||
|
||||
jschar c = atom->chars()[0];
|
||||
if (!JS7_ISDEC(c) && c != '-')
|
||||
return false;
|
||||
|
||||
return StringIsTypedArrayIndex(atom, indexp);
|
||||
}
|
||||
|
||||
static inline unsigned
|
||||
|
@ -87,6 +87,7 @@ support-files =
|
||||
[test_bug92773.html]
|
||||
[test_bug940783.html]
|
||||
[test_bug965082.html]
|
||||
[test_bug960820.html]
|
||||
[test_crosscompartment_weakmap.html]
|
||||
[test_frameWrapping.html]
|
||||
# The JS test component we use below is only available in debug builds.
|
||||
|
47
js/xpconnect/tests/mochitest/test_bug960820.html
Normal file
47
js/xpconnect/tests/mochitest/test_bug960820.html
Normal file
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=960820
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 960820</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for exception stacks crossing **/
|
||||
|
||||
// Synchronous event dispatch creates a new script entry point. At the time
|
||||
// of this writing, an event listener defined in a Sandbox will cause the
|
||||
// SafeJSContext to be pushed to the cx stack, which differs from the JSContext
|
||||
// associated with this DOM window. So we test both kinds of boundaries.
|
||||
var sb = new SpecialPowers.Cu.Sandbox(SpecialPowers.Services.scriptSecurityManager.getSystemPrincipal());
|
||||
sb.win = window;
|
||||
SpecialPowers.Cu.evalInSandbox("win.document.addEventListener('click', " +
|
||||
"function clickHandler() { win.wrappedJSObject.clickCallback(); });", sb);
|
||||
function clickCallback() {
|
||||
var stack = (new Error()).stack;
|
||||
ok(true, "Invoked clickCallback. Stack: " + stack);
|
||||
ok(/clickCallback/.test(stack), "clickCallback should be in the stack");
|
||||
ok(!/clickHandler/.test(stack), "clickHandler should not be in the stack");
|
||||
ok(/dispatchClick/.test(stack), "dispatchClick should be in the stack");
|
||||
}
|
||||
function dispatchClick() {
|
||||
document.dispatchEvent(new MouseEvent('click'));
|
||||
}
|
||||
dispatchClick();
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=960820">Mozilla Bug 960820</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
13
layout/base/crashtests/847242.html
Normal file
13
layout/base/crashtests/847242.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.f { unicode-bidi: bidi-override; width: 1px; white-space: pre-line; }
|
||||
.f:first-letter { font-size: 200% }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="f">
ت萁
|
||||
x</div>
|
||||
</body>
|
||||
</html>
|
@ -415,6 +415,7 @@ load 826163.html
|
||||
load 833604-1.html
|
||||
load 835056.html
|
||||
load 836990-1.html
|
||||
load 847242.html
|
||||
load 852293.html
|
||||
load 860579-1.html
|
||||
pref(layers.force-active,true) load 859526-1.html
|
||||
|
@ -35,6 +35,20 @@ static const char16_t kRLE = 0x202B;
|
||||
static const char16_t kLRO = 0x202D;
|
||||
static const char16_t kRLO = 0x202E;
|
||||
static const char16_t kPDF = 0x202C;
|
||||
static const char16_t kSeparators[] = {
|
||||
// All characters with Bidi type Segment Separator or Block Separator
|
||||
char16_t('\t'),
|
||||
char16_t('\r'),
|
||||
char16_t('\n'),
|
||||
char16_t(0xb),
|
||||
char16_t(0x1c),
|
||||
char16_t(0x1d),
|
||||
char16_t(0x1e),
|
||||
char16_t(0x1f),
|
||||
char16_t(0x85),
|
||||
char16_t(0x2029),
|
||||
char16_t(0)
|
||||
};
|
||||
|
||||
#define NS_BIDI_CONTROL_FRAME ((nsIFrame*)0xfffb1d1)
|
||||
|
||||
@ -631,7 +645,7 @@ nsBidiPresUtils::ResolveParagraph(nsBlockFrame* aBlockFrame,
|
||||
if (aBpd->BufferLength() < 1) {
|
||||
return NS_OK;
|
||||
}
|
||||
aBpd->mBuffer.ReplaceChar("\t\r\n", kSpace);
|
||||
aBpd->mBuffer.ReplaceChar(kSeparators, kSpace);
|
||||
|
||||
int32_t runCount;
|
||||
|
||||
|
@ -86,6 +86,7 @@ support-files = bug633762_iframe.html
|
||||
[test_bug904810.html]
|
||||
[test_bug938772.html]
|
||||
[test_contained_plugin_transplant.html]
|
||||
skip-if = os=='win'
|
||||
[test_image_selection.html]
|
||||
[test_image_selection_2.html]
|
||||
[test_invalidate_during_plugin_paint.html]
|
||||
|
@ -317,6 +317,243 @@ MOZ_XML_SetUnparsedEntityDeclHandler
|
||||
MOZ_XML_SetUserData
|
||||
MOZ_XML_SetXmlDeclHandler
|
||||
MOZ_XML_StopParser
|
||||
#ifdef MOZ_TREE_CAIRO
|
||||
_moz_cairo_append_path
|
||||
_moz_cairo_arc
|
||||
_moz_cairo_arc_negative
|
||||
_moz_cairo_clip
|
||||
_moz_cairo_clip_extents
|
||||
_moz_cairo_clip_preserve
|
||||
_moz_cairo_close_path
|
||||
_moz_cairo_copy_clip_rectangle_list
|
||||
_moz_cairo_copy_path
|
||||
_moz_cairo_copy_path_flat
|
||||
_moz_cairo_create
|
||||
_moz_cairo_curve_to
|
||||
_moz_cairo_debug_reset_static_data
|
||||
_moz_cairo_destroy
|
||||
_moz_cairo_device_to_user
|
||||
_moz_cairo_device_to_user_distance
|
||||
_moz_cairo_fill
|
||||
_moz_cairo_fill_extents
|
||||
_moz_cairo_fill_preserve
|
||||
_moz_cairo_font_face_destroy
|
||||
_moz_cairo_font_options_create
|
||||
_moz_cairo_font_options_destroy
|
||||
_moz_cairo_font_options_get_hint_metrics
|
||||
_moz_cairo_font_options_set_antialias
|
||||
_moz_cairo_format_stride_for_width
|
||||
_moz_cairo_get_antialias
|
||||
_moz_cairo_get_current_point
|
||||
_moz_cairo_get_dash
|
||||
_moz_cairo_get_dash_count
|
||||
_moz_cairo_get_fill_rule
|
||||
_moz_cairo_get_font_matrix
|
||||
_moz_cairo_get_group_target
|
||||
_moz_cairo_get_line_cap
|
||||
_moz_cairo_get_line_join
|
||||
_moz_cairo_get_line_width
|
||||
_moz_cairo_get_matrix
|
||||
_moz_cairo_get_miter_limit
|
||||
_moz_cairo_get_operator
|
||||
_moz_cairo_get_scaled_font
|
||||
_moz_cairo_get_source
|
||||
_moz_cairo_get_target
|
||||
_moz_cairo_glyph_extents
|
||||
_moz_cairo_glyph_path
|
||||
_moz_cairo_identity_matrix
|
||||
_moz_cairo_image_surface_create
|
||||
_moz_cairo_image_surface_create_for_data
|
||||
_moz_cairo_image_surface_get_data
|
||||
_moz_cairo_image_surface_get_format
|
||||
_moz_cairo_image_surface_get_height
|
||||
_moz_cairo_image_surface_get_stride
|
||||
_moz_cairo_image_surface_get_width
|
||||
_moz_cairo_in_fill
|
||||
_moz_cairo_in_stroke
|
||||
_moz_cairo_line_to
|
||||
_moz_cairo_mask
|
||||
_moz_cairo_mask_surface
|
||||
_moz_cairo_matrix_init
|
||||
_moz_cairo_matrix_init_identity
|
||||
_moz_cairo_matrix_init_scale
|
||||
_moz_cairo_matrix_init_translate
|
||||
_moz_cairo_matrix_invert
|
||||
_moz_cairo_matrix_multiply
|
||||
_moz_cairo_matrix_rotate
|
||||
_moz_cairo_matrix_scale
|
||||
_moz_cairo_matrix_transform_distance
|
||||
_moz_cairo_matrix_transform_point
|
||||
_moz_cairo_matrix_translate
|
||||
_moz_cairo_move_to
|
||||
_moz_cairo_new_path
|
||||
_moz_cairo_new_sub_path
|
||||
_moz_cairo_paint
|
||||
_moz_cairo_paint_with_alpha
|
||||
_moz_cairo_path_destroy
|
||||
_moz_cairo_path_extents
|
||||
_moz_cairo_pattern_add_color_stop_rgba
|
||||
_moz_cairo_pattern_create_for_surface
|
||||
_moz_cairo_pattern_create_linear
|
||||
_moz_cairo_pattern_create_radial
|
||||
_moz_cairo_pattern_create_rgba
|
||||
_moz_cairo_pattern_destroy
|
||||
_moz_cairo_pattern_get_color_stop_count
|
||||
_moz_cairo_pattern_get_color_stop_rgba
|
||||
_moz_cairo_pattern_get_extend
|
||||
_moz_cairo_pattern_get_filter
|
||||
_moz_cairo_pattern_get_linear_points
|
||||
_moz_cairo_pattern_get_matrix
|
||||
_moz_cairo_pattern_get_radial_circles
|
||||
_moz_cairo_pattern_get_rgba
|
||||
_moz_cairo_pattern_get_surface
|
||||
_moz_cairo_pattern_get_type
|
||||
_moz_cairo_pattern_reference
|
||||
_moz_cairo_pattern_set_extend
|
||||
_moz_cairo_pattern_set_filter
|
||||
_moz_cairo_pattern_set_matrix
|
||||
_moz_cairo_pattern_status
|
||||
_moz_cairo_pdf_surface_create_for_stream
|
||||
_moz_cairo_pop_group
|
||||
_moz_cairo_pop_group_to_source
|
||||
_moz_cairo_push_group
|
||||
_moz_cairo_push_group_with_content
|
||||
_moz_cairo_rectangle
|
||||
_moz_cairo_rectangle_list_destroy
|
||||
_moz_cairo_reference
|
||||
_moz_cairo_reset_clip
|
||||
_moz_cairo_restore
|
||||
_moz_cairo_rotate
|
||||
_moz_cairo_save
|
||||
_moz_cairo_scale
|
||||
_moz_cairo_scaled_font_create
|
||||
_moz_cairo_scaled_font_destroy
|
||||
_moz_cairo_scaled_font_get_font_matrix
|
||||
_moz_cairo_scaled_font_get_font_options
|
||||
_moz_cairo_scaled_font_get_type
|
||||
_moz_cairo_scaled_font_reference
|
||||
_moz_cairo_scaled_font_status
|
||||
_moz_cairo_set_antialias
|
||||
_moz_cairo_set_dash
|
||||
_moz_cairo_set_fill_rule
|
||||
_moz_cairo_set_font_face
|
||||
_moz_cairo_set_font_size
|
||||
_moz_cairo_set_line_cap
|
||||
_moz_cairo_set_line_join
|
||||
_moz_cairo_set_line_width
|
||||
_moz_cairo_set_matrix
|
||||
_moz_cairo_set_miter_limit
|
||||
_moz_cairo_set_operator
|
||||
_moz_cairo_set_scaled_font
|
||||
_moz_cairo_set_source
|
||||
_moz_cairo_set_source_rgba
|
||||
_moz_cairo_set_source_surface
|
||||
_moz_cairo_show_glyphs
|
||||
_moz_cairo_status
|
||||
_moz_cairo_stroke
|
||||
_moz_cairo_stroke_extents
|
||||
_moz_cairo_stroke_preserve
|
||||
_moz_cairo_surface_create_similar
|
||||
_moz_cairo_surface_destroy
|
||||
_moz_cairo_surface_finish
|
||||
_moz_cairo_surface_flush
|
||||
_moz_cairo_surface_get_content
|
||||
_moz_cairo_surface_get_device_offset
|
||||
_moz_cairo_surface_get_reference_count
|
||||
_moz_cairo_surface_get_subpixel_antialiasing
|
||||
_moz_cairo_surface_get_type
|
||||
_moz_cairo_surface_get_user_data
|
||||
_moz_cairo_surface_mark_dirty
|
||||
_moz_cairo_surface_mark_dirty_rectangle
|
||||
_moz_cairo_surface_reference
|
||||
_moz_cairo_surface_set_device_offset
|
||||
_moz_cairo_surface_set_fallback_resolution
|
||||
_moz_cairo_surface_set_subpixel_antialiasing
|
||||
_moz_cairo_surface_set_user_data
|
||||
_moz_cairo_surface_show_page
|
||||
_moz_cairo_surface_status
|
||||
_moz_cairo_tee_surface_add
|
||||
_moz_cairo_tee_surface_create
|
||||
_moz_cairo_tee_surface_index
|
||||
_moz_cairo_transform
|
||||
_moz_cairo_translate
|
||||
_moz_cairo_user_to_device
|
||||
_moz_cairo_user_to_device_distance
|
||||
_moz_cairo_win32_font_face_create_for_logfontw_hfont
|
||||
#ifdef NS_PRINTING
|
||||
_moz_cairo_win32_printing_surface_create
|
||||
#endif
|
||||
_moz_cairo_win32_scaled_font_select_font
|
||||
_moz_cairo_win32_surface_create
|
||||
_moz_cairo_win32_surface_create_with_d3dsurface9
|
||||
_moz_cairo_win32_surface_create_with_ddb
|
||||
_moz_cairo_win32_surface_create_with_dib
|
||||
_moz_cairo_win32_surface_get_dc
|
||||
_moz_cairo_win32_surface_get_image
|
||||
#ifdef MOZ_TREE_PIXMAN
|
||||
_moz_pixman_image_composite32
|
||||
_moz_pixman_image_create_bits
|
||||
_moz_pixman_image_set_transform
|
||||
_moz_pixman_image_unref
|
||||
_moz_pixman_transform_from_pixman_f_transform
|
||||
_moz_pixman_transform_invert
|
||||
_moz_pixman_region32_reset
|
||||
_moz_pixman_region32_init
|
||||
_moz_pixman_region32_init_rect
|
||||
_moz_pixman_region32_init_rects
|
||||
_moz_pixman_region32_init_with_extents
|
||||
_moz_pixman_region32_fini
|
||||
_moz_pixman_region32_translate
|
||||
_moz_pixman_region32_copy
|
||||
_moz_pixman_region32_intersect
|
||||
_moz_pixman_region32_intersect_rect
|
||||
_moz_pixman_region32_union
|
||||
_moz_pixman_region32_union_rect
|
||||
_moz_pixman_region32_subtract
|
||||
_moz_pixman_region32_inverse
|
||||
_moz_pixman_region32_contains_point
|
||||
_moz_pixman_region32_contains_rectangle
|
||||
_moz_pixman_region32_not_empty
|
||||
_moz_pixman_region32_extents
|
||||
_moz_pixman_region32_n_rects
|
||||
_moz_pixman_region32_rectangles
|
||||
_moz_pixman_region32_equal
|
||||
_moz_pixman_region32_selfcheck
|
||||
_moz_pixman_region32_reset
|
||||
_moz_pixman_region32_clear
|
||||
#endif
|
||||
cairo_d2d_create_device
|
||||
cairo_d2d_create_device_from_d3d10device
|
||||
cairo_d2d_device_get_device
|
||||
cairo_d2d_get_dc
|
||||
cairo_d2d_get_image_surface_cache_usage
|
||||
cairo_d2d_get_surface_vram_usage
|
||||
cairo_d2d_present_backbuffer
|
||||
cairo_d2d_release_dc
|
||||
cairo_d2d_scroll
|
||||
cairo_d2d_surface_create
|
||||
cairo_d2d_surface_create_for_handle
|
||||
cairo_d2d_surface_create_for_hwnd
|
||||
cairo_d2d_surface_create_for_texture
|
||||
cairo_d2d_surface_get_height
|
||||
cairo_d2d_surface_get_texture
|
||||
cairo_d2d_surface_get_width
|
||||
cairo_dwrite_font_face_create_for_dwrite_fontface
|
||||
cairo_dwrite_get_cleartype_rendering_mode
|
||||
cairo_dwrite_scaled_font_allow_manual_show_glyphs
|
||||
cairo_dwrite_scaled_font_get_force_GDI_classic
|
||||
cairo_dwrite_scaled_font_set_force_GDI_classic
|
||||
cairo_dwrite_set_cleartype_params
|
||||
cairo_null_surface_create
|
||||
cairo_release_device
|
||||
cairo_surface_attach_snapshot
|
||||
cairo_win32_get_dc_with_clip
|
||||
cairo_win32_get_system_text_quality
|
||||
cairo_win32_surface_create_with_alpha
|
||||
cairo_win32_surface_get_height
|
||||
cairo_win32_surface_get_width
|
||||
cairo_win32_surface_set_can_convert_to_dib
|
||||
#endif
|
||||
hb_blob_create
|
||||
hb_blob_destroy
|
||||
hb_blob_get_data
|
||||
|
15
layout/reftests/bidi/847242-1-ref.html
Normal file
15
layout/reftests/bidi/847242-1-ref.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
div {
|
||||
font-family: monospace;
|
||||
font-size: 24px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>PASS
</div>
|
||||
</body>
|
||||
</html>
|
18
layout/reftests/bidi/847242-1.html
Normal file
18
layout/reftests/bidi/847242-1.html
Normal file
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<style>
|
||||
div {
|
||||
unicode-bidi: bidi-override;
|
||||
direction: rtl;
|
||||
text-align: left;
|
||||
font-family: monospace;
|
||||
font-size: 24px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
SSAP</div>
|
||||
</body>
|
||||
</html>
|
@ -138,6 +138,7 @@ skip-if(B2G) == 726420-1.html 726420-1-ref.html
|
||||
== 746987-4.html 746987-4-ref.html
|
||||
== 779003-1.html 779003-1-ref.html
|
||||
== 779003-1-dynamic.html 779003-1-ref.html
|
||||
== 847242-1.html 847242-1-ref.html
|
||||
== 869833-1.xul 869833-1-ref.xul
|
||||
== 922530-1.html 922530-1-ref.html
|
||||
== 922550-1.html 922550-1-ref.html
|
||||
|
@ -102,7 +102,7 @@ skip-if(B2G) fuzzy-if(cocoaWidget,4,184) == feDistantLight-filterRes-01.svg feDi
|
||||
|
||||
fuzzy(1,119) == feDiffuseLighting-1.svg feDiffuseLighting-1-ref.svg
|
||||
|
||||
skip-if(d2d) == feSpecularLighting-1.svg feSpecularLighting-1-ref.svg
|
||||
fuzzy(2,2659) skip-if(d2d) == feSpecularLighting-1.svg feSpecularLighting-1-ref.svg
|
||||
|
||||
pref(layout.css.filters.enabled,true) == multiple-svg-filters.svg multiple-svg-filters-ref.svg
|
||||
pref(layout.css.filters.enabled,true) == multiple-svg-filters-long-chain.svg multiple-svg-filters-ref.svg
|
||||
|
18
layout/svg/crashtests/963086-1.svg
Normal file
18
layout/svg/crashtests/963086-1.svg
Normal file
@ -0,0 +1,18 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 64 64">
|
||||
<defs>
|
||||
<filter id="dropShadow">
|
||||
<feGaussianBlur stdDeviation="2" />
|
||||
<feOffset
|
||||
result="offsetBlur"
|
||||
dy="1073741824"/>
|
||||
<feMerge>
|
||||
<feMergeNode
|
||||
in="offsetBlur" />
|
||||
<feMergeNode
|
||||
in="SourceGraphic" />
|
||||
</feMerge>
|
||||
</filter>
|
||||
</defs>
|
||||
<rect height="64" width="64" style="filter:url(#dropShadow)" />
|
||||
</svg>
|
After Width: | Height: | Size: 451 B |
@ -178,5 +178,6 @@ load 898909-1.svg
|
||||
load 898951-1.svg
|
||||
load 919371-1.xhtml
|
||||
load 952270-1.svg
|
||||
load 963086-1.svg
|
||||
load 975773-1.svg
|
||||
load 974746-1.svg
|
||||
|
@ -69,6 +69,7 @@ if CONFIG['MOZ_WEBRTC_SIGNALING']:
|
||||
'signaling/src/peerconnection/PeerConnectionCtx.cpp',
|
||||
'signaling/src/peerconnection/PeerConnectionImpl.cpp',
|
||||
'signaling/src/peerconnection/PeerConnectionMedia.cpp',
|
||||
'signaling/src/peerconnection/WebrtcGlobalInformation.cpp',
|
||||
'signaling/src/sipcc/core/ccapp/call_logger.c',
|
||||
'signaling/src/sipcc/core/ccapp/capability_set.c',
|
||||
'signaling/src/sipcc/core/ccapp/cc_call_feature.c',
|
||||
|
@ -193,6 +193,10 @@
|
||||
'defines' : [
|
||||
'MOZILLA_INTERNAL_API'
|
||||
],
|
||||
'sources': [
|
||||
'./src/peerconnection/WebrtcGlobalInformation.cpp',
|
||||
'./src/peerconnection/WebrtcGlobalInformation.h',
|
||||
],
|
||||
}],
|
||||
['build_for_test!=0', {
|
||||
'include_dirs': [
|
||||
|
@ -25,6 +25,10 @@
|
||||
namespace mozilla {
|
||||
class PeerConnectionCtxShutdown;
|
||||
|
||||
namespace dom {
|
||||
class WebrtcGlobalInformation;
|
||||
}
|
||||
|
||||
// Unit-test helper, because cc_media_constraints_t is hard to forward-declare
|
||||
|
||||
class MediaConstraintsExternal {
|
||||
@ -76,6 +80,7 @@ class PeerConnectionCtx : public CSF::CC_Observer {
|
||||
// Make these classes friend so that they can access mPeerconnections.
|
||||
friend class PeerConnectionImpl;
|
||||
friend class PeerConnectionWrapper;
|
||||
friend class mozilla::dom::WebrtcGlobalInformation;
|
||||
|
||||
private:
|
||||
// We could make these available only via accessors but it's too much trouble.
|
||||
|
@ -147,6 +147,16 @@ PRLogModuleInfo *signalingLogInfo() {
|
||||
|
||||
namespace sipcc {
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
RTCStatsQuery::RTCStatsQuery(bool internal) : internalStats(internal) {
|
||||
}
|
||||
|
||||
RTCStatsQuery::~RTCStatsQuery() {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Getting exceptions back down from PCObserver is generally not harmful.
|
||||
namespace {
|
||||
class JSErrorResult : public ErrorResult
|
||||
@ -1282,19 +1292,19 @@ public:
|
||||
// Specialized helper - push map[key] if specified or all map values onto array
|
||||
|
||||
static void
|
||||
PushBackSelect(std::vector<RefPtr<MediaPipeline>>& aDst,
|
||||
PushBackSelect(nsTArray<RefPtr<MediaPipeline>>& aDst,
|
||||
const std::map<TrackID, RefPtr<mozilla::MediaPipeline>> & aSrc,
|
||||
TrackID aKey = 0) {
|
||||
auto begin = aKey ? aSrc.find(aKey) : aSrc.begin(), it = begin;
|
||||
for (auto end = (aKey && begin != aSrc.end())? ++begin : aSrc.end();
|
||||
it != end; ++it) {
|
||||
aDst.push_back(it->second);
|
||||
aDst.AppendElement(it->second);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
PeerConnectionImpl::GetStats(MediaStreamTrack *aSelector, bool internalStats) {
|
||||
PeerConnectionImpl::GetStats(MediaStreamTrack *aSelector) {
|
||||
PC_AUTO_ENTER_API_CALL(true);
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
@ -1303,73 +1313,21 @@ PeerConnectionImpl::GetStats(MediaStreamTrack *aSelector, bool internalStats) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
// Gather up pipelines from mMedia and dispatch them to STS for inspection
|
||||
nsAutoPtr<RTCStatsQuery> query(new RTCStatsQuery(false));
|
||||
|
||||
std::vector<RefPtr<MediaPipeline>> pipelines;
|
||||
TrackID trackId = aSelector ? aSelector->GetTrackID() : 0;
|
||||
nsresult rv = BuildStatsQuery_m(aSelector, query.get());
|
||||
|
||||
for (int i = 0, len = mMedia->LocalStreamsLength(); i < len; i++) {
|
||||
PushBackSelect(pipelines, mMedia->GetLocalStream(i)->GetPipelines(), trackId);
|
||||
}
|
||||
for (int i = 0, len = mMedia->RemoteStreamsLength(); i < len; i++) {
|
||||
PushBackSelect(pipelines, mMedia->GetRemoteStream(i)->GetPipelines(), trackId);
|
||||
}
|
||||
|
||||
// From the list of MediaPipelines, determine the set of NrIceMediaStreams
|
||||
// we are interested in.
|
||||
std::vector<RefPtr<NrIceMediaStream> > streams;
|
||||
RefPtr<NrIceCtx> iceCtx(mMedia->ice_ctx());
|
||||
for (auto p = pipelines.begin(); p != pipelines.end(); ++p) {
|
||||
size_t level = p->get()->level();
|
||||
// TODO(bcampen@mozilla.com): I may need to revisit this for bundle.
|
||||
// (Bug 786234)
|
||||
RefPtr<NrIceMediaStream> temp(mMedia->ice_media_stream(level-1));
|
||||
if (temp.get()) {
|
||||
streams.push_back(temp);
|
||||
} else {
|
||||
CSFLogError(logTag, "Failed to get NrIceMediaStream for level %u "
|
||||
"in %s: %s",
|
||||
uint32_t(level), __FUNCTION__, mHandle.c_str());
|
||||
MOZ_CRASH();
|
||||
}
|
||||
}
|
||||
|
||||
DOMHighResTimeStamp now;
|
||||
nsresult rv = GetTimeSinceEpoch(&now);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
RUN_ON_THREAD(mSTSThread,
|
||||
WrapRunnableNM(&PeerConnectionImpl::GetStats_s,
|
||||
WrapRunnableNM(&PeerConnectionImpl::GetStatsForPCObserver_s,
|
||||
mHandle,
|
||||
mName,
|
||||
mThread,
|
||||
internalStats,
|
||||
pipelines,
|
||||
iceCtx,
|
||||
streams,
|
||||
now),
|
||||
query),
|
||||
NS_DISPATCH_NORMAL);
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PeerConnectionImpl::GetLogging(const nsAString& aPattern) {
|
||||
PC_AUTO_ENTER_API_CALL_NO_CHECK();
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
std::string pattern(NS_ConvertUTF16toUTF8(aPattern).get());
|
||||
RUN_ON_THREAD(mSTSThread,
|
||||
WrapRunnableNM(&PeerConnectionImpl::GetLogging_s,
|
||||
mHandle,
|
||||
mThread,
|
||||
pattern),
|
||||
NS_DISPATCH_NORMAL);
|
||||
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PeerConnectionImpl::AddIceCandidate(const char* aCandidate, const char* aMid, unsigned short aLevel) {
|
||||
PC_AUTO_ENTER_API_CALL(true);
|
||||
@ -1791,6 +1749,12 @@ PeerConnectionImpl::SetSignalingState_m(PCImplSignalingState aSignalingState)
|
||||
MOZ_ASSERT(!rv.Failed());
|
||||
}
|
||||
|
||||
bool
|
||||
PeerConnectionImpl::IsClosed() const
|
||||
{
|
||||
return !mMedia;
|
||||
}
|
||||
|
||||
PeerConnectionWrapper::PeerConnectionWrapper(const std::string& handle)
|
||||
: impl_(nullptr) {
|
||||
if (PeerConnectionCtx::GetInstance()->mPeerConnections.find(handle) ==
|
||||
@ -1966,141 +1930,77 @@ PeerConnectionImpl::IceGatheringStateChange_m(PCImplIceGatheringState aState)
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
nsresult
|
||||
PeerConnectionImpl::GetStatsImpl_s(
|
||||
bool internalStats,
|
||||
const std::vector<RefPtr<MediaPipeline>>& pipelines,
|
||||
const RefPtr<NrIceCtx>& iceCtx,
|
||||
const std::vector<RefPtr<NrIceMediaStream>>& streams,
|
||||
DOMHighResTimeStamp now,
|
||||
RTCStatsReportInternal* report) {
|
||||
PeerConnectionImpl::BuildStatsQuery_m(
|
||||
mozilla::dom::MediaStreamTrack *aSelector,
|
||||
RTCStatsQuery *query) {
|
||||
|
||||
ASSERT_ON_THREAD(iceCtx->thread());
|
||||
if (IsClosed()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Gather stats from pipelines provided (can't touch mMedia + stream on STS)
|
||||
if (!mMedia->ice_ctx() || !mThread) {
|
||||
CSFLogError(logTag, "Could not build stats query, critical components of "
|
||||
"PeerConnectionImpl not set.");
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
for (auto it = pipelines.begin(); it != pipelines.end(); ++it) {
|
||||
const MediaPipeline& mp = **it;
|
||||
nsString idstr = (mp.Conduit()->type() == MediaSessionConduit::AUDIO) ?
|
||||
NS_LITERAL_STRING("audio_") : NS_LITERAL_STRING("video_");
|
||||
idstr.AppendInt(mp.trackid());
|
||||
nsresult rv = GetTimeSinceEpoch(&(query->now));
|
||||
|
||||
switch (mp.direction()) {
|
||||
case MediaPipeline::TRANSMIT: {
|
||||
nsString localId = NS_LITERAL_STRING("outbound_rtp_") + idstr;
|
||||
nsString remoteId;
|
||||
nsString ssrc;
|
||||
unsigned int ssrcval;
|
||||
if (mp.Conduit()->GetLocalSSRC(&ssrcval)) {
|
||||
ssrc.AppendInt(ssrcval);
|
||||
}
|
||||
{
|
||||
// First, fill in remote stat with rtcp receiver data, if present.
|
||||
// ReceiverReports have less information than SenderReports,
|
||||
// so fill in what we can.
|
||||
DOMHighResTimeStamp timestamp;
|
||||
uint32_t jitterMs;
|
||||
uint32_t packetsReceived;
|
||||
uint64_t bytesReceived;
|
||||
uint32_t packetsLost;
|
||||
if (mp.Conduit()->GetRTCPReceiverReport(×tamp, &jitterMs,
|
||||
&packetsReceived,
|
||||
&bytesReceived,
|
||||
&packetsLost)) {
|
||||
remoteId = NS_LITERAL_STRING("outbound_rtcp_") + idstr;
|
||||
RTCInboundRTPStreamStats s;
|
||||
s.mTimestamp.Construct(timestamp);
|
||||
s.mId.Construct(remoteId);
|
||||
s.mType.Construct(RTCStatsType::Inboundrtp);
|
||||
if (ssrc.Length()) {
|
||||
s.mSsrc.Construct(ssrc);
|
||||
}
|
||||
s.mJitter.Construct(double(jitterMs)/1000);
|
||||
s.mRemoteId.Construct(localId);
|
||||
s.mIsRemote = true;
|
||||
s.mPacketsReceived.Construct(packetsReceived);
|
||||
s.mBytesReceived.Construct(bytesReceived);
|
||||
s.mPacketsLost.Construct(packetsLost);
|
||||
report->mInboundRTPStreamStats.Value().AppendElement(s);
|
||||
}
|
||||
}
|
||||
// Then, fill in local side (with cross-link to remote only if present)
|
||||
{
|
||||
RTCOutboundRTPStreamStats s;
|
||||
s.mTimestamp.Construct(now);
|
||||
s.mId.Construct(localId);
|
||||
s.mType.Construct(RTCStatsType::Outboundrtp);
|
||||
if (ssrc.Length()) {
|
||||
s.mSsrc.Construct(ssrc);
|
||||
}
|
||||
s.mRemoteId.Construct(remoteId);
|
||||
s.mIsRemote = false;
|
||||
s.mPacketsSent.Construct(mp.rtp_packets_sent());
|
||||
s.mBytesSent.Construct(mp.rtp_bytes_sent());
|
||||
report->mOutboundRTPStreamStats.Value().AppendElement(s);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MediaPipeline::RECEIVE: {
|
||||
nsString localId = NS_LITERAL_STRING("inbound_rtp_") + idstr;
|
||||
nsString remoteId;
|
||||
nsString ssrc;
|
||||
unsigned int ssrcval;
|
||||
if (mp.Conduit()->GetRemoteSSRC(&ssrcval)) {
|
||||
ssrc.AppendInt(ssrcval);
|
||||
}
|
||||
{
|
||||
// First, fill in remote stat with rtcp sender data, if present.
|
||||
DOMHighResTimeStamp timestamp;
|
||||
uint32_t packetsSent;
|
||||
uint64_t bytesSent;
|
||||
if (mp.Conduit()->GetRTCPSenderReport(×tamp,
|
||||
&packetsSent, &bytesSent)) {
|
||||
remoteId = NS_LITERAL_STRING("inbound_rtcp_") + idstr;
|
||||
RTCOutboundRTPStreamStats s;
|
||||
s.mTimestamp.Construct(timestamp);
|
||||
s.mId.Construct(remoteId);
|
||||
s.mType.Construct(RTCStatsType::Outboundrtp);
|
||||
if (ssrc.Length()) {
|
||||
s.mSsrc.Construct(ssrc);
|
||||
}
|
||||
s.mRemoteId.Construct(localId);
|
||||
s.mIsRemote = true;
|
||||
s.mPacketsSent.Construct(packetsSent);
|
||||
s.mBytesSent.Construct(bytesSent);
|
||||
report->mOutboundRTPStreamStats.Value().AppendElement(s);
|
||||
}
|
||||
}
|
||||
// Then, fill in local side (with cross-link to remote only if present)
|
||||
RTCInboundRTPStreamStats s;
|
||||
s.mTimestamp.Construct(now);
|
||||
s.mId.Construct(localId);
|
||||
s.mType.Construct(RTCStatsType::Inboundrtp);
|
||||
if (ssrc.Length()) {
|
||||
s.mSsrc.Construct(ssrc);
|
||||
}
|
||||
unsigned int jitterMs, packetsLost;
|
||||
if (mp.Conduit()->GetRTPStats(&jitterMs, &packetsLost)) {
|
||||
s.mJitter.Construct(double(jitterMs)/1000);
|
||||
s.mPacketsLost.Construct(packetsLost);
|
||||
}
|
||||
if (remoteId.Length()) {
|
||||
s.mRemoteId.Construct(remoteId);
|
||||
}
|
||||
s.mIsRemote = false;
|
||||
s.mPacketsReceived.Construct(mp.rtp_packets_received());
|
||||
s.mBytesReceived.Construct(mp.rtp_bytes_received());
|
||||
report->mInboundRTPStreamStats.Value().AppendElement(s);
|
||||
break;
|
||||
}
|
||||
if (NS_FAILED(rv)) {
|
||||
CSFLogError(logTag, "Could not build stats query, could not get timestamp");
|
||||
return rv;
|
||||
}
|
||||
|
||||
// We do not use the pcHandle here, since that's risky to expose to content.
|
||||
query->report = RTCStatsReportInternalConstruct(
|
||||
NS_ConvertASCIItoUTF16(mName.c_str()),
|
||||
query->now);
|
||||
|
||||
// Gather up pipelines from mMedia so they may be inspected on STS
|
||||
TrackID trackId = aSelector ? aSelector->GetTrackID() : 0;
|
||||
|
||||
for (int i = 0, len = mMedia->LocalStreamsLength(); i < len; i++) {
|
||||
PushBackSelect(query->pipelines,
|
||||
mMedia->GetLocalStream(i)->GetPipelines(),
|
||||
trackId);
|
||||
}
|
||||
|
||||
for (int i = 0, len = mMedia->RemoteStreamsLength(); i < len; i++) {
|
||||
PushBackSelect(query->pipelines,
|
||||
mMedia->GetRemoteStream(i)->GetPipelines(),
|
||||
trackId);
|
||||
}
|
||||
|
||||
query->iceCtx = mMedia->ice_ctx();
|
||||
|
||||
// From the list of MediaPipelines, determine the set of NrIceMediaStreams
|
||||
// we are interested in.
|
||||
std::set<size_t> streamsGrabbed;
|
||||
for (size_t p = 0; p < query->pipelines.Length(); ++p) {
|
||||
|
||||
size_t level = query->pipelines[p]->level();
|
||||
|
||||
// Don't grab the same stream twice, since that causes duplication
|
||||
// of the ICE stats.
|
||||
if (streamsGrabbed.count(level)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
streamsGrabbed.insert(level);
|
||||
// TODO(bcampen@mozilla.com): I may need to revisit this for bundle.
|
||||
// (Bug 786234)
|
||||
RefPtr<NrIceMediaStream> temp(mMedia->ice_media_stream(level-1));
|
||||
if (temp.get()) {
|
||||
query->streams.AppendElement(temp);
|
||||
} else {
|
||||
CSFLogError(logTag, "Failed to get NrIceMediaStream for level %u "
|
||||
"in %s: %s",
|
||||
uint32_t(level), __FUNCTION__, mHandle.c_str());
|
||||
MOZ_CRASH();
|
||||
}
|
||||
}
|
||||
|
||||
// Gather stats from ICE
|
||||
for (auto s = streams.begin(); s != streams.end(); ++s) {
|
||||
FillStatsReport_s(**s, internalStats, now, report);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
return rv;
|
||||
}
|
||||
|
||||
static void ToRTCIceCandidateStats(
|
||||
@ -2127,7 +2027,7 @@ static void ToRTCIceCandidateStats(
|
||||
}
|
||||
}
|
||||
|
||||
void PeerConnectionImpl::FillStatsReport_s(
|
||||
static void RecordIceStats_s(
|
||||
NrIceMediaStream& mediaStream,
|
||||
bool internalStats,
|
||||
DOMHighResTimeStamp now,
|
||||
@ -2183,45 +2083,169 @@ void PeerConnectionImpl::FillStatsReport_s(
|
||||
}
|
||||
}
|
||||
|
||||
void PeerConnectionImpl::GetStats_s(
|
||||
const std::string& pcHandle, // The Runnable holds the memory
|
||||
const std::string& pcName, // The Runnable holds the memory
|
||||
nsCOMPtr<nsIThread> callbackThread,
|
||||
bool internalStats,
|
||||
const std::vector<RefPtr<MediaPipeline>>& pipelines,
|
||||
const RefPtr<NrIceCtx>& iceCtx,
|
||||
const std::vector<RefPtr<NrIceMediaStream>>& streams,
|
||||
DOMHighResTimeStamp now) {
|
||||
nsresult
|
||||
PeerConnectionImpl::ExecuteStatsQuery_s(RTCStatsQuery *query) {
|
||||
|
||||
ASSERT_ON_THREAD(iceCtx->thread());
|
||||
ASSERT_ON_THREAD(query->iceCtx->thread());
|
||||
|
||||
// We do not use the pcHandle here, since that's risky to expose to content.
|
||||
nsAutoPtr<RTCStatsReportInternal> report(
|
||||
new RTCStatsReportInternalConstruct(
|
||||
NS_ConvertASCIItoUTF16(pcName.c_str()),
|
||||
now));
|
||||
// NrIceCtx must be destroyed on STS, so it is not safe to dispatch it back
|
||||
// to main.
|
||||
RefPtr<NrIceCtx> iceCtxTmp(query->iceCtx);
|
||||
query->iceCtx = nullptr;
|
||||
|
||||
nsresult rv = GetStatsImpl_s(internalStats,
|
||||
pipelines,
|
||||
iceCtx,
|
||||
streams,
|
||||
now,
|
||||
report);
|
||||
// Gather stats from pipelines provided (can't touch mMedia + stream on STS)
|
||||
|
||||
RUN_ON_THREAD(callbackThread,
|
||||
WrapRunnableNM(&PeerConnectionImpl::OnStatsReport_m,
|
||||
pcHandle,
|
||||
rv,
|
||||
pipelines, // return for release on main thread
|
||||
report),
|
||||
NS_DISPATCH_NORMAL);
|
||||
for (size_t p = 0; p < query->pipelines.Length(); ++p) {
|
||||
const MediaPipeline& mp = *query->pipelines[p];
|
||||
nsString idstr = (mp.Conduit()->type() == MediaSessionConduit::AUDIO) ?
|
||||
NS_LITERAL_STRING("audio_") : NS_LITERAL_STRING("video_");
|
||||
idstr.AppendInt(mp.trackid());
|
||||
|
||||
switch (mp.direction()) {
|
||||
case MediaPipeline::TRANSMIT: {
|
||||
nsString localId = NS_LITERAL_STRING("outbound_rtp_") + idstr;
|
||||
nsString remoteId;
|
||||
nsString ssrc;
|
||||
unsigned int ssrcval;
|
||||
if (mp.Conduit()->GetLocalSSRC(&ssrcval)) {
|
||||
ssrc.AppendInt(ssrcval);
|
||||
}
|
||||
{
|
||||
// First, fill in remote stat with rtcp receiver data, if present.
|
||||
// ReceiverReports have less information than SenderReports,
|
||||
// so fill in what we can.
|
||||
DOMHighResTimeStamp timestamp;
|
||||
uint32_t jitterMs;
|
||||
uint32_t packetsReceived;
|
||||
uint64_t bytesReceived;
|
||||
uint32_t packetsLost;
|
||||
if (mp.Conduit()->GetRTCPReceiverReport(×tamp, &jitterMs,
|
||||
&packetsReceived,
|
||||
&bytesReceived,
|
||||
&packetsLost)) {
|
||||
remoteId = NS_LITERAL_STRING("outbound_rtcp_") + idstr;
|
||||
RTCInboundRTPStreamStats s;
|
||||
s.mTimestamp.Construct(timestamp);
|
||||
s.mId.Construct(remoteId);
|
||||
s.mType.Construct(RTCStatsType::Inboundrtp);
|
||||
if (ssrc.Length()) {
|
||||
s.mSsrc.Construct(ssrc);
|
||||
}
|
||||
s.mJitter.Construct(double(jitterMs)/1000);
|
||||
s.mRemoteId.Construct(localId);
|
||||
s.mIsRemote = true;
|
||||
s.mPacketsReceived.Construct(packetsReceived);
|
||||
s.mBytesReceived.Construct(bytesReceived);
|
||||
s.mPacketsLost.Construct(packetsLost);
|
||||
query->report.mInboundRTPStreamStats.Value().AppendElement(s);
|
||||
}
|
||||
}
|
||||
// Then, fill in local side (with cross-link to remote only if present)
|
||||
{
|
||||
RTCOutboundRTPStreamStats s;
|
||||
s.mTimestamp.Construct(query->now);
|
||||
s.mId.Construct(localId);
|
||||
s.mType.Construct(RTCStatsType::Outboundrtp);
|
||||
if (ssrc.Length()) {
|
||||
s.mSsrc.Construct(ssrc);
|
||||
}
|
||||
s.mRemoteId.Construct(remoteId);
|
||||
s.mIsRemote = false;
|
||||
s.mPacketsSent.Construct(mp.rtp_packets_sent());
|
||||
s.mBytesSent.Construct(mp.rtp_bytes_sent());
|
||||
query->report.mOutboundRTPStreamStats.Value().AppendElement(s);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MediaPipeline::RECEIVE: {
|
||||
nsString localId = NS_LITERAL_STRING("inbound_rtp_") + idstr;
|
||||
nsString remoteId;
|
||||
nsString ssrc;
|
||||
unsigned int ssrcval;
|
||||
if (mp.Conduit()->GetRemoteSSRC(&ssrcval)) {
|
||||
ssrc.AppendInt(ssrcval);
|
||||
}
|
||||
{
|
||||
// First, fill in remote stat with rtcp sender data, if present.
|
||||
DOMHighResTimeStamp timestamp;
|
||||
uint32_t packetsSent;
|
||||
uint64_t bytesSent;
|
||||
if (mp.Conduit()->GetRTCPSenderReport(×tamp,
|
||||
&packetsSent, &bytesSent)) {
|
||||
remoteId = NS_LITERAL_STRING("inbound_rtcp_") + idstr;
|
||||
RTCOutboundRTPStreamStats s;
|
||||
s.mTimestamp.Construct(timestamp);
|
||||
s.mId.Construct(remoteId);
|
||||
s.mType.Construct(RTCStatsType::Outboundrtp);
|
||||
if (ssrc.Length()) {
|
||||
s.mSsrc.Construct(ssrc);
|
||||
}
|
||||
s.mRemoteId.Construct(localId);
|
||||
s.mIsRemote = true;
|
||||
s.mPacketsSent.Construct(packetsSent);
|
||||
s.mBytesSent.Construct(bytesSent);
|
||||
query->report.mOutboundRTPStreamStats.Value().AppendElement(s);
|
||||
}
|
||||
}
|
||||
// Then, fill in local side (with cross-link to remote only if present)
|
||||
RTCInboundRTPStreamStats s;
|
||||
s.mTimestamp.Construct(query->now);
|
||||
s.mId.Construct(localId);
|
||||
s.mType.Construct(RTCStatsType::Inboundrtp);
|
||||
if (ssrc.Length()) {
|
||||
s.mSsrc.Construct(ssrc);
|
||||
}
|
||||
unsigned int jitterMs, packetsLost;
|
||||
if (mp.Conduit()->GetRTPStats(&jitterMs, &packetsLost)) {
|
||||
s.mJitter.Construct(double(jitterMs)/1000);
|
||||
s.mPacketsLost.Construct(packetsLost);
|
||||
}
|
||||
if (remoteId.Length()) {
|
||||
s.mRemoteId.Construct(remoteId);
|
||||
}
|
||||
s.mIsRemote = false;
|
||||
s.mPacketsReceived.Construct(mp.rtp_packets_received());
|
||||
s.mBytesReceived.Construct(mp.rtp_bytes_received());
|
||||
query->report.mInboundRTPStreamStats.Value().AppendElement(s);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gather stats from ICE
|
||||
for (size_t s = 0; s != query->streams.Length(); ++s) {
|
||||
RecordIceStats_s(*query->streams[s],
|
||||
query->internalStats,
|
||||
query->now,
|
||||
&(query->report));
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void PeerConnectionImpl::OnStatsReport_m(
|
||||
void PeerConnectionImpl::GetStatsForPCObserver_s(
|
||||
const std::string& pcHandle, // The Runnable holds the memory
|
||||
nsAutoPtr<RTCStatsQuery> query) {
|
||||
|
||||
MOZ_ASSERT(query);
|
||||
MOZ_ASSERT(query->iceCtx);
|
||||
ASSERT_ON_THREAD(query->iceCtx->thread());
|
||||
|
||||
nsresult rv = PeerConnectionImpl::ExecuteStatsQuery_s(query.get());
|
||||
|
||||
NS_DispatchToMainThread(
|
||||
WrapRunnableNM(
|
||||
&PeerConnectionImpl::DeliverStatsReportToPCObserver_m,
|
||||
pcHandle,
|
||||
rv,
|
||||
query),
|
||||
NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
void PeerConnectionImpl::DeliverStatsReportToPCObserver_m(
|
||||
const std::string& pcHandle,
|
||||
nsresult result,
|
||||
const std::vector<RefPtr<MediaPipeline>>& pipelines, //returned for release
|
||||
nsAutoPtr<RTCStatsReportInternal> report) {
|
||||
nsAutoPtr<RTCStatsQuery> query) {
|
||||
|
||||
// Is the PeerConnectionImpl still around?
|
||||
PeerConnectionWrapper pcw(pcHandle);
|
||||
@ -2231,7 +2255,7 @@ void PeerConnectionImpl::OnStatsReport_m(
|
||||
if (pco) {
|
||||
JSErrorResult rv;
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
pco->OnGetStatsSuccess(*report, rv);
|
||||
pco->OnGetStatsSuccess(query->report, rv);
|
||||
} else {
|
||||
pco->OnGetStatsError(kInternalError,
|
||||
ObString("Failed to fetch statistics"),
|
||||
@ -2245,49 +2269,6 @@ void PeerConnectionImpl::OnStatsReport_m(
|
||||
}
|
||||
}
|
||||
|
||||
void PeerConnectionImpl::GetLogging_s(const std::string& pcHandle,
|
||||
nsCOMPtr<nsIThread> callbackThread,
|
||||
const std::string& pattern) {
|
||||
RLogRingBuffer* logs = RLogRingBuffer::GetInstance();
|
||||
nsAutoPtr<std::deque<std::string>> result(new std::deque<std::string>);
|
||||
logs->Filter(pattern, 0, result);
|
||||
RUN_ON_THREAD(callbackThread,
|
||||
WrapRunnableNM(&PeerConnectionImpl::OnGetLogging_m,
|
||||
pcHandle,
|
||||
pattern,
|
||||
result),
|
||||
NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
void PeerConnectionImpl::OnGetLogging_m(
|
||||
const std::string& pcHandle,
|
||||
const std::string& pattern,
|
||||
nsAutoPtr<std::deque<std::string>> logging) {
|
||||
|
||||
// Is the PeerConnectionImpl still around?
|
||||
PeerConnectionWrapper pcw(pcHandle);
|
||||
if (pcw.impl()) {
|
||||
nsRefPtr<PeerConnectionObserver> pco =
|
||||
do_QueryObjectReferent(pcw.impl()->mPCObserver);
|
||||
if (pco) {
|
||||
JSErrorResult rv;
|
||||
if (!logging->empty()) {
|
||||
Sequence<nsString> nsLogs;
|
||||
for (auto l = logging->begin(); l != logging->end(); ++l) {
|
||||
nsLogs.AppendElement(ObString(l->c_str()));
|
||||
}
|
||||
pco->OnGetLoggingSuccess(nsLogs, rv);
|
||||
} else {
|
||||
pco->OnGetLoggingError(kInternalError,
|
||||
ObString(("No logging matching pattern " + pattern).c_str()), rv);
|
||||
}
|
||||
|
||||
if (rv.Failed()) {
|
||||
CSFLogError(logTag, "Error firing stats observer callback");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "prlock.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsWeakPtr.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsIWeakReferenceUtils.h" // for the definition of nsWeakPtr
|
||||
#include "IPeerConnection.h"
|
||||
#include "sigslot.h"
|
||||
@ -33,6 +34,7 @@
|
||||
#include "VideoUtils.h"
|
||||
#include "VideoSegment.h"
|
||||
#include "nsNSSShutDown.h"
|
||||
#include "mozilla/dom/RTCStatsReportBinding.h"
|
||||
#endif
|
||||
|
||||
namespace test {
|
||||
@ -154,6 +156,27 @@ private:
|
||||
std::vector<NrIceTurnServer> mTurnServers;
|
||||
};
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
// Not an inner class so we can forward declare.
|
||||
class RTCStatsQuery {
|
||||
public:
|
||||
explicit RTCStatsQuery(bool internalStats);
|
||||
~RTCStatsQuery();
|
||||
|
||||
mozilla::dom::RTCStatsReportInternal report;
|
||||
std::string error;
|
||||
|
||||
private:
|
||||
friend class PeerConnectionImpl;
|
||||
std::string pcName;
|
||||
bool internalStats;
|
||||
nsTArray<mozilla::RefPtr<mozilla::MediaPipeline>> pipelines;
|
||||
mozilla::RefPtr<NrIceCtx> iceCtx;
|
||||
nsTArray<mozilla::RefPtr<NrIceMediaStream>> streams;
|
||||
DOMHighResTimeStamp now;
|
||||
};
|
||||
#endif // MOZILLA_INTERNAL_API
|
||||
|
||||
// Enter an API call and check that the state is OK,
|
||||
// the PC isn't closed, etc.
|
||||
#define PC_AUTO_ENTER_API_CALL(assert_ice_ready) \
|
||||
@ -313,16 +336,9 @@ public:
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_TO_ERRORRESULT(GetStats, ErrorResult &rv,
|
||||
mozilla::dom::MediaStreamTrack *aSelector,
|
||||
bool internalStats)
|
||||
mozilla::dom::MediaStreamTrack *aSelector)
|
||||
{
|
||||
rv = GetStats(aSelector, internalStats);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_TO_ERRORRESULT(GetLogging, ErrorResult &rv,
|
||||
const nsAString& pattern)
|
||||
{
|
||||
rv = GetLogging(pattern);
|
||||
rv = GetStats(aSelector);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP AddIceCandidate(const char* aCandidate, const char* aMid,
|
||||
@ -490,9 +506,17 @@ public:
|
||||
// Sets the RTC Signaling State
|
||||
void SetSignalingState_m(mozilla::dom::PCImplSignalingState aSignalingState);
|
||||
|
||||
bool IsClosed() const;
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
// initialize telemetry for when calls start
|
||||
void startCallTelem();
|
||||
|
||||
nsresult BuildStatsQuery_m(
|
||||
mozilla::dom::MediaStreamTrack *aSelector,
|
||||
RTCStatsQuery *query);
|
||||
|
||||
static nsresult ExecuteStatsQuery_s(RTCStatsQuery *query);
|
||||
#endif
|
||||
|
||||
private:
|
||||
@ -544,51 +568,15 @@ private:
|
||||
|
||||
|
||||
#ifdef MOZILLA_INTERNAL_API
|
||||
// TODO(bcampen@mozilla.com): Once the dust settles on this stuff, it
|
||||
// probably makes sense to make these static in PeerConnectionImpl.cpp
|
||||
// (ie; stop exporting them)
|
||||
|
||||
// Fills in an RTCStatsReportInternal. Must be run on STS.
|
||||
static void GetStats_s(
|
||||
static void GetStatsForPCObserver_s(
|
||||
const std::string& pcHandle,
|
||||
const std::string& pcName,
|
||||
nsCOMPtr<nsIThread> callbackThread,
|
||||
bool internalStats,
|
||||
const std::vector<mozilla::RefPtr<mozilla::MediaPipeline>> &pipelines,
|
||||
const mozilla::RefPtr<NrIceCtx> &iceCtx,
|
||||
const std::vector<mozilla::RefPtr<NrIceMediaStream>> &streams,
|
||||
DOMHighResTimeStamp now);
|
||||
|
||||
static nsresult GetStatsImpl_s(
|
||||
bool internalStats,
|
||||
const std::vector<mozilla::RefPtr<mozilla::MediaPipeline>> &pipelines,
|
||||
const mozilla::RefPtr<NrIceCtx> &iceCtx,
|
||||
const std::vector<mozilla::RefPtr<NrIceMediaStream>> &streams,
|
||||
DOMHighResTimeStamp now,
|
||||
mozilla::dom::RTCStatsReportInternal *report);
|
||||
|
||||
static void FillStatsReport_s(
|
||||
NrIceMediaStream& stream,
|
||||
bool internalStats,
|
||||
DOMHighResTimeStamp now,
|
||||
mozilla::dom::RTCStatsReportInternal* stats);
|
||||
nsAutoPtr<RTCStatsQuery> query);
|
||||
|
||||
// Sends an RTCStatsReport to JS. Must run on main thread.
|
||||
static void OnStatsReport_m(
|
||||
static void DeliverStatsReportToPCObserver_m(
|
||||
const std::string& pcHandle,
|
||||
nsresult result,
|
||||
const std::vector<mozilla::RefPtr<mozilla::MediaPipeline>> &pipelines,
|
||||
nsAutoPtr<mozilla::dom::RTCStatsReportInternal> report);
|
||||
|
||||
// Fetches logs matching pattern from RLogRingBuffer. Must be run on STS.
|
||||
static void GetLogging_s(const std::string& pcHandle,
|
||||
nsCOMPtr<nsIThread> callbackThread,
|
||||
const std::string& pattern);
|
||||
|
||||
// Sends logging to JS. Must run on main thread.
|
||||
static void OnGetLogging_m(const std::string& pcHandle,
|
||||
const std::string& pattern,
|
||||
nsAutoPtr<std::deque<std::string>> logging);
|
||||
nsAutoPtr<RTCStatsQuery> query);
|
||||
#endif
|
||||
|
||||
// Timecard used to measure processing time. This should be the first class
|
||||
|
@ -0,0 +1,216 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "WebrtcGlobalInformation.h"
|
||||
|
||||
#include <deque>
|
||||
#include <string>
|
||||
|
||||
#include "CSFLog.h"
|
||||
|
||||
#include "mozilla/dom/WebrtcGlobalInformationBinding.h"
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsNetCID.h" // NS_SOCKETTRANSPORTSERVICE_CONTRACTID
|
||||
#include "nsServiceManagerUtils.h" // do_GetService
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "mozilla/Vector.h"
|
||||
#include "nsProxyRelease.h"
|
||||
|
||||
#include "rlogringbuffer.h"
|
||||
#include "runnable_utils.h"
|
||||
#include "PeerConnectionCtx.h"
|
||||
#include "PeerConnectionImpl.h"
|
||||
|
||||
using sipcc::PeerConnectionImpl;
|
||||
using sipcc::PeerConnectionCtx;
|
||||
using sipcc::RTCStatsQuery;
|
||||
|
||||
static const char* logTag = "WebrtcGlobalInformation";
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
typedef Vector<nsAutoPtr<RTCStatsQuery>> RTCStatsQueries;
|
||||
|
||||
static void OnStatsReport_m(
|
||||
nsMainThreadPtrHandle<WebrtcGlobalStatisticsCallback> aStatsCallback,
|
||||
nsAutoPtr<RTCStatsQueries> aQueryList)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MOZ_ASSERT(aQueryList);
|
||||
|
||||
WebrtcGlobalStatisticsReport report;
|
||||
report.mReports.Construct();
|
||||
for (auto q = aQueryList->begin(); q != aQueryList->end(); ++q) {
|
||||
MOZ_ASSERT(*q);
|
||||
report.mReports.Value().AppendElement((*q)->report);
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
aStatsCallback.get()->Call(report, rv);
|
||||
|
||||
if (rv.Failed()) {
|
||||
CSFLogError(logTag, "Error firing stats observer callback");
|
||||
}
|
||||
}
|
||||
|
||||
static void GetAllStats_s(
|
||||
nsMainThreadPtrHandle<WebrtcGlobalStatisticsCallback> aStatsCallback,
|
||||
nsAutoPtr<RTCStatsQueries> aQueryList)
|
||||
{
|
||||
MOZ_ASSERT(aQueryList);
|
||||
|
||||
for (auto q = aQueryList->begin(); q != aQueryList->end(); ++q) {
|
||||
MOZ_ASSERT(*q);
|
||||
PeerConnectionImpl::ExecuteStatsQuery_s(*q);
|
||||
}
|
||||
|
||||
NS_DispatchToMainThread(WrapRunnableNM(&OnStatsReport_m,
|
||||
aStatsCallback,
|
||||
aQueryList),
|
||||
NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
static void OnGetLogging_m(
|
||||
nsMainThreadPtrHandle<WebrtcGlobalLoggingCallback> aLoggingCallback,
|
||||
const std::string& aPattern,
|
||||
nsAutoPtr<std::deque<std::string>> aLogList)
|
||||
{
|
||||
ErrorResult rv;
|
||||
if (!aLogList->empty()) {
|
||||
Sequence<nsString> nsLogs;
|
||||
for (auto l = aLogList->begin(); l != aLogList->end(); ++l) {
|
||||
nsLogs.AppendElement(NS_ConvertUTF8toUTF16(l->c_str()));
|
||||
}
|
||||
aLoggingCallback.get()->Call(nsLogs, rv);
|
||||
}
|
||||
|
||||
if (rv.Failed()) {
|
||||
CSFLogError(logTag, "Error firing logging observer callback");
|
||||
}
|
||||
}
|
||||
|
||||
static void GetLogging_s(
|
||||
nsMainThreadPtrHandle<WebrtcGlobalLoggingCallback> aLoggingCallback,
|
||||
const std::string& aPattern)
|
||||
{
|
||||
RLogRingBuffer* logs = RLogRingBuffer::GetInstance();
|
||||
nsAutoPtr<std::deque<std::string>> result(new std::deque<std::string>);
|
||||
// Might not exist yet.
|
||||
if (logs) {
|
||||
logs->Filter(aPattern, 0, result);
|
||||
}
|
||||
NS_DispatchToMainThread(WrapRunnableNM(&OnGetLogging_m,
|
||||
aLoggingCallback,
|
||||
aPattern,
|
||||
result),
|
||||
NS_DISPATCH_NORMAL);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
WebrtcGlobalInformation::GetAllStats(
|
||||
const GlobalObject& aGlobal,
|
||||
WebrtcGlobalStatisticsCallback& aStatsCallback,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
if (!NS_IsMainThread()) {
|
||||
aRv.Throw(NS_ERROR_NOT_SAME_THREAD);
|
||||
return;
|
||||
}
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIEventTarget> stsThread =
|
||||
do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
aRv.Throw(rv);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!stsThread) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return;
|
||||
}
|
||||
|
||||
nsAutoPtr<RTCStatsQueries> queries(new RTCStatsQueries);
|
||||
|
||||
// If there is no PeerConnectionCtx, go through the same motions, since
|
||||
// the API consumer doesn't care why there are no PeerConnectionImpl.
|
||||
if (PeerConnectionCtx::isActive()) {
|
||||
PeerConnectionCtx *ctx = PeerConnectionCtx::GetInstance();
|
||||
MOZ_ASSERT(ctx);
|
||||
for (auto p = ctx->mPeerConnections.begin();
|
||||
p != ctx->mPeerConnections.end();
|
||||
++p) {
|
||||
MOZ_ASSERT(p->second);
|
||||
|
||||
if (!p->second->IsClosed()) {
|
||||
queries->append(nsAutoPtr<RTCStatsQuery>(new RTCStatsQuery(true)));
|
||||
p->second->BuildStatsQuery_m(nullptr, // all tracks
|
||||
queries->back());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// CallbackObject does not support threadsafe refcounting, and must be
|
||||
// destroyed on main.
|
||||
nsMainThreadPtrHandle<WebrtcGlobalStatisticsCallback> callbackHandle(
|
||||
new nsMainThreadPtrHolder<WebrtcGlobalStatisticsCallback>(&aStatsCallback));
|
||||
|
||||
rv = RUN_ON_THREAD(stsThread,
|
||||
WrapRunnableNM(&GetAllStats_s, callbackHandle, queries),
|
||||
NS_DISPATCH_NORMAL);
|
||||
|
||||
aRv = rv;
|
||||
}
|
||||
|
||||
void
|
||||
WebrtcGlobalInformation::GetLogging(
|
||||
const GlobalObject& aGlobal,
|
||||
const nsAString& aPattern,
|
||||
WebrtcGlobalLoggingCallback& aLoggingCallback,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
if (!NS_IsMainThread()) {
|
||||
aRv.Throw(NS_ERROR_NOT_SAME_THREAD);
|
||||
return;
|
||||
}
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIEventTarget> stsThread =
|
||||
do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID, &rv);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
aRv.Throw(rv);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!stsThread) {
|
||||
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string pattern(NS_ConvertUTF16toUTF8(aPattern).get());
|
||||
|
||||
// CallbackObject does not support threadsafe refcounting, and must be
|
||||
// destroyed on main.
|
||||
nsMainThreadPtrHandle<WebrtcGlobalLoggingCallback> callbackHandle(
|
||||
new nsMainThreadPtrHolder<WebrtcGlobalLoggingCallback>(&aLoggingCallback));
|
||||
|
||||
rv = RUN_ON_THREAD(stsThread,
|
||||
WrapRunnableNM(&GetLogging_s, callbackHandle, pattern),
|
||||
NS_DISPATCH_NORMAL);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
aLoggingCallback.Release();
|
||||
}
|
||||
|
||||
aRv = rv;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -0,0 +1,41 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef _WEBRTC_GLOBAL_INFORMATION_H_
|
||||
#define _WEBRTC_GLOBAL_INFORMATION_H_
|
||||
|
||||
#include "nsString.h"
|
||||
|
||||
namespace mozilla {
|
||||
class ErrorResult;
|
||||
|
||||
namespace dom {
|
||||
class GlobalObject;
|
||||
class WebrtcGlobalStatisticsCallback;
|
||||
class WebrtcGlobalLoggingCallback;
|
||||
|
||||
class WebrtcGlobalInformation
|
||||
{
|
||||
public:
|
||||
static void GetAllStats(const GlobalObject& aGlobal,
|
||||
WebrtcGlobalStatisticsCallback& aStatsCallback,
|
||||
ErrorResult& aRv);
|
||||
|
||||
static void GetLogging(const GlobalObject& aGlobal,
|
||||
const nsAString& aPattern,
|
||||
WebrtcGlobalLoggingCallback& aLoggingCallback,
|
||||
ErrorResult& aRv);
|
||||
|
||||
private:
|
||||
WebrtcGlobalInformation() MOZ_DELETE;
|
||||
WebrtcGlobalInformation(const WebrtcGlobalInformation& aOrig) MOZ_DELETE;
|
||||
WebrtcGlobalInformation& operator=(
|
||||
const WebrtcGlobalInformation& aRhs) MOZ_DELETE;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // _WEBRTC_GLOBAL_INFORMATION_H_
|
||||
|
@ -52,13 +52,23 @@
|
||||
#elif defined(__powerpc64__)
|
||||
#define WEBRTC_ARCH_PPC64 1
|
||||
#define WEBRTC_ARCH_64_BITS 1
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#define WEBRTC_LITTLE_ENDIAN
|
||||
#else
|
||||
#define WEBRTC_ARCH_BIG_ENDIAN
|
||||
#define WEBRTC_BIG_ENDIAN
|
||||
#endif
|
||||
#elif defined(__ppc__) || defined(__powerpc__)
|
||||
#define WEBRTC_ARCH_PPC 1
|
||||
#define WEBRTC_ARCH_32_BITS 1
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#define WEBRTC_ARCH_LITTLE_ENDIAN
|
||||
#define WEBRTC_LITTLE_ENDIAN
|
||||
#else
|
||||
#define WEBRTC_ARCH_BIG_ENDIAN
|
||||
#define WEBRTC_BIG_ENDIAN
|
||||
#endif
|
||||
#elif defined(__sparc64__)
|
||||
#define WEBRTC_ARCH_SPARC 1
|
||||
#define WEBRTC_ARCH_64_BITS 1
|
||||
|
@ -91,7 +91,7 @@
|
||||
# else
|
||||
# error "CPU type is unknown"
|
||||
# endif
|
||||
#elif defined(__APPLE__)
|
||||
#elif defined(__APPLE__) || defined(__powerpc__) || defined(__ppc__)
|
||||
# if __LITTLE_ENDIAN__
|
||||
# define MOZ_LITTLE_ENDIAN 1
|
||||
# elif __BIG_ENDIAN__
|
||||
@ -119,8 +119,7 @@
|
||||
* cases.
|
||||
*/
|
||||
#elif defined(__sparc) || defined(__sparc__) || \
|
||||
defined(_POWER) || defined(__powerpc__) || \
|
||||
defined(__ppc__) || defined(__hppa) || \
|
||||
defined(_POWER) || defined(__hppa) || \
|
||||
defined(_MIPSEB) || defined(__ARMEB__) || \
|
||||
defined(__s390__) || defined(__AARCH64EB__) || \
|
||||
(defined(__sh__) && defined(__LITTLE_ENDIAN__)) || \
|
||||
|
@ -12,7 +12,9 @@ Cu.import("resource://gre/modules/Services.jsm")
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/AppsUtils.jsm");
|
||||
|
||||
#ifdef MOZ_ANDROID_SYNTHAPKS
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "WebappManager", "resource://gre/modules/WebappManager.jsm");
|
||||
#endif
|
||||
|
||||
const DEFAULT_ICON = "chrome://browser/skin/images/default-app-icon.png";
|
||||
|
||||
@ -43,9 +45,11 @@ function openLink(aEvent) {
|
||||
} catch (ex) {}
|
||||
}
|
||||
|
||||
#ifdef MOZ_ANDROID_SYNTHAPKS
|
||||
function checkForUpdates(aEvent) {
|
||||
WebappManager.checkForUpdates(true);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef MOZ_ANDROID_SYNTHAPKS
|
||||
var ContextMenus = {
|
||||
@ -93,7 +97,9 @@ function onLoad(aEvent) {
|
||||
elmts[i].addEventListener("click", openLink, false);
|
||||
}
|
||||
|
||||
#ifdef MOZ_ANDROID_SYNTHAPKS
|
||||
document.getElementById("update-item").addEventListener("click", checkForUpdates, false);
|
||||
#endif
|
||||
|
||||
navigator.mozApps.mgmt.oninstall = onInstall;
|
||||
navigator.mozApps.mgmt.onuninstall = onUninstall;
|
||||
|
@ -55,12 +55,13 @@
|
||||
<div id="browse-title" class="title">&aboutApps.browseMarketplace;</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
#ifdef MOZ_ANDROID_SYNTHAPKS
|
||||
<div class="list-item" id="update-item" role="button">
|
||||
<img class="icon" src="chrome://browser/skin/images/update.png" />
|
||||
<div class="inner">
|
||||
<div id="browse-title" class="title">&aboutApps.checkForUpdates;</div>
|
||||
</div>
|
||||
</div>
|
||||
#endif
|
||||
</body>
|
||||
</html>
|
||||
|
@ -28,13 +28,15 @@ XPCOMUtils.defineLazyGetter(this, "Strings", function() {
|
||||
return Services.strings.createBundle("chrome://browser/locale/webapp.properties");
|
||||
});
|
||||
|
||||
function log(message) {
|
||||
function debug(aMessage) {
|
||||
// We use *dump* instead of Services.console.logStringMessage so the messages
|
||||
// have the INFO level of severity instead of the ERROR level. And we don't
|
||||
// append a newline character to the end of the message because *dump* spills
|
||||
// into the Android native logging system, which strips newlines from messages
|
||||
// and breaks messages into lines automatically at display time (i.e. logcat).
|
||||
dump(message);
|
||||
#ifdef MOZ_DEBUG
|
||||
dump(aMessage);
|
||||
#endif
|
||||
}
|
||||
|
||||
function sendMessageToJava(aMessage) {
|
||||
@ -80,7 +82,7 @@ this.WebappManager = {
|
||||
} catch(ex) {
|
||||
aMessage.error = ex;
|
||||
aMessageManager.sendAsyncMessage("Webapps:Install:Return:KO", aMessage);
|
||||
log("error downloading APK: " + ex);
|
||||
debug("error downloading APK: " + ex);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -92,7 +94,7 @@ this.WebappManager = {
|
||||
}).bind(this)); },
|
||||
|
||||
_downloadApk: function(aManifestUrl) {
|
||||
log("_downloadApk for " + aManifestUrl);
|
||||
debug("_downloadApk for " + aManifestUrl);
|
||||
let deferred = Promise.defer();
|
||||
|
||||
// Get the endpoint URL and convert it to an nsIURI/nsIURL object.
|
||||
@ -106,7 +108,7 @@ this.WebappManager = {
|
||||
};
|
||||
generatorUrl.query =
|
||||
[p + "=" + encodeURIComponent(params[p]) for (p in params)].join("&");
|
||||
log("downloading APK from " + generatorUrl.spec);
|
||||
debug("downloading APK from " + generatorUrl.spec);
|
||||
|
||||
let file = Cc["@mozilla.org/download-manager;1"].
|
||||
getService(Ci.nsIDownloadManager).
|
||||
@ -114,7 +116,7 @@ this.WebappManager = {
|
||||
clone();
|
||||
file.append(aManifestUrl.replace(/[^a-zA-Z0-9]/gi, "") + ".apk");
|
||||
file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
|
||||
log("downloading APK to " + file.path);
|
||||
debug("downloading APK to " + file.path);
|
||||
|
||||
let worker = new ChromeWorker("resource://gre/modules/WebappManagerWorker.js");
|
||||
worker.onmessage = function(event) {
|
||||
@ -125,7 +127,7 @@ this.WebappManager = {
|
||||
if (type == "success") {
|
||||
deferred.resolve(file.path);
|
||||
} else { // type == "failure"
|
||||
log("error downloading APK: " + message);
|
||||
debug("error downloading APK: " + message);
|
||||
deferred.reject(message);
|
||||
}
|
||||
}
|
||||
@ -147,7 +149,7 @@ this.WebappManager = {
|
||||
// when we trigger the native install dialog and doesn't re-init itself
|
||||
// afterward (TODO: file bug about this behavior).
|
||||
if ("appcache_path" in aData.app.manifest) {
|
||||
log("deleting appcache_path from manifest: " + aData.app.manifest.appcache_path);
|
||||
debug("deleting appcache_path from manifest: " + aData.app.manifest.appcache_path);
|
||||
delete aData.app.manifest.appcache_path;
|
||||
}
|
||||
|
||||
@ -168,7 +170,7 @@ this.WebappManager = {
|
||||
},
|
||||
|
||||
launch: function({ manifestURL, origin }) {
|
||||
log("launchWebapp: " + manifestURL);
|
||||
debug("launchWebapp: " + manifestURL);
|
||||
|
||||
sendMessageToJava({
|
||||
type: "Webapps:Open",
|
||||
@ -178,7 +180,7 @@ this.WebappManager = {
|
||||
},
|
||||
|
||||
uninstall: function(aData) {
|
||||
log("uninstall: " + aData.manifestURL);
|
||||
debug("uninstall: " + aData.manifestURL);
|
||||
|
||||
if (this._testing) {
|
||||
// We don't have to do anything, as the registry does all the work.
|
||||
@ -199,7 +201,7 @@ this.WebappManager = {
|
||||
let mm = {
|
||||
sendAsyncMessage: function (aMessageName, aData) {
|
||||
// TODO hook this back to Java to report errors.
|
||||
log("sendAsyncMessage " + aMessageName + ": " + JSON.stringify(aData));
|
||||
debug("sendAsyncMessage " + aMessageName + ": " + JSON.stringify(aData));
|
||||
}
|
||||
};
|
||||
|
||||
@ -244,7 +246,7 @@ this.WebappManager = {
|
||||
},
|
||||
|
||||
_autoUpdate: function(aData, aOldApp) { return Task.spawn((function*() {
|
||||
log("_autoUpdate app of type " + aData.type);
|
||||
debug("_autoUpdate app of type " + aData.type);
|
||||
|
||||
if (aData.type == "hosted") {
|
||||
let oldManifest = yield DOMApplicationRegistry.getManifestFor(aData.manifestURL);
|
||||
@ -257,13 +259,13 @@ this.WebappManager = {
|
||||
_checkingForUpdates: false,
|
||||
|
||||
checkForUpdates: function(userInitiated) { return Task.spawn((function*() {
|
||||
log("checkForUpdates");
|
||||
debug("checkForUpdates");
|
||||
|
||||
// Don't start checking for updates if we're already doing so.
|
||||
// TODO: Consider cancelling the old one and starting a new one anyway
|
||||
// if the user requested this one.
|
||||
if (this._checkingForUpdates) {
|
||||
log("already checking for updates");
|
||||
debug("already checking for updates");
|
||||
return;
|
||||
}
|
||||
this._checkingForUpdates = true;
|
||||
@ -466,7 +468,7 @@ this.WebappManager = {
|
||||
try {
|
||||
yield OS.file.remove(apk.filePath);
|
||||
} catch(ex) {
|
||||
log("error removing " + apk.filePath + " for cancelled update: " + ex);
|
||||
debug("error removing " + apk.filePath + " for cancelled update: " + ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -512,14 +514,14 @@ this.WebappManager = {
|
||||
for (let id in DOMApplicationRegistry.webapps) {
|
||||
let app = DOMApplicationRegistry.webapps[id];
|
||||
if (aData.apkPackageNames.indexOf(app.apkPackageName) > -1) {
|
||||
log("attempting to uninstall " + app.name);
|
||||
debug("attempting to uninstall " + app.name);
|
||||
DOMApplicationRegistry.uninstall(
|
||||
app.manifestURL,
|
||||
function() {
|
||||
log("success uninstalling " + app.name);
|
||||
debug("success uninstalling " + app.name);
|
||||
},
|
||||
function(error) {
|
||||
log("error uninstalling " + app.name + ": " + error);
|
||||
debug("error uninstalling " + app.name + ": " + error);
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -548,7 +550,7 @@ this.WebappManager = {
|
||||
if (aPrefs.length > 0) {
|
||||
let array = new TextEncoder().encode(JSON.stringify(aPrefs));
|
||||
OS.File.writeAtomic(aFile.path, array, { tmpPath: aFile.path + ".tmp" }).then(null, function onError(reason) {
|
||||
log("Error writing default prefs: " + reason);
|
||||
debug("Error writing default prefs: " + reason);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -23,7 +23,9 @@ EXTRA_JS_MODULES += [
|
||||
]
|
||||
|
||||
if CONFIG['MOZ_ANDROID_SYNTHAPKS']:
|
||||
EXTRA_JS_MODULES += [
|
||||
EXTRA_PP_JS_MODULES += [
|
||||
'WebappManager.jsm',
|
||||
]
|
||||
EXTRA_JS_MODULES += [
|
||||
'WebappManagerWorker.js',
|
||||
]
|
||||
|
@ -1041,16 +1041,15 @@ NS_IMETHODIMP CacheEntry::GetSecurityInfo(nsISupports * *aSecurityInfo)
|
||||
|
||||
NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
char const* info;
|
||||
nsXPIDLCString info;
|
||||
nsCOMPtr<nsISupports> secInfo;
|
||||
nsresult rv;
|
||||
|
||||
rv = mFile->GetElement("security-info", &info);
|
||||
rv = mFile->GetElement("security-info", getter_Copies(info));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (info) {
|
||||
rv = NS_DeserializeObject(nsDependentCString(info),
|
||||
getter_AddRefs(secInfo));
|
||||
rv = NS_DeserializeObject(info, getter_AddRefs(secInfo));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
@ -1137,15 +1136,7 @@ NS_IMETHODIMP CacheEntry::GetMetaDataElement(const char * aKey, char * *aRetval)
|
||||
{
|
||||
NS_ENSURE_SUCCESS(mFileStatus, NS_ERROR_NOT_AVAILABLE);
|
||||
|
||||
const char *value;
|
||||
nsresult rv = mFile->GetElement(aKey, &value);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (!value)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
*aRetval = NS_strdup(value);
|
||||
return NS_OK;
|
||||
return mFile->GetElement(aKey, aRetval);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP CacheEntry::SetMetaDataElement(const char * aKey, const char * aValue)
|
||||
|
@ -745,13 +745,18 @@ CacheFile::ThrowMemoryCachedData()
|
||||
}
|
||||
|
||||
nsresult
|
||||
CacheFile::GetElement(const char *aKey, const char **_retval)
|
||||
CacheFile::GetElement(const char *aKey, char **_retval)
|
||||
{
|
||||
CacheFileAutoLock lock(this);
|
||||
MOZ_ASSERT(mMetadata);
|
||||
NS_ENSURE_TRUE(mMetadata, NS_ERROR_UNEXPECTED);
|
||||
|
||||
*_retval = mMetadata->GetElement(aKey);
|
||||
const char *value;
|
||||
value = mMetadata->GetElement(aKey);
|
||||
if (!value)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
*_retval = NS_strdup(value);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
nsresult ThrowMemoryCachedData();
|
||||
|
||||
// metadata forwarders
|
||||
nsresult GetElement(const char *aKey, const char **_retval);
|
||||
nsresult GetElement(const char *aKey, char **_retval);
|
||||
nsresult SetElement(const char *aKey, const char *aValue);
|
||||
nsresult ElementsSize(uint32_t *_retval);
|
||||
nsresult SetExpirationTime(uint32_t aExpirationTime);
|
||||
|
@ -195,7 +195,11 @@ HttpChannelParentListener::OnRedirectResult(bool succeeded)
|
||||
"Channel finished a redirect response, but doesn't implement "
|
||||
"nsIParentRedirectingChannel to complete it.");
|
||||
|
||||
activeRedirectingChannel->CompleteRedirect(succeeded);
|
||||
if (activeRedirectingChannel) {
|
||||
activeRedirectingChannel->CompleteRedirect(succeeded);
|
||||
} else {
|
||||
succeeded = false;
|
||||
}
|
||||
|
||||
if (succeeded) {
|
||||
// Switch to redirect channel and delete the old one.
|
||||
|
@ -147,7 +147,16 @@ WillRedirect(const nsHttpResponseHead * response)
|
||||
class AutoRedirectVetoNotifier
|
||||
{
|
||||
public:
|
||||
AutoRedirectVetoNotifier(nsHttpChannel* channel) : mChannel(channel) {}
|
||||
AutoRedirectVetoNotifier(nsHttpChannel* channel) : mChannel(channel)
|
||||
{
|
||||
if (mChannel->mHasAutoRedirectVetoNotifier) {
|
||||
MOZ_CRASH("Nested AutoRedirectVetoNotifier on the stack");
|
||||
mChannel = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
mChannel->mHasAutoRedirectVetoNotifier = true;
|
||||
}
|
||||
~AutoRedirectVetoNotifier() {ReportRedirectResult(false);}
|
||||
void RedirectSucceeded() {ReportRedirectResult(true);}
|
||||
|
||||
@ -169,13 +178,15 @@ AutoRedirectVetoNotifier::ReportRedirectResult(bool succeeded)
|
||||
NS_GET_IID(nsIRedirectResultListener),
|
||||
getter_AddRefs(vetoHook));
|
||||
|
||||
#ifdef MOZ_VISUAL_EVENT_TRACER
|
||||
nsHttpChannel* channel = mChannel;
|
||||
#endif
|
||||
mChannel = nullptr;
|
||||
|
||||
if (vetoHook)
|
||||
vetoHook->OnRedirectResult(succeeded);
|
||||
|
||||
// Drop after the notification
|
||||
channel->mHasAutoRedirectVetoNotifier = false;
|
||||
|
||||
MOZ_EVENT_TRACER_DONE(channel, "net::http::redirect-callbacks");
|
||||
}
|
||||
|
||||
@ -207,6 +218,7 @@ nsHttpChannel::nsHttpChannel()
|
||||
, mHasQueryString(0)
|
||||
, mConcurentCacheAccess(0)
|
||||
, mIsPartialRequest(0)
|
||||
, mHasAutoRedirectVetoNotifier(0)
|
||||
, mDidReval(false)
|
||||
{
|
||||
LOG(("Creating nsHttpChannel [this=%p]\n", this));
|
||||
|
@ -395,6 +395,8 @@ private:
|
||||
uint32_t mConcurentCacheAccess : 1;
|
||||
// whether the request is setup be byte-range
|
||||
uint32_t mIsPartialRequest : 1;
|
||||
// true iff there is AutoRedirectVetoNotifier on the stack
|
||||
uint32_t mHasAutoRedirectVetoNotifier : 1;
|
||||
|
||||
nsTArray<nsContinueRedirectionFunc> mRedirectFuncStack;
|
||||
|
||||
|
18
testing/mochitest/tests/Harness_sanity/mochitest.ini
Normal file
18
testing/mochitest/tests/Harness_sanity/mochitest.ini
Normal file
@ -0,0 +1,18 @@
|
||||
[test_sanity.html]
|
||||
[test_sanityException.html]
|
||||
[test_sanityException2.html]
|
||||
[test_sanityWindowSnapshot.html]
|
||||
[test_SpecialPowersExtension.html]
|
||||
[test_SpecialPowersExtension2.html]
|
||||
support-files = file_SpecialPowersFrame1.html
|
||||
[test_SpecialPowersPushPermissions.html]
|
||||
[test_SpecialPowersPushPrefEnv.html]
|
||||
[test_SimpleTestGetTestFileURL.html]
|
||||
[test_SpecialPowersLoadChromeScript.html]
|
||||
support-files = SpecialPowersLoadChromeScript.js
|
||||
[test_bug816847.html]
|
||||
[test_sanity_cleanup.html]
|
||||
[test_sanity_cleanup2.html]
|
||||
[test_sanityEventUtils.html]
|
||||
[test_sanitySimpletest.html]
|
||||
|
@ -1,28 +0,0 @@
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
TEST_FILES = \
|
||||
test_sanity.html \
|
||||
test_sanityException.html \
|
||||
test_sanityException2.html \
|
||||
test_sanityWindowSnapshot.html \
|
||||
test_SpecialPowersExtension.html \
|
||||
test_SpecialPowersExtension2.html \
|
||||
test_SpecialPowersPushPermissions.html \
|
||||
test_SpecialPowersPushPrefEnv.html \
|
||||
file_SpecialPowersFrame1.html \
|
||||
test_SimpleTestGetTestFileURL.html \
|
||||
test_SpecialPowersLoadChromeScript.html \
|
||||
SpecialPowersLoadChromeScript.js \
|
||||
test_bug816847.html \
|
||||
test_sanity_cleanup.html \
|
||||
test_sanity_cleanup2.html \
|
||||
test_sanityEventUtils.html \
|
||||
test_sanitySimpletest.html \
|
||||
$(NULL)
|
||||
# Copy the sanity tests into a subdirectory, so the top level is all dirs
|
||||
# in the test screen.
|
||||
TEST_DEST = $(DEPTH)/_tests/$(relativesrcdir)/Harness_sanity
|
||||
INSTALL_TARGETS += TEST
|
@ -9,3 +9,6 @@ PARALLEL_DIRS += [
|
||||
'SimpleTest',
|
||||
'browser',
|
||||
]
|
||||
|
||||
MOCHITEST_MANIFESTS += ['Harness_sanity/mochitest.ini']
|
||||
|
||||
|
@ -390,7 +390,10 @@ def read_ini(fp, variables=None, default='DEFAULT',
|
||||
# interpret the variables
|
||||
def interpret_variables(global_dict, local_dict):
|
||||
variables = global_dict.copy()
|
||||
if 'skip-if' in local_dict and 'skip-if' in variables:
|
||||
local_dict['skip-if'] = "(%s) || (%s)" % (variables['skip-if'].split('#')[0], local_dict['skip-if'].split('#')[0])
|
||||
variables.update(local_dict)
|
||||
|
||||
return variables
|
||||
|
||||
sections = [(i, interpret_variables(variables, j)) for i, j in sections]
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user