mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Merge the last PGO-green inbound changeset to m-c.
This commit is contained in:
commit
51e1eb405c
@ -22,7 +22,7 @@
|
||||
|
||||
<script type="application/javascript">
|
||||
//gA11yEventDumpID = "eventdump"; // debug stuff
|
||||
//gA11yEventDumpToConsole = true; // debug stuff
|
||||
gA11yEventDumpToConsole = true; // debug stuff
|
||||
|
||||
var gQueue = null;
|
||||
function doTests()
|
||||
|
@ -373,7 +373,8 @@ var shell = {
|
||||
name: 'view',
|
||||
data: {
|
||||
type: handler.type,
|
||||
url: handler.url
|
||||
url: handler.url,
|
||||
extras: handler.extras
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -83,6 +83,8 @@ YoutubeProtocolHandler.prototype = {
|
||||
|
||||
let bestType = -1;
|
||||
|
||||
let extras = { }
|
||||
|
||||
streams.forEach(function(aStream) {
|
||||
let params = extractParameters(aStream);
|
||||
let url = params["url"];
|
||||
@ -95,12 +97,18 @@ YoutubeProtocolHandler.prototype = {
|
||||
mimeType = type;
|
||||
bestType = index;
|
||||
}
|
||||
for (let param in params) {
|
||||
if (["thumbnail_url", "length_seconds", "title"].indexOf(param) != -1) {
|
||||
extras[param] = decodeURIComponent(params[param]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (uri && mimeType) {
|
||||
cpmm.sendAsyncMessage("content-handler", {
|
||||
url: uri,
|
||||
type: mimeType
|
||||
type: mimeType,
|
||||
extras: extras
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -708,6 +708,7 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
|
||||
@BINPATH@/components/ProcessGlobal.js
|
||||
@BINPATH@/components/ContentHandler.js
|
||||
@BINPATH@/components/PaymentGlue.js
|
||||
@BINPATH@/components/YoutubeProtocolHandler.js
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
@BINPATH@/@DLL_PREFIX@plugin_child_interpose@DLL_SUFFIX@
|
||||
|
@ -27,6 +27,20 @@ ifndef INCLUDED_AUTOCONF_MK
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
endif
|
||||
|
||||
space = $(NULL) $(NULL)
|
||||
|
||||
# Include defs.mk files that can be found in $(srcdir)/$(DEPTH),
|
||||
# $(srcdir)/$(DEPTH-1), $(srcdir)/$(DEPTH-2), etc., and $(srcdir)
|
||||
# where $(DEPTH-1) is one level less of depth, $(DEPTH-2), two, etc.
|
||||
# i.e. for DEPTH=../../.., DEPTH-1 is ../.. and DEPTH-2 is ..
|
||||
# These defs.mk files are used to define variables in a directory
|
||||
# and all its subdirectories, recursively.
|
||||
__depth := $(subst /, ,$(DEPTH))
|
||||
ifeq (.,$(__depth))
|
||||
__depth :=
|
||||
endif
|
||||
$(foreach __d,$(__depth) .,$(eval __depth = $(wordlist 2,$(words $(__depth)),$(__depth))$(eval -include $(subst $(space),/,$(strip $(srcdir) $(__depth) defs.mk)))))
|
||||
|
||||
COMMA = ,
|
||||
|
||||
# Sanity check some variables
|
||||
@ -51,9 +65,6 @@ $(foreach x,$(CHECK_VARS),$(check-variable))
|
||||
core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))
|
||||
core_realpath = $(if $(realpath $(1)),$(realpath $(1)),$(call core_abspath,$(1)))
|
||||
|
||||
nullstr :=
|
||||
space :=$(nullstr) # EOL
|
||||
|
||||
core_winabspath = $(firstword $(subst /, ,$(call core_abspath,$(1)))):$(subst $(space),,$(patsubst %,\\%,$(wordlist 2,$(words $(subst /, ,$(call core_abspath,$(1)))), $(strip $(subst /, ,$(call core_abspath,$(1)))))))
|
||||
|
||||
RM = rm -f
|
||||
@ -814,3 +825,7 @@ PLY_INCLUDE = -I$(topsrcdir)/other-licenses/ply
|
||||
endif
|
||||
|
||||
export CL_INCLUDES_PREFIX
|
||||
|
||||
ifeq ($(MOZ_WIDGET_GTK),2)
|
||||
MOZ_GTK2_CFLAGS := -I$(topsrcdir)/widget/gtk2/compat $(MOZ_GTK2_CFLAGS)
|
||||
endif
|
||||
|
@ -943,7 +943,7 @@ $(HOST_CMMOBJS): host_%.$(OBJ_SUFFIX): %.mm
|
||||
$(COBJS): %.$(OBJ_SUFFIX): %.c $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(REPORT_BUILD)
|
||||
@$(MAKE_DEPS_AUTO_CC)
|
||||
$(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $(_VPATH_SRCS)
|
||||
$(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
# DEFINES and ACDEFINES are needed here to enable conditional compilation of Q_OBJECTs:
|
||||
# 'moc' only knows about #defines it gets on the command line (-D...), not in
|
||||
@ -965,7 +965,7 @@ $(ASOBJS): %.$(OBJ_SUFFIX): %.$(ASM_SUFFIX)
|
||||
endif
|
||||
|
||||
$(SOBJS): %.$(OBJ_SUFFIX): %.S
|
||||
$(AS) -o $@ $(ASFLAGS) -c $<
|
||||
$(AS) -o $@ $(ASFLAGS) $(LOCAL_INCLUDES) $(TARGET_LOCAL_INCLUDES) -c $<
|
||||
|
||||
#
|
||||
# Please keep the next two rules in sync.
|
||||
@ -973,43 +973,43 @@ $(SOBJS): %.$(OBJ_SUFFIX): %.S
|
||||
$(CCOBJS): %.$(OBJ_SUFFIX): %.cc $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(REPORT_BUILD)
|
||||
@$(MAKE_DEPS_AUTO_CXX)
|
||||
$(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
|
||||
$(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
$(CPPOBJS): %.$(OBJ_SUFFIX): %.cpp $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(REPORT_BUILD)
|
||||
@$(MAKE_DEPS_AUTO_CXX)
|
||||
$(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
|
||||
$(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
$(CMMOBJS): $(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.mm $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(REPORT_BUILD)
|
||||
@$(MAKE_DEPS_AUTO_CXX)
|
||||
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(_VPATH_SRCS)
|
||||
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
$(CMOBJS): $(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.m $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(REPORT_BUILD)
|
||||
@$(MAKE_DEPS_AUTO_CC)
|
||||
$(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $(COMPILE_CMFLAGS) $(_VPATH_SRCS)
|
||||
$(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $(COMPILE_CMFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
%.s: %.cpp $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CCC) -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
|
||||
$(CCC) -S $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
%.s: %.cc $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CCC) -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
|
||||
$(CCC) -S $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
%.s: %.c $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CC) -S $(COMPILE_CFLAGS) $(_VPATH_SRCS)
|
||||
$(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
%.i: %.cpp $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) > $*.i
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) > $*.i
|
||||
|
||||
%.i: %.cc $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) > $*.i
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) > $*.i
|
||||
|
||||
%.i: %.c $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CC) -C -E $(COMPILE_CFLAGS) $(_VPATH_SRCS) > $*.i
|
||||
$(CC) -C -E $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) > $*.i
|
||||
|
||||
%.i: %.mm $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(_VPATH_SRCS) > $*.i
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) > $*.i
|
||||
|
||||
%.res: %.rc
|
||||
@echo Creating Resource file: $@
|
||||
|
24
configure.in
24
configure.in
@ -65,7 +65,7 @@ PYTHON_VERSION_MAJOR=2
|
||||
PYTHON_VERSION_MINOR=5
|
||||
CAIRO_VERSION=1.10
|
||||
PANGO_VERSION=1.14.0
|
||||
GTK2_VERSION=2.10.0
|
||||
GTK2_VERSION=2.18.0
|
||||
WINDRES_VERSION=2.14.90
|
||||
W32API_VERSION=3.14
|
||||
GNOMEVFS_VERSION=2.0
|
||||
@ -4435,6 +4435,8 @@ dnl ========================================================
|
||||
dnl = Enable the toolkit as needed =
|
||||
dnl ========================================================
|
||||
|
||||
MOZ_WIDGET_GTK=
|
||||
|
||||
case "$MOZ_WIDGET_TOOLKIT" in
|
||||
|
||||
cairo-windows)
|
||||
@ -4458,7 +4460,8 @@ cairo-gtk2|cairo-gtk2-x11)
|
||||
TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
|
||||
TK_LIBS='$(MOZ_GTK2_LIBS)'
|
||||
AC_DEFINE(MOZ_WIDGET_GTK2)
|
||||
AC_DEFINE(MOZ_WIDGET_GTK,2)
|
||||
MOZ_WIDGET_GTK=2
|
||||
AC_DEFINE_UNQUOTED(MOZ_WIDGET_GTK,$MOZ_WIDGET_GTK)
|
||||
MOZ_PDF_PRINTING=1
|
||||
MOZ_INSTRUMENT_EVENT_LOOP=1
|
||||
;;
|
||||
@ -4732,6 +4735,7 @@ AC_SUBST(MOZ_ENABLE_QTMOBILITY)
|
||||
AC_SUBST(MOZ_ENABLE_XREMOTE)
|
||||
AC_SUBST(MOZ_GTK2_CFLAGS)
|
||||
AC_SUBST(MOZ_GTK2_LIBS)
|
||||
AC_SUBST(MOZ_WIDGET_GTK)
|
||||
AC_SUBST(MOZ_QT_CFLAGS)
|
||||
AC_SUBST(MOZ_QT_LIBS)
|
||||
|
||||
@ -8802,8 +8806,12 @@ fi
|
||||
|
||||
# Generate a JSON config file for unittest harnesses etc to read
|
||||
# build configuration details from in a standardized way.
|
||||
OS_TARGET=${OS_TARGET} TARGET_CPU=${TARGET_CPU} MOZ_DEBUG=${MOZ_DEBUG} \
|
||||
MOZ_WIDGET_TOOLKIT=${MOZ_WIDGET_TOOLKIT} UNIVERSAL_BINARY=${UNIVERSAL_BINARY} \
|
||||
OS_TARGET=${OS_TARGET} \
|
||||
TARGET_CPU=${TARGET_CPU} \
|
||||
MOZ_DEBUG=${MOZ_DEBUG} \
|
||||
MOZ_WIDGET_TOOLKIT=${MOZ_WIDGET_TOOLKIT} \
|
||||
UNIVERSAL_BINARY=${UNIVERSAL_BINARY} \
|
||||
MOZ_CRASHREPORTER=${MOZ_CRASHREPORTER} \
|
||||
$PYTHON ${_topsrcdir}/config/writemozinfo.py ./mozinfo.json.tmp
|
||||
if cmp -s ./mozinfo.json.tmp ./mozinfo.json; then
|
||||
rm ./mozinfo.json.tmp
|
||||
@ -8888,10 +8896,10 @@ fi
|
||||
# Run freetype configure script
|
||||
|
||||
if test "$MOZ_TREE_FREETYPE"; then
|
||||
export CFLAGS="$CFLAGS -std=c99"
|
||||
export CPPFLAGS="$CPPFLAGS"
|
||||
export CXXFLAGS="$CXXFLAGS"
|
||||
export LDFLAGS="$LDFLAGS"
|
||||
export CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS -std=c99"
|
||||
export CPPFLAGS="$CPPFLAGS $MOZ_DEBUG_FLAGS"
|
||||
export CXXFLAGS="$CXXFLAGS $MOZ_DEBUG_FLAGS"
|
||||
export LDFLAGS="$LDFLAGS $MOZ_DEBUG_LDFLAGS"
|
||||
export CONFIG_FILES="unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in"
|
||||
ac_configure_args="$ac_configure_args --host=$target --disable-shared --with-pic=yes"
|
||||
AC_OUTPUT_SUBDIRS(modules/freetype2)
|
||||
|
@ -40,6 +40,7 @@ MOCHITEST_CHROME_FILES = \
|
||||
test_bug599295.html \
|
||||
test_bug650776.html \
|
||||
test_bug650784.html \
|
||||
test_bug750096.html \
|
||||
test_bug752226-3.xul \
|
||||
test_bug752226-4.xul \
|
||||
test_bug682305.html \
|
||||
|
45
content/base/test/chrome/test_bug750096.html
Normal file
45
content/base/test/chrome/test_bug750096.html
Normal file
@ -0,0 +1,45 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=750096
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 750096</title>
|
||||
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=750096">Mozilla Bug 750096</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 750096 **/
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
var u = Components.interfaces.nsIParserUtils;
|
||||
var s = Components.classes["@mozilla.org/parserutils;1"]
|
||||
.getService(u);
|
||||
|
||||
var elt = document.getElementById("content");
|
||||
|
||||
var embed = s.parseFragment("<embed src=\'javascript:this.fail = true;\'>", 0, false, null, elt);
|
||||
var img = s.parseFragment("<img src=\'javascript:this.fail = true;\'>", 0, false, null, elt);
|
||||
var video = s.parseFragment("<video src=\'javascript:this.fail = true;\'></video>", 0, false, null, elt);
|
||||
var object = s.parseFragment("<object data=\'javascript:this.fail = true;\'></object>", 0, false, null, elt);
|
||||
var iframe = s.parseFragment("<iframe src=\'javascript:this.fail = true;\'></iframe>", 0, false, null, elt);
|
||||
|
||||
setTimeout(function() {
|
||||
ok(!window.fail, "Should not have failed.");
|
||||
SimpleTest.finish();
|
||||
}, 0);
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -52,6 +52,8 @@ CPPSRCS += \
|
||||
WebGLExtensionLoseContext.cpp \
|
||||
WebGLTexelConversions.cpp \
|
||||
WebGLExtensionCompressedTextureS3TC.cpp \
|
||||
WebGLExtensionCompressedTextureATC.cpp \
|
||||
WebGLExtensionCompressedTexturePVRTC.cpp \
|
||||
WebGLExtensionDepthTexture.cpp \
|
||||
WebGLElementArrayCache.cpp \
|
||||
$(NULL)
|
||||
|
@ -963,6 +963,16 @@ bool WebGLContext::IsExtensionSupported(WebGLExtensionID ext)
|
||||
isSupported = true;
|
||||
}
|
||||
break;
|
||||
case WEBGL_compressed_texture_atc:
|
||||
if (gl->IsExtensionSupported(GLContext::AMD_compressed_ATC_texture)) {
|
||||
isSupported = true;
|
||||
}
|
||||
break;
|
||||
case WEBGL_compressed_texture_pvrtc:
|
||||
if (gl->IsExtensionSupported(GLContext::IMG_texture_compression_pvrtc)) {
|
||||
isSupported = true;
|
||||
}
|
||||
break;
|
||||
case WEBGL_depth_texture:
|
||||
if (gl->IsGLES2() &&
|
||||
gl->IsExtensionSupported(GLContext::OES_packed_depth_stencil) &&
|
||||
@ -1024,6 +1034,18 @@ WebGLContext::GetExtension(const nsAString& aName)
|
||||
if (IsExtensionSupported(WEBGL_compressed_texture_s3tc))
|
||||
ext = WEBGL_compressed_texture_s3tc;
|
||||
}
|
||||
else if (aName.Equals(NS_LITERAL_STRING("MOZ_WEBGL_compressed_texture_atc"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
if (IsExtensionSupported(WEBGL_compressed_texture_atc))
|
||||
ext = WEBGL_compressed_texture_atc;
|
||||
}
|
||||
else if (aName.Equals(NS_LITERAL_STRING("MOZ_WEBGL_compressed_texture_pvrtc"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
if (IsExtensionSupported(WEBGL_compressed_texture_pvrtc))
|
||||
ext = WEBGL_compressed_texture_pvrtc;
|
||||
}
|
||||
else if (aName.Equals(NS_LITERAL_STRING("MOZ_WEBGL_depth_texture"),
|
||||
nsCaseInsensitiveStringComparator()))
|
||||
{
|
||||
@ -1049,6 +1071,12 @@ WebGLContext::GetExtension(const nsAString& aName)
|
||||
case WEBGL_compressed_texture_s3tc:
|
||||
mExtensions[ext] = new WebGLExtensionCompressedTextureS3TC(this);
|
||||
break;
|
||||
case WEBGL_compressed_texture_atc:
|
||||
mExtensions[ext] = new WebGLExtensionCompressedTextureATC(this);
|
||||
break;
|
||||
case WEBGL_compressed_texture_pvrtc:
|
||||
mExtensions[ext] = new WebGLExtensionCompressedTexturePVRTC(this);
|
||||
break;
|
||||
case WEBGL_depth_texture:
|
||||
mExtensions[ext] = new WebGLExtensionDepthTexture(this);
|
||||
break;
|
||||
@ -1570,6 +1598,10 @@ WebGLContext::GetSupportedExtensions(Nullable< nsTArray<nsString> > &retval)
|
||||
arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_lose_context"));
|
||||
if (IsExtensionSupported(WEBGL_compressed_texture_s3tc))
|
||||
arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_compressed_texture_s3tc"));
|
||||
if (IsExtensionSupported(WEBGL_compressed_texture_atc))
|
||||
arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_compressed_texture_atc"));
|
||||
if (IsExtensionSupported(WEBGL_compressed_texture_pvrtc))
|
||||
arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_compressed_texture_pvrtc"));
|
||||
if (IsExtensionSupported(WEBGL_depth_texture))
|
||||
arr.AppendElement(NS_LITERAL_STRING("MOZ_WEBGL_depth_texture"));
|
||||
}
|
||||
|
@ -461,11 +461,13 @@ class WebGLContext :
|
||||
public WebGLRectangleObject,
|
||||
public nsWrapperCache
|
||||
{
|
||||
friend class WebGLContextUserData;
|
||||
friend class WebGLMemoryPressureObserver;
|
||||
friend class WebGLMemoryMultiReporterWrapper;
|
||||
friend class WebGLExtensionLoseContext;
|
||||
friend class WebGLExtensionCompressedTextureS3TC;
|
||||
friend class WebGLContextUserData;
|
||||
friend class WebGLMemoryPressureObserver;
|
||||
friend class WebGLExtensionCompressedTextureATC;
|
||||
friend class WebGLExtensionCompressedTexturePVRTC;
|
||||
friend class WebGLExtensionDepthTexture;
|
||||
|
||||
enum {
|
||||
@ -1170,6 +1172,8 @@ protected:
|
||||
EXT_texture_filter_anisotropic,
|
||||
WEBGL_lose_context,
|
||||
WEBGL_compressed_texture_s3tc,
|
||||
WEBGL_compressed_texture_atc,
|
||||
WEBGL_compressed_texture_pvrtc,
|
||||
WEBGL_depth_texture,
|
||||
WebGLExtensionID_number_of_extensions,
|
||||
WebGLExtensionID_unknown_extension
|
||||
@ -1209,7 +1213,7 @@ protected:
|
||||
bool ValidateGLSLString(const nsAString& string, const char *info);
|
||||
|
||||
bool ValidateTexImage2DTarget(WebGLenum target, WebGLsizei width, WebGLsizei height, const char* info);
|
||||
bool ValidateCompressedTextureSize(WebGLint level, WebGLenum format, WebGLsizei width, WebGLsizei height, uint32_t byteLength, const char* info);
|
||||
bool ValidateCompressedTextureSize(WebGLenum target, WebGLint level, WebGLenum format, WebGLsizei width, WebGLsizei height, uint32_t byteLength, const char* info);
|
||||
bool ValidateLevelWidthHeightForTarget(WebGLenum target, WebGLint level, WebGLsizei width, WebGLsizei height, const char* info);
|
||||
|
||||
static uint32_t GetBitsPerTexel(WebGLenum format, WebGLenum type);
|
||||
|
@ -4225,17 +4225,13 @@ WebGLContext::CompressedTexImage2D(WebGLenum target, WebGLint level, WebGLenum i
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ValidateLevelWidthHeightForTarget(target, level, width, height, "compressedTexImage2D")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (border) {
|
||||
ErrorInvalidValue("compressedTexImage2D: border is not 0");
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t byteLength = view.Length();
|
||||
if (!ValidateCompressedTextureSize(level, internalformat, width, height, byteLength, "compressedTexImage2D")) {
|
||||
if (!ValidateCompressedTextureSize(target, level, internalformat, width, height, byteLength, "compressedTexImage2D")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4281,7 +4277,7 @@ WebGLContext::CompressedTexSubImage2D(WebGLenum target, WebGLint level, WebGLint
|
||||
}
|
||||
|
||||
uint32_t byteLength = view.Length();
|
||||
if (!ValidateCompressedTextureSize(level, format, width, height, byteLength, "compressedTexSubImage2D")) {
|
||||
if (!ValidateCompressedTextureSize(target, level, format, width, height, byteLength, "compressedTexSubImage2D")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -4323,6 +4319,19 @@ WebGLContext::CompressedTexSubImage2D(WebGLenum target, WebGLint level, WebGLint
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LOCAL_GL_COMPRESSED_RGB_PVRTC_4BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGB_PVRTC_2BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_PVRTC_4BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_PVRTC_2BPPV1:
|
||||
{
|
||||
if (xoffset || yoffset ||
|
||||
width != imageInfo.Width() ||
|
||||
height != imageInfo.Height())
|
||||
{
|
||||
ErrorInvalidValue("compressedTexSubImage2D: the update rectangle doesn't match the existing image");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gl->fCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, byteLength, view.Data());
|
||||
|
@ -198,6 +198,13 @@ WebGLContext::IsTextureFormatCompressed(GLenum format)
|
||||
case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
|
||||
case LOCAL_GL_ATC_RGB:
|
||||
case LOCAL_GL_ATC_RGBA_EXPLICIT_ALPHA:
|
||||
case LOCAL_GL_ATC_RGBA_INTERPOLATED_ALPHA:
|
||||
case LOCAL_GL_COMPRESSED_RGB_PVRTC_4BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGB_PVRTC_2BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_PVRTC_4BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_PVRTC_2BPPV1:
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -371,37 +371,52 @@ bool WebGLContext::ValidateTexImage2DTarget(WebGLenum target, WebGLsizei width,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateCompressedTextureSize(WebGLint level, WebGLenum format, WebGLsizei width,
|
||||
WebGLsizei height, uint32_t byteLength, const char* info)
|
||||
bool WebGLContext::ValidateCompressedTextureSize(WebGLenum target, WebGLint level,
|
||||
WebGLenum format,
|
||||
WebGLsizei width, WebGLsizei height, uint32_t byteLength, const char* info)
|
||||
{
|
||||
CheckedUint32 calculated_byteLength = 0;
|
||||
CheckedUint32 checked_byteLength = byteLength;
|
||||
if (!checked_byteLength.isValid()) {
|
||||
ErrorInvalidValue("%s: data length out of bounds", info);
|
||||
if (!ValidateLevelWidthHeightForTarget(target, level, width, height, info)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// negative width and height must already have been handled above
|
||||
MOZ_ASSERT(width >= 0 && height >= 0);
|
||||
|
||||
CheckedUint32 required_byteLength = 0;
|
||||
|
||||
switch (format) {
|
||||
case LOCAL_GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
|
||||
case LOCAL_GL_ATC_RGB:
|
||||
{
|
||||
calculated_byteLength = ((CheckedUint32(width) + 3) / 4) * ((CheckedUint32(height) + 3) / 4) * 8;
|
||||
if (!calculated_byteLength.isValid() || !(checked_byteLength == calculated_byteLength)) {
|
||||
ErrorInvalidValue("%s: data size does not match dimensions", info);
|
||||
return false;
|
||||
}
|
||||
required_byteLength = ((CheckedUint32(width) + 3) / 4) * ((CheckedUint32(height) + 3) / 4) * 8;
|
||||
break;
|
||||
}
|
||||
case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
|
||||
case LOCAL_GL_ATC_RGBA_EXPLICIT_ALPHA:
|
||||
case LOCAL_GL_ATC_RGBA_INTERPOLATED_ALPHA:
|
||||
{
|
||||
calculated_byteLength = ((CheckedUint32(width) + 3) / 4) * ((CheckedUint32(height) + 3) / 4) * 16;
|
||||
if (!calculated_byteLength.isValid() || !(checked_byteLength == calculated_byteLength)) {
|
||||
ErrorInvalidValue("%s: data size does not match dimensions", info);
|
||||
return false;
|
||||
}
|
||||
required_byteLength = ((CheckedUint32(width) + 3) / 4) * ((CheckedUint32(height) + 3) / 4) * 16;
|
||||
break;
|
||||
}
|
||||
case LOCAL_GL_COMPRESSED_RGB_PVRTC_4BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_PVRTC_4BPPV1:
|
||||
{
|
||||
required_byteLength = CheckedUint32(NS_MAX(width, 8)) * CheckedUint32(NS_MAX(height, 8)) / 2;
|
||||
break;
|
||||
}
|
||||
case LOCAL_GL_COMPRESSED_RGB_PVRTC_2BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_PVRTC_2BPPV1:
|
||||
{
|
||||
required_byteLength = CheckedUint32(NS_MAX(width, 16)) * CheckedUint32(NS_MAX(height, 8)) / 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!required_byteLength.isValid() || required_byteLength.value() != byteLength) {
|
||||
ErrorInvalidValue("%s: data size does not match dimensions", info);
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (format) {
|
||||
@ -411,19 +426,32 @@ bool WebGLContext::ValidateCompressedTextureSize(WebGLint level, WebGLenum forma
|
||||
case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
|
||||
{
|
||||
if (level == 0 && width % 4 == 0 && height % 4 == 0) {
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
if (level > 0
|
||||
&& (width == 0 || width == 1 || width == 2 || width % 4 == 0)
|
||||
&& (height == 0 || height == 1 || height == 2 || height % 4 == 0))
|
||||
{
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
ErrorInvalidOperation("%s: level parameter does not match width and height", info);
|
||||
return false;
|
||||
}
|
||||
case LOCAL_GL_COMPRESSED_RGB_PVRTC_4BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGB_PVRTC_2BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_PVRTC_4BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_PVRTC_2BPPV1:
|
||||
{
|
||||
if (!is_pot_assuming_nonnegative(width) ||
|
||||
!is_pot_assuming_nonnegative(height))
|
||||
{
|
||||
ErrorInvalidValue("%s: width and height must be powers of two", info);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ErrorInvalidOperation("%s: level parameter does not match width and height", info);
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WebGLContext::ValidateLevelWidthHeightForTarget(WebGLenum target, WebGLint level, WebGLsizei width,
|
||||
@ -483,11 +511,19 @@ uint32_t WebGLContext::GetBitsPerTexel(WebGLenum format, WebGLenum type)
|
||||
return 3 * multiplier;
|
||||
case LOCAL_GL_RGBA:
|
||||
return 4 * multiplier;
|
||||
case LOCAL_GL_COMPRESSED_RGB_PVRTC_2BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_PVRTC_2BPPV1:
|
||||
return 2;
|
||||
case LOCAL_GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
|
||||
case LOCAL_GL_ATC_RGB:
|
||||
case LOCAL_GL_COMPRESSED_RGB_PVRTC_4BPPV1:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_PVRTC_4BPPV1:
|
||||
return 4;
|
||||
case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
|
||||
case LOCAL_GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
|
||||
case LOCAL_GL_ATC_RGBA_EXPLICIT_ALPHA:
|
||||
case LOCAL_GL_ATC_RGBA_INTERPOLATED_ALPHA:
|
||||
return 8;
|
||||
default:
|
||||
break;
|
||||
|
32
content/canvas/src/WebGLExtensionCompressedTextureATC.cpp
Normal file
32
content/canvas/src/WebGLExtensionCompressedTextureATC.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
/* 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 "WebGLContext.h"
|
||||
#include "WebGLExtensions.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
WebGLExtensionCompressedTextureATC::WebGLExtensionCompressedTextureATC(WebGLContext* context)
|
||||
: WebGLExtension(context)
|
||||
{
|
||||
context->mCompressedTextureFormats.AppendElement(LOCAL_GL_ATC_RGB);
|
||||
context->mCompressedTextureFormats.AppendElement(LOCAL_GL_ATC_RGBA_EXPLICIT_ALPHA);
|
||||
context->mCompressedTextureFormats.AppendElement(LOCAL_GL_ATC_RGBA_INTERPOLATED_ALPHA);
|
||||
}
|
||||
|
||||
WebGLExtensionCompressedTextureATC::~WebGLExtensionCompressedTextureATC()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(WebGLExtensionCompressedTextureATC, WebGLExtension)
|
||||
NS_IMPL_RELEASE_INHERITED(WebGLExtensionCompressedTextureATC, WebGLExtension)
|
||||
|
||||
DOMCI_DATA(WebGLExtensionCompressedTextureATC, WebGLExtensionCompressedTextureATC)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLExtensionCompressedTextureATC)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLExtensionCompressedTextureATC)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, WebGLExtension)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLExtensionCompressedTextureATC)
|
||||
NS_INTERFACE_MAP_END_INHERITING(WebGLExtension)
|
33
content/canvas/src/WebGLExtensionCompressedTexturePVRTC.cpp
Normal file
33
content/canvas/src/WebGLExtensionCompressedTexturePVRTC.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/* 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 "WebGLContext.h"
|
||||
#include "WebGLExtensions.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
WebGLExtensionCompressedTexturePVRTC::WebGLExtensionCompressedTexturePVRTC(WebGLContext* context)
|
||||
: WebGLExtension(context)
|
||||
{
|
||||
context->mCompressedTextureFormats.AppendElement(LOCAL_GL_COMPRESSED_RGB_PVRTC_4BPPV1);
|
||||
context->mCompressedTextureFormats.AppendElement(LOCAL_GL_COMPRESSED_RGB_PVRTC_2BPPV1);
|
||||
context->mCompressedTextureFormats.AppendElement(LOCAL_GL_COMPRESSED_RGBA_PVRTC_4BPPV1);
|
||||
context->mCompressedTextureFormats.AppendElement(LOCAL_GL_COMPRESSED_RGBA_PVRTC_2BPPV1);
|
||||
}
|
||||
|
||||
WebGLExtensionCompressedTexturePVRTC::~WebGLExtensionCompressedTexturePVRTC()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
NS_IMPL_ADDREF_INHERITED(WebGLExtensionCompressedTexturePVRTC, WebGLExtension)
|
||||
NS_IMPL_RELEASE_INHERITED(WebGLExtensionCompressedTexturePVRTC, WebGLExtension)
|
||||
|
||||
DOMCI_DATA(WebGLExtensionCompressedTexturePVRTC, WebGLExtensionCompressedTexturePVRTC)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(WebGLExtensionCompressedTexturePVRTC)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIWebGLExtensionCompressedTexturePVRTC)
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, WebGLExtension)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(WebGLExtensionCompressedTexturePVRTC)
|
||||
NS_INTERFACE_MAP_END_INHERITING(WebGLExtension)
|
@ -56,6 +56,30 @@ public:
|
||||
NS_DECL_NSIWEBGLEXTENSION
|
||||
};
|
||||
|
||||
class WebGLExtensionCompressedTextureATC :
|
||||
public nsIWebGLExtensionCompressedTextureATC,
|
||||
public WebGLExtension
|
||||
{
|
||||
public:
|
||||
WebGLExtensionCompressedTextureATC(WebGLContext* context);
|
||||
virtual ~WebGLExtensionCompressedTextureATC();
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIWEBGLEXTENSION
|
||||
};
|
||||
|
||||
class WebGLExtensionCompressedTexturePVRTC :
|
||||
public nsIWebGLExtensionCompressedTexturePVRTC,
|
||||
public WebGLExtension
|
||||
{
|
||||
public:
|
||||
WebGLExtensionCompressedTexturePVRTC(WebGLContext* context);
|
||||
virtual ~WebGLExtensionCompressedTexturePVRTC();
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
NS_DECL_NSIWEBGLEXTENSION
|
||||
};
|
||||
|
||||
class WebGLExtensionDepthTexture :
|
||||
public nsIWebGLExtensionDepthTexture,
|
||||
public WebGLExtension
|
||||
|
@ -65,12 +65,12 @@ WebappsRegistry.prototype = {
|
||||
Services.DOMRequest.fireSuccess(req, null);
|
||||
}
|
||||
break;
|
||||
case "Webapps:IsInstalled:Return:OK":
|
||||
Services.DOMRequest.fireSuccess(req, msg.installed);
|
||||
break;
|
||||
case "Webapps:GetInstalled:Return:OK":
|
||||
Services.DOMRequest.fireSuccess(req, convertAppsArray(msg.apps, this._window));
|
||||
break;
|
||||
case "Webapps:GetSelf:Return:KO":
|
||||
Services.DOMRequest.fireError(req, "ERROR");
|
||||
break;
|
||||
}
|
||||
this.removeRequest(msg.requestID);
|
||||
},
|
||||
@ -146,11 +146,24 @@ WebappsRegistry.prototype = {
|
||||
getSelf: function() {
|
||||
let request = this.createRequest();
|
||||
cpmm.sendAsyncMessage("Webapps:GetSelf", { origin: this._getOrigin(this._window.location.href),
|
||||
appId: this._window.document.nodePrincipal.appId,
|
||||
oid: this._id,
|
||||
requestID: this.getRequestId(request) });
|
||||
return request;
|
||||
},
|
||||
|
||||
isInstalled: function(aManifestURL) {
|
||||
let manifestURL = Services.io.newURI(aManifestURL, null, this._window.document.baseURIObject);
|
||||
this._window.document.nodePrincipal.checkMayLoad(manifestURL, true, false);
|
||||
|
||||
let request = this.createRequest();
|
||||
cpmm.sendAsyncMessage("Webapps:IsInstalled", { origin: this._getOrigin(this._window.location.href),
|
||||
manifestURL: manifestURL.spec,
|
||||
oid: this._id,
|
||||
requestID: this.getRequestId(request) });
|
||||
return request;
|
||||
},
|
||||
|
||||
getInstalled: function() {
|
||||
let request = this.createRequest();
|
||||
cpmm.sendAsyncMessage("Webapps:GetInstalled", { origin: this._getOrigin(this._window.location.href),
|
||||
@ -197,7 +210,8 @@ WebappsRegistry.prototype = {
|
||||
init: function(aWindow) {
|
||||
this.initHelper(aWindow, ["Webapps:Install:Return:OK", "Webapps:Install:Return:KO",
|
||||
"Webapps:GetInstalled:Return:OK",
|
||||
"Webapps:GetSelf:Return:OK", "Webapps:GetSelf:Return:KO"]);
|
||||
"Webapps:GetSelf:Return:OK",
|
||||
"Webapps:IsInstalled:Return:OK" ]);
|
||||
|
||||
let util = this._window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
|
||||
this._id = util.outerWindowID;
|
||||
|
@ -56,7 +56,7 @@ let DOMApplicationRegistry = {
|
||||
|
||||
init: function() {
|
||||
this.messages = ["Webapps:Install", "Webapps:Uninstall",
|
||||
"Webapps:GetSelf",
|
||||
"Webapps:GetSelf", "Webapps:IsInstalled",
|
||||
"Webapps:GetInstalled", "Webapps:GetNotInstalled",
|
||||
"Webapps:Launch", "Webapps:GetAll",
|
||||
"Webapps:InstallPackage", "Webapps:GetBasePath",
|
||||
@ -447,6 +447,9 @@ let DOMApplicationRegistry = {
|
||||
case "Webapps:Launch":
|
||||
Services.obs.notifyObservers(mm, "webapps-launch", JSON.stringify(msg));
|
||||
break;
|
||||
case "Webapps:IsInstalled":
|
||||
this.isInstalled(msg, mm);
|
||||
break;
|
||||
case "Webapps:GetInstalled":
|
||||
this.getInstalled(msg, mm);
|
||||
break;
|
||||
@ -856,13 +859,29 @@ let DOMApplicationRegistry = {
|
||||
|
||||
getSelf: function(aData, aMm) {
|
||||
aData.apps = [];
|
||||
let tmp = [];
|
||||
let id = this._appId(aData.origin);
|
||||
|
||||
if (id && this._isLaunchable(this.webapps[id].origin)) {
|
||||
let app = AppsUtils.cloneAppObject(this.webapps[id]);
|
||||
aData.apps.push(app);
|
||||
tmp.push({ id: id });
|
||||
if (aData.appId == Ci.nsIScriptSecurityManager.NO_APP_ID ||
|
||||
aData.appId == Ci.nsIScriptSecurityManager.UNKNOWN_APP_ID) {
|
||||
aMm.sendAsyncMessage("Webapps:GetSelf:Return:OK", aData);
|
||||
return;
|
||||
}
|
||||
|
||||
let tmp = [];
|
||||
|
||||
for (let id in this.webapps) {
|
||||
if (this.webapps[id].origin == aData.origin &&
|
||||
this.webapps[id].localId == aData.appId &&
|
||||
this._isLaunchable(this.webapps[id].origin)) {
|
||||
let app = AppsUtils.cloneAppObject(this.webapps[id]);
|
||||
aData.apps.push(app);
|
||||
tmp.push({ id: id });
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!aData.apps.length) {
|
||||
aMm.sendAsyncMessage("Webapps:GetSelf:Return:OK", aData);
|
||||
return;
|
||||
}
|
||||
|
||||
this._readManifests(tmp, (function(aResult) {
|
||||
@ -872,6 +891,19 @@ let DOMApplicationRegistry = {
|
||||
}).bind(this));
|
||||
},
|
||||
|
||||
isInstalled: function(aData, aMm) {
|
||||
aData.installed = false;
|
||||
|
||||
for (let appId in this.webapps) {
|
||||
if (this.webapps[appId].manifestURL == aData.manifestURL) {
|
||||
aData.installed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
aMm.sendAsyncMessage("Webapps:IsInstalled:Return:OK", aData);
|
||||
},
|
||||
|
||||
getInstalled: function(aData, aMm) {
|
||||
aData.apps = [];
|
||||
let tmp = [];
|
||||
|
@ -1113,36 +1113,16 @@ Navigator::RequestWakeLock(const nsAString &aTopic, nsIDOMMozWakeLock **aWakeLoc
|
||||
// Navigator::nsIDOMNavigatorSms
|
||||
//*****************************************************************************
|
||||
|
||||
bool
|
||||
Navigator::IsSmsSupported() const
|
||||
{
|
||||
#ifdef MOZ_WEBSMS_BACKEND
|
||||
nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
|
||||
NS_ENSURE_TRUE(smsService, false);
|
||||
|
||||
bool result = false;
|
||||
smsService->HasSupport(&result);
|
||||
|
||||
return result;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
Navigator::GetMozSms(nsIDOMMozSmsManager** aSmsManager)
|
||||
{
|
||||
*aSmsManager = nullptr;
|
||||
|
||||
if (!mSmsManager) {
|
||||
if (!IsSmsSupported()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mWindow);
|
||||
NS_ENSURE_TRUE(window && window->GetDocShell(), NS_OK);
|
||||
|
||||
mSmsManager = SmsManager::CheckPermissionAndCreateInstance(window);
|
||||
mSmsManager = SmsManager::CreateInstanceIfAllowed(window);
|
||||
NS_ENSURE_TRUE(mSmsManager, NS_OK);
|
||||
}
|
||||
|
||||
|
@ -162,8 +162,6 @@ public:
|
||||
NS_DECL_NSIDOMNAVIGATORCAMERA
|
||||
|
||||
private:
|
||||
bool IsSmsSupported() const;
|
||||
|
||||
nsRefPtr<nsMimeTypeArray> mMimeTypes;
|
||||
nsRefPtr<nsPluginArray> mPlugins;
|
||||
nsRefPtr<nsGeolocation> mGeolocation;
|
||||
|
@ -1584,6 +1584,12 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
||||
NS_DEFINE_CLASSINFO_DATA(WebGLExtensionCompressedTextureS3TC, WebGLExtensionSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
||||
nsIXPCScriptable::WANT_ADDPROPERTY)
|
||||
NS_DEFINE_CLASSINFO_DATA(WebGLExtensionCompressedTextureATC, WebGLExtensionSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
||||
nsIXPCScriptable::WANT_ADDPROPERTY)
|
||||
NS_DEFINE_CLASSINFO_DATA(WebGLExtensionCompressedTexturePVRTC, WebGLExtensionSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
||||
nsIXPCScriptable::WANT_ADDPROPERTY)
|
||||
NS_DEFINE_CLASSINFO_DATA(WebGLExtensionDepthTexture, WebGLExtensionSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS |
|
||||
nsIXPCScriptable::WANT_ADDPROPERTY)
|
||||
@ -4281,6 +4287,14 @@ nsDOMClassInfo::Init()
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIWebGLExtensionCompressedTextureS3TC)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(WebGLExtensionCompressedTextureATC, nsIWebGLExtensionCompressedTextureATC)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIWebGLExtensionCompressedTextureATC)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(WebGLExtensionCompressedTexturePVRTC, nsIWebGLExtensionCompressedTexturePVRTC)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIWebGLExtensionCompressedTexturePVRTC)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(WebGLExtensionDepthTexture, nsIWebGLExtensionDepthTexture)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIWebGLExtensionDepthTexture)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
@ -459,6 +459,8 @@ DOMCI_CLASS(WebGLExtensionStandardDerivatives)
|
||||
DOMCI_CLASS(WebGLExtensionTextureFilterAnisotropic)
|
||||
DOMCI_CLASS(WebGLExtensionLoseContext)
|
||||
DOMCI_CLASS(WebGLExtensionCompressedTextureS3TC)
|
||||
DOMCI_CLASS(WebGLExtensionCompressedTextureATC)
|
||||
DOMCI_CLASS(WebGLExtensionCompressedTexturePVRTC)
|
||||
DOMCI_CLASS(WebGLExtensionDepthTexture)
|
||||
|
||||
DOMCI_CLASS(PaintRequest)
|
||||
|
@ -2324,6 +2324,10 @@ nsDOMWindowUtils::WrapDOMFile(nsIFile *aFile,
|
||||
return NS_ERROR_DOM_SECURITY_ERR;
|
||||
}
|
||||
|
||||
if (!aFile) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_ADDREF(*aDOMFile = new nsDOMFileFile(aFile));
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -413,6 +413,7 @@ ContactManager.prototype = {
|
||||
case "Contact:Save:Return:KO":
|
||||
case "Contact:Remove:Return:KO":
|
||||
case "Contacts:Clear:Return:KO":
|
||||
case "Contacts:GetSimContacts:Return:KO":
|
||||
req = this.getRequest(msg.requestID);
|
||||
if (req)
|
||||
Services.DOMRequest.fireError(req.request, msg.errorMsg);
|
||||
@ -579,6 +580,7 @@ ContactManager.prototype = {
|
||||
"Contact:Save:Return:OK", "Contact:Save:Return:KO",
|
||||
"Contact:Remove:Return:OK", "Contact:Remove:Return:KO",
|
||||
"Contacts:GetSimContacts:Return:OK",
|
||||
"Contacts:GetSimContacts:Return:KO",
|
||||
"PermissionPromptHelper:AskPermission:OK"]);
|
||||
},
|
||||
|
||||
|
@ -149,11 +149,19 @@ let DOMContactManager = {
|
||||
);
|
||||
break;
|
||||
case "Contacts:GetSimContacts":
|
||||
let callback = function(aContactType, aContacts) {
|
||||
if (DEBUG) debug("got SIM contacts: " + aContactType + " " + JSON.stringify(aContacts));
|
||||
mm.sendAsyncMessage("Contacts:GetSimContacts:Return:OK", {requestID: msg.requestID, contacts: aContacts});
|
||||
};
|
||||
mRIL.getICCContacts(msg.options.contactType, callback);
|
||||
mRIL.getICCContacts(
|
||||
msg.options.contactType,
|
||||
function (aErrorMsg, aType, aContacts) {
|
||||
if (aErrorMsg) {
|
||||
mm.sendAsyncMessage("Contacts:GetSimContacts:Return:KO",
|
||||
{requestID: msg.requestID,
|
||||
errorMsg: aErrorMsg});
|
||||
} else {
|
||||
mm.sendAsyncMessage("Contacts:GetSimContacts:Return:OK",
|
||||
{requestID: msg.requestID,
|
||||
contacts: aContacts});
|
||||
}
|
||||
}.bind(this));
|
||||
break;
|
||||
default:
|
||||
if (DEBUG) debug("WRONG MESSAGE NAME: " + aMessage.name);
|
||||
|
@ -31,6 +31,7 @@ MOCHITEST_FILES = \
|
||||
test_workers.html \
|
||||
test_archivereader.html \
|
||||
test_archivereader_zip_in_zip.html \
|
||||
test_bug_793311.html \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
28
dom/file/test/test_bug_793311.html
Normal file
28
dom/file/test/test_bug_793311.html
Normal file
@ -0,0 +1,28 @@
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 793311 Test</title>
|
||||
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script type="text/javascript;version=1.7">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
try {
|
||||
SpecialPowers.DOMWindowUtils.wrapDOMFile(null);
|
||||
ok(false, "wrapDOMFile(null) throws an exception");
|
||||
} catch(e) {
|
||||
ok(true, "wrapDOMFile(null) throws an exception");
|
||||
}
|
||||
SimpleTest.finish();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -243,6 +243,18 @@ dictionary MozStkSetUpCall
|
||||
jsval callMessage;
|
||||
};
|
||||
|
||||
dictionary MozStkSetUpEventList
|
||||
{
|
||||
/**
|
||||
* The list of events that needs to provide details to ICC when they happen.
|
||||
* When this valus is null, means an indication to remove the existing list
|
||||
* of events in ME.
|
||||
*
|
||||
* @see nsIDOMMozIccManager.STK_EVENT_TYPE_*
|
||||
*/
|
||||
jsval eventList; // unsigned short []
|
||||
};
|
||||
|
||||
dictionary MozStkCommand
|
||||
{
|
||||
/**
|
||||
@ -267,29 +279,33 @@ dictionary MozStkCommand
|
||||
* options varies accrording to the typeOfCommand in MozStkCommand.
|
||||
*
|
||||
* When typeOfCommand is
|
||||
* - STK_DISPLAY_TEXT
|
||||
* - STK_SET_UP_IDLE_MODE_TEXT
|
||||
* - STK_REFRESH
|
||||
* - STK_SEND_{SS|USSD|SMS|DTMF},
|
||||
* - STK_CMD_DISPLAY_TEXT
|
||||
* - STK_CMD_SET_UP_IDLE_MODE_TEXT
|
||||
* - STK_CMD_REFRESH
|
||||
* - STK_CMD_SEND_{SS|USSD|SMS|DTMF},
|
||||
* options is MozStkTextMessage.
|
||||
*
|
||||
* When typeOfCommand is
|
||||
* - STK_SELECT_ITEM
|
||||
* - STK_SET_UP_MENU
|
||||
* - STK_CMD_SELECT_ITEM
|
||||
* - STK_CMD_SET_UP_MENU
|
||||
* options is MozStkMenu.
|
||||
*
|
||||
* When typeOfCommand is
|
||||
* - STK_GET_INKEY
|
||||
* - STK_GET_INPUT,
|
||||
* - STK_CMD_GET_INKEY
|
||||
* - STK_CMD_GET_INPUT,
|
||||
* options is MozStkInput.
|
||||
*
|
||||
* When typeOfCommand is
|
||||
* - STK_LAUNCH_BROWSER
|
||||
* - STK_CMD_LAUNCH_BROWSER
|
||||
* options is MozStkBrowserSetting.
|
||||
*
|
||||
* When typeOfCommand is
|
||||
* - STK_SET_UP_CALL
|
||||
* - STK_CMD_SET_UP_CALL
|
||||
* options is MozStkSetUpCall.
|
||||
*
|
||||
* When typeOfCommand is
|
||||
* - STK_CMD_SET_UP_EVENT_LIST
|
||||
* options is MozStkSetUpEventList.
|
||||
*/
|
||||
jsval options;
|
||||
};
|
||||
@ -323,13 +339,6 @@ dictionary MozStkResponse
|
||||
*/
|
||||
DOMString input;
|
||||
|
||||
/**
|
||||
* Alphabet encoding.
|
||||
*
|
||||
* @see MozStkInput.isUCS2
|
||||
*/
|
||||
boolean isUCS2;
|
||||
|
||||
/**
|
||||
* YES/NO response.
|
||||
*
|
||||
@ -337,13 +346,6 @@ dictionary MozStkResponse
|
||||
*/
|
||||
boolean isYesNo;
|
||||
|
||||
/**
|
||||
* Packed or unpacked format.
|
||||
*
|
||||
* @see MozStkInput.isPacked
|
||||
*/
|
||||
boolean isPacked;
|
||||
|
||||
/**
|
||||
* User has confirmed or rejected the call during STK_CMD_CALL_SET_UP.
|
||||
*
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
interface nsIDOMEventListener;
|
||||
|
||||
[scriptable, builtinclass, uuid(cf58adc2-2db6-4130-86d2-2044788889cb)]
|
||||
[scriptable, builtinclass, uuid(2eace3f9-6aa4-491b-820e-7d69ce7b3f02)]
|
||||
interface nsIDOMMozIccManager : nsIDOMEventTarget
|
||||
{
|
||||
/**
|
||||
@ -30,6 +30,7 @@ interface nsIDOMMozIccManager : nsIDOMEventTarget
|
||||
* @see TS 11.14, clause 13.4
|
||||
*/
|
||||
const unsigned short STK_CMD_REFRESH = 0x01;
|
||||
const unsigned short STK_CMD_SET_UP_EVENT_LIST = 0x05;
|
||||
const unsigned short STK_CMD_SET_UP_CALL = 0x10;
|
||||
const unsigned short STK_CMD_SEND_SS = 0x11;
|
||||
const unsigned short STK_CMD_SEND_USSD = 0x12;
|
||||
@ -140,6 +141,27 @@ interface nsIDOMMozIccManager : nsIDOMEventTarget
|
||||
/** Bearer Independent Protocol error */
|
||||
const unsigned short STK_RESULT_BIP_ERROR = 0x3a;
|
||||
|
||||
/**
|
||||
* STK Event List
|
||||
*/
|
||||
const unsigned short STK_EVENT_TYPE_MT_CALL = 0x00;
|
||||
const unsigned short STK_EVENT_TYPE_CALL_CONNECTED = 0x01;
|
||||
const unsigned short STK_EVENT_TYPE_CALL_DISCONNECTED = 0x02;
|
||||
const unsigned short STK_EVENT_TYPE_LOCATION_STATUS = 0x03;
|
||||
const unsigned short STK_EVENT_TYPE_USER_ACTIVITY = 0x04;
|
||||
const unsigned short STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE = 0x05;
|
||||
const unsigned short STK_EVENT_TYPE_CARD_READER_STATUS = 0x06;
|
||||
const unsigned short STK_EVENT_TYPE_LANGUAGE_SELECTION = 0x07;
|
||||
const unsigned short STK_EVENT_TYPE_BROWSER_TERMINATION = 0x08;
|
||||
const unsigned short STK_EVENT_TYPE_DATA_AVAILABLE = 0x09;
|
||||
const unsigned short STK_EVENT_TYPE_CHANNEL_STATUS = 0x0a;
|
||||
const unsigned short STK_EVENT_TYPE_SINGLE_ACCESS_TECHNOLOGY_CHANGED = 0x0b;
|
||||
const unsigned short STK_EVENT_TYPE_DISPLAY_PARAMETER_CHANGED = 0x0c;
|
||||
const unsigned short STK_EVENT_TYPE_LOCAL_CONNECTION = 0x0d;
|
||||
const unsigned short STK_EVENT_TYPE_NETWORK_SEARCH_MODE_CHANGED = 0x0e;
|
||||
const unsigned short STK_EVENT_TYPE_BROWSING_STATUS = 0x0f;
|
||||
const unsigned short STK_EVENT_TYPE_FRAMES_INFORMATION_CHANGED = 0x10;
|
||||
|
||||
/**
|
||||
* Send the response back to ICC after an attempt to execute STK Proactive
|
||||
* Command.
|
||||
|
@ -73,7 +73,7 @@ interface mozIDOMApplicationMgmt : nsISupports
|
||||
attribute nsIDOMEventListener onuninstall;
|
||||
};
|
||||
|
||||
[scriptable, uuid(dd9a044c-1073-4d2b-a17d-c9b5834b3420)]
|
||||
[scriptable, uuid(7ca34d3e-d855-4d0a-a3b3-58c0acad9ec3)]
|
||||
interface mozIDOMApplicationRegistry : nsISupports
|
||||
{
|
||||
/**
|
||||
@ -94,6 +94,11 @@ interface mozIDOMApplicationRegistry : nsISupports
|
||||
*/
|
||||
nsIDOMDOMRequest getSelf();
|
||||
|
||||
/**
|
||||
* the request will return true if the app from that origin is installed
|
||||
*/
|
||||
nsIDOMDOMRequest isInstalled(in DOMString manifestUrl);
|
||||
|
||||
/**
|
||||
* the request will return the applications installed from this origin, or null.
|
||||
*/
|
||||
|
@ -155,6 +155,25 @@ interface nsIWebGLExtensionCompressedTextureS3TC : nsIWebGLExtension
|
||||
const WebGLenum COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(9592637f-ee3b-4c42-8329-5c9ad47411c1)]
|
||||
interface nsIWebGLExtensionCompressedTextureATC : nsIWebGLExtension
|
||||
{
|
||||
/* Compressed Texture Formats */
|
||||
const WebGLenum COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
|
||||
const WebGLenum COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
|
||||
const WebGLenum COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(c33aa5a1-035c-4dfa-b240-df71395ad0f8)]
|
||||
interface nsIWebGLExtensionCompressedTexturePVRTC : nsIWebGLExtension
|
||||
{
|
||||
/* Compressed Texture Formats */
|
||||
const WebGLenum COMPRESSED_RGB_PVRTC_4BPPV1 = 0x8C00;
|
||||
const WebGLenum COMPRESSED_RGB_PVRTC_2BPPV1 = 0x8C01;
|
||||
const WebGLenum COMPRESSED_RGBA_PVRTC_4BPPV1 = 0x8C02;
|
||||
const WebGLenum COMPRESSED_RGBA_PVRTC_2BPPV1 = 0x8C03;
|
||||
};
|
||||
|
||||
[scriptable, builtinclass, uuid(ef36f000-c1b2-11e1-afa7-0800200c9a66)]
|
||||
interface nsIWebGLExtensionDepthTexture : nsIWebGLExtension
|
||||
{
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <gdk/gdkx.h>
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#include "gtk2compat.h"
|
||||
#include "gtk2xtbin.h"
|
||||
#include "mozilla/X11Util.h"
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
#if (MOZ_WIDGET_GTK == 3)
|
||||
#include <gtk/gtkx.h>
|
||||
#endif
|
||||
#include "gtk2compat.h"
|
||||
#endif
|
||||
|
||||
#include "nsIFile.h"
|
||||
|
@ -17,13 +17,6 @@
|
||||
<![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
|
||||
const isOSXMtnLion = navigator.userAgent.indexOf("Mac OS X 10.8") != -1;
|
||||
if (isOSXLion || isOSXMtnLion) {
|
||||
todo(false, "Can't test plugin crash notification on OS X 10.7 or 10.8, see bug 705047");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function runTests() {
|
||||
if (!SimpleTest.testPluginIsOOP()) {
|
||||
ok(true, "Skipping this test when test plugin is not OOP.");
|
||||
|
@ -15,13 +15,6 @@
|
||||
<![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
|
||||
const isOSXMtnLion = navigator.userAgent.indexOf("Mac OS X 10.8") != -1;
|
||||
if (isOSXLion || isOSXMtnLion) {
|
||||
todo(false, "Can't test plugin crash notification on OS X 10.7 or 10.8, see bug 705047");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
var success = false;
|
||||
|
||||
var observerFired = false;
|
||||
|
@ -15,13 +15,6 @@
|
||||
<![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
|
||||
const isOSXMtnLion = navigator.userAgent.indexOf("Mac OS X 10.8") != -1;
|
||||
if (isOSXLion || isOSXMtnLion) {
|
||||
todo(false, "Can't test plugin crash notification on OS X 10.7 or 10.8, see bug 705047");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
var success = false;
|
||||
|
||||
var observerFired = false;
|
||||
|
@ -18,13 +18,6 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
SimpleTest.ignoreAllUncaughtExceptions();
|
||||
|
||||
const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
|
||||
const isOSXMtnLion = navigator.userAgent.indexOf("Mac OS X 10.8") != -1;
|
||||
if (isOSXLion || isOSXMtnLion) {
|
||||
todo(false, "Can't test plugin crash notification on OS X 10.7 or 10.8, see bug 705047");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
@ -7,15 +7,7 @@
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
window.frameLoaded = function frameLoaded_toCrash() {
|
||||
const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
|
||||
const isOSXMtnLion = navigator.userAgent.indexOf("Mac OS X 10.8") != -1;
|
||||
if (isOSXLion || isOSXMtnLion) {
|
||||
todo(false, "Can't test plugin crash notification on OS X 10.7 or 10.8, see bug 705047");
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SimpleTest.testPluginIsOOP()) {
|
||||
if (!SimpleTest.testPluginIsOOP()) {
|
||||
ok(true, "Skipping this test when test plugin is not OOP.");
|
||||
SimpleTest.finish();
|
||||
return;
|
||||
|
@ -6,13 +6,6 @@
|
||||
<script class="testbody" type="application/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
|
||||
const isOSXMtnLion = navigator.userAgent.indexOf("Mac OS X 10.8") != -1;
|
||||
if (isOSXLion || isOSXMtnLion) {
|
||||
todo(false, "Can't test plugin crash notification on OS X 10.7 or 10.8, see bug 705047");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
window.frameLoaded = function frameLoaded_toCrash() {
|
||||
if (!SimpleTest.testPluginIsOOP()) {
|
||||
ok(true, "Skipping this test when test plugin is not OOP.");
|
||||
|
@ -17,13 +17,6 @@
|
||||
<![CDATA[
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
|
||||
const isOSXMtnLion = navigator.userAgent.indexOf("Mac OS X 10.8") != -1;
|
||||
if (isOSXLion || isOSXMtnLion) {
|
||||
todo(false, "Can't test plugin crash notification on OS X 10.7 or 10.8, see bug 705047");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
function runTests() {
|
||||
if (!SimpleTest.testPluginIsOOP()) {
|
||||
ok(true, "Skipping this test when test plugin is not OOP.");
|
||||
|
@ -60,10 +60,14 @@ NS_IMPL_EVENT_HANDLER(SmsManager, sent)
|
||||
NS_IMPL_EVENT_HANDLER(SmsManager, delivered)
|
||||
|
||||
/* static */already_AddRefed<SmsManager>
|
||||
SmsManager::CheckPermissionAndCreateInstance(nsPIDOMWindow* aWindow)
|
||||
SmsManager::CreateInstanceIfAllowed(nsPIDOMWindow* aWindow)
|
||||
{
|
||||
NS_ASSERTION(aWindow, "Null pointer!");
|
||||
|
||||
#ifndef MOZ_WEBSMS_BACKEND
|
||||
return nullptr;
|
||||
#endif
|
||||
|
||||
// First of all, the general pref has to be turned on.
|
||||
bool enabled = false;
|
||||
Preferences::GetBool("dom.sms.enabled", &enabled);
|
||||
@ -80,6 +84,16 @@ SmsManager::CheckPermissionAndCreateInstance(nsPIDOMWindow* aWindow)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Check the Sms Service:
|
||||
nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
|
||||
NS_ENSURE_TRUE(smsService, nullptr);
|
||||
|
||||
bool result = false;
|
||||
smsService->HasSupport(&result);
|
||||
if (!result) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsRefPtr<SmsManager> smsMgr = new SmsManager();
|
||||
smsMgr->Init(aWindow);
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
||||
nsDOMEventTargetHelper)
|
||||
|
||||
static already_AddRefed<SmsManager>
|
||||
CheckPermissionAndCreateInstance(nsPIDOMWindow *aWindow);
|
||||
CreateInstanceIfAllowed(nsPIDOMWindow *aWindow);
|
||||
|
||||
void Init(nsPIDOMWindow *aWindow);
|
||||
void Shutdown();
|
||||
|
@ -33,6 +33,9 @@ using namespace mozilla;
|
||||
#define HEADPHONES_STATUS_OFF NS_LITERAL_STRING("off").get()
|
||||
#define HEADPHONES_STATUS_UNKNOWN NS_LITERAL_STRING("unknown").get()
|
||||
|
||||
// A bitwise variable for recording what kind of headset is attached.
|
||||
static int sHeadsetState;
|
||||
|
||||
static bool
|
||||
IsFmRadioAudioOn()
|
||||
{
|
||||
@ -63,13 +66,59 @@ GetRoutingMode(int aType) {
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
InternalSetAudioRoutesICS(SwitchState aState)
|
||||
{
|
||||
if (aState == SWITCH_STATE_HEADSET) {
|
||||
AudioSystem::setDeviceConnectionState(AUDIO_DEVICE_OUT_WIRED_HEADSET,
|
||||
AUDIO_POLICY_DEVICE_STATE_AVAILABLE, "");
|
||||
sHeadsetState |= AUDIO_DEVICE_OUT_WIRED_HEADSET;
|
||||
} else if (aState == SWITCH_STATE_HEADPHONE) {
|
||||
AudioSystem::setDeviceConnectionState(AUDIO_DEVICE_OUT_WIRED_HEADPHONE,
|
||||
AUDIO_POLICY_DEVICE_STATE_AVAILABLE, "");
|
||||
sHeadsetState |= AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
|
||||
} else if (aState == SWITCH_STATE_OFF) {
|
||||
AudioSystem::setDeviceConnectionState(static_cast<audio_devices_t>(sHeadsetState),
|
||||
AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE, "");
|
||||
sHeadsetState = 0;
|
||||
}
|
||||
|
||||
// The audio volume is not consistent when we plug and unplug the headset.
|
||||
// Set the fm volume again here.
|
||||
if (IsFmRadioAudioOn()) {
|
||||
float masterVolume;
|
||||
AudioSystem::getMasterVolume(&masterVolume);
|
||||
AudioSystem::setFmVolume(masterVolume);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
InternalSetAudioRoutesGB(SwitchState aState)
|
||||
{
|
||||
audio_io_handle_t handle =
|
||||
AudioSystem::getOutput((AudioSystem::stream_type)AudioSystem::SYSTEM);
|
||||
String8 cmd;
|
||||
|
||||
if (aState == SWITCH_STATE_HEADSET || aState == SWITCH_STATE_HEADPHONE) {
|
||||
cmd.appendFormat("routing=%d", GetRoutingMode(nsIAudioManager::FORCE_HEADPHONES));
|
||||
} else if (aState == SWITCH_STATE_OFF) {
|
||||
cmd.appendFormat("routing=%d", GetRoutingMode(nsIAudioManager::FORCE_SPEAKER));
|
||||
}
|
||||
|
||||
AudioSystem::setParameters(handle, cmd);
|
||||
}
|
||||
|
||||
static void
|
||||
InternalSetAudioRoutes(SwitchState aState)
|
||||
{
|
||||
if (aState == SWITCH_STATE_ON) {
|
||||
AudioManager::SetAudioRoute(nsIAudioManager::FORCE_HEADPHONES);
|
||||
} else if (aState == SWITCH_STATE_OFF) {
|
||||
AudioManager::SetAudioRoute(nsIAudioManager::FORCE_SPEAKER);
|
||||
if (static_cast<
|
||||
status_t (*)(audio_devices_t, audio_policy_dev_state_t, const char*)
|
||||
>(AudioSystem::setDeviceConnectionState)) {
|
||||
InternalSetAudioRoutesICS(aState);
|
||||
} else if (static_cast<
|
||||
audio_io_handle_t (*)(AudioSystem::stream_type, uint32_t, uint32_t, uint32_t, AudioSystem::output_flags)
|
||||
>(AudioSystem::getOutput)) {
|
||||
InternalSetAudioRoutesGB(aState);
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,7 +150,7 @@ AudioManager::AudioManager() : mPhoneState(PHONE_STATE_CURRENT),
|
||||
mObserver(new HeadphoneSwitchObserver())
|
||||
{
|
||||
RegisterSwitchObserver(SWITCH_HEADPHONES, mObserver);
|
||||
|
||||
|
||||
InternalSetAudioRoutes(GetCurrentSwitchState(SWITCH_HEADPHONES));
|
||||
}
|
||||
|
||||
@ -235,34 +284,6 @@ AudioManager::GetForceForUse(int32_t aUsage, int32_t* aForce) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
AudioManager::SetAudioRoute(int aRoutes) {
|
||||
if (static_cast<
|
||||
audio_io_handle_t (*)(AudioSystem::stream_type, uint32_t, uint32_t, uint32_t, AudioSystem::output_flags)
|
||||
>(AudioSystem::getOutput)) {
|
||||
audio_io_handle_t handle = 0;
|
||||
handle = AudioSystem::getOutput((AudioSystem::stream_type)AudioSystem::SYSTEM);
|
||||
String8 cmd;
|
||||
cmd.appendFormat("routing=%d", GetRoutingMode(aRoutes));
|
||||
AudioSystem::setParameters(handle, cmd);
|
||||
} else if (static_cast<
|
||||
status_t (*)(audio_devices_t, audio_policy_dev_state_t, const char*)
|
||||
>(AudioSystem::setDeviceConnectionState)) {
|
||||
AudioSystem::setDeviceConnectionState(AUDIO_DEVICE_OUT_WIRED_HEADSET,
|
||||
GetRoutingMode(aRoutes) == AudioSystem::DEVICE_OUT_WIRED_HEADSET ?
|
||||
AUDIO_POLICY_DEVICE_STATE_AVAILABLE : AUDIO_POLICY_DEVICE_STATE_UNAVAILABLE,
|
||||
"");
|
||||
|
||||
// The audio volume is not consistent when we plug and unplug the headset.
|
||||
// Set the fm volume again here.
|
||||
if (IsFmRadioAudioOn()) {
|
||||
float masterVolume;
|
||||
AudioSystem::getMasterVolume(&masterVolume);
|
||||
AudioSystem::setFmVolume(masterVolume);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
AudioManager::GetFmRadioAudioEnabled(bool *aFmRadioAudioEnabled)
|
||||
{
|
||||
|
@ -44,8 +44,6 @@ public:
|
||||
AudioManager();
|
||||
~AudioManager();
|
||||
|
||||
static void SetAudioRoute(int aRoutes);
|
||||
|
||||
protected:
|
||||
int32_t mPhoneState;
|
||||
|
||||
|
@ -448,7 +448,9 @@ RadioInterfaceLayer.prototype = {
|
||||
let callback = this._contactsCallbacks[message.requestId];
|
||||
if (callback) {
|
||||
delete this._contactsCallbacks[message.requestId];
|
||||
callback.receiveContactsList(message.contactType, message.contacts);
|
||||
callback.receiveContactsList(message.errorMsg,
|
||||
message.contactType,
|
||||
message.contacts);
|
||||
}
|
||||
break;
|
||||
case "iccmbdn":
|
||||
@ -1864,7 +1866,7 @@ RadioInterfaceLayer.prototype = {
|
||||
getICCContacts: function getICCContacts(contactType, callback) {
|
||||
if (!this._contactsCallbacks) {
|
||||
this._contactsCallbacks = {};
|
||||
}
|
||||
}
|
||||
let requestId = Math.floor(Math.random() * 1000);
|
||||
this._contactsCallbacks[requestId] = callback;
|
||||
this.worker.postMessage({rilMessageType: "getICCContacts",
|
||||
|
@ -117,18 +117,22 @@ interface nsIRILDataCallback : nsISupports
|
||||
in unsigned long length);
|
||||
};
|
||||
|
||||
[scriptable, function, uuid(cfff68a2-7799-4c37-acca-bf58c19b2236)]
|
||||
[scriptable, function, uuid(a94282b6-da60-4daf-95c1-82ee6889d0df)]
|
||||
interface nsIRILContactCallback : nsISupports
|
||||
{
|
||||
/**
|
||||
* Called when nsIRadioInterfaceLayer is asked to provide ICC contacts.
|
||||
*
|
||||
* @param errorMsg
|
||||
* error message from RIL.
|
||||
* @param contactType
|
||||
* Type of the dialling number, i.e. ADN, FDN.
|
||||
* @param contacts
|
||||
* Array of the ICC contacts of the specified type.
|
||||
*/
|
||||
void receiveContactsList(in DOMString contactType, in jsval contacts);
|
||||
void receiveContactsList(in DOMString errorMsg,
|
||||
in DOMString contactType,
|
||||
in jsval contacts);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -535,6 +535,7 @@ const COMPREHENSIONTLV_TAG_ITEM_ID = 0x10;
|
||||
const COMPREHENSIONTLV_TAG_RESPONSE_LENGTH = 0x11;
|
||||
const COMPREHENSIONTLV_TAG_HELP_REQUEST = 0x15;
|
||||
const COMPREHENSIONTLV_TAG_DEFAULT_TEXT = 0x17;
|
||||
const COMPREHENSIONTLV_TAG_EVENT_LIST = 0x19;
|
||||
const COMPREHENSIONTLV_TAG_ICON_ID = 0x1e;
|
||||
const COMPREHENSIONTLV_TAG_ICON_ID_LIST = 0x1f;
|
||||
const COMPREHENSIONTLV_TAG_IMMEDIATE_RESPONSE = 0x2b;
|
||||
@ -550,6 +551,7 @@ const STK_DEVICE_ID_NETWORK = 0x83;
|
||||
|
||||
// STK Proactive commands.
|
||||
const STK_CMD_REFRESH = 0x01;
|
||||
const STK_CMD_SET_UP_EVENT_LIST = 0x05;
|
||||
const STK_CMD_SET_UP_CALL = 0x10;
|
||||
const STK_CMD_SEND_SS = 0x11;
|
||||
const STK_CMD_SEND_USSD = 0x12;
|
||||
@ -698,6 +700,24 @@ const STK_TEXT_CODING_GSM_7BIT_PACKED = 0x00;
|
||||
const STK_TEXT_CODING_GSM_8BIT = 0x04;
|
||||
const STK_TEXT_CODING_UCS2 = 0x08;
|
||||
|
||||
// STK Event List.
|
||||
const STK_EVENT_TYPE_MT_CALL = 0x00;
|
||||
const STK_EVENT_TYPE_CALL_CONNECTED = 0x01;
|
||||
const STK_EVENT_TYPE_CALL_DISCONNECTED = 0x02;
|
||||
const STK_EVENT_TYPE_LOCATION_STATUS = 0x03;
|
||||
const STK_EVENT_TYPE_USER_ACTIVITY = 0x04;
|
||||
const STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE = 0x05;
|
||||
const STK_EVENT_TYPE_CARD_READER_STATUS = 0x06;
|
||||
const STK_EVENT_TYPE_LANGUAGE_SELECTION = 0x07;
|
||||
const STK_EVENT_TYPE_BROWSER_TERMINATION = 0x08;
|
||||
const STK_EVENT_TYPE_DATA_AVAILABLE = 0x09;
|
||||
const STK_EVENT_TYPE_CHANNEL_STATUS = 0x0a;
|
||||
const STK_EVENT_TYPE_SINGLE_ACCESS_TECHNOLOGY_CHANGED = 0x0b;
|
||||
const STK_EVENT_TYPE_DISPLAY_PARAMETER_CHANGED = 0x0c;
|
||||
const STK_EVENT_TYPE_LOCAL_CONNECTION = 0x0d;
|
||||
const STK_EVENT_TYPE_NETWORK_SEARCH_MODE_CHANGED = 0x0e;
|
||||
const STK_EVENT_TYPE_BROWSING_STATUS = 0x0f;
|
||||
|
||||
/**
|
||||
* (U)SIM Services.
|
||||
*
|
||||
|
@ -1461,11 +1461,10 @@ let RIL = {
|
||||
}
|
||||
|
||||
function error(options) {
|
||||
// TODO: Error handling should be addressed in Bug 787477
|
||||
delete options.callback;
|
||||
delete options.onerror;
|
||||
options.rilMessageType = "icccontacts";
|
||||
options.contacts = [];
|
||||
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
|
||||
this.sendDOMMessage(options);
|
||||
}
|
||||
|
||||
@ -1554,9 +1553,8 @@ let RIL = {
|
||||
*/
|
||||
getICCContacts: function getICCContacts(options) {
|
||||
if (!this.appType) {
|
||||
// TODO: Error handling should be addressed in Bug 787477
|
||||
options.rilMessageType = "icccontacts";
|
||||
options.contacts = [];
|
||||
options.errorMsg = GECKO_ERROR_REQUEST_NOT_SUPPORTED;
|
||||
this.sendDOMMessage(options);
|
||||
}
|
||||
|
||||
@ -1602,11 +1600,10 @@ let RIL = {
|
||||
}
|
||||
|
||||
function error(options) {
|
||||
// TODO: Error handling should be addressed in Bug 787477
|
||||
delete options.callback;
|
||||
delete options.onerror;
|
||||
options.rilMessageType = "icccontacts";
|
||||
options.contacts = [];
|
||||
options.errorMsg = RIL_ERROR_TO_GECKO_ERROR[options.rilRequestError];
|
||||
this.sendDOMMessage(options);
|
||||
}
|
||||
|
||||
@ -2147,8 +2144,6 @@ let RIL = {
|
||||
* @param [optional] itemIdentifier
|
||||
* @param [optional] input
|
||||
* @param [optional] isYesNo
|
||||
* @param [optional] isUCS2
|
||||
* @param [optional] isPacked
|
||||
* @param [optional] hasConfirmed
|
||||
*/
|
||||
sendStkTerminalResponse: function sendStkTerminalResponse(response) {
|
||||
@ -2159,13 +2154,14 @@ let RIL = {
|
||||
|
||||
let token = Buf.newParcel(REQUEST_STK_SEND_TERMINAL_RESPONSE);
|
||||
let textLen = 0;
|
||||
let command = response.command;
|
||||
if (response.resultCode != STK_RESULT_HELP_INFO_REQUIRED) {
|
||||
if (response.isYesNo) {
|
||||
textLen = 1;
|
||||
} else if (response.input) {
|
||||
if (response.isUCS2) {
|
||||
if (command.options.isUCS2) {
|
||||
textLen = response.input.length * 2;
|
||||
} else if (response.isPacked) {
|
||||
} else if (command.options.isPacked) {
|
||||
let bits = response.input.length * 7;
|
||||
textLen = bits * 7 / 8 + (bits % 8 ? 1 : 0);
|
||||
} else {
|
||||
@ -2187,9 +2183,9 @@ let RIL = {
|
||||
COMPREHENSIONTLV_FLAG_CR);
|
||||
GsmPDUHelper.writeHexOctet(3);
|
||||
if (response.command) {
|
||||
GsmPDUHelper.writeHexOctet(response.command.commandNumber);
|
||||
GsmPDUHelper.writeHexOctet(response.command.typeOfCommand);
|
||||
GsmPDUHelper.writeHexOctet(response.command.commandQualifier);
|
||||
GsmPDUHelper.writeHexOctet(command.commandNumber);
|
||||
GsmPDUHelper.writeHexOctet(command.typeOfCommand);
|
||||
GsmPDUHelper.writeHexOctet(command.commandQualifier);
|
||||
} else {
|
||||
GsmPDUHelper.writeHexOctet(0x00);
|
||||
GsmPDUHelper.writeHexOctet(0x00);
|
||||
@ -2240,8 +2236,10 @@ let RIL = {
|
||||
GsmPDUHelper.writeHexOctet(COMPREHENSIONTLV_TAG_TEXT_STRING |
|
||||
COMPREHENSIONTLV_FLAG_CR);
|
||||
GsmPDUHelper.writeHexOctet(textLen + 1); // +1 for coding
|
||||
let coding = response.isUCS2 ? STK_TEXT_CODING_UCS2 :
|
||||
(response.isPacked ? STK_TEXT_CODING_GSM_7BIT_PACKED :
|
||||
let coding = command.options.isUCS2 ?
|
||||
STK_TEXT_CODING_UCS2 :
|
||||
(command.options.isPacked ?
|
||||
STK_TEXT_CODING_GSM_7BIT_PACKED :
|
||||
STK_TEXT_CODING_GSM_8BIT);
|
||||
GsmPDUHelper.writeHexOctet(coding);
|
||||
|
||||
@ -5620,6 +5618,9 @@ let StkCommandParamsFactory = {
|
||||
createParam: function createParam(cmdDetails, ctlvs) {
|
||||
let param;
|
||||
switch (cmdDetails.typeOfCommand) {
|
||||
case STK_CMD_SET_UP_EVENT_LIST:
|
||||
param = this.processSetUpEventList(cmdDetails, ctlvs);
|
||||
break;
|
||||
case STK_CMD_SET_UP_MENU:
|
||||
case STK_CMD_SELECT_ITEM:
|
||||
param = this.processSelectItem(cmdDetails, ctlvs);
|
||||
@ -5655,6 +5656,27 @@ let StkCommandParamsFactory = {
|
||||
return param;
|
||||
},
|
||||
|
||||
/**
|
||||
* Construct a param for Set Up Event list.
|
||||
*
|
||||
* @param cmdDetails
|
||||
* The value object of CommandDetails TLV.
|
||||
* @param ctlvs
|
||||
* The all TLVs in this proactive command.
|
||||
*/
|
||||
processSetUpEventList: function processSetUpEventList(cmdDetails, ctlvs) {
|
||||
let ctlv = StkProactiveCmdHelper.searchForTag(
|
||||
COMPREHENSIONTLV_TAG_EVENT_LIST, ctlvs);
|
||||
if (!ctlv) {
|
||||
RIL.sendStkTerminalResponse({
|
||||
command: cmdDetails,
|
||||
resultCode: STK_RESULT_REQUIRED_VALUES_MISSING});
|
||||
throw new Error("Stk Event List: Required value missing : Event List");
|
||||
}
|
||||
|
||||
return ctlv.value || {eventList: null};
|
||||
},
|
||||
|
||||
/**
|
||||
* Construct a param for Select Item.
|
||||
*
|
||||
@ -5923,6 +5945,8 @@ let StkProactiveCmdHelper = {
|
||||
return this.retrieveResponseLength(length);
|
||||
case COMPREHENSIONTLV_TAG_DEFAULT_TEXT:
|
||||
return this.retrieveDefaultText(length);
|
||||
case COMPREHENSIONTLV_TAG_EVENT_LIST:
|
||||
return this.retrieveEventList(length);
|
||||
case COMPREHENSIONTLV_TAG_IMMEDIATE_RESPONSE:
|
||||
return this.retrieveImmediaResponse(length);
|
||||
case COMPREHENSIONTLV_TAG_URL:
|
||||
@ -6097,6 +6121,21 @@ let StkProactiveCmdHelper = {
|
||||
return this.retrieveTextString(length);
|
||||
},
|
||||
|
||||
/**
|
||||
* Event List.
|
||||
*/
|
||||
retrieveEventList: function retrieveEventList(length) {
|
||||
if (!length) {
|
||||
// null means an indication to ME to remove the existing list of events
|
||||
// in ME.
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
eventList: GsmPDUHelper.readHexOctetArray(length)
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Immediate Response.
|
||||
*
|
||||
|
@ -290,6 +290,8 @@ var interfaceNamesInGlobalScope =
|
||||
"CSSPrimitiveValue",
|
||||
"SVGStopElement",
|
||||
"WebGLExtensionCompressedTextureS3TC",
|
||||
"WebGLExtensionCompressedTextureATC",
|
||||
"WebGLExtensionCompressedTexturePVRTC",
|
||||
"XULCommandEvent",
|
||||
"HTMLMediaElement",
|
||||
"SVGPathSegLinetoHorizontalAbs",
|
||||
|
@ -29,4 +29,10 @@ MOCHITEST_CHROME_FILES = \
|
||||
test_launch_paths.xul \
|
||||
$(NULL)
|
||||
|
||||
MOCHITEST_FILES = \
|
||||
test_bug_779982.html \
|
||||
file_bug_779982.js \
|
||||
file_bug_779982.html \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
@ -26,10 +26,7 @@ navigator.mozApps.install(parent.url2, null).onsuccess = function onInstall() {
|
||||
parent.app2 = this.result;
|
||||
|
||||
navigator.mozApps.getSelf().onsuccess = function onGetSelf() {
|
||||
parent.ok(this.result instanceof SpecialPowers.Ci.mozIDOMApplication,
|
||||
"getSelf() from app's origin returns mozIDOMApplication");
|
||||
parent.is(this.result.manifestURL, parent.url2,
|
||||
"getSelf() from app's origin returns origin's app");
|
||||
parent.ok(this.result == null, "getSelf() from app's origin returns null if called from a browser");
|
||||
|
||||
// Tell the test page to continue the tests.
|
||||
parent.postMessage("next", "*");
|
||||
|
50
dom/tests/mochitest/webapps/file_bug_779982.html
Normal file
50
dom/tests/mochitest/webapps/file_bug_779982.html
Normal file
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
foobar!
|
||||
</body>
|
||||
<script>
|
||||
var finished = false;
|
||||
var data = window.location.search.substring(1).split('&');
|
||||
|
||||
function finish(value) {
|
||||
value ? alert('success') : alert('failure');
|
||||
finished = true;
|
||||
}
|
||||
|
||||
switch (data[0]) {
|
||||
case "getSelf":
|
||||
navigator.mozApps.getSelf().onsuccess = function onGetSelf() {
|
||||
if (data[1] == 'true') {
|
||||
finish(this.result == null);
|
||||
} else {
|
||||
finish(this.result != null);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "isInstalled":
|
||||
navigator.mozApps.isInstalled('http://example.org/manifest.webapp').onsuccess = function onIsInstalled() {
|
||||
if (data[1] == 'true') {
|
||||
finish(this.result == false);
|
||||
} else {
|
||||
finish(this.result == true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "isInstalledWrong":
|
||||
try {
|
||||
navigator.mozApps.isInstalled('http://something.org/manifest.webapp');
|
||||
finish(false);
|
||||
} catch (e) {
|
||||
finish(true);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
finish(false);
|
||||
break;
|
||||
}
|
||||
</script>
|
||||
</html>
|
125
dom/tests/mochitest/webapps/file_bug_779982.js
Normal file
125
dom/tests/mochitest/webapps/file_bug_779982.js
Normal file
@ -0,0 +1,125 @@
|
||||
function makeAllAppsLaunchable() {
|
||||
var Webapps = {};
|
||||
SpecialPowers.wrap(Components).utils.import("resource://gre/modules/Webapps.jsm", Webapps);
|
||||
var appRegistry = SpecialPowers.wrap(Webapps.DOMApplicationRegistry);
|
||||
|
||||
var originalValue = appRegistry.allAppsLaunchable;
|
||||
appRegistry.allAppsLaunchable = true;
|
||||
|
||||
// Clean up after ourselves once tests are done so the test page is unloaded.
|
||||
window.addEventListener("unload", function restoreAllAppsLaunchable(event) {
|
||||
if (event.target == window.document) {
|
||||
window.removeEventListener("unload", restoreAllAppsLaunchable, false);
|
||||
appRegistry.allAppsLaunchable = originalValue;
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
makeAllAppsLaunchable();
|
||||
|
||||
var fileTestOnCurrentOrigin = 'http://example.org/tests/dom/tests/mochitest/webapps/file_bug_779982.html';
|
||||
|
||||
var previousPrefs = {
|
||||
mozBrowserFramesEnabled: undefined,
|
||||
oop_by_default: undefined,
|
||||
};
|
||||
|
||||
try {
|
||||
previousPrefs.mozBrowserFramesEnabled = SpecialPowers.getBoolPref('dom.mozBrowserFramesEnabled');
|
||||
} catch(e)
|
||||
{
|
||||
}
|
||||
|
||||
SpecialPowers.setBoolPref('dom.mozBrowserFramesEnabled', true);
|
||||
|
||||
SpecialPowers.addPermission("browser", true, window.document);
|
||||
|
||||
var gData = [
|
||||
// APP 1
|
||||
{
|
||||
app: 'http://example.org/manifest.webapp',
|
||||
action: 'getSelf',
|
||||
isnull: false,
|
||||
src: fileTestOnCurrentOrigin,
|
||||
message: 'getSelf() for app should return something'
|
||||
},
|
||||
{
|
||||
app: 'http://example.org/manifest.webapp',
|
||||
action: 'isInstalled',
|
||||
isnull: false,
|
||||
src: fileTestOnCurrentOrigin,
|
||||
message: 'isInstalled() for app should return true'
|
||||
},
|
||||
{
|
||||
app: 'http://example.org/manifest.webapp',
|
||||
action: 'isInstalledWrong',
|
||||
isnull: true,
|
||||
src: fileTestOnCurrentOrigin,
|
||||
message: 'isInstalled() for browser should return true'
|
||||
},
|
||||
// Browser
|
||||
{
|
||||
browser: true,
|
||||
action: 'getSelf',
|
||||
isnull: true,
|
||||
src: fileTestOnCurrentOrigin,
|
||||
message: 'getSelf() for browser should return null'
|
||||
},
|
||||
{
|
||||
browser: true,
|
||||
action: 'isInstalled',
|
||||
isnull: false,
|
||||
src: fileTestOnCurrentOrigin,
|
||||
message: 'isInstalled() for browser should return true'
|
||||
},
|
||||
{
|
||||
browser: true,
|
||||
action: 'isInstalledWrong',
|
||||
isnull: true,
|
||||
src: fileTestOnCurrentOrigin,
|
||||
message: 'isInstalled() for browser should return true'
|
||||
},
|
||||
];
|
||||
|
||||
function runTest() {
|
||||
for (var i in gData) {
|
||||
var iframe = document.createElement('iframe');
|
||||
var data = gData[i];
|
||||
|
||||
if (data.app) {
|
||||
iframe.setAttribute('mozbrowser', '');
|
||||
iframe.setAttribute('mozapp', data.app);
|
||||
} else if (data.browser) {
|
||||
iframe.setAttribute('mozbrowser', '');
|
||||
}
|
||||
|
||||
if (data.app || data.browser) {
|
||||
iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
|
||||
is(e.detail.message, 'success', data.message);
|
||||
|
||||
i++;
|
||||
if (i >= gData.length) {
|
||||
if (previousPrefs.mozBrowserFramesEnabled !== undefined) {
|
||||
SpecialPowers.setBoolPref('dom.mozBrowserFramesEnabled', previousPrefs.mozBrowserFramesEnabled);
|
||||
}
|
||||
|
||||
SpecialPowers.removePermission("browser", window.document);
|
||||
|
||||
SimpleTest.finish();
|
||||
} else {
|
||||
gTestRunner.next();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
iframe.src = data.src + '?' + data.action + '&' + data.isnull;
|
||||
document.getElementById('content').appendChild(iframe);
|
||||
|
||||
yield;
|
||||
}
|
||||
}
|
||||
|
||||
var gTestRunner = runTest();
|
||||
|
||||
gTestRunner.next();
|
21
dom/tests/mochitest/webapps/test_bug_779982.html
Normal file
21
dom/tests/mochitest/webapps/test_bug_779982.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=779982
|
||||
-->
|
||||
<head>
|
||||
<title>Test for getSelf()/isInstalled() in browser and in apps</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=779982">Mozilla Bug 779982</a>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript;version=1.7" src="file_bug_779982.js">
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -20,6 +20,7 @@
|
||||
|
||||
var props = {
|
||||
QueryInterface: "function",
|
||||
isInstalled: "function",
|
||||
getInstalled: "function",
|
||||
getSelf: "function",
|
||||
install: "function",
|
||||
|
@ -69,6 +69,8 @@ static const char *sExtensionNames[] = {
|
||||
"GL_EXT_texture_compression_dxt1",
|
||||
"GL_ANGLE_texture_compression_dxt3",
|
||||
"GL_ANGLE_texture_compression_dxt5",
|
||||
"GL_AMD_compressed_ATC_texture",
|
||||
"GL_IMG_texture_compression_pvrtc",
|
||||
"GL_EXT_framebuffer_blit",
|
||||
"GL_ANGLE_framebuffer_blit",
|
||||
"GL_EXT_framebuffer_multisample",
|
||||
|
@ -1658,6 +1658,8 @@ public:
|
||||
EXT_texture_compression_dxt1,
|
||||
ANGLE_texture_compression_dxt3,
|
||||
ANGLE_texture_compression_dxt5,
|
||||
AMD_compressed_ATC_texture,
|
||||
IMG_texture_compression_pvrtc,
|
||||
EXT_framebuffer_blit,
|
||||
ANGLE_framebuffer_blit,
|
||||
EXT_framebuffer_multisample,
|
||||
|
@ -3093,6 +3093,17 @@ typedef void* GLeglImage;
|
||||
#define LOCAL_WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
||||
#define LOCAL_WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
|
||||
|
||||
// AMD_compressed_ATC_texture
|
||||
#define LOCAL_GL_ATC_RGB 0x8C92
|
||||
#define LOCAL_GL_ATC_RGBA_EXPLICIT_ALPHA 0x8C93
|
||||
#define LOCAL_GL_ATC_RGBA_INTERPOLATED_ALPHA 0x87EE
|
||||
|
||||
// IMG_texture_compression_pvrtc
|
||||
#define LOCAL_GL_COMPRESSED_RGB_PVRTC_4BPPV1 0x8C00
|
||||
#define LOCAL_GL_COMPRESSED_RGB_PVRTC_2BPPV1 0x8C01
|
||||
#define LOCAL_GL_COMPRESSED_RGBA_PVRTC_4BPPV1 0x8C02
|
||||
#define LOCAL_GL_COMPRESSED_RGBA_PVRTC_2BPPV1 0x8C03
|
||||
|
||||
#define LOCAL_WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||
#define LOCAL_WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define LOCAL_WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||
|
@ -28,9 +28,6 @@
|
||||
|
||||
#include "cairo.h"
|
||||
#include <gtk/gtk.h>
|
||||
#if (MOZ_WIDGET_GTK == 2)
|
||||
#include "gtk2compat.h"
|
||||
#endif
|
||||
|
||||
#include "gfxImageSurface.h"
|
||||
#ifdef MOZ_X11
|
||||
|
@ -52,6 +52,8 @@ enum SwitchState {
|
||||
SWITCH_STATE_UNKNOWN = -1,
|
||||
SWITCH_STATE_ON,
|
||||
SWITCH_STATE_OFF,
|
||||
SWITCH_STATE_HEADSET, // Headphone with microphone
|
||||
SWITCH_STATE_HEADPHONE, // without microphone
|
||||
NUM_SWITCH_STATE
|
||||
};
|
||||
|
||||
|
@ -235,16 +235,6 @@ MacPowerInformationService::HandleChange(void* aContext) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sIOPSGetTimeRemainingEstimate) {
|
||||
// See if we can get a time estimate.
|
||||
CFTimeInterval estimate = sIOPSGetTimeRemainingEstimate();
|
||||
if (estimate == kIOPSTimeRemainingUnlimited || estimate == kIOPSTimeRemainingUnknown) {
|
||||
remainingTime = kUnknownRemainingTime;
|
||||
} else {
|
||||
remainingTime = estimate;
|
||||
}
|
||||
}
|
||||
|
||||
// Get a battery level estimate. This key is required.
|
||||
int currentCapacity = 0;
|
||||
const void* cfRef = ::CFDictionaryGetValue(currPowerSourceDesc, CFSTR(kIOPSCurrentCapacityKey));
|
||||
@ -264,6 +254,31 @@ MacPowerInformationService::HandleChange(void* aContext) {
|
||||
// source doesn't have that info.
|
||||
if(::CFDictionaryGetValueIfPresent(currPowerSourceDesc, CFSTR(kIOPSIsChargingKey), &cfRef)) {
|
||||
charging = ::CFBooleanGetValue((CFBooleanRef)cfRef);
|
||||
|
||||
// Get an estimate of how long it's going to take until we're fully charged.
|
||||
// This key is optional.
|
||||
if (charging) {
|
||||
// Default value that will be changed if we happen to find the actual
|
||||
// remaining time.
|
||||
remainingTime = level == 1.0 ? kDefaultRemainingTime : kUnknownRemainingTime;
|
||||
|
||||
if (::CFDictionaryGetValueIfPresent(currPowerSourceDesc,
|
||||
CFSTR(kIOPSTimeToFullChargeKey), &cfRef)) {
|
||||
int timeToCharge;
|
||||
::CFNumberGetValue((CFNumberRef)cfRef, kCFNumberIntType, &timeToCharge);
|
||||
if (timeToCharge != kIOPSTimeRemainingUnknown) {
|
||||
remainingTime = timeToCharge*60;
|
||||
}
|
||||
}
|
||||
} else if (sIOPSGetTimeRemainingEstimate) { // not charging
|
||||
// See if we can get a time estimate.
|
||||
CFTimeInterval estimate = sIOPSGetTimeRemainingEstimate();
|
||||
if (estimate == kIOPSTimeRemainingUnlimited || estimate == kIOPSTimeRemainingUnknown) {
|
||||
remainingTime = kUnknownRemainingTime;
|
||||
} else {
|
||||
remainingTime = estimate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -38,25 +38,8 @@ using namespace mozilla::hal;
|
||||
namespace mozilla {
|
||||
namespace hal_impl {
|
||||
/**
|
||||
* The uevent for a headset on SGS2 insertion looks like:
|
||||
*
|
||||
* change@/devices/virtual/switch/h2w
|
||||
* ACTION=change
|
||||
* DEVPATH=/devices/virtual/switch/h2w
|
||||
* SUBSYSTEM=switch
|
||||
* SWITCH_NAME=h2w
|
||||
* SWITCH_STATE=2
|
||||
* SEQNUM=2581
|
||||
* On Otoro, SWITCH_NAME could be Headset/No Device when plug/unplug.
|
||||
* change@/devices/virtual/switch/h2w
|
||||
* ACTION=change
|
||||
* DEVPATH=/devices/virtual/switch/h2w
|
||||
* SUBSYSTEM=switch
|
||||
* SWITCH_NAME=Headset
|
||||
* SWITCH_STATE=1
|
||||
* SEQNUM=1602
|
||||
*
|
||||
* The uevent for usb on GB,
|
||||
* The uevent for a usb on GB insertion looks like:
|
||||
*
|
||||
* change@/devices/virtual/switch/usb_configuration
|
||||
* ACTION=change
|
||||
* DEVPATH=/devices/virtual/switch/usb_configuration
|
||||
@ -64,7 +47,7 @@ namespace hal_impl {
|
||||
* SWITCH_NAME=usb_configuration
|
||||
* SWITCH_STATE=0
|
||||
* SEQNUM=5038
|
||||
*/
|
||||
*/
|
||||
class SwitchHandler : public RefCounted<SwitchHandler>
|
||||
{
|
||||
public:
|
||||
@ -184,6 +167,47 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The uevent delivered for the headset under ICS looks like,
|
||||
*
|
||||
* change@/devices/virtual/switch/h2w
|
||||
* ACTION=change
|
||||
* DEVPATH=/devices/virtual/switch/h2w
|
||||
* SUBSYSTEM=switch
|
||||
* SWITCH_NAME=h2w
|
||||
* SWITCH_STATE=2 // Headset with no mic
|
||||
* SEQNUM=2581
|
||||
* On Otoro, SWITCH_NAME could be Headset/No Device when plug/unplug.
|
||||
* change@/devices/virtual/switch/h2w
|
||||
* ACTION=change
|
||||
* DEVPATH=/devices/virtual/switch/h2w
|
||||
* SUBSYSTEM=switch
|
||||
* SWITCH_NAME=Headset
|
||||
* SWITCH_STATE=1 // Headset with mic
|
||||
* SEQNUM=1602
|
||||
*/
|
||||
class SwitchHandlerHeadphone: public SwitchHandler
|
||||
{
|
||||
public:
|
||||
SwitchHandlerHeadphone(const char* aDevPath) :
|
||||
SwitchHandler(aDevPath, SWITCH_HEADPHONES)
|
||||
{
|
||||
SwitchHandler::GetInitialState();
|
||||
}
|
||||
|
||||
virtual ~SwitchHandlerHeadphone() { }
|
||||
|
||||
protected:
|
||||
SwitchState ConvertState(const char* aState)
|
||||
{
|
||||
MOZ_ASSERT(aState);
|
||||
|
||||
return aState[0] == '0' ? SWITCH_STATE_OFF :
|
||||
(aState[0] == '1' ? SWITCH_STATE_HEADSET : SWITCH_STATE_HEADPHONE);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
typedef nsTArray<RefPtr<SwitchHandler> > SwitchHandlerArray;
|
||||
|
||||
class SwitchEventRunnable : public nsRunnable
|
||||
@ -285,10 +309,10 @@ private:
|
||||
|
||||
void Init()
|
||||
{
|
||||
mHandler.AppendElement(new SwitchHandler(SWITCH_HEADSET_DEVPATH, SWITCH_HEADPHONES));
|
||||
mHandler.AppendElement(new SwitchHandlerHeadphone(SWITCH_HEADSET_DEVPATH));
|
||||
mHandler.AppendElement(new SwitchHandler(SWITCH_USB_DEVPATH_GB, SWITCH_USB));
|
||||
mHandler.AppendElement(new SwitchHandlerUsbIcs(SWITCH_USB_DEVPATH_ICS));
|
||||
|
||||
|
||||
SwitchHandlerArray::index_type handlerIndex;
|
||||
SwitchHandlerArray::size_type numHandlers = mHandler.Length();
|
||||
|
||||
|
@ -27,6 +27,20 @@ ifndef INCLUDED_AUTOCONF_MK
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
endif
|
||||
|
||||
space = $(NULL) $(NULL)
|
||||
|
||||
# Include defs.mk files that can be found in $(srcdir)/$(DEPTH),
|
||||
# $(srcdir)/$(DEPTH-1), $(srcdir)/$(DEPTH-2), etc., and $(srcdir)
|
||||
# where $(DEPTH-1) is one level less of depth, $(DEPTH-2), two, etc.
|
||||
# i.e. for DEPTH=../../.., DEPTH-1 is ../.. and DEPTH-2 is ..
|
||||
# These defs.mk files are used to define variables in a directory
|
||||
# and all its subdirectories, recursively.
|
||||
__depth := $(subst /, ,$(DEPTH))
|
||||
ifeq (.,$(__depth))
|
||||
__depth :=
|
||||
endif
|
||||
$(foreach __d,$(__depth) .,$(eval __depth = $(wordlist 2,$(words $(__depth)),$(__depth))$(eval -include $(subst $(space),/,$(strip $(srcdir) $(__depth) defs.mk)))))
|
||||
|
||||
COMMA = ,
|
||||
|
||||
# Sanity check some variables
|
||||
@ -51,9 +65,6 @@ $(foreach x,$(CHECK_VARS),$(check-variable))
|
||||
core_abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))
|
||||
core_realpath = $(if $(realpath $(1)),$(realpath $(1)),$(call core_abspath,$(1)))
|
||||
|
||||
nullstr :=
|
||||
space :=$(nullstr) # EOL
|
||||
|
||||
core_winabspath = $(firstword $(subst /, ,$(call core_abspath,$(1)))):$(subst $(space),,$(patsubst %,\\%,$(wordlist 2,$(words $(subst /, ,$(call core_abspath,$(1)))), $(strip $(subst /, ,$(call core_abspath,$(1)))))))
|
||||
|
||||
RM = rm -f
|
||||
@ -814,3 +825,7 @@ PLY_INCLUDE = -I$(topsrcdir)/other-licenses/ply
|
||||
endif
|
||||
|
||||
export CL_INCLUDES_PREFIX
|
||||
|
||||
ifeq ($(MOZ_WIDGET_GTK),2)
|
||||
MOZ_GTK2_CFLAGS := -I$(topsrcdir)/widget/gtk2/compat $(MOZ_GTK2_CFLAGS)
|
||||
endif
|
||||
|
@ -943,7 +943,7 @@ $(HOST_CMMOBJS): host_%.$(OBJ_SUFFIX): %.mm
|
||||
$(COBJS): %.$(OBJ_SUFFIX): %.c $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(REPORT_BUILD)
|
||||
@$(MAKE_DEPS_AUTO_CC)
|
||||
$(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $(_VPATH_SRCS)
|
||||
$(ELOG) $(CC) $(OUTOPTION)$@ -c $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
# DEFINES and ACDEFINES are needed here to enable conditional compilation of Q_OBJECTs:
|
||||
# 'moc' only knows about #defines it gets on the command line (-D...), not in
|
||||
@ -965,7 +965,7 @@ $(ASOBJS): %.$(OBJ_SUFFIX): %.$(ASM_SUFFIX)
|
||||
endif
|
||||
|
||||
$(SOBJS): %.$(OBJ_SUFFIX): %.S
|
||||
$(AS) -o $@ $(ASFLAGS) -c $<
|
||||
$(AS) -o $@ $(ASFLAGS) $(LOCAL_INCLUDES) $(TARGET_LOCAL_INCLUDES) -c $<
|
||||
|
||||
#
|
||||
# Please keep the next two rules in sync.
|
||||
@ -973,43 +973,43 @@ $(SOBJS): %.$(OBJ_SUFFIX): %.S
|
||||
$(CCOBJS): %.$(OBJ_SUFFIX): %.cc $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(REPORT_BUILD)
|
||||
@$(MAKE_DEPS_AUTO_CXX)
|
||||
$(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
|
||||
$(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
$(CPPOBJS): %.$(OBJ_SUFFIX): %.cpp $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(REPORT_BUILD)
|
||||
@$(MAKE_DEPS_AUTO_CXX)
|
||||
$(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
|
||||
$(ELOG) $(CCC) $(OUTOPTION)$@ -c $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
$(CMMOBJS): $(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.mm $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(REPORT_BUILD)
|
||||
@$(MAKE_DEPS_AUTO_CXX)
|
||||
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(_VPATH_SRCS)
|
||||
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
$(CMOBJS): $(OBJ_PREFIX)%.$(OBJ_SUFFIX): %.m $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(REPORT_BUILD)
|
||||
@$(MAKE_DEPS_AUTO_CC)
|
||||
$(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $(COMPILE_CMFLAGS) $(_VPATH_SRCS)
|
||||
$(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $(COMPILE_CMFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
%.s: %.cpp $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CCC) -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
|
||||
$(CCC) -S $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
%.s: %.cc $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CCC) -S $(COMPILE_CXXFLAGS) $(_VPATH_SRCS)
|
||||
$(CCC) -S $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
%.s: %.c $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CC) -S $(COMPILE_CFLAGS) $(_VPATH_SRCS)
|
||||
$(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
|
||||
|
||||
%.i: %.cpp $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) > $*.i
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) > $*.i
|
||||
|
||||
%.i: %.cc $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(_VPATH_SRCS) > $*.i
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) > $*.i
|
||||
|
||||
%.i: %.c $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CC) -C -E $(COMPILE_CFLAGS) $(_VPATH_SRCS) > $*.i
|
||||
$(CC) -C -E $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) > $*.i
|
||||
|
||||
%.i: %.mm $(call mkdir_deps,$(MDDEPDIR))
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(_VPATH_SRCS) > $*.i
|
||||
$(CCC) -C -E $(COMPILE_CXXFLAGS) $(COMPILE_CMMFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS) > $*.i
|
||||
|
||||
%.res: %.rc
|
||||
@echo Creating Resource file: $@
|
||||
|
@ -250,7 +250,7 @@ struct FunctionInfo
|
||||
|
||||
// Calling convention of the function. Convert to ffi_abi using GetABI
|
||||
// and OBJECT_TO_JSVAL. Stored as a JSObject* for ease of tracing.
|
||||
JSObject* mABI;
|
||||
JSObject* mABI;
|
||||
|
||||
// The CType of the value returned by the function.
|
||||
JSObject* mReturnType;
|
||||
|
@ -2645,7 +2645,7 @@ CodeGenerator::visitIteratorNext(LIteratorNext *lir)
|
||||
const Register temp = ToRegister(lir->temp());
|
||||
const ValueOperand output = ToOutValue(lir);
|
||||
|
||||
typedef bool (*pf)(JSContext *, JSObject *, MutableHandleValue);
|
||||
typedef bool (*pf)(JSContext *, HandleObject, MutableHandleValue);
|
||||
static const VMFunction Info = FunctionInfo<pf>(js_IteratorNext);
|
||||
|
||||
OutOfLineCode *ool = oolCallVM(Info, lir, (ArgList(), obj), StoreValueTo(output));
|
||||
@ -2703,7 +2703,7 @@ CodeGenerator::visitIteratorEnd(LIteratorEnd *lir)
|
||||
const Register temp1 = ToRegister(lir->temp1());
|
||||
const Register temp2 = ToRegister(lir->temp2());
|
||||
|
||||
typedef bool (*pf)(JSContext *, JSObject *);
|
||||
typedef bool (*pf)(JSContext *, HandleObject);
|
||||
static const VMFunction Info = FunctionInfo<pf>(CloseIterator);
|
||||
|
||||
OutOfLineCode *ool = oolCallVM(Info, lir, (ArgList(), obj), StoreNothing());
|
||||
|
@ -278,6 +278,18 @@ TryAttachNativeStub(JSContext *cx, IonCacheGetProperty &cache, HandleObject obj,
|
||||
if (!IsCacheableGetProp(obj, holder, shape))
|
||||
return true;
|
||||
|
||||
// TI infers the possible types of native object properties. There's one
|
||||
// edge case though: for singleton objects it does not add the initial
|
||||
// "undefined" type, see the propertySet comment in jsinfer.h. We can't
|
||||
// monitor the return type inside an idempotent cache though, so we don't
|
||||
// handle this case.
|
||||
if (cache.idempotent() &&
|
||||
holder->hasSingletonType() &&
|
||||
holder->getSlot(shape->slot()).isUndefined())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
*isCacheableNative = true;
|
||||
|
||||
if (cache.stubCount() < MAX_STUBS) {
|
||||
|
@ -252,7 +252,7 @@ CloseLiveIterator(JSContext *cx, const InlineFrameIterator &frame, uint32 localS
|
||||
si.skip();
|
||||
|
||||
Value v = si.read();
|
||||
JSObject *obj = &v.toObject();
|
||||
RootedObject obj(cx, &v.toObject());
|
||||
|
||||
if (cx->isExceptionPending())
|
||||
UnwindIteratorForException(cx, obj);
|
||||
|
13
js/src/jit-test/tests/ion/bug792944.js
Normal file
13
js/src/jit-test/tests/ion/bug792944.js
Normal file
@ -0,0 +1,13 @@
|
||||
function whoo() {
|
||||
(new Object()).foo()
|
||||
}
|
||||
Object.prototype.foo = function() { return undefined };
|
||||
whoo();
|
||||
Object.prototype.foo = undefined;
|
||||
gc();
|
||||
try {
|
||||
whoo();
|
||||
assertEq(0, 1);
|
||||
} catch(e) {
|
||||
assertEq(e instanceof TypeError, true);
|
||||
}
|
@ -3890,13 +3890,16 @@ ScriptAnalysis::analyzeTypesBytecode(JSContext *cx, unsigned offset,
|
||||
TypeObject *rest = TypeScript::InitObject(cx, script, pc, JSProto_Array);
|
||||
if (!rest)
|
||||
return false;
|
||||
types->addType(cx, Type::ObjectType(rest));
|
||||
|
||||
// Simulate setting a element.
|
||||
HeapTypeSet *propTypes = rest->getProperty(cx, JSID_VOID, true);
|
||||
if (!propTypes)
|
||||
return false;
|
||||
propTypes->addType(cx, Type::UnknownType());
|
||||
if (!rest->unknownProperties()) {
|
||||
HeapTypeSet *propTypes = rest->getProperty(cx, JSID_VOID, true);
|
||||
if (!propTypes)
|
||||
return false;
|
||||
propTypes->addType(cx, Type::UnknownType());
|
||||
}
|
||||
|
||||
types->addType(cx, Type::ObjectType(rest));
|
||||
} else {
|
||||
types->addType(cx, Type::UnknownType());
|
||||
}
|
||||
|
@ -1029,7 +1029,7 @@ IteratorMore(JSContext *cx, JSObject *iterobj, bool *cond, MutableHandleValue rv
|
||||
}
|
||||
|
||||
static inline bool
|
||||
IteratorNext(JSContext *cx, JSObject *iterobj, MutableHandleValue rval)
|
||||
IteratorNext(JSContext *cx, HandleObject iterobj, MutableHandleValue rval)
|
||||
{
|
||||
if (iterobj->isPropertyIterator()) {
|
||||
NativeIterator *ni = iterobj->asPropertyIterator().getNativeIterator();
|
||||
@ -1778,7 +1778,9 @@ BEGIN_CASE(JSOP_ITERNEXT)
|
||||
JS_ASSERT(regs.sp[-1].isObject());
|
||||
PUSH_NULL();
|
||||
MutableHandleValue res = MutableHandleValue::fromMarkedLocation(®s.sp[-1]);
|
||||
if (!IteratorNext(cx, ®s.sp[-2].toObject(), res))
|
||||
RootedObject &obj = rootObject0;
|
||||
obj = ®s.sp[-2].toObject();
|
||||
if (!IteratorNext(cx, obj, res))
|
||||
goto error;
|
||||
}
|
||||
END_CASE(JSOP_ITERNEXT)
|
||||
@ -1786,7 +1788,9 @@ END_CASE(JSOP_ITERNEXT)
|
||||
BEGIN_CASE(JSOP_ENDITER)
|
||||
{
|
||||
JS_ASSERT(regs.stackDepth() >= 1);
|
||||
bool ok = CloseIterator(cx, ®s.sp[-1].toObject());
|
||||
RootedObject &obj = rootObject0;
|
||||
obj = ®s.sp[-1].toObject();
|
||||
bool ok = CloseIterator(cx, obj);
|
||||
regs.sp--;
|
||||
if (!ok)
|
||||
goto error;
|
||||
@ -3916,7 +3920,9 @@ END_CASE(JSOP_ARRAYPUSH)
|
||||
case JSTRY_ITER: {
|
||||
/* This is similar to JSOP_ENDITER in the interpreter loop. */
|
||||
JS_ASSERT(JSOp(*regs.pc) == JSOP_ENDITER);
|
||||
bool ok = UnwindIteratorForException(cx, ®s.sp[-1].toObject());
|
||||
RootedObject &obj = rootObject0;
|
||||
obj = ®s.sp[-1].toObject();
|
||||
bool ok = UnwindIteratorForException(cx, obj);
|
||||
regs.sp -= 1;
|
||||
if (!ok)
|
||||
goto error;
|
||||
|
@ -83,7 +83,7 @@ NewKeyValuePair(JSContext *cx, jsid id, const Value &val, MutableHandleValue rva
|
||||
Value vec[2] = { IdToValue(id), val };
|
||||
AutoArrayRooter tvr(cx, ArrayLength(vec), vec);
|
||||
|
||||
JSObject *aobj = NewDenseCopiedArray(cx, 2, vec);
|
||||
RawObject aobj = NewDenseCopiedArray(cx, 2, vec);
|
||||
if (!aobj)
|
||||
return false;
|
||||
rval.setObject(*aobj);
|
||||
@ -91,11 +91,9 @@ NewKeyValuePair(JSContext *cx, jsid id, const Value &val, MutableHandleValue rva
|
||||
}
|
||||
|
||||
static inline bool
|
||||
Enumerate(JSContext *cx, JSObject *obj, JSObject *pobj, jsid id,
|
||||
Enumerate(JSContext *cx, HandleObject pobj, jsid id,
|
||||
bool enumerable, unsigned flags, IdSet& ht, AutoIdVector *props)
|
||||
{
|
||||
JS_ASSERT_IF(flags & JSITER_OWNONLY, obj == pobj);
|
||||
|
||||
/*
|
||||
* We implement __proto__ using a property on |Object.prototype|, but
|
||||
* because __proto__ is highly deserving of removal, we don't want it to
|
||||
@ -129,11 +127,9 @@ Enumerate(JSContext *cx, JSObject *obj, JSObject *pobj, jsid id,
|
||||
}
|
||||
|
||||
static bool
|
||||
EnumerateNativeProperties(JSContext *cx, JSObject *obj_, JSObject *pobj_, unsigned flags, IdSet &ht,
|
||||
EnumerateNativeProperties(JSContext *cx, HandleObject pobj, unsigned flags, IdSet &ht,
|
||||
AutoIdVector *props)
|
||||
{
|
||||
RootedObject obj(cx, obj_), pobj(cx, pobj_);
|
||||
|
||||
size_t initialLength = props->length();
|
||||
|
||||
/* Collect all unique properties from this object's scope. */
|
||||
@ -143,7 +139,7 @@ EnumerateNativeProperties(JSContext *cx, JSObject *obj_, JSObject *pobj_, unsign
|
||||
Shape &shape = r.front();
|
||||
|
||||
if (!JSID_IS_DEFAULT_XML_NAMESPACE(shape.propid()) &&
|
||||
!Enumerate(cx, obj, pobj, shape.propid(), shape.enumerable(), flags, ht, props))
|
||||
!Enumerate(cx, pobj, shape.propid(), shape.enumerable(), flags, ht, props))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -154,10 +150,10 @@ EnumerateNativeProperties(JSContext *cx, JSObject *obj_, JSObject *pobj_, unsign
|
||||
}
|
||||
|
||||
static bool
|
||||
EnumerateDenseArrayProperties(JSContext *cx, JSObject *obj, JSObject *pobj, unsigned flags,
|
||||
EnumerateDenseArrayProperties(JSContext *cx, HandleObject pobj, unsigned flags,
|
||||
IdSet &ht, AutoIdVector *props)
|
||||
{
|
||||
if (!Enumerate(cx, obj, pobj, NameToId(cx->names().length), false, flags, ht, props))
|
||||
if (!Enumerate(cx, pobj, NameToId(cx->names().length), false, flags, ht, props))
|
||||
return false;
|
||||
|
||||
if (pobj->getArrayLength() > 0) {
|
||||
@ -166,7 +162,7 @@ EnumerateDenseArrayProperties(JSContext *cx, JSObject *obj, JSObject *pobj, unsi
|
||||
for (size_t i = 0; i < initlen; ++i, ++vp) {
|
||||
if (!vp->isMagic(JS_ARRAY_HOLE)) {
|
||||
/* Dense arrays never get so large that i would not fit into an integer id. */
|
||||
if (!Enumerate(cx, obj, pobj, INT_TO_JSID(i), true, flags, ht, props))
|
||||
if (!Enumerate(cx, pobj, INT_TO_JSID(i), true, flags, ht, props))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -206,14 +202,13 @@ struct SortComparatorIds
|
||||
#endif /* JS_MORE_DETERMINISTIC */
|
||||
|
||||
static bool
|
||||
Snapshot(JSContext *cx, RawObject obj_, unsigned flags, AutoIdVector *props)
|
||||
Snapshot(JSContext *cx, RawObject pobj_, unsigned flags, AutoIdVector *props)
|
||||
{
|
||||
IdSet ht(cx);
|
||||
if (!ht.init(32))
|
||||
return false;
|
||||
|
||||
RootedObject obj(cx, obj_), pobj(cx);
|
||||
pobj = obj;
|
||||
RootedObject pobj(cx, pobj_);
|
||||
|
||||
do {
|
||||
Class *clasp = pobj->getClass();
|
||||
@ -222,10 +217,10 @@ Snapshot(JSContext *cx, RawObject obj_, unsigned flags, AutoIdVector *props)
|
||||
!(clasp->flags & JSCLASS_NEW_ENUMERATE)) {
|
||||
if (!clasp->enumerate(cx, pobj))
|
||||
return false;
|
||||
if (!EnumerateNativeProperties(cx, obj, pobj, flags, ht, props))
|
||||
if (!EnumerateNativeProperties(cx, pobj, flags, ht, props))
|
||||
return false;
|
||||
} else if (pobj->isDenseArray()) {
|
||||
if (!EnumerateDenseArrayProperties(cx, obj, pobj, flags, ht, props))
|
||||
if (!EnumerateDenseArrayProperties(cx, pobj, flags, ht, props))
|
||||
return false;
|
||||
} else if (ParallelArrayObject::is(pobj)) {
|
||||
if (!ParallelArrayObject::enumerate(cx, pobj, flags, props))
|
||||
@ -251,7 +246,7 @@ Snapshot(JSContext *cx, RawObject obj_, unsigned flags, AutoIdVector *props)
|
||||
return false;
|
||||
}
|
||||
for (size_t n = 0, len = proxyProps.length(); n < len; n++) {
|
||||
if (!Enumerate(cx, obj, pobj, proxyProps[n], true, flags, ht, props))
|
||||
if (!Enumerate(cx, pobj, proxyProps[n], true, flags, ht, props))
|
||||
return false;
|
||||
}
|
||||
/* Proxy objects enumerate the prototype on their own, so we are done here. */
|
||||
@ -263,7 +258,7 @@ Snapshot(JSContext *cx, RawObject obj_, unsigned flags, AutoIdVector *props)
|
||||
if (!JSObject::enumerate(cx, pobj, op, &state, &id))
|
||||
return false;
|
||||
if (state.isMagic(JS_NATIVE_ENUMERATE)) {
|
||||
if (!EnumerateNativeProperties(cx, obj, pobj, flags, ht, props))
|
||||
if (!EnumerateNativeProperties(cx, pobj, flags, ht, props))
|
||||
return false;
|
||||
} else {
|
||||
while (true) {
|
||||
@ -272,7 +267,7 @@ Snapshot(JSContext *cx, RawObject obj_, unsigned flags, AutoIdVector *props)
|
||||
return false;
|
||||
if (state.isNull())
|
||||
break;
|
||||
if (!Enumerate(cx, obj, pobj, id, true, flags, ht, props))
|
||||
if (!Enumerate(cx, pobj, id, true, flags, ht, props))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -418,7 +413,7 @@ NewPropertyIteratorObject(JSContext *cx, unsigned flags)
|
||||
if (!shape)
|
||||
return NULL;
|
||||
|
||||
JSObject *obj = JSObject::create(cx, ITERATOR_FINALIZE_KIND, shape, type, NULL);
|
||||
RawObject obj = JSObject::create(cx, ITERATOR_FINALIZE_KIND, shape, type, NULL);
|
||||
if (!obj)
|
||||
return NULL;
|
||||
|
||||
@ -454,7 +449,7 @@ NativeIterator::allocateIterator(JSContext *cx, uint32_t slength, const AutoIdVe
|
||||
}
|
||||
|
||||
inline void
|
||||
NativeIterator::init(JSObject *obj, unsigned flags, uint32_t slength, uint32_t key)
|
||||
NativeIterator::init(RawObject obj, unsigned flags, uint32_t slength, uint32_t key)
|
||||
{
|
||||
this->obj.init(obj);
|
||||
this->flags = flags;
|
||||
@ -505,7 +500,7 @@ VectorToKeyIterator(JSContext *cx, HandleObject obj, unsigned flags, AutoIdVecto
|
||||
* the shape key; if such a GC *does* occur, we can only get hits through
|
||||
* the one-slot lastNativeIterator cache.
|
||||
*/
|
||||
JSObject *pobj = obj;
|
||||
RawObject pobj = obj;
|
||||
size_t ind = 0;
|
||||
do {
|
||||
ni->shapes_array[ind++] = pobj->lastProperty();
|
||||
@ -569,7 +564,7 @@ EnumeratedIdVectorToIterator(JSContext *cx, HandleObject obj, unsigned flags, Au
|
||||
}
|
||||
|
||||
static inline void
|
||||
UpdateNativeIterator(NativeIterator *ni, JSObject *obj)
|
||||
UpdateNativeIterator(NativeIterator *ni, RawObject obj)
|
||||
{
|
||||
// Update the object for which the native iterator is associated, so
|
||||
// SuppressDeletedPropertyHelper will recognize the iterator as a match.
|
||||
@ -601,7 +596,7 @@ GetIterator(JSContext *cx, HandleObject obj, unsigned flags, MutableHandleValue
|
||||
if (!Invoke(cx, ObjectOrNullValue(obj), method, 0, NULL, vp.address()))
|
||||
return false;
|
||||
|
||||
JSObject *obj = ToObject(cx, vp);
|
||||
RawObject obj = ToObject(cx, vp);
|
||||
if (!obj)
|
||||
return false;
|
||||
vp.setObject(*obj);
|
||||
@ -615,7 +610,7 @@ GetIterator(JSContext *cx, HandleObject obj, unsigned flags, MutableHandleValue
|
||||
|
||||
if (obj) {
|
||||
if (JSIteratorOp op = obj->getClass()->ext.iteratorObject) {
|
||||
JSObject *iterobj = op(cx, obj, !(flags & JSITER_FOREACH));
|
||||
RawObject iterobj = op(cx, obj, !(flags & JSITER_FOREACH));
|
||||
if (!iterobj)
|
||||
return false;
|
||||
vp.setObject(*iterobj);
|
||||
@ -631,8 +626,8 @@ GetIterator(JSContext *cx, HandleObject obj, unsigned flags, MutableHandleValue
|
||||
* will result in a miss.
|
||||
*/
|
||||
PropertyIteratorObject *last = cx->runtime->nativeIterCache.last;
|
||||
JSObject *proto = obj->getProto();
|
||||
if (last) {
|
||||
RawObject proto = obj->getProto();
|
||||
NativeIterator *lastni = last->getNativeIterator();
|
||||
if (!(lastni->flags & (JSITER_ACTIVE|JSITER_UNREUSABLE)) &&
|
||||
obj->isNative() &&
|
||||
@ -653,21 +648,23 @@ GetIterator(JSContext *cx, HandleObject obj, unsigned flags, MutableHandleValue
|
||||
* allows us to re-use a previous iterator object that is not
|
||||
* currently active.
|
||||
*/
|
||||
JSObject *pobj = obj;
|
||||
do {
|
||||
if (!pobj->isNative() ||
|
||||
pobj->hasUncacheableProto() ||
|
||||
obj->getOps()->enumerate ||
|
||||
pobj->getClass()->enumerate != JS_EnumerateStub) {
|
||||
shapes.clear();
|
||||
goto miss;
|
||||
}
|
||||
Shape *shape = pobj->lastProperty();
|
||||
key = (key + (key << 16)) ^ (uintptr_t(shape) >> 3);
|
||||
if (!shapes.append((Shape *) shape))
|
||||
return false;
|
||||
pobj = pobj->getProto();
|
||||
} while (pobj);
|
||||
{
|
||||
RawObject pobj = obj;
|
||||
do {
|
||||
if (!pobj->isNative() ||
|
||||
pobj->hasUncacheableProto() ||
|
||||
obj->getOps()->enumerate ||
|
||||
pobj->getClass()->enumerate != JS_EnumerateStub) {
|
||||
shapes.clear();
|
||||
goto miss;
|
||||
}
|
||||
Shape *shape = pobj->lastProperty();
|
||||
key = (key + (key << 16)) ^ (uintptr_t(shape) >> 3);
|
||||
if (!shapes.append((Shape *) shape))
|
||||
return false;
|
||||
pobj = pobj->getProto();
|
||||
} while (pobj);
|
||||
}
|
||||
|
||||
PropertyIteratorObject *iterobj = cx->runtime->nativeIterCache.get(key);
|
||||
if (iterobj) {
|
||||
@ -781,7 +778,7 @@ iterator_next_impl(JSContext *cx, CallArgs args)
|
||||
{
|
||||
JS_ASSERT(IsIterator(args.thisv()));
|
||||
|
||||
Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
|
||||
RootedObject thisObj(cx, &args.thisv().toObject());
|
||||
|
||||
if (!js_IteratorMore(cx, thisObj, args.rval()))
|
||||
return false;
|
||||
@ -822,14 +819,14 @@ iterator_iteratorObject(JSContext *cx, HandleObject obj, JSBool keysonly)
|
||||
}
|
||||
|
||||
void
|
||||
PropertyIteratorObject::trace(JSTracer *trc, JSObject *obj)
|
||||
PropertyIteratorObject::trace(JSTracer *trc, RawObject obj)
|
||||
{
|
||||
if (NativeIterator *ni = obj->asPropertyIterator().getNativeIterator())
|
||||
ni->mark(trc);
|
||||
}
|
||||
|
||||
void
|
||||
PropertyIteratorObject::finalize(FreeOp *fop, JSObject *obj)
|
||||
PropertyIteratorObject::finalize(FreeOp *fop, RawObject obj)
|
||||
{
|
||||
if (NativeIterator *ni = obj->asPropertyIterator().getNativeIterator()) {
|
||||
obj->asPropertyIterator().setNativeIterator(NULL);
|
||||
@ -869,10 +866,10 @@ const uint32_t CLOSED_INDEX = UINT32_MAX;
|
||||
JSObject *
|
||||
ElementIteratorObject::create(JSContext *cx, Handle<Value> target)
|
||||
{
|
||||
Rooted<JSObject*> proto(cx, cx->global()->getOrCreateElementIteratorPrototype(cx));
|
||||
RootedObject proto(cx, cx->global()->getOrCreateElementIteratorPrototype(cx));
|
||||
if (!proto)
|
||||
return NULL;
|
||||
JSObject *iterobj = NewObjectWithGivenProto(cx, &ElementIteratorClass, proto, cx->global());
|
||||
RootedObject iterobj(cx, NewObjectWithGivenProto(cx, &ElementIteratorClass, proto, cx->global()));
|
||||
if (iterobj) {
|
||||
iterobj->setReservedSlot(TargetSlot, target);
|
||||
iterobj->setReservedSlot(IndexSlot, Int32Value(0));
|
||||
@ -899,7 +896,7 @@ ElementIteratorObject::next_impl(JSContext *cx, CallArgs args)
|
||||
RootedObject iterobj(cx, &args.thisv().toObject());
|
||||
uint32_t i, length;
|
||||
RootedValue target(cx, iterobj->getReservedSlot(TargetSlot));
|
||||
Rooted<JSObject*> obj(cx);
|
||||
RootedObject obj(cx);
|
||||
|
||||
// Get target.length.
|
||||
if (target.isString()) {
|
||||
@ -964,7 +961,7 @@ JSFunctionSpec ElementIteratorObject::methods[] = {
|
||||
|
||||
#if JS_HAS_GENERATORS
|
||||
static JSBool
|
||||
CloseGenerator(JSContext *cx, JSObject *genobj);
|
||||
CloseGenerator(JSContext *cx, HandleObject genobj);
|
||||
#endif
|
||||
|
||||
bool
|
||||
@ -1007,7 +1004,7 @@ js::ValueToIterator(JSContext *cx, unsigned flags, MutableHandleValue vp)
|
||||
}
|
||||
|
||||
bool
|
||||
js::CloseIterator(JSContext *cx, JSObject *obj)
|
||||
js::CloseIterator(JSContext *cx, HandleObject obj)
|
||||
{
|
||||
cx->iterValue.setMagic(JS_NO_ITER_VALUE);
|
||||
|
||||
@ -1038,7 +1035,7 @@ js::CloseIterator(JSContext *cx, JSObject *obj)
|
||||
}
|
||||
|
||||
bool
|
||||
js::UnwindIteratorForException(JSContext *cx, JSObject *obj)
|
||||
js::UnwindIteratorForException(JSContext *cx, HandleObject obj)
|
||||
{
|
||||
RootedValue v(cx, cx->getPendingException());
|
||||
cx->clearPendingException();
|
||||
@ -1049,7 +1046,7 @@ js::UnwindIteratorForException(JSContext *cx, JSObject *obj)
|
||||
}
|
||||
|
||||
void
|
||||
js::UnwindIteratorForUncatchableException(JSContext *cx, JSObject *obj)
|
||||
js::UnwindIteratorForUncatchableException(JSContext *cx, RawObject obj)
|
||||
{
|
||||
if (obj->isPropertyIterator()) {
|
||||
NativeIterator *ni = obj->asPropertyIterator().getNativeIterator();
|
||||
@ -1263,7 +1260,7 @@ js_IteratorMore(JSContext *cx, HandleObject iterobj, MutableHandleValue rval)
|
||||
}
|
||||
|
||||
bool
|
||||
js_IteratorNext(JSContext *cx, JSObject *iterobj, MutableHandleValue rval)
|
||||
js_IteratorNext(JSContext *cx, HandleObject iterobj, MutableHandleValue rval)
|
||||
{
|
||||
/* Fast path for native iterators */
|
||||
if (iterobj->isPropertyIterator()) {
|
||||
@ -1317,7 +1314,7 @@ Class js::StopIterationClass = {
|
||||
#if JS_HAS_GENERATORS
|
||||
|
||||
static void
|
||||
generator_finalize(FreeOp *fop, JSObject *obj)
|
||||
generator_finalize(FreeOp *fop, RawObject obj)
|
||||
{
|
||||
JSGenerator *gen = (JSGenerator *) obj->getPrivate();
|
||||
if (!gen)
|
||||
@ -1382,7 +1379,7 @@ SetGeneratorClosed(JSContext *cx, JSGenerator *gen)
|
||||
}
|
||||
|
||||
static void
|
||||
generator_trace(JSTracer *trc, JSObject *obj)
|
||||
generator_trace(JSTracer *trc, RawObject obj)
|
||||
{
|
||||
JSGenerator *gen = (JSGenerator *) obj->getPrivate();
|
||||
if (!gen)
|
||||
@ -1433,10 +1430,13 @@ js_NewGenerator(JSContext *cx)
|
||||
StackFrame *stackfp = stackRegs.fp();
|
||||
|
||||
Rooted<GlobalObject*> global(cx, &stackfp->global());
|
||||
JSObject *proto = global->getOrCreateGeneratorPrototype(cx);
|
||||
if (!proto)
|
||||
return NULL;
|
||||
JSObject *obj = NewObjectWithGivenProto(cx, &GeneratorClass, proto, global);
|
||||
RootedObject obj(cx);
|
||||
{
|
||||
RawObject proto = global->getOrCreateGeneratorPrototype(cx);
|
||||
if (!proto)
|
||||
return NULL;
|
||||
obj = NewObjectWithGivenProto(cx, &GeneratorClass, proto, global);
|
||||
}
|
||||
if (!obj)
|
||||
return NULL;
|
||||
|
||||
@ -1494,7 +1494,7 @@ typedef enum JSGeneratorOp {
|
||||
* operation inside its frame.
|
||||
*/
|
||||
static JSBool
|
||||
SendToGenerator(JSContext *cx, JSGeneratorOp op, JSObject *obj,
|
||||
SendToGenerator(JSContext *cx, JSGeneratorOp op, HandleObject obj,
|
||||
JSGenerator *gen, const Value &arg)
|
||||
{
|
||||
if (gen->state == JSGEN_RUNNING || gen->state == JSGEN_CLOSING) {
|
||||
@ -1591,7 +1591,7 @@ SendToGenerator(JSContext *cx, JSGeneratorOp op, JSObject *obj,
|
||||
}
|
||||
|
||||
static JSBool
|
||||
CloseGenerator(JSContext *cx, JSObject *obj)
|
||||
CloseGenerator(JSContext *cx, HandleObject obj)
|
||||
{
|
||||
JS_ASSERT(obj->isGenerator());
|
||||
|
||||
@ -1618,7 +1618,7 @@ generator_send_impl(JSContext *cx, CallArgs args)
|
||||
{
|
||||
JS_ASSERT(IsGenerator(args.thisv()));
|
||||
|
||||
Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
|
||||
RootedObject thisObj(cx, &args.thisv().toObject());
|
||||
|
||||
JSGenerator *gen = (JSGenerator *) thisObj->getPrivate();
|
||||
if (!gen || gen->state == JSGEN_CLOSED) {
|
||||
@ -1655,7 +1655,7 @@ generator_next_impl(JSContext *cx, CallArgs args)
|
||||
{
|
||||
JS_ASSERT(IsGenerator(args.thisv()));
|
||||
|
||||
Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
|
||||
RootedObject thisObj(cx, &args.thisv().toObject());
|
||||
|
||||
JSGenerator *gen = (JSGenerator *) thisObj->getPrivate();
|
||||
if (!gen || gen->state == JSGEN_CLOSED) {
|
||||
@ -1682,7 +1682,7 @@ generator_throw_impl(JSContext *cx, CallArgs args)
|
||||
{
|
||||
JS_ASSERT(IsGenerator(args.thisv()));
|
||||
|
||||
Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
|
||||
RootedObject thisObj(cx, &args.thisv().toObject());
|
||||
|
||||
JSGenerator *gen = (JSGenerator *) thisObj->getPrivate();
|
||||
if (!gen || gen->state == JSGEN_CLOSED) {
|
||||
@ -1713,7 +1713,7 @@ generator_close_impl(JSContext *cx, CallArgs args)
|
||||
{
|
||||
JS_ASSERT(IsGenerator(args.thisv()));
|
||||
|
||||
Rooted<JSObject*> thisObj(cx, &args.thisv().toObject());
|
||||
RootedObject thisObj(cx, &args.thisv().toObject());
|
||||
|
||||
JSGenerator *gen = (JSGenerator *) thisObj->getPrivate();
|
||||
if (!gen || gen->state == JSGEN_CLOSED) {
|
||||
@ -1758,7 +1758,7 @@ static JSFunctionSpec generator_methods[] = {
|
||||
/* static */ bool
|
||||
GlobalObject::initIteratorClasses(JSContext *cx, Handle<GlobalObject *> global)
|
||||
{
|
||||
Rooted<JSObject*> iteratorProto(cx);
|
||||
RootedObject iteratorProto(cx);
|
||||
Value iteratorProtoVal = global->getPrototype(JSProto_Iterator);
|
||||
if (iteratorProtoVal.isObject()) {
|
||||
iteratorProto = &iteratorProtoVal.toObject();
|
||||
@ -1787,7 +1787,7 @@ GlobalObject::initIteratorClasses(JSContext *cx, Handle<GlobalObject *> global)
|
||||
return false;
|
||||
}
|
||||
|
||||
Rooted<JSObject*> proto(cx);
|
||||
RootedObject proto(cx);
|
||||
if (global->getSlot(ELEMENT_ITERATOR_PROTO).isUndefined()) {
|
||||
Class *cls = &ElementIteratorClass;
|
||||
proto = global->createBlankPrototypeInheriting(cx, cls, *iteratorProto);
|
||||
|
@ -65,7 +65,7 @@ struct NativeIterator
|
||||
|
||||
static NativeIterator *allocateIterator(JSContext *cx, uint32_t slength,
|
||||
const js::AutoIdVector &props);
|
||||
void init(JSObject *obj, unsigned flags, uint32_t slength, uint32_t key);
|
||||
void init(RawObject obj, unsigned flags, uint32_t slength, uint32_t key);
|
||||
|
||||
void mark(JSTracer *trc);
|
||||
};
|
||||
@ -79,8 +79,8 @@ class PropertyIteratorObject : public JSObject
|
||||
inline void setNativeIterator(js::NativeIterator *ni);
|
||||
|
||||
private:
|
||||
static void trace(JSTracer *trc, JSObject *obj);
|
||||
static void finalize(FreeOp *fop, JSObject *obj);
|
||||
static void trace(JSTracer *trc, RawObject obj);
|
||||
static void finalize(FreeOp *fop, RawObject obj);
|
||||
};
|
||||
|
||||
/*
|
||||
@ -145,13 +145,13 @@ bool
|
||||
ValueToIterator(JSContext *cx, unsigned flags, MutableHandleValue vp);
|
||||
|
||||
bool
|
||||
CloseIterator(JSContext *cx, JSObject *iterObj);
|
||||
CloseIterator(JSContext *cx, HandleObject iterObj);
|
||||
|
||||
bool
|
||||
UnwindIteratorForException(JSContext *cx, JSObject *obj);
|
||||
UnwindIteratorForException(JSContext *cx, js::HandleObject obj);
|
||||
|
||||
void
|
||||
UnwindIteratorForUncatchableException(JSContext *cx, JSObject *obj);
|
||||
UnwindIteratorForUncatchableException(JSContext *cx, RawObject obj);
|
||||
|
||||
JSBool
|
||||
IteratorConstructor(JSContext *cx, unsigned argc, Value *vp);
|
||||
@ -176,7 +176,7 @@ extern bool
|
||||
js_IteratorMore(JSContext *cx, js::HandleObject iterobj, js::MutableHandleValue rval);
|
||||
|
||||
extern bool
|
||||
js_IteratorNext(JSContext *cx, JSObject *iterobj, js::MutableHandleValue rval);
|
||||
js_IteratorNext(JSContext *cx, js::HandleObject iterobj, js::MutableHandleValue rval);
|
||||
|
||||
extern JSBool
|
||||
js_ThrowStopIteration(JSContext *cx);
|
||||
|
@ -631,7 +631,7 @@ CanReify(Value *vp)
|
||||
|
||||
struct AutoCloseIterator
|
||||
{
|
||||
AutoCloseIterator(JSContext *cx, JSObject *obj) : cx(cx), obj(obj) {}
|
||||
AutoCloseIterator(JSContext *cx, JSObject *obj) : cx(cx), obj(cx, obj) {}
|
||||
|
||||
~AutoCloseIterator() { if (obj) CloseIterator(cx, obj); }
|
||||
|
||||
@ -639,13 +639,13 @@ struct AutoCloseIterator
|
||||
|
||||
private:
|
||||
JSContext *cx;
|
||||
JSObject *obj;
|
||||
RootedObject obj;
|
||||
};
|
||||
|
||||
static bool
|
||||
Reify(JSContext *cx, JSCompartment *origin, Value *vp)
|
||||
{
|
||||
PropertyIteratorObject *iterObj = &vp->toObject().asPropertyIterator();
|
||||
Rooted<PropertyIteratorObject*> iterObj(cx, &vp->toObject().asPropertyIterator());
|
||||
NativeIterator *ni = iterObj->getNativeIterator();
|
||||
|
||||
AutoCloseIterator close(cx, iterObj);
|
||||
|
@ -107,7 +107,8 @@ FindExceptionHandler(JSContext *cx)
|
||||
* pending exception.
|
||||
*/
|
||||
JS_ASSERT(JSOp(*pc) == JSOP_ENDITER);
|
||||
bool ok = UnwindIteratorForException(cx, &cx->regs().sp[-1].toObject());
|
||||
RootedObject obj(cx, &cx->regs().sp[-1].toObject());
|
||||
bool ok = UnwindIteratorForException(cx, obj);
|
||||
cx->regs().sp -= 1;
|
||||
if (!ok)
|
||||
goto error;
|
||||
|
@ -1101,7 +1101,7 @@ stubs::IterNext(VMFrame &f)
|
||||
JS_ASSERT(f.regs.stackDepth() >= 1);
|
||||
JS_ASSERT(f.regs.sp[-1].isObject());
|
||||
|
||||
JSObject *iterobj = &f.regs.sp[-1].toObject();
|
||||
RootedObject iterobj(f.cx, &f.regs.sp[-1].toObject());
|
||||
f.regs.sp[0].setNull();
|
||||
f.regs.sp++;
|
||||
if (!js_IteratorNext(f.cx, iterobj, MutableHandleValue::fromMarkedLocation(&f.regs.sp[-1])))
|
||||
@ -1126,7 +1126,8 @@ void JS_FASTCALL
|
||||
stubs::EndIter(VMFrame &f)
|
||||
{
|
||||
JS_ASSERT(f.regs.stackDepth() >= 1);
|
||||
if (!CloseIterator(f.cx, &f.regs.sp[-1].toObject()))
|
||||
RootedObject obj(f.cx, &f.regs.sp[-1].toObject());
|
||||
if (!CloseIterator(f.cx, obj))
|
||||
THROW();
|
||||
}
|
||||
|
||||
|
@ -171,9 +171,13 @@ var XPCOMUtils = {
|
||||
*/
|
||||
defineLazyGetter: function XPCU_defineLazyGetter(aObject, aName, aLambda)
|
||||
{
|
||||
aObject.__defineGetter__(aName, function() {
|
||||
delete aObject[aName];
|
||||
return aObject[aName] = aLambda.apply(aObject);
|
||||
Object.defineProperty(aObject, aName, {
|
||||
get: function () {
|
||||
delete aObject[aName];
|
||||
return aObject[aName] = aLambda.apply(aObject);
|
||||
},
|
||||
configurable: true,
|
||||
enumerable: true
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -476,6 +476,8 @@ irregularFilenames = {
|
||||
'nsIWebGLExtensionTextureFilterAnisotropic' : 'nsIDOMWebGLRenderingContext',
|
||||
'nsIWebGLExtensionLoseContext' : 'nsIDOMWebGLRenderingContext',
|
||||
'nsIWebGLExtensionCompressedTextureS3TC' : 'nsIDOMWebGLRenderingContext',
|
||||
'nsIWebGLExtensionCompressedTextureATC' : 'nsIDOMWebGLRenderingContext',
|
||||
'nsIWebGLExtensionCompressedTexturePVRTC' : 'nsIDOMWebGLRenderingContext',
|
||||
'nsIWebGLExtensionDepthTexture' : 'nsIDOMWebGLRenderingContext',
|
||||
|
||||
'nsIIndexedDatabaseUsageCallback': 'nsIIndexedDatabaseManager',
|
||||
|
@ -23,10 +23,10 @@ HTTP(..) == blur-opacity.html blur-opacity-ref.html
|
||||
== overflow-not-scrollable-1.html overflow-not-scrollable-1-ref2.html
|
||||
== overflow-not-scrollable-2.html overflow-not-scrollable-2-ref.html
|
||||
|
||||
!= text-shadow-selected-1.html text-shadow-selected-1-notref.html
|
||||
== text-shadow-selected-1.html text-shadow-selected-1-ref.html
|
||||
!= text-shadow-selected-2.html text-shadow-selected-2-notref.html
|
||||
== text-shadow-selected-2.html text-shadow-selected-2-ref.html
|
||||
needs-focus != text-shadow-selected-1.html text-shadow-selected-1-notref.html
|
||||
needs-focus == text-shadow-selected-1.html text-shadow-selected-1-ref.html
|
||||
needs-focus != text-shadow-selected-2.html text-shadow-selected-2-notref.html
|
||||
needs-focus == text-shadow-selected-2.html text-shadow-selected-2-ref.html
|
||||
|
||||
# bug 692744
|
||||
== text-shadow-on-space-1.html text-shadow-on-space-1-ref.html
|
||||
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function onload() {
|
||||
window.focus();
|
||||
var range = document.createRange();
|
||||
range.selectNodeContents(document.getElementById("selectMe"));
|
||||
var sel = window.getSelection();
|
||||
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function onload() {
|
||||
window.focus();
|
||||
var range = document.createRange();
|
||||
range.selectNodeContents(document.getElementById("selectMe"));
|
||||
var sel = window.getSelection();
|
||||
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function onload() {
|
||||
window.focus();
|
||||
var range = document.createRange();
|
||||
range.selectNodeContents(document.getElementById("selectMe"));
|
||||
var sel = window.getSelection();
|
||||
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function onload() {
|
||||
window.focus();
|
||||
var range = document.createRange();
|
||||
range.selectNodeContents(document.getElementById("selectMe"));
|
||||
var sel = window.getSelection();
|
||||
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function onload() {
|
||||
window.focus();
|
||||
var range = document.createRange();
|
||||
range.selectNodeContents(document.getElementById("selectMe"));
|
||||
var sel = window.getSelection();
|
||||
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function onload() {
|
||||
window.focus();
|
||||
var range = document.createRange();
|
||||
range.selectNodeContents(document.getElementById("selectMe"));
|
||||
var sel = window.getSelection();
|
||||
|
@ -1480,40 +1480,6 @@ CopyProperties(const nsAString& aKey, nsIVariant *aData, void *aClosure)
|
||||
return PL_DHASH_NEXT;
|
||||
}
|
||||
|
||||
// Return whether upon a redirect code of httpStatus for method, the
|
||||
// request method should be rewritten to GET.
|
||||
//
|
||||
bool
|
||||
HttpBaseChannel::ShouldRewriteRedirectToGET(uint32_t httpStatus,
|
||||
nsHttpAtom method)
|
||||
{
|
||||
// for 301 and 302, only rewrite POST
|
||||
if (httpStatus == 301 || httpStatus == 302)
|
||||
return method == nsHttp::Post;
|
||||
|
||||
// rewrite for 303 unless it was HEAD
|
||||
if (httpStatus == 303)
|
||||
return method != nsHttp::Head;
|
||||
|
||||
// otherwise, such as for 307, do not rewrite
|
||||
return false;
|
||||
}
|
||||
|
||||
// Return whether the specified method is safe as per RFC 2616, Section 9.1.1.
|
||||
bool
|
||||
HttpBaseChannel::IsSafeMethod(nsHttpAtom method)
|
||||
{
|
||||
// This code will need to be extended for new safe methods, otherwise
|
||||
// they'll default to "not safe".
|
||||
return method == nsHttp::Get ||
|
||||
method == nsHttp::Head ||
|
||||
method == nsHttp::Options ||
|
||||
method == nsHttp::Propfind ||
|
||||
method == nsHttp::Report ||
|
||||
method == nsHttp::Search ||
|
||||
method == nsHttp::Trace;
|
||||
}
|
||||
|
||||
nsresult
|
||||
HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI,
|
||||
nsIChannel *newChannel,
|
||||
|
@ -185,9 +185,6 @@ public:
|
||||
|
||||
public: /* Necko internal use only... */
|
||||
|
||||
bool ShouldRewriteRedirectToGET(uint32_t httpStatus, nsHttpAtom method);
|
||||
bool IsSafeMethod(nsHttpAtom method);
|
||||
|
||||
protected:
|
||||
|
||||
// Handle notifying listener, removing from loadgroup if request failed.
|
||||
|
@ -724,8 +724,8 @@ HttpChannelChild::Redirect1Begin(const uint32_t& newChannelId,
|
||||
mResponseHead = new nsHttpResponseHead(responseHead);
|
||||
SetCookie(mResponseHead->PeekHeader(nsHttp::Set_Cookie));
|
||||
|
||||
bool rewriteToGET = ShouldRewriteRedirectToGET(mResponseHead->Status(),
|
||||
mRequestHead.Method());
|
||||
bool rewriteToGET = nsHttp::ShouldRewriteRedirectToGET(
|
||||
mResponseHead->Status(), mRequestHead.Method());
|
||||
|
||||
rv = SetupReplacementChannel(uri, newChannel, !rewriteToGET);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -293,3 +293,32 @@ nsHttp::IsPermanentRedirect(PRUint32 httpStatus)
|
||||
return httpStatus == 301 || httpStatus == 308;
|
||||
}
|
||||
|
||||
bool
|
||||
nsHttp::ShouldRewriteRedirectToGET(PRUint32 httpStatus, nsHttpAtom method)
|
||||
{
|
||||
// for 301 and 302, only rewrite POST
|
||||
if (httpStatus == 301 || httpStatus == 302)
|
||||
return method == nsHttp::Post;
|
||||
|
||||
// rewrite for 303 unless it was HEAD
|
||||
if (httpStatus == 303)
|
||||
return method != nsHttp::Head;
|
||||
|
||||
// otherwise, such as for 307, do not rewrite
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
nsHttp::IsSafeMethod(nsHttpAtom method)
|
||||
{
|
||||
// This code will need to be extended for new safe methods, otherwise
|
||||
// they'll default to "not safe".
|
||||
return method == nsHttp::Get ||
|
||||
method == nsHttp::Head ||
|
||||
method == nsHttp::Options ||
|
||||
method == nsHttp::Propfind ||
|
||||
method == nsHttp::Report ||
|
||||
method == nsHttp::Search ||
|
||||
method == nsHttp::Trace;
|
||||
}
|
||||
|
||||
|
@ -183,6 +183,14 @@ struct nsHttp
|
||||
// Return whether the HTTP status code represents a permanent redirect
|
||||
static bool IsPermanentRedirect(PRUint32 httpStatus);
|
||||
|
||||
// Return whether upon a redirect code of httpStatus for method, the
|
||||
// request method should be rewritten to GET.
|
||||
static bool ShouldRewriteRedirectToGET(PRUint32 httpStatus, nsHttpAtom method);
|
||||
|
||||
// Return whether the specified method is safe as per RFC 2616,
|
||||
// Section 9.1.1.
|
||||
static bool IsSafeMethod(nsHttpAtom method);
|
||||
|
||||
// Declare all atoms
|
||||
//
|
||||
// The atom names and values are stored in nsHttpAtomList.h and are brought
|
||||
|
@ -4,6 +4,7 @@
|
||||
* 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 "nsHttp.h"
|
||||
#include "nsHttpChannel.h"
|
||||
#include "nsHttpHandler.h"
|
||||
#include "nsStandardURL.h"
|
||||
@ -4079,12 +4080,12 @@ nsHttpChannel::ContinueProcessRedirectionAfterFallback(nsresult rv)
|
||||
}
|
||||
}
|
||||
|
||||
bool rewriteToGET = HttpBaseChannel::ShouldRewriteRedirectToGET(
|
||||
mRedirectType, mRequestHead.Method());
|
||||
bool rewriteToGET = nsHttp::ShouldRewriteRedirectToGET(
|
||||
mRedirectType, mRequestHead.Method());
|
||||
|
||||
// prompt if the method is not safe (such as POST, PUT, DELETE, ...)
|
||||
if (!rewriteToGET &&
|
||||
!HttpBaseChannel::IsSafeMethod(mRequestHead.Method())) {
|
||||
!nsHttp::IsSafeMethod(mRequestHead.Method())) {
|
||||
rv = PromptTempRedirect();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
@ -206,6 +206,7 @@
|
||||
"dom/tests/mochitest/pointerlock/test_pointerlock-api.html": "TIMED_OUT",
|
||||
"dom/tests/mochitest/sessionstorage/test_sessionStorageClone.html": "",
|
||||
"dom/tests/mochitest/sessionstorage/test_sessionStorageHttpHttps.html": "TIMED_OUT",
|
||||
"dom/tests/mochitest/webapps/test_bug_779982.html": "Bug 793211",
|
||||
"dom/tests/mochitest/whatwg/test_bug500328.html": "TIMED_OUT",
|
||||
"editor/composer/test/test_bug389350.html": "",
|
||||
"editor/libeditor/base/tests/test_bug408231.html": "",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"talos.zip": {
|
||||
"url": "http://build.mozilla.org/talos/zips/talos.f0e890e6d628.zip",
|
||||
"url": "http://build.mozilla.org/talos/zips/talos.a210f048087b.zip",
|
||||
"path": ""
|
||||
}
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ skip-if = os == "android"
|
||||
skip-if = !debug
|
||||
|
||||
[include:toolkit/crashreporter/test/unit/xpcshell.ini]
|
||||
skip-if = os == "linux" || !crashreporter
|
||||
skip-if = !crashreporter
|
||||
|
||||
[include:toolkit/crashreporter/test/unit_ipc/xpcshell.ini]
|
||||
skip-if = !crashreporter
|
||||
|
@ -68,6 +68,9 @@ ifeq ($(OS_TARGET),Android)
|
||||
DIRS += fileid
|
||||
# NDK5 workarounds
|
||||
DEFINES += -D_STLP_CONST_CONSTRUCTOR_BUG -D_STLP_NO_MEMBER_TEMPLATES
|
||||
TARGET_LOCAL_INCLUDES = \
|
||||
-I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/android/include/ \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
DIRS += client
|
||||
@ -76,7 +79,7 @@ ifdef MOZ_CRASHREPORTER_INJECTOR
|
||||
DIRS += injector
|
||||
endif
|
||||
|
||||
LOCAL_INCLUDES = -I$(srcdir)/google-breakpad/src
|
||||
LOCAL_INCLUDES += -I$(srcdir)/google-breakpad/src
|
||||
DEFINES += -DUNICODE -D_UNICODE
|
||||
|
||||
EXPORTS = \
|
||||
|
@ -184,6 +184,7 @@ void LoadProxyinfo()
|
||||
gpointer SendThread(gpointer args)
|
||||
{
|
||||
string response, error;
|
||||
long response_code;
|
||||
|
||||
bool success = google_breakpad::HTTPUpload::SendRequest
|
||||
(gSendURL,
|
||||
@ -193,6 +194,7 @@ gpointer SendThread(gpointer args)
|
||||
gHttpProxy, gAuth,
|
||||
gCACertificateFile,
|
||||
&response,
|
||||
&response_code,
|
||||
&error);
|
||||
if (success) {
|
||||
LogMessage("Crash report submitted successfully");
|
||||
|
@ -1,5 +0,0 @@
|
||||
repo: aa80aeafa44f5c17c84e1dac5a7119a6d1ef4341
|
||||
node: 2645d42a92c4144ec095d774a32d2fcaec1afa0b
|
||||
branch: default
|
||||
latesttag: null
|
||||
latesttagdistance: 581
|
@ -1,7 +0,0 @@
|
||||
[.]
|
||||
src/testing -r175 http://googlemock.googlecode.com/svn/trunk/
|
||||
src/tools/gyp -r762 http://gyp.googlecode.com/svn/trunk
|
||||
[src/third_party/glog]
|
||||
glog http://google-glog.googlecode.com/svn/trunk
|
||||
[src/third_party/protobuf]
|
||||
protobuf http://protobuf.googlecode.com/svn/trunk
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user