Merge mozilla-central to autoland r=merge a=merge on a CLOSED TREE

This commit is contained in:
Brindusan Cristian 2017-11-16 00:41:40 +02:00
commit cdb95907ba
1506 changed files with 157325 additions and 56288 deletions

View File

@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
bug 1368868 - if PSM xpcshell tests have been run locally, these changes will break the tests without a clobber (see bug 1416332)
Bug 1405993 - Update to ICU 60 requires clobber

View File

@ -29,10 +29,10 @@ class DocAccessibleParent : public ProxyAccessible,
public:
DocAccessibleParent() :
ProxyAccessible(this), mParentDoc(kNoParentDoc),
mTopLevel(false), mShutdown(false)
#if defined(XP_WIN)
, mEmulatedWindowHandle(nullptr)
mEmulatedWindowHandle(nullptr),
#endif // defined(XP_WIN)
mTopLevel(false), mShutdown(false)
{
MOZ_COUNT_CTOR_INHERITED(DocAccessibleParent, ProxyAccessible);
sMaxDocID++;
@ -40,6 +40,7 @@ public:
MOZ_ASSERT(!LiveDocs().Get(mActorID));
LiveDocs().Put(mActorID, this);
}
~DocAccessibleParent()
{
LiveDocs().Remove(mActorID);

View File

@ -19,8 +19,8 @@ static StaticAutoPtr<PlatformChild> sPlatformChild;
DocAccessibleChild::DocAccessibleChild(DocAccessible* aDoc, IProtocol* aManager)
: DocAccessibleChildBase(aDoc)
, mEmulatedWindowHandle(nullptr)
, mIsRemoteConstructed(false)
, mEmulatedWindowHandle(nullptr)
{
MOZ_COUNT_CTOR_INHERITED(DocAccessibleChild, DocAccessibleChildBase);
if (!sPlatformChild) {
@ -318,4 +318,3 @@ DocAccessibleChild::RecvRestoreFocus()
} // namespace a11y
} // namespace mozilla

View File

@ -0,0 +1,36 @@
. "$topsrcdir/build/mozconfig.win-common"
MOZ_AUTOMATION_L10N_CHECK=0
. "$topsrcdir/browser/config/mozconfigs/common"
ac_add_options --target=x86_64-pc-mingw32
ac_add_options --host=x86_64-pc-mingw32
ac_add_options --enable-optimize
ac_add_options --enable-debug
ac_add_options --disable-sandbox
ac_add_options --enable-coverage
# Needed to enable breakpad in application.ini
export MOZILLA_OFFICIAL=1
# Enable Telemetry
export MOZ_TELEMETRY_REPORTING=1
. $topsrcdir/build/win64/mozconfig.vs-latest
# Package js shell.
export MOZ_PACKAGE_JSSHELL=1
if [ -d "$topsrcdir/clang" ]; then
CLANG_LIB_DIR="$(cd $topsrcdir/clang/lib/clang/* && cd lib/windows && pwd)"
export LIB=$LIB:$CLANG_LIB_DIR
mk_export_correct_style LIB
export LDFLAGS="clang_rt.profile-x86_64.lib"
fi
export CFLAGS="--coverage"
export CXXFLAGS="--coverage"
. "$topsrcdir/build/mozconfig.common.override"
. "$topsrcdir/build/mozconfig.clang-cl"

View File

@ -243,6 +243,7 @@ inline bool isIgnoredPathForSprintfLiteral(const CallExpr *Call,
Begin->compare_lower(StringRef("google-breakpad")) == 0 ||
Begin->compare_lower(StringRef("gflags")) == 0 ||
Begin->compare_lower(StringRef("harfbuzz")) == 0 ||
Begin->compare_lower(StringRef("icu")) == 0 ||
Begin->compare_lower(StringRef("jsoncpp")) == 0 ||
Begin->compare_lower(StringRef("libstagefright")) == 0 ||
Begin->compare_lower(StringRef("mtransport")) == 0 ||

View File

@ -198,25 +198,6 @@ def android_toolchain_prefix_base(target):
return target.toolchain
@depends(android_platform, android_toolchain)
def extra_toolchain_flags(platform_dir, toolchain_dir):
if not platform_dir:
return []
return ['-isystem',
os.path.join(platform_dir, 'usr', 'include'),
'-gcc-toolchain',
toolchain_dir]
@depends(android_toolchain_prefix_base, android_toolchain)
def android_toolchain_prefix(prefix_base, toolchain):
if toolchain:
return '%s/bin/%s-' % (toolchain, prefix_base)
imply_option('--with-toolchain-prefix', android_toolchain_prefix,
reason='--with-android-ndk')
option(env='STLPORT_CPPFLAGS',
nargs=1,
help='Options compiler should pass for standard C++ library')
@ -226,7 +207,7 @@ option(env='STLPORT_CPPFLAGS',
@imports(_from='os.path', _import='isdir')
def stlport_cppflags(value, ndk, _):
if value and len(value):
return value
return value.split()
if not ndk:
return
@ -251,21 +232,42 @@ def stlport_cppflags(value, ndk, _):
# Add android/support/include/ for prototyping long double math
# functions, locale-specific C library functions, multibyte support,
# etc.
return "-I%s -I%s -I%s" % (cxx_include,
os.path.join(ndk, 'sources', 'android',
'support', 'include'),
cxxabi_include)
return [
'-I%s' % cxx_include,
'-I%s' % os.path.join(ndk, 'sources', 'android', 'support', 'include'),
'-I%s' % cxxabi_include]
add_old_configure_assignment('stlport_cppflags', stlport_cppflags)
@depends(stlport_cppflags, android_platform, android_toolchain,
@depends(android_platform, android_toolchain, stlport_cppflags)
def extra_toolchain_flags(platform_dir, toolchain_dir, stlport_cppflags):
if not platform_dir:
return []
flags = ['-isystem',
os.path.join(platform_dir, 'usr', 'include'),
'-gcc-toolchain',
toolchain_dir]
flags.extend(stlport_cppflags if stlport_cppflags else [])
return flags
@depends(android_toolchain_prefix_base, android_toolchain)
def android_toolchain_prefix(prefix_base, toolchain):
if toolchain:
return '%s/bin/%s-' % (toolchain, prefix_base)
imply_option('--with-toolchain-prefix', android_toolchain_prefix,
reason='--with-android-ndk')
@depends(extra_toolchain_flags, android_toolchain,
android_toolchain_prefix_base, '--help')
@imports(_from='os.path', _import='isdir')
def bindgen_cflags_defaults(stlport_cppflags, android_platform, toolchain,
toolchain_prefix, _):
if not stlport_cppflags:
def bindgen_cflags_defaults(toolchain_flags, toolchain, toolchain_prefix, _):
if not toolchain_flags:
return
gcc_include = os.path.join(
@ -274,10 +276,8 @@ def bindgen_cflags_defaults(stlport_cppflags, android_platform, toolchain,
gcc_include = os.path.join(
toolchain, 'lib', 'gcc', toolchain_prefix, '4.9')
cflags_format = "%s -isystem %s -gcc-toolchain %s -I%s -I%s"
return cflags_format % (stlport_cppflags,
os.path.join(android_platform, 'usr', 'include'),
toolchain,
cflags_format = "%s -I%s -I%s"
return cflags_format % (' '.join(toolchain_flags),
os.path.join(gcc_include, 'include'),
os.path.join(gcc_include, 'include-fixed'))

View File

@ -78,6 +78,61 @@ def check_headers(*headers, **kwargs):
return checks
# Determine whether to add a given flag to the given lists of flags for C or
# C++ compilation.
# - `flag` is the flag to test
# - `cflags` is a @depends function for the list of C compiler flags to add to
# - `cxxflags` is a @depends function for the list of C++ compiler flags to
# add to
# - `test_flags` is a list of flags to pass to the compiler instead of merely
# passing `flag`. This is especially useful for checking warning flags. If
# this list is empty, `flag` will be passed on its own.
# - `compiler` (optional) is the compiler to test against (c_compiler or
# cxx_compiler, from toolchain.configure). When omitted, both compilers
# are tested; the list of flags added to is dependent on the compiler tested.
# - `when` (optional) is a @depends function or option name conditioning
# when the warning flag is wanted.
# - `check`, when not set, skips checking whether the flag is supported and
# adds it to the list of flags unconditionally.
@template
def check_and_add_flags(flag, cflags, cxxflags, test_flags,
compiler=None, when=None, check=True):
if compiler is not None:
compilers = (compiler,)
else:
compilers = (c_compiler, cxx_compiler)
if when is None:
when = always
if test_flags:
flags = test_flags
else:
flags = [flag]
for c in compilers:
assert c in (c_compiler, cxx_compiler)
lang, list_of_flags = {
c_compiler: ('C', cflags),
cxx_compiler: ('C++', cxxflags),
}[c]
@depends(c, when)
def result(c, when):
if when and c.type in ('clang', 'gcc'):
return True
if check:
result = c.try_compile(
flags=flags, when=result,
check_msg='whether the %s compiler supports %s' % (lang, flag))
@depends(result, list_of_flags)
def maybe_add_flag(result, list_of_flags):
if result:
list_of_flags.append(flag)
@dependable
def warnings_cflags():
return []
@ -101,49 +156,21 @@ def warnings_cxxflags():
# for add_gcc_warning().
@template
def check_and_add_gcc_warning(warning, compiler=None, when=None, check=True):
if compiler is not None:
compilers = (compiler,)
# GCC and clang will fail if given an unknown warning option like
# -Wfoobar. But later versions won't fail if given an unknown negated
# warning option like -Wno-foobar. So when we are checking for support
# of a negated warning option, we actually test the positive form, but
# add the negated form to the flags variable.
if warning.startswith('-Wno-') and not warning.startswith('-Wno-error='):
flags = ['-Werror', '-W' + warning[5:]]
elif warning.startswith('-Werror='):
flags = [warning]
else:
compilers = (c_compiler, cxx_compiler)
flags = ['-Werror', warning]
if when is None:
when = always
check_and_add_flags(warning, warnings_cflags, warnings_cxxflags,
flags, compiler=compiler, when=when, check=check)
for c in compilers:
assert c in (c_compiler, cxx_compiler)
lang, warnings_flags = {
c_compiler: ('C', warnings_cflags),
cxx_compiler: ('C++', warnings_cxxflags),
}[c]
# GCC and clang will fail if given an unknown warning option like
# -Wfoobar. But later versions won't fail if given an unknown negated
# warning option like -Wno-foobar. So when we are checking for support
# of a negated warning option, we actually test the positive form, but
# add the negated form to the flags variable.
if (warning.startswith('-Wno-') and
not warning.startswith('-Wno-error=')):
flags = ['-Werror', '-W' + warning[5:]]
elif warning.startswith('-Werror='):
flags = [warning]
else:
flags = ['-Werror', warning]
@depends(c, when)
def result(c, when):
if when and c.type in ('clang', 'gcc'):
return True
if check:
result = c.try_compile(
flags=flags, when=result,
check_msg='whether the %s compiler supports %s' % (lang,
warning))
@depends(result, warnings_flags)
def maybe_add_flag(result, warnings_flags):
if result:
warnings_flags.append(warning)
# Add the given warning to the list of warning flags for the build.
# - `warning` is the warning flag (e.g. -Wfoo)
@ -157,3 +184,45 @@ def check_and_add_gcc_warning(warning, compiler=None, when=None, check=True):
@template
def add_gcc_warning(warning, compiler=None, when=None):
check_and_add_gcc_warning(warning, compiler, when, check=False)
# Like the warning checks above, but for general compilation flags.
@dependable
def compilation_cflags():
return []
@dependable
def compilation_cxxflags():
return []
# Tests whether GCC or clang support the given compilation flag; if the flag
# is supported, add it to the list of compilation flags for the build.
# - `flag` is the flag to test
# - `compiler` (optional) is the compiler to test against (c_compiler or
# cxx_compiler, from toolchain.configure). When omitted, both compilers
# are tested.
# - `when` (optional) is a @depends function or option name conditioning
# when the warning flag is wanted.
# - `check`, when not set, skips checking whether the flag is supported and
# adds it to the list of flags unconditionally. This is only meant for
# add_gcc_flag().
@template
def check_and_add_gcc_flag(flag, compiler=None, when=None, check=True):
flags = ['-Werror', flag]
check_and_add_flags(flag, compilation_cflags, compilation_cxxflags,
flags, compiler=compiler, when=when, check=check)
# Add the given flag to the list of flags for the build.
# - `flag` is the flag (e.g. -fno-sized-deallocation)
# - `compiler` (optional) is the compiler to add the flag for (c_compiler or
# cxx_compiler, from toolchain.configure). When omitted, the flag is added
# for both compilers.
# - `when` (optional) is a @depends function or option name conditioning
# when the flag is wanted.
@template
def add_gcc_flag(warning, compiler=None, when=None):
check_and_add_gcc_flag(warning, compiler, when, check=False)

View File

@ -0,0 +1,13 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
# We support C++14, but we don't want to enable the sized deallocation
# facilities in C++14 yet.
check_and_add_gcc_flag('-fno-sized-deallocation', compiler=cxx_compiler)
# Please keep these last in this file.
add_old_configure_assignment('_COMPILATION_CFLAGS', compilation_cflags)
add_old_configure_assignment('_COMPILATION_CXXFLAGS', compilation_cxxflags)

View File

@ -414,6 +414,17 @@ def get_compiler_info(compiler, language):
#endif
''')
# Try including a header to ensure that cross-compilers are set up
# correctly.
header = {
'C': 'stddef.h',
'C++': 'cstddef',
}[language]
check += dedent('''\
#include <%(header)s>
''' % {'header': header})
result = try_preprocess(compiler, language, check)
if not result:
@ -488,28 +499,24 @@ def check_compiler(compiler, language, target):
if info.type in ('clang-cl', 'clang', 'gcc'):
append_flag('-std=gnu99')
# Note: MSVC, while supporting C++11, still reports 199711L for __cplusplus.
# Note: MSVC, while supporting C++14, still reports 199711L for __cplusplus.
# Note: this is a strict version check because we used to always add
# -std=gnu++11.
# -std=gnu++14.
draft_cxx14_version = 201300
cxx14_version = 201402
if info.language == 'C++':
if target.kernel != 'WINNT':
if info.type in ('clang', 'gcc') and info.language_version != 201103:
append_flag('-std=gnu++11')
else:
if info.type == 'clang' and info.language_version != 201103:
append_flag('-std=gnu++11')
# MSVC 2015 headers include C++14 features, but don't guard them
# with appropriate checks.
if info.type == 'clang-cl' and info.language_version != cxx14_version:
append_flag('-std=c++14')
# GCC 4.9 indicates that it implements draft C++14 features
# instead of the full language.
elif info.type == 'gcc' and not \
(info.language_version == draft_cxx14_version or
info.language_version == cxx14_version):
append_flag('-std=gnu++14')
if info.type == 'clang' and info.language_version != cxx14_version:
append_flag('-std=gnu++14')
# MSVC 2015 headers include C++14 features, but don't guard them
# with appropriate checks.
elif info.type == 'clang-cl' and info.language_version != cxx14_version:
append_flag('-std=c++14')
# GCC 4.9 indicates that it implements draft C++14 features
# instead of the full language.
elif info.type == 'gcc' and \
info.language_version not in (draft_cxx14_version,
cxx14_version):
append_flag('-std=gnu++14')
# We force clang-cl to emulate Visual C++ 2017 version 15.4
if info.type == 'clang-cl' and info.version != '19.11.25547':
@ -805,11 +812,12 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
input=provided_compiler.compiler,
paths=toolchain_search_path)
@depends(compiler, provided_compiler, compiler_wrapper, host_or_target)
@depends(compiler, provided_compiler, compiler_wrapper, host_or_target,
extra_toolchain_flags)
@checking('whether %s can be used' % what, lambda x: bool(x))
@imports(_from='mozbuild.shellutil', _import='quote')
def valid_compiler(compiler, provided_compiler, compiler_wrapper,
host_or_target):
host_or_target, extra_flags):
wrapper = list(compiler_wrapper or ())
if provided_compiler:
provided_wrapper = list(provided_compiler.wrapper)
@ -822,6 +830,9 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
flags = provided_compiler.flags
else:
flags = []
toolchain_flags = []
if host_or_target_str == 'target' and extra_flags:
toolchain_flags = extra_flags
# Ideally, we'd always use the absolute path, but unfortunately, on
# Windows, the compiler is very often in a directory containing spaces.
@ -843,8 +854,8 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
quote(os.path.dirname(found_compiler)),
quote(os.path.dirname(full_path)))
info = check_compiler(wrapper + [compiler] + flags, language,
host_or_target)
info = check_compiler(wrapper + [compiler] + flags + toolchain_flags,
language, host_or_target)
# Check that the additional flags we got are enough to not require any
# more flags. If we get an exception, just ignore it; it's liable to be
@ -854,8 +865,9 @@ def compiler(language, host_or_target, c_compiler=None, other_compiler=None,
try:
if info.flags:
flags += info.flags
info = check_compiler(wrapper + [compiler] + flags, language,
host_or_target)
info = check_compiler(wrapper + [compiler] + flags +
toolchain_flags,
language, host_or_target)
except FatalCheckError:
pass

View File

@ -57,7 +57,6 @@ check_and_add_gcc_warning('-Wclass-varargs')
check_and_add_gcc_warning('-Wloop-analysis')
# catches C++ version forward-compat issues
check_and_add_gcc_warning('-Wc++11-compat-pedantic', cxx_compiler)
check_and_add_gcc_warning('-Wc++14-compat', cxx_compiler)
check_and_add_gcc_warning('-Wc++14-compat-pedantic', cxx_compiler)
check_and_add_gcc_warning('-Wc++1z-compat', cxx_compiler)

View File

@ -124,9 +124,10 @@ nsJSPrincipals::ReadPrincipals(JSContext* aCx, JSStructuredCloneReader* aReader,
}
static bool
ReadSuffixAndSpec(JSStructuredCloneReader* aReader,
ReadPrincipalInfo(JSStructuredCloneReader* aReader,
OriginAttributes& aAttrs,
nsACString& aSpec)
nsACString& aSpec,
nsACString& aOriginNoSuffix)
{
uint32_t suffixLength, specLength;
if (!JS_ReadUint32Pair(aReader, &suffixLength, &specLength)) {
@ -154,6 +155,22 @@ ReadSuffixAndSpec(JSStructuredCloneReader* aReader,
return false;
}
uint32_t originNoSuffixLength, dummy;
if (!JS_ReadUint32Pair(aReader, &originNoSuffixLength, &dummy)) {
return false;
}
MOZ_ASSERT(dummy == 0);
if (!aOriginNoSuffix.SetLength(originNoSuffixLength, fallible)) {
return false;
}
if (!JS_ReadBytes(aReader, aOriginNoSuffix.BeginWriting(),
originNoSuffixLength)) {
return false;
}
return true;
}
@ -167,7 +184,8 @@ ReadPrincipalInfo(JSStructuredCloneReader* aReader,
} else if (aTag == SCTAG_DOM_NULL_PRINCIPAL) {
OriginAttributes attrs;
nsAutoCString spec;
if (!ReadSuffixAndSpec(aReader, attrs, spec)) {
nsAutoCString originNoSuffix;
if (!ReadPrincipalInfo(aReader, attrs, spec, originNoSuffix)) {
return false;
}
aInfo = NullPrincipalInfo(attrs, spec);
@ -196,11 +214,14 @@ ReadPrincipalInfo(JSStructuredCloneReader* aReader,
} else if (aTag == SCTAG_DOM_CONTENT_PRINCIPAL) {
OriginAttributes attrs;
nsAutoCString spec;
if (!ReadSuffixAndSpec(aReader, attrs, spec)) {
nsAutoCString originNoSuffix;
if (!ReadPrincipalInfo(aReader, attrs, spec, originNoSuffix)) {
return false;
}
aInfo = ContentPrincipalInfo(attrs, void_t(), spec);
MOZ_DIAGNOSTIC_ASSERT(!originNoSuffix.IsEmpty());
aInfo = ContentPrincipalInfo(attrs, originNoSuffix, spec);
} else {
MOZ_CRASH("unexpected principal structured clone tag");
}
@ -241,16 +262,20 @@ nsJSPrincipals::ReadKnownPrincipalType(JSContext* aCx,
}
static bool
WriteSuffixAndSpec(JSStructuredCloneWriter* aWriter,
WritePrincipalInfo(JSStructuredCloneWriter* aWriter,
const OriginAttributes& aAttrs,
const nsCString& aSpec)
const nsCString& aSpec,
const nsCString& aOriginNoSuffix)
{
nsAutoCString suffix;
aAttrs.CreateSuffix(suffix);
return JS_WriteUint32Pair(aWriter, suffix.Length(), aSpec.Length()) &&
JS_WriteBytes(aWriter, suffix.get(), suffix.Length()) &&
JS_WriteBytes(aWriter, aSpec.get(), aSpec.Length());
JS_WriteBytes(aWriter, aSpec.get(), aSpec.Length()) &&
JS_WriteUint32Pair(aWriter, aOriginNoSuffix.Length(), 0) &&
JS_WriteBytes(aWriter, aOriginNoSuffix.get(),
aOriginNoSuffix.Length());
}
static bool
@ -259,7 +284,8 @@ WritePrincipalInfo(JSStructuredCloneWriter* aWriter, const PrincipalInfo& aInfo)
if (aInfo.type() == PrincipalInfo::TNullPrincipalInfo) {
const NullPrincipalInfo& nullInfo = aInfo;
return JS_WriteUint32Pair(aWriter, SCTAG_DOM_NULL_PRINCIPAL, 0) &&
WriteSuffixAndSpec(aWriter, nullInfo.attrs(), nullInfo.spec());
WritePrincipalInfo(aWriter, nullInfo.attrs(), nullInfo.spec(),
EmptyCString());
}
if (aInfo.type() == PrincipalInfo::TSystemPrincipalInfo) {
return JS_WriteUint32Pair(aWriter, SCTAG_DOM_SYSTEM_PRINCIPAL, 0);
@ -282,7 +308,8 @@ WritePrincipalInfo(JSStructuredCloneWriter* aWriter, const PrincipalInfo& aInfo)
MOZ_ASSERT(aInfo.type() == PrincipalInfo::TContentPrincipalInfo);
const ContentPrincipalInfo& cInfo = aInfo;
return JS_WriteUint32Pair(aWriter, SCTAG_DOM_CONTENT_PRINCIPAL, 0) &&
WriteSuffixAndSpec(aWriter, cInfo.attrs(), cInfo.spec());
WritePrincipalInfo(aWriter, cInfo.attrs(), cInfo.spec(),
cInfo.originNoSuffix());
}
bool

View File

@ -4,6 +4,7 @@ SOURCES += [
'/intl/icu/source/common/bmpset.cpp',
'/intl/icu/source/common/brkeng.cpp',
'/intl/icu/source/common/brkiter.cpp',
'/intl/icu/source/common/bytesinkutil.cpp',
'/intl/icu/source/common/bytestream.cpp',
'/intl/icu/source/common/bytestrie.cpp',
'/intl/icu/source/common/bytestriebuilder.cpp',
@ -47,6 +48,7 @@ SOURCES += [
'/intl/icu/source/common/punycode.cpp',
'/intl/icu/source/common/putil.cpp',
'/intl/icu/source/common/rbbi.cpp',
'/intl/icu/source/common/rbbi_cache.cpp',
'/intl/icu/source/common/rbbidata.cpp',
'/intl/icu/source/common/rbbinode.cpp',
'/intl/icu/source/common/rbbirb.cpp',
@ -225,6 +227,7 @@ EXPORTS.unicode += [
'/intl/icu/source/common/unicode/simpleformatter.h',
'/intl/icu/source/common/unicode/std_string.h',
'/intl/icu/source/common/unicode/strenum.h',
'/intl/icu/source/common/unicode/stringoptions.h',
'/intl/icu/source/common/unicode/stringpiece.h',
'/intl/icu/source/common/unicode/stringtriebuilder.h',
'/intl/icu/source/common/unicode/symtable.h',

View File

@ -95,7 +95,25 @@ SOURCES += [
'/intl/icu/source/i18n/nfrule.cpp',
'/intl/icu/source/i18n/nfsubs.cpp',
'/intl/icu/source/i18n/nortrans.cpp',
'/intl/icu/source/i18n/nounit.cpp',
'/intl/icu/source/i18n/nultrans.cpp',
'/intl/icu/source/i18n/number_affixutils.cpp',
'/intl/icu/source/i18n/number_compact.cpp',
'/intl/icu/source/i18n/number_decimalquantity.cpp',
'/intl/icu/source/i18n/number_decimfmtprops.cpp',
'/intl/icu/source/i18n/number_fluent.cpp',
'/intl/icu/source/i18n/number_formatimpl.cpp',
'/intl/icu/source/i18n/number_grouping.cpp',
'/intl/icu/source/i18n/number_integerwidth.cpp',
'/intl/icu/source/i18n/number_longnames.cpp',
'/intl/icu/source/i18n/number_modifiers.cpp',
'/intl/icu/source/i18n/number_notation.cpp',
'/intl/icu/source/i18n/number_padding.cpp',
'/intl/icu/source/i18n/number_patternmodifier.cpp',
'/intl/icu/source/i18n/number_patternstring.cpp',
'/intl/icu/source/i18n/number_rounding.cpp',
'/intl/icu/source/i18n/number_scientific.cpp',
'/intl/icu/source/i18n/number_stringbuilder.cpp',
'/intl/icu/source/i18n/numfmt.cpp',
'/intl/icu/source/i18n/numsys.cpp',
'/intl/icu/source/i18n/olsontz.cpp',
@ -227,6 +245,8 @@ EXPORTS.unicode += [
'/intl/icu/source/i18n/unicode/measunit.h',
'/intl/icu/source/i18n/unicode/measure.h',
'/intl/icu/source/i18n/unicode/msgfmt.h',
'/intl/icu/source/i18n/unicode/nounit.h',
'/intl/icu/source/i18n/unicode/numberformatter.h',
'/intl/icu/source/i18n/unicode/numfmt.h',
'/intl/icu/source/i18n/unicode/numsys.h',
'/intl/icu/source/i18n/unicode/plurfmt.h',

View File

@ -154,7 +154,7 @@
frame.addEventListener('load', function listener(e) {
if (++count == occurances) {
frame.removeEventListener('load', listener);
resolve();
setTimeout(resolve, 0);
}
});
});

View File

@ -10,7 +10,7 @@
</div>
<script type="application/javascript">
function waitForLoad(frame) {
return new Promise(r => frame.onload = r);
return new Promise(r => frame.onload = () => setTimeout(r, 0));
}
async function loadFramesAndNavigate() {

View File

@ -7,6 +7,8 @@
#ifndef mozilla_AnimationComparator_h
#define mozilla_AnimationComparator_h
#include "mozilla/dom/Animation.h"
namespace mozilla {
// Although this file is called AnimationComparator, we don't actually

View File

@ -8,6 +8,7 @@
#include "mozilla/dom/AnimationEffectReadOnlyBinding.h"
#include "mozilla/dom/Animation.h"
#include "mozilla/dom/KeyframeEffectReadOnly.h"
#include "mozilla/AnimationUtils.h"
#include "mozilla/FloatingPoint.h"

View File

@ -6,6 +6,9 @@
#include "EffectCompositor.h"
#include <bitset>
#include <initializer_list>
#include "mozilla/dom/Animation.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/KeyframeEffectReadOnly.h"
@ -36,8 +39,7 @@
#include "nsRuleProcessorData.h" // For ElementRuleProcessorData etc.
#include "nsStyleContextInlines.h"
#include "nsTArray.h"
#include <bitset>
#include <initializer_list>
#include "PendingAnimationTracker.h"
using mozilla::dom::Animation;
using mozilla::dom::Element;

View File

@ -11,6 +11,7 @@
#include "mozilla/dom/AnimationEffectTiming.h"
#include "mozilla/dom/KeyframeEffectBinding.h"
#include "nsDOMMutationObserver.h" // For nsAutoAnimationMutationBatch
#include "nsStyleContext.h"
namespace mozilla {
namespace dom {

View File

@ -6,7 +6,9 @@
#include "mozilla/dom/KeyframeEffectReadOnly.h"
#include "FrameLayerBuilder.h"
#include "gfxPrefs.h"
#include "mozilla/dom/Animation.h"
#include "mozilla/dom/KeyframeAnimationOptionsBinding.h"
// For UnrestrictedDoubleOrKeyframeAnimationOptions;
#include "mozilla/dom/CSSPseudoElement.h"
@ -15,8 +17,9 @@
#include "mozilla/AnimationUtils.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/EffectSet.h"
#include "mozilla/GeckoStyleContext.h"
#include "mozilla/FloatingPoint.h" // For IsFinite
#include "mozilla/GeckoStyleContext.h"
#include "mozilla/LayerAnimationInfo.h"
#include "mozilla/LookAndFeel.h" // For LookAndFeel::GetInt
#include "mozilla/KeyframeUtils.h"
#include "mozilla/ServoBindings.h"
@ -24,11 +27,14 @@
#include "mozilla/TypeTraits.h"
#include "Layers.h" // For Layer
#include "nsComputedDOMStyle.h" // nsComputedDOMStyle::GetStyleContext
#include "nsContentUtils.h"
#include "nsCSSPropertyIDSet.h"
#include "nsCSSProps.h" // For nsCSSProps::PropHasFlags
#include "nsCSSPseudoElements.h" // For CSSPseudoElementType
#include "nsIFrame.h"
#include "nsIPresShell.h"
#include "nsIScriptError.h"
#include "nsRefreshDriver.h"
#include "nsStyleContextInlines.h"
namespace mozilla {

View File

@ -17,6 +17,7 @@
#include "mozilla/dom/Animation.h"
#include "mozilla/dom/Attr.h"
#include "mozilla/dom/Grid.h"
#include "mozilla/gfx/Matrix.h"
#include "nsDOMAttributeMap.h"
#include "nsAtom.h"
#include "nsIContentInlines.h"
@ -161,6 +162,8 @@
using namespace mozilla;
using namespace mozilla::dom;
using mozilla::gfx::Matrix4x4;
//
// Verify sizes of elements on 64-bit platforms. This should catch most memory
// regressions, and is easy to verify locally since most developers are on

View File

@ -55,7 +55,8 @@ class nsContentList;
class nsDOMTokenList;
struct nsRect;
class nsFocusManager;
class nsGlobalWindow;
class nsGlobalWindowInner;
class nsGlobalWindowOuter;
class nsICSSDeclaration;
class nsISMILAttr;
class nsDocument;
@ -613,7 +614,8 @@ private:
// Need to allow the ESM, nsGlobalWindow, and the focus manager to
// set our state
friend class mozilla::EventStateManager;
friend class ::nsGlobalWindow;
friend class ::nsGlobalWindowInner;
friend class ::nsGlobalWindowOuter;
friend class ::nsFocusManager;
// Allow CusomtElementRegistry to call AddStates.
@ -1779,6 +1781,9 @@ private:
// Data members
EventStates mState;
// Per-node data managed by Servo.
//
// There should not be data on nodes that are in the flattened tree, or
// descendants of display: none elements.
mozilla::ServoCell<ServoNodeData*> mServoData;
};

View File

@ -19,6 +19,7 @@
#include "mozilla/dom/WorkerScope.h"
#include "mozilla/UniquePtrExtensions.h"
#include "nsAutoPtr.h"
#include "nsIThreadRetargetableStreamListener.h"
#include "nsNetUtil.h"
#include "nsIAuthPrompt.h"
#include "nsIAuthPrompt2.h"
@ -1783,7 +1784,8 @@ class EventSourceWorkerHolder final : public WorkerHolder
{
public:
explicit EventSourceWorkerHolder(EventSourceImpl* aEventSourceImpl)
: mEventSourceImpl(aEventSourceImpl)
: WorkerHolder("EventSourceWorkerHolder")
, mEventSourceImpl(aEventSourceImpl)
{
}

View File

@ -9,6 +9,10 @@
#include "ImageTracker.h"
#include "imgIRequest.h"
#include "mozilla/Preferences.h"
#include "nsXULAppAPI.h"
namespace mozilla {
namespace dom {

View File

@ -5,6 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "IntlUtils.h"
#include "mozilla/dom/ToJSValue.h"
#include "mozIMozIntl.h"
#include "nsContentUtils.h"

View File

@ -7,6 +7,8 @@
#define mozilla_dom_IntlUtils_h
#include "mozilla/dom/IntlUtilsBinding.h"
#include "nsWrapperCache.h"
#include "xpcprivate.h"
class nsPIDOMWindowInner;

View File

@ -7,6 +7,7 @@
#ifndef mozilla_dom_Pose_h
#define mozilla_dom_Pose_h
#include "mozilla/ErrorResult.h"
#include "nsWrapperCache.h"
namespace mozilla {

View File

@ -7,6 +7,7 @@
#ifndef mozilla_dom_PostMessageEvent_h
#define mozilla_dom_PostMessageEvent_h
#include "mozilla/dom/Event.h"
#include "mozilla/dom/StructuredCloneHolder.h"
#include "nsCOMPtr.h"
#include "mozilla/RefPtr.h"

View File

@ -10,7 +10,11 @@
#include "SelectionChangeListener.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsFrameSelection.h"
#include "nsRange.h"
#include "Selection.h"

View File

@ -9,12 +9,11 @@
#include "js/StructuredClone.h"
#include "js/Utility.h"
#include "jswrapper.h"
#include "xpcpublic.h"
#include "mozilla/dom/BlobImpl.h"
#include "mozilla/dom/StructuredCloneTags.h"
#include "mozilla/Maybe.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/StructuredCloneTags.h"
#include "xpcpublic.h"
namespace mozilla {
namespace dom {

View File

@ -390,6 +390,9 @@ SOURCES += [
'nsFrameMessageManager.cpp',
# This file has a #error "Never include windows.h in this file!"
'nsGlobalWindow.cpp',
# These files are included by nsGlobalWindow.cpp
# 'nsGlobalWindowInner.cpp',
# 'nsGlobalWindowOuter.cpp',
# Conflicts with windows.h's definition of LoadImage.
'nsImageLoadingContent.cpp',
# Because of OS X headers.

View File

@ -803,7 +803,7 @@ nsDOMClassInfo::PostCreatePrototype(JSContext * cx, JSObject * aProto)
NS_ENSURE_TRUE(nameSpaceManager, NS_OK);
JS::Rooted<JS::PropertyDescriptor> desc(cx);
nsresult rv = ResolvePrototype(sXPConnect, win->AssertInner(), cx, global,
nsresult rv = ResolvePrototype(sXPConnect, win, cx, global,
mData->mNameUTF16, mData, nullptr,
nameSpaceManager, proto, &desc);
NS_ENSURE_SUCCESS(rv, rv);

View File

@ -20,8 +20,8 @@
#endif
struct nsGlobalNameStruct;
class nsGlobalWindow;
class nsGlobalWindowInner;
class nsGlobalWindowOuter;
struct nsDOMClassInfoData;
@ -145,7 +145,8 @@ protected:
JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
JS::MutableHandle<JS::PropertyDescriptor> desc);
friend class nsGlobalWindow;
friend class nsGlobalWindowInner;
friend class nsGlobalWindowOuter;
public:
static bool NameStructEnabled(JSContext* aCx, nsGlobalWindowInner *aWin,
const nsAString& aName,

View File

@ -22,9 +22,8 @@
#include "nsTextFragment.h"
#include "nsThreadUtils.h"
using mozilla::Maybe;
using mozilla::Move;
using mozilla::NonOwningAnimationTarget;
using namespace mozilla;
using mozilla::dom::TreeOrderComparator;
using mozilla::dom::Animation;
using mozilla::dom::Element;

View File

@ -4,13 +4,10 @@
* 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/. */
// Local Includes
#include "nsDOMWindowList.h"
// Helper classes
#include "FlushType.h"
#include "nsCOMPtr.h"
// Interfaces needed
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMWindow.h"
@ -19,6 +16,8 @@
#include "nsIScriptGlobalObject.h"
#include "nsIWebNavigation.h"
using namespace mozilla;
nsDOMWindowList::nsDOMWindowList(nsIDocShell *aDocShell)
{
SetDocShell(aDocShell);

View File

@ -7,8 +7,6 @@
#include "nsGkAtoms.h"
#include "nsStaticAtom.h"
using namespace mozilla;
#define GK_ATOM(name_, value_) NS_STATIC_ATOM_DEFN(nsGkAtoms, name_)
#include "nsGkAtomList.h"
#undef GK_ATOM

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2584,9 +2584,9 @@ nsINode::GetAccessibleNode()
#ifdef ACCESSIBILITY
RefPtr<AccessibleNode> anode = new AccessibleNode(this);
return anode.forget();
#endif
#else
return nullptr;
#endif
}
void

View File

@ -31,6 +31,7 @@
#include "mozilla/dom/Element.h"
#include "mozilla/dom/ScriptSettings.h"
using namespace mozilla;
using namespace mozilla::dom;
bool

View File

@ -22,7 +22,8 @@
#define DOM_WINDOW_FROZEN_TOPIC "dom-window-frozen"
#define DOM_WINDOW_THAWED_TOPIC "dom-window-thawed"
class nsGlobalWindow;
class nsGlobalWindowInner;
class nsGlobalWindowOuter;
class nsIArray;
class nsIContent;
class nsICSSDeclaration;
@ -253,9 +254,11 @@ public:
// the window was frozen.
virtual nsresult FireDelayedDOMEvents() = 0;
nsPIDOMWindowOuter* GetOuterWindow()
nsPIDOMWindowOuter* GetOuterWindow() const
{
return mIsInnerWindow ? mOuterWindow.get() : AsOuter();
return mIsInnerWindow
? mOuterWindow.get()
: const_cast<nsPIDOMWindowOuter*>(AsOuter());
}
bool IsInnerWindow() const
@ -268,25 +271,11 @@ public:
return !IsInnerWindow();
}
// Outer windows only.
virtual bool WouldReuseInnerWindow(nsIDocument* aNewDocument) = 0;
/**
* Get the docshell in this window.
*/
nsIDocShell *GetDocShell() const;
/**
* Set the docshell in the window. Must not be called with a null docshell
* (use DetachFromDocShell for that).
*/
virtual void SetDocShell(nsIDocShell *aDocShell) = 0;
/**
* Detach an outer window from its docshell.
*/
virtual void DetachFromDocShell() = 0;
/**
* Set a new document in the window. Calling this method will in
* most cases create a new inner window. If this method is called on
@ -602,8 +591,6 @@ public:
virtual nsresult MoveBy(int32_t aXDif, int32_t aYDif) = 0;
virtual nsresult UpdateCommands(const nsAString& anAction, nsISelection* aSel, int16_t aReason) = 0;
mozilla::dom::TabGroup* TabGroup();
mozilla::dom::DocGroup* GetDocGroup() const;
virtual nsISerialEventTarget*
@ -765,7 +752,12 @@ protected:
// and memory layout!
class nsPIDOMWindowInner : public nsPIDOMWindow<mozIDOMWindow>
{
friend nsGlobalWindow;
friend nsGlobalWindowInner;
friend nsGlobalWindowOuter;
explicit nsPIDOMWindowInner(nsPIDOMWindowOuter* aOuterWindow)
: nsPIDOMWindow<mozIDOMWindow>(aOuterWindow)
{}
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMWINDOWINNER_IID)
@ -939,6 +931,7 @@ public:
// timeout-throttling.
bool HasOpenWebSockets() const;
mozilla::dom::TabGroup* TabGroup();
protected:
void CreatePerformanceObjectIfNeeded();
};
@ -950,6 +943,10 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindowInner, NS_PIDOMWINDOWINNER_IID)
class nsPIDOMWindowOuter : public nsPIDOMWindow<mozIDOMWindowProxy>
{
protected:
explicit nsPIDOMWindowOuter()
: nsPIDOMWindow<mozIDOMWindowProxy>(nullptr)
{}
void RefreshMediaElementsVolume();
void RefreshMediaElementsSuspend(SuspendTypes aSuspend);
bool IsDisposableSuspend(SuspendTypes aSuspend) const;
@ -1030,6 +1027,8 @@ public:
bool IsTopLevelWindow();
bool HadOriginalOpener() const;
mozilla::dom::TabGroup* TabGroup();
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindowOuter, NS_PIDOMWINDOWOUTER_IID)

View File

@ -26,6 +26,8 @@
#include "nsStreamUtils.h"
#include <algorithm>
using namespace mozilla;
using mozilla::net::ReferrerPolicy;
/**

View File

@ -7,12 +7,14 @@
#include "nsTreeSanitizer.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/DeclarationBlock.h"
#include "mozilla/ServoDeclarationBlock.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/css/Declaration.h"
#include "mozilla/css/StyleRule.h"
#include "mozilla/css/Rule.h"
#include "mozilla/dom/CSSRuleList.h"
#include "mozilla/dom/SRIMetadata.h"
#include "nsCSSParser.h"
#include "nsCSSPropertyID.h"
#include "nsUnicharInputStream.h"
@ -28,6 +30,7 @@
#include "nsQueryObject.h"
using namespace mozilla;
using namespace mozilla::dom;
//
// Thanks to Mark Pilgrim and Sam Ruby for the initial whitelist

View File

@ -7,6 +7,8 @@
#include "gtest/gtest.h"
#include "nsGlobalWindow.h"
// XXX(nika): I can't find any non-test callers of this code, can we remove it?
struct dialog_test {
const char* input;
const char* output;
@ -25,7 +27,7 @@ void runTokenizeTest(dialog_test& test)
nsAutoString result;
nsAutoString token;
while (nsGlobalWindow::TokenizeDialogOptions(token, iter, end)) {
while (nsGlobalWindowInner::TokenizeDialogOptions(token, iter, end)) {
if (!result.IsEmpty()) {
result.Append(',');
}
@ -41,7 +43,7 @@ void runTest(dialog_test& test)
NS_ConvertUTF8toUTF16 input(test.input);
nsAutoString result;
nsGlobalWindow::ConvertDialogOptions(input, result);
nsGlobalWindowInner::ConvertDialogOptions(input, result);
ASSERT_STREQ(test.output, NS_ConvertUTF16toUTF8(result).get()) << "Testing " << test.input;
}

View File

@ -1025,7 +1025,9 @@ struct TypeNeedsOuterization
// We only need to outerize Window objects, so anything inheriting from
// nsGlobalWindow (which inherits from EventTarget itself).
static const bool value =
IsBaseOf<nsGlobalWindow, T>::value || IsSame<EventTarget, T>::value;
IsBaseOf<nsGlobalWindowInner, T>::value ||
IsBaseOf<nsGlobalWindowOuter, T>::value ||
IsSame<EventTarget, T>::value;
};
#ifdef DEBUG

View File

@ -319,7 +319,7 @@ ToStringHelper(const char* aSeverity, const nsString& aMessage,
static const char format2[] =
"[%s: \"%s\"]";
UniqueChars temp;
JS::UniqueChars temp;
char* tempMessage = nullptr;
char* tempSourceName = nullptr;
char* tempSourceLine = nullptr;

View File

@ -22,7 +22,7 @@ using namespace mozilla::dom;
namespace {
static nsCString
FormatStackString(JSContext* cx, HandleObject aStack) {
FormatStackString(JSContext* cx, JS::HandleObject aStack) {
JS::RootedString formattedStack(cx);
if (!JS::BuildStackString(cx, aStack, &formattedStack)) {
@ -111,7 +111,7 @@ nsScriptErrorWithStack::ToString(nsACString& /*UTF8*/ aResult)
}
JSContext* cx = jsapi.cx();
RootedObject stack(cx, mStack);
JS::RootedObject stack(cx, mStack);
nsCString stackString = FormatStackString(cx, stack);
nsCString combined = message + NS_LITERAL_CSTRING("\n") + stackString;
aResult.Assign(combined);

View File

@ -7,8 +7,9 @@
#ifndef mozilla_dom_TestInterfaceIterableDouble_h
#define mozilla_dom_TestInterfaceIterableDouble_h
#include "nsWrapperCache.h"
#include "nsCOMPtr.h"
#include "nsTArray.h"
#include "nsWrapperCache.h"
class nsPIDOMWindowInner;

View File

@ -7,8 +7,9 @@
#ifndef mozilla_dom_TestInterfaceIterableDoubleUnion_h
#define mozilla_dom_TestInterfaceIterableDoubleUnion_h
#include "nsWrapperCache.h"
#include "mozilla/dom/TestInterfaceJSMaplikeSetlikeIterableBinding.h"
#include "nsCOMPtr.h"
#include "nsWrapperCache.h"
class nsPIDOMWindowInner;

View File

@ -7,8 +7,9 @@
#ifndef mozilla_dom_TestInterfaceIterableSingle_h
#define mozilla_dom_TestInterfaceIterableSingle_h
#include "nsWrapperCache.h"
#include "nsCOMPtr.h"
#include "nsWrapperCache.h"
#include "nsTArray.h"
class nsPIDOMWindowInner;

View File

@ -240,7 +240,8 @@ class BroadcastChannelWorkerHolder final : public workers::WorkerHolder
public:
explicit BroadcastChannelWorkerHolder(BroadcastChannel* aChannel)
: mChannel(aChannel)
: workers::WorkerHolder("BroadcastChannelWorkerHolder")
, mChannel(aChannel)
{
MOZ_COUNT_CTOR(BroadcastChannelWorkerHolder);
}

View File

@ -12,6 +12,7 @@
#include "mozilla/dom/cache/Cache.h"
#include "mozilla/dom/cache/CacheChild.h"
#include "mozilla/dom/cache/CacheStreamControlChild.h"
#include "mozilla/dom/cache/CacheWorkerHolder.h"
namespace mozilla {
namespace dom {

View File

@ -12,6 +12,7 @@
#include "mozilla/dom/cache/SavedTypes.h"
#include "mozilla/ipc/FileDescriptorSetParent.h"
#include "mozilla/ipc/InputStreamUtils.h"
#include "mozilla/ipc/IPCStreamUtils.h"
namespace mozilla {
namespace dom {

View File

@ -7,7 +7,9 @@
#include "mozilla/dom/cache/CacheStorage.h"
#include "mozilla/Unused.h"
#include "mozilla/dom/CacheBinding.h"
#include "mozilla/dom/CacheStorageBinding.h"
#include "mozilla/dom/InternalRequest.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/Response.h"
#include "mozilla/dom/cache/AutoUtils.h"

View File

@ -9,8 +9,10 @@
#include "mozilla/Unused.h"
#include "mozilla/dom/cache/ActorUtils.h"
#include "mozilla/dom/cache/CacheTypes.h"
#include "mozilla/dom/cache/CacheWorkerHolder.h"
#include "mozilla/dom/cache/ReadStream.h"
#include "mozilla/ipc/FileDescriptorSetChild.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/ipc/PFileDescriptorSetChild.h"
#include "nsISupportsImpl.h"

View File

@ -6,20 +6,24 @@
#include "mozilla/dom/cache/CacheStreamControlParent.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/Unused.h"
#include "mozilla/dom/cache/CacheTypes.h"
#include "mozilla/dom/cache/ReadStream.h"
#include "mozilla/dom/cache/StreamList.h"
#include "mozilla/ipc/FileDescriptorSetParent.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundParent.h"
#include "mozilla/ipc/PFileDescriptorSetParent.h"
#include "nsISupportsImpl.h"
#include "nsTArray.h"
namespace mozilla {
namespace dom {
namespace cache {
using mozilla::dom::OptionalFileDescriptorSet;
using mozilla::ipc::AutoIPCStream;
using mozilla::ipc::FileDescriptor;
using mozilla::ipc::FileDescriptorSetParent;
using mozilla::ipc::PFileDescriptorSetParent;

View File

@ -116,7 +116,7 @@ CacheWorkerHolder::Notify(Status aStatus)
}
CacheWorkerHolder::CacheWorkerHolder(Behavior aBehavior)
: WorkerHolder(aBehavior)
: WorkerHolder("CacheWorkerHolder", aBehavior)
, mNotified(false)
{
}

View File

@ -17,6 +17,7 @@
#include "mozilla/dom/cache/SavedTypes.h"
#include "mozilla/dom/cache/Types.h"
#include "mozilla/dom/cache/TypeUtils.h"
#include "mozilla/net/MozURL.h"
#include "mozIStorageConnection.h"
#include "mozIStorageStatement.h"
#include "mozStorageHelper.h"
@ -2114,8 +2115,23 @@ ReadResponse(mozIStorageConnection* aConn, EntryId aEntryId,
return NS_ERROR_FAILURE;
}
RefPtr<net::MozURL> url;
rv = net::MozURL::Init(getter_AddRefs(url), specNoSuffix);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
#ifdef DEBUG
nsCString scheme;
rv = url->GetScheme(scheme);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
MOZ_ASSERT(scheme == "http" || scheme == "https" || scheme == "file");
#endif
nsCString origin;
rv = url->GetOrigin(origin);
if (NS_WARN_IF(NS_FAILED(rv))) { return rv; }
aSavedResponseOut->mValue.principalInfo() =
mozilla::ipc::ContentPrincipalInfo(attrs, void_t(), specNoSuffix);
mozilla::ipc::ContentPrincipalInfo(attrs, origin, specNoSuffix);
}
bool nullPadding = false;

View File

@ -6,6 +6,7 @@
#include "mozilla/dom/cache/FileUtils.h"
#include "DBSchema.h"
#include "mozilla/dom/InternalResponse.h"
#include "mozilla/dom/quota/FileStreams.h"
#include "mozilla/dom/quota/QuotaManager.h"
@ -26,9 +27,6 @@ namespace mozilla {
namespace dom {
namespace cache {
#define PADDING_FILE_NAME ".padding"
#define PADDING_TMP_FILE_NAME ".padding-tmp"
using mozilla::dom::quota::FileInputStream;
using mozilla::dom::quota::FileOutputStream;
using mozilla::dom::quota::PERSISTENCE_TYPE_DEFAULT;

View File

@ -9,6 +9,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/dom/cache/Types.h"
#include "mozIStorageConnection.h"
#include "nsStreamUtils.h"
#include "nsTArrayForwardDeclare.h"
@ -19,6 +20,9 @@ namespace mozilla {
namespace dom {
namespace cache {
#define PADDING_FILE_NAME ".padding"
#define PADDING_TMP_FILE_NAME ".padding-tmp"
enum DirPaddingFile
{
FILE,
@ -55,7 +59,8 @@ BodyOpen(const QuotaInfo& aQuotaInfo, nsIFile* aBaseDir, const nsID& aId,
nsresult
BodyMaybeUpdatePaddingSize(const QuotaInfo& aQuotaInfo, nsIFile* aBaseDir,
const nsID& aId, int64_t* aPaddingSizeOut);
const nsID& aId, const uint32_t aPaddingInfo,
int64_t* aPaddingSizeOut);
nsresult
BodyDeleteFiles(const QuotaInfo& aQuotaInfo, nsIFile* aBaseDir,

View File

@ -6,10 +6,13 @@
#include "mozilla/dom/cache/QuotaClient.h"
#include "DBAction.h"
#include "FileUtils.h"
#include "mozilla/dom/cache/Manager.h"
#include "mozilla/dom/quota/QuotaManager.h"
#include "mozilla/dom/quota/UsageInfo.h"
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/Unused.h"
#include "nsIFile.h"
#include "nsISimpleEnumerator.h"
#include "nsThreadUtils.h"

View File

@ -10,6 +10,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/dom/cache/Types.h"
#include "mozilla/dom/quota/Client.h"
#include "mozIStorageConnection.h"
namespace mozilla {
namespace dom {

View File

@ -7,12 +7,13 @@
#ifndef mozilla_dom_cache_ReadStream_h
#define mozilla_dom_cache_ReadStream_h
#include "mozilla/ErrorResult.h"
#include "mozilla/ipc/FileDescriptor.h"
#include "mozilla/RefPtr.h"
#include "nsCOMPtr.h"
#include "nsID.h"
#include "nsIInputStream.h"
#include "nsISupportsImpl.h"
#include "mozilla/RefPtr.h"
#include "nsTArrayForwardDeclare.h"
namespace mozilla {

View File

@ -14,6 +14,7 @@
#include "mozilla/dom/cache/CacheTypes.h"
#include "mozilla/dom/cache/ReadStream.h"
#include "mozilla/ipc/BackgroundChild.h"
#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/ipc/PFileDescriptorSetChild.h"
#include "mozilla/ipc/InputStreamUtils.h"

View File

@ -18,7 +18,7 @@ ClientHandleOpChild::ActorDestroy(ActorDestroyReason aReason)
}
}
IPCResult
mozilla::ipc::IPCResult
ClientHandleOpChild::Recv__delete__(const ClientOpResult& aResult)
{
if (aResult.type() == ClientOpResult::Tnsresult &&

View File

@ -8,6 +8,8 @@
#include "mozilla/dom/ClientOpPromise.h"
#include "mozilla/dom/ClientThing.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"
#include "nsIPrincipal.h"
namespace mozilla {
namespace ipc {

View File

@ -6,6 +6,8 @@
#include "ClientManagerOpChild.h"
#include "mozilla/ipc/ProtocolUtils.h"
namespace mozilla {
namespace dom {
@ -18,7 +20,7 @@ ClientManagerOpChild::ActorDestroy(ActorDestroyReason aReason)
}
}
IPCResult
mozilla::ipc::IPCResult
ClientManagerOpChild::Recv__delete__(const ClientOpResult& aResult)
{
if (aResult.type() == ClientOpResult::Tnsresult &&

View File

@ -6,6 +6,8 @@
#include "ClientManagerOpParent.h"
#include "ClientManagerService.h"
namespace mozilla {
namespace dom {

View File

@ -6,13 +6,16 @@
#include "ClientManagerService.h"
#include "ClientSourceParent.h"
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"
namespace mozilla {
namespace dom {
using mozilla::ipc::AssertIsOnBackgroundThread;
using mozilla::ipc::ContentPrincipalInfo;
using mozilla::ipc::PrincipalInfo;
namespace {

View File

@ -6,6 +6,7 @@
#ifndef _mozilla_dom_ClientManagerService_h
#define _mozilla_dom_ClientManagerService_h
#include "mozilla/ipc/PBackgroundSharedTypes.h"
#include "nsDataHashtable.h"
namespace mozilla {

View File

@ -26,10 +26,10 @@ class ClientSourceParent final : public PClientSourceParent
KillInvalidChild();
// PClientSourceParent
IPCResult
mozilla::ipc::IPCResult
RecvTeardown() override;
IPCResult
mozilla::ipc::IPCResult
RecvExecutionReady(const ClientSourceExecutionReadyArgs& aArgs) override;
void

View File

@ -45,8 +45,7 @@ ClientIsValidPrincipalInfo(const PrincipalInfo& aPrincipalInfo)
// Verify the principal originNoSuffix parses.
RefPtr<MozURL> originURL;
rv = MozURL::Init(getter_AddRefs(originURL),
content.originNoSuffix().get_nsCString());
rv = MozURL::Init(getter_AddRefs(originURL), content.originNoSuffix());
NS_ENSURE_SUCCESS(rv, false);
nsAutoCString originOrigin;
@ -98,8 +97,7 @@ ClientIsValidCreationURL(const PrincipalInfo& aPrincipalInfo,
// Parse the principal origin URL as well. This ensures any MozURL
// parser issues effect both URLs equally.
RefPtr<MozURL> principalURL;
rv = MozURL::Init(getter_AddRefs(principalURL),
content.originNoSuffix().get_nsCString());
rv = MozURL::Init(getter_AddRefs(principalURL), content.originNoSuffix());
NS_ENSURE_SUCCESS(rv, false);
nsAutoCString origin;

View File

@ -144,6 +144,7 @@ private:
class WebCryptoTask::InternalWorkerHolder final : public WorkerHolder
{
InternalWorkerHolder()
: WorkerHolder("WebCryptoTask::InternalWorkerHolder")
{ }
~InternalWorkerHolder()

View File

@ -1148,29 +1148,6 @@ Event::TimeStamp() const
return nsRFPService::ReduceTimePrecisionAsMSecs(TimeStampImpl());
}
bool
Event::GetPreventDefault() const
{
nsCOMPtr<nsPIDOMWindowInner> win(do_QueryInterface(mOwner));
if (win) {
if (nsIDocument* doc = win->GetExtantDoc()) {
doc->WarnOnceAbout(nsIDocument::eGetPreventDefault);
}
}
// GetPreventDefault() is legacy and Gecko specific method. Although,
// the result should be same as defaultPrevented, we don't need to break
// backward compatibility of legacy method. Let's behave traditionally.
return DefaultPrevented();
}
NS_IMETHODIMP
Event::GetPreventDefault(bool* aReturn)
{
NS_ENSURE_ARG_POINTER(aReturn);
*aReturn = GetPreventDefault();
return NS_OK;
}
NS_IMETHODIMP
Event::GetDefaultPrevented(bool* aReturn)
{

View File

@ -236,8 +236,6 @@ public:
EventTarget* GetExplicitOriginalTarget() const;
EventTarget* GetComposedTarget() const;
bool GetPreventDefault() const;
/**
* @param aCalledByDefaultHandler Should be true when this is called by
* C++ or Chrome. Otherwise, e.g., called
@ -398,7 +396,6 @@ private:
NS_IMETHOD StopImmediatePropagation(void) override { return _to StopImmediatePropagation(); } \
NS_IMETHOD GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget) override { return _to GetOriginalTarget(aOriginalTarget); } \
NS_IMETHOD GetExplicitOriginalTarget(nsIDOMEventTarget** aExplicitOriginalTarget) override { return _to GetExplicitOriginalTarget(aExplicitOriginalTarget); } \
NS_IMETHOD GetPreventDefault(bool* aRetval) override { return _to GetPreventDefault(aRetval); } \
NS_IMETHOD GetIsTrusted(bool* aIsTrusted) override { return _to GetIsTrusted(aIsTrusted); } \
NS_IMETHOD SetTarget(nsIDOMEventTarget* aTarget) override { return _to SetTarget(aTarget); } \
NS_IMETHOD_(bool) IsDispatchStopped(void) override { return _to IsDispatchStopped(); } \

View File

@ -29,7 +29,8 @@ class FetchBodyWorkerHolder final : public workers::WorkerHolder
public:
explicit FetchBodyWorkerHolder(FetchBodyConsumer<Derived>* aConsumer)
: mConsumer(aConsumer)
: workers::WorkerHolder("FetchBodyWorkerHolder")
, mConsumer(aConsumer)
, mWasNotified(false)
{
MOZ_ASSERT(aConsumer);

View File

@ -28,7 +28,8 @@ class FetchStreamWorkerHolder final : public WorkerHolder
{
public:
explicit FetchStreamWorkerHolder(FetchStream* aStream)
: WorkerHolder(WorkerHolder::Behavior::AllowIdleShutdownStart)
: WorkerHolder("FetchStreamWorkerHolder",
WorkerHolder::Behavior::AllowIdleShutdownStart)
, mStream(aStream)
, mWasNotified(false)
{}

View File

@ -24,7 +24,8 @@ class FetchStreamReaderWorkerHolder final : public WorkerHolder
{
public:
explicit FetchStreamReaderWorkerHolder(FetchStreamReader* aReader)
: WorkerHolder(WorkerHolder::Behavior::AllowIdleShutdownStart)
: WorkerHolder("FetchStreamReaderWorkerHolder",
WorkerHolder::Behavior::AllowIdleShutdownStart)
, mReader(aReader)
, mWasNotified(false)
{}

View File

@ -274,7 +274,8 @@ class WorkerStreamOwner final : public WorkerHolder
public:
explicit WorkerStreamOwner(nsIAsyncInputStream* aStream)
: WorkerHolder(WorkerHolder::Behavior::AllowIdleShutdownStart)
: WorkerHolder("WorkerStreamOwner",
WorkerHolder::Behavior::AllowIdleShutdownStart)
, mStream(aStream)
{}

View File

@ -103,6 +103,7 @@ FileReader::RootResultArrayBuffer()
FileReader::FileReader(nsIGlobalObject* aGlobal,
WorkerPrivate* aWorkerPrivate)
: DOMEventTargetHelper(aGlobal)
, WorkerHolder("FileReader")
, mFileData(nullptr)
, mDataLen(0)
, mDataFormat(FILE_AS_BINARY)

View File

@ -364,7 +364,7 @@ MutableBlobStorage::~MutableBlobStorage()
if (mFD) {
RefPtr<Runnable> runnable = new CloseFileRunnable(mFD);
DispatchToIOThread(runnable.forget());
Unused << DispatchToIOThread(runnable.forget());
}
if (mTaskQueue) {
@ -408,7 +408,10 @@ MutableBlobStorage::GetBlobWhenReady(nsISupports* aParent,
// This Runnable will also close the FD on the I/O thread.
RefPtr<Runnable> runnable =
new LastRunnable(this, aParent, aContentType, aCallback);
DispatchToIOThread(runnable.forget());
// If the dispatching fails, we are shutting down and it's fine to do not
// run the callback.
Unused << DispatchToIOThread(runnable.forget());
return;
}
@ -475,7 +478,10 @@ MutableBlobStorage::Append(const void* aData, uint32_t aLength)
return NS_ERROR_OUT_OF_MEMORY;
}
DispatchToIOThread(runnable.forget());
nsresult rv = DispatchToIOThread(runnable.forget());
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
mDataLen += aLength;
return NS_OK;
@ -581,7 +587,10 @@ MutableBlobStorage::TemporaryFileCreated(PRFileDesc* aFD)
// callback, we need just to close the file descriptor in the correct thread.
if (mStorageState == eClosed && !mPendingCallback) {
RefPtr<Runnable> runnable = new CloseFileRunnable(aFD);
DispatchToIOThread(runnable.forget());
// If this dispatching fails, CloseFileRunnable will close the FD in the
// DTOR on the current thread.
Unused << DispatchToIOThread(runnable.forget());
// Let's inform the parent that we have nothing else to do.
mActor->SendOperationDone(false, EmptyCString());
@ -605,7 +614,11 @@ MutableBlobStorage::TemporaryFileCreated(PRFileDesc* aFD)
mData = nullptr;
DispatchToIOThread(runnable.forget());
nsresult rv = DispatchToIOThread(runnable.forget());
if (NS_WARN_IF(NS_FAILED(rv))) {
// Shutting down, we cannot continue.
return;
}
// If we are closed, it means that GetBlobWhenReady() has been called when we
// were already waiting for a temporary file-descriptor. Finally we are here,
@ -618,7 +631,7 @@ MutableBlobStorage::TemporaryFileCreated(PRFileDesc* aFD)
RefPtr<Runnable> runnable =
new LastRunnable(this, mPendingParent, mPendingContentType,
mPendingCallback);
DispatchToIOThread(runnable.forget());
Unused << DispatchToIOThread(runnable.forget());
mPendingParent = nullptr;
mPendingCallback = nullptr;
@ -651,7 +664,7 @@ MutableBlobStorage::ErrorPropagated(nsresult aRv)
}
}
void
nsresult
MutableBlobStorage::DispatchToIOThread(already_AddRefed<nsIRunnable> aRunnable)
{
if (!mTaskQueue) {
@ -663,7 +676,12 @@ MutableBlobStorage::DispatchToIOThread(already_AddRefed<nsIRunnable> aRunnable)
}
nsCOMPtr<nsIRunnable> runnable(aRunnable);
mTaskQueue->Dispatch(runnable.forget());
nsresult rv = mTaskQueue->Dispatch(runnable.forget());
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return NS_OK;
}
size_t

View File

@ -89,7 +89,8 @@ private:
bool MaybeCreateTemporaryFile();
void DispatchToIOThread(already_AddRefed<nsIRunnable> aRunnable);
MOZ_MUST_USE nsresult
DispatchToIOThread(already_AddRefed<nsIRunnable> aRunnable);
// All these variables are touched on the main thread only.

View File

@ -95,6 +95,10 @@ private:
class IPCBlobInputStreamWorkerHolder final : public WorkerHolder
{
public:
IPCBlobInputStreamWorkerHolder()
: WorkerHolder("IPCBlobInputStreamWorkerHolder")
{}
bool Notify(Status aStatus) override
{
// We must keep the worker alive until the migration is completed.

View File

@ -428,7 +428,8 @@ class IDBOpenDBRequest::WorkerHolder final
public:
explicit
WorkerHolder(WorkerPrivate* aWorkerPrivate)
: mWorkerPrivate(aWorkerPrivate)
: mozilla::dom::workers::WorkerHolder("IDBOpenDBRequest::WorkerHolder")
, mWorkerPrivate(aWorkerPrivate)
#ifdef DEBUG
, mWorkerPrivateDEBUG(aWorkerPrivate)
#endif

View File

@ -47,7 +47,8 @@ class IDBTransaction::WorkerHolder final
public:
WorkerHolder(WorkerPrivate* aWorkerPrivate, IDBTransaction* aTransaction)
: mWorkerPrivate(aWorkerPrivate)
: mozilla::dom::workers::WorkerHolder("IDBTransaction::WorkerHolder")
, mWorkerPrivate(aWorkerPrivate)
, mTransaction(aTransaction)
{
MOZ_ASSERT(aWorkerPrivate);

View File

@ -198,12 +198,6 @@ interface nsIDOMEvent : nsISupports
*/
readonly attribute nsIDOMEventTarget explicitOriginalTarget;
/**
* @deprecated Use nsIDOMEvent::defaultPrevented.
* To be removed in bug 691151.
*/
boolean getPreventDefault();
readonly attribute boolean isTrusted;
attribute boolean cancelBubble;

View File

@ -158,8 +158,6 @@ PrefixedFullscreenAPIWarning=Prefixed Fullscreen API is deprecated. Please use u
NodeIteratorDetachWarning=Calling detach() on a NodeIterator no longer has an effect.
# LOCALIZATION NOTE: Do not translate "LenientThis" and "this"
LenientThisWarning=Ignoring get or set of property that has [LenientThis] because the “this” object is incorrect.
# LOCALIZATION NOTE: Do not translate "getPreventDefault" or "defaultPrevented".
GetPreventDefaultWarning=Use of getPreventDefault() is deprecated. Use defaultPrevented instead.
# LOCALIZATION NOTE: Do not translate "getUserData", "setUserData", "WeakMap", or "element.dataset".
GetSetUserDataWarning=Use of getUserData() or setUserData() is deprecated. Use WeakMap or element.dataset instead.
# LOCALIZATION NOTE: Do not translate "mozGetAsFile" or "toBlob"

View File

@ -25,6 +25,7 @@
#include "mozilla/dom/VideoTrack.h"
#include "mozilla/dom/VideoTrackList.h"
#include "mozilla/layers/ShadowLayers.h"
#include "mozilla/Unused.h"
#include "nsComponentManagerUtils.h"
#include "nsContentUtils.h"
#include "nsError.h"
@ -1099,8 +1100,7 @@ MediaDecoder::NotifyCompositor()
mReader,
&MediaFormatReader::UpdateCompositor,
knowsCompositor.forget());
mReader->OwnerThread()->Dispatch(r.forget(),
AbstractThread::DontAssertDispatchSuccess);
Unused << mReader->OwnerThread()->Dispatch(r.forget());
}
}
@ -1380,10 +1380,13 @@ MediaDecoder::NotifyDataArrivedInternal()
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_DIAGNOSTIC_ASSERT(!IsShutdown());
mReader->OwnerThread()->Dispatch(
NewRunnableMethod("MediaFormatReader::NotifyDataArrived",
mReader.get(),
&MediaFormatReader::NotifyDataArrived));
nsresult rv =
mReader->OwnerThread()->Dispatch(
NewRunnableMethod("MediaFormatReader::NotifyDataArrived",
mReader.get(),
&MediaFormatReader::NotifyDataArrived));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void

View File

@ -1500,7 +1500,8 @@ public:
// seek is actually performed, the ThenValue of SeekPromise has already
// been set so that it won't be postponed.
RefPtr<Runnable> r = mAsyncSeekTask = new AysncNextFrameSeekTask(this);
OwnerThread()->Dispatch(r.forget());
nsresult rv = OwnerThread()->Dispatch(r.forget());
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
private:
@ -3497,10 +3498,12 @@ MediaDecoderStateMachine::ScheduleStateMachine()
}
mDispatchedStateMachine = true;
OwnerThread()->Dispatch(
NewRunnableMethod("MediaDecoderStateMachine::RunStateMachine",
this,
&MediaDecoderStateMachine::RunStateMachine));
nsresult rv =
OwnerThread()->Dispatch(
NewRunnableMethod("MediaDecoderStateMachine::RunStateMachine",
this,
&MediaDecoderStateMachine::RunStateMachine));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void
@ -3730,12 +3733,12 @@ MediaDecoderStateMachine::RequestDebugInfo()
using PromiseType = MediaDecoder::DebugInfoPromise;
RefPtr<PromiseType::Private> p = new PromiseType::Private(__func__);
RefPtr<MediaDecoderStateMachine> self = this;
OwnerThread()->Dispatch(
nsresult rv = OwnerThread()->Dispatch(
NS_NewRunnableFunction(
"MediaDecoderStateMachine::RequestDebugInfo",
[self, p]() { p->Resolve(self->GetDebugInfo(), __func__); }),
AbstractThread::AssertDispatchSuccess,
AbstractThread::TailDispatch);
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
return p.forget();
}
@ -3750,7 +3753,8 @@ void MediaDecoderStateMachine::AddOutputStream(ProcessedMediaStream* aStream,
this,
&MediaDecoderStateMachine::SetAudioCaptured,
true);
OwnerThread()->Dispatch(r.forget());
nsresult rv = OwnerThread()->Dispatch(r.forget());
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void MediaDecoderStateMachine::RemoveOutputStream(MediaStream* aStream)
@ -3764,7 +3768,8 @@ void MediaDecoderStateMachine::RemoveOutputStream(MediaStream* aStream)
this,
&MediaDecoderStateMachine::SetAudioCaptured,
false);
OwnerThread()->Dispatch(r.forget());
nsresult rv = OwnerThread()->Dispatch(r.forget());
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
}

View File

@ -204,7 +204,8 @@ public:
? aEndTime
: media::TimeUnit::Invalid();
});
OwnerThread()->Dispatch(r.forget());
nsresult rv = OwnerThread()->Dispatch(r.forget());
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void DispatchCanPlayThrough(bool aCanPlayThrough)

View File

@ -13,6 +13,7 @@
#include "mozilla/Mutex.h"
#include "mozilla/Tuple.h"
#include "mozilla/TypeTraits.h"
#include "mozilla/Unused.h"
#include "nsISupportsImpl.h"
#include "nsTArray.h"
@ -109,7 +110,7 @@ template <>
struct EventTarget<AbstractThread> {
static void
Dispatch(AbstractThread* aTarget, already_AddRefed<nsIRunnable> aTask) {
aTarget->Dispatch(Move(aTask), AbstractThread::DontAssertDispatchSuccess);
Unused << aTarget->Dispatch(Move(aTask));
}
};

View File

@ -1025,9 +1025,11 @@ public:
void Reset() override
{
RefPtr<Wrapper> self = this;
mTaskQueue->Dispatch(
NS_NewRunnableFunction("MediaFormatReader::DemuxerProxy::Wrapper::Reset",
[self]() { self->mTrackDemuxer->Reset(); }));
nsresult rv =
mTaskQueue->Dispatch(
NS_NewRunnableFunction("MediaFormatReader::DemuxerProxy::Wrapper::Reset",
[self]() { self->mTrackDemuxer->Reset(); }));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
nsresult GetNextRandomAccessPoint(TimeUnit* aTime) override
@ -1084,9 +1086,11 @@ private:
~Wrapper()
{
RefPtr<MediaTrackDemuxer> trackDemuxer = mTrackDemuxer.forget();
mTaskQueue->Dispatch(NS_NewRunnableFunction(
"MediaFormatReader::DemuxerProxy::Wrapper::~Wrapper",
[trackDemuxer]() { trackDemuxer->BreakCycles(); }));
nsresult rv =
mTaskQueue->Dispatch(NS_NewRunnableFunction(
"MediaFormatReader::DemuxerProxy::Wrapper::~Wrapper",
[trackDemuxer]() { trackDemuxer->BreakCycles(); }));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void UpdateRandomAccessPoint()
@ -1994,7 +1998,8 @@ MediaFormatReader::ScheduleUpdate(TrackType aTrack)
decoder.mUpdateScheduled = true;
RefPtr<nsIRunnable> task(NewRunnableMethod<TrackType>(
"MediaFormatReader::Update", this, &MediaFormatReader::Update, aTrack));
OwnerThread()->Dispatch(task.forget());
nsresult rv = OwnerThread()->Dispatch(task.forget());
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
bool
@ -2893,8 +2898,10 @@ MediaFormatReader::ScheduleSeek()
return;
}
mSeekScheduled = true;
OwnerThread()->Dispatch(NewRunnableMethod(
"MediaFormatReader::AttemptSeek", this, &MediaFormatReader::AttemptSeek));
nsresult rv =
OwnerThread()->Dispatch(NewRunnableMethod(
"MediaFormatReader::AttemptSeek", this, &MediaFormatReader::AttemptSeek));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void

View File

@ -962,10 +962,12 @@ private:
}
mEncoderListener = MakeAndAddRef<EncoderListener>(mEncoderThread, this);
mEncoderThread->Dispatch(
NewRunnableMethod<RefPtr<EncoderListener>>(
"mozilla::MediaEncoder::RegisterListener",
mEncoder, &MediaEncoder::RegisterListener, mEncoderListener));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod<RefPtr<EncoderListener>>(
"mozilla::MediaEncoder::RegisterListener",
mEncoder, &MediaEncoder::RegisterListener, mEncoderListener));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
if (mRecorder->mAudioNode) {
mEncoder->ConnectAudioNode(mRecorder->mAudioNode,

View File

@ -135,7 +135,8 @@ ReaderProxy::ReleaseResources()
NewRunnableMethod("MediaFormatReader::ReleaseResources",
mReader,
&MediaFormatReader::ReleaseResources);
mReader->OwnerThread()->Dispatch(r.forget());
nsresult rv = mReader->OwnerThread()->Dispatch(r.forget());
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void
@ -147,7 +148,8 @@ ReaderProxy::ResetDecode(TrackSet aTracks)
mReader,
&MediaFormatReader::ResetDecode,
aTracks);
mReader->OwnerThread()->Dispatch(r.forget());
nsresult rv = mReader->OwnerThread()->Dispatch(r.forget());
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
RefPtr<ShutdownPromise>
@ -193,7 +195,8 @@ ReaderProxy::SetVideoBlankDecode(bool aIsBlankDecode)
mReader,
&MediaFormatReader::SetVideoNullDecode,
aIsBlankDecode);
mReader->OwnerThread()->Dispatch(r.forget());
nsresult rv = mReader->OwnerThread()->Dispatch(r.forget());
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void
@ -215,7 +218,8 @@ ReaderProxy::SetCanonicalDuration(
mDuration.Connect(canonical);
mWatchManager.Watch(mDuration, &ReaderProxy::UpdateDuration);
});
mReader->OwnerThread()->Dispatch(r.forget());
nsresult rv = mReader->OwnerThread()->Dispatch(r.forget());
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
} // namespace mozilla

View File

@ -21,6 +21,7 @@
#include "mozilla/Preferences.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/TaskQueue.h"
#include "mozilla/Unused.h"
#include "nsIPrincipal.h"
#include "nsMimeTypes.h"
#include "OggWriter.h"
@ -96,31 +97,37 @@ public:
}
if (!mInitialized) {
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::AudioTrackEncoder::SetStartOffset",
mEncoder, &AudioTrackEncoder::SetStartOffset, aTrackOffset));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::AudioTrackEncoder::SetStartOffset",
mEncoder, &AudioTrackEncoder::SetStartOffset, aTrackOffset));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
mInitialized = true;
}
if (mDirectConnected) {
if (aQueuedMedia.IsNull()) {
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::AudioTrackEncoder::AdvanceBlockedInput",
mEncoder, &AudioTrackEncoder::AdvanceBlockedInput,
aQueuedMedia.GetDuration()));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::AudioTrackEncoder::AdvanceBlockedInput",
mEncoder, &AudioTrackEncoder::AdvanceBlockedInput,
aQueuedMedia.GetDuration()));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
return;
}
} else {
NotifyRealtimeTrackData(aGraph, aTrackOffset, aQueuedMedia);
}
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::AudioTrackEncoder::AdvanceCurrentTime",
mEncoder, &AudioTrackEncoder::AdvanceCurrentTime,
aQueuedMedia.GetDuration()));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::AudioTrackEncoder::AdvanceCurrentTime",
mEncoder, &AudioTrackEncoder::AdvanceCurrentTime,
aQueuedMedia.GetDuration()));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void NotifyRealtimeTrackData(MediaStreamGraph* aGraph,
@ -139,10 +146,12 @@ public:
AudioSegment copy;
copy.AppendSlice(audio, 0, audio.GetDuration());
mEncoderThread->Dispatch(
NewRunnableMethod<StoreCopyPassByRRef<AudioSegment>>(
"mozilla::AudioTrackEncoder::AppendAudioSegment",
mEncoder, &AudioTrackEncoder::AppendAudioSegment, Move(copy)));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod<StoreCopyPassByRRef<AudioSegment>>(
"mozilla::AudioTrackEncoder::AppendAudioSegment",
mEncoder, &AudioTrackEncoder::AppendAudioSegment, Move(copy)));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void NotifyEnded() override
@ -154,17 +163,21 @@ public:
return;
}
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::AudioTrackEncoder::NotifyEndOfStream",
mEncoder, &AudioTrackEncoder::NotifyEndOfStream));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::AudioTrackEncoder::NotifyEndOfStream",
mEncoder, &AudioTrackEncoder::NotifyEndOfStream));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void NotifyRemoved() override
{
if (!mShutdown) {
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::AudioTrackEncoder::NotifyEndOfStream",
mEncoder, &AudioTrackEncoder::NotifyEndOfStream));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::AudioTrackEncoder::NotifyEndOfStream",
mEncoder, &AudioTrackEncoder::NotifyEndOfStream));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
mRemoved = true;
@ -238,27 +251,33 @@ public:
}
if (!mInitialized) {
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::VideoTrackEncoder::SetStartOffset",
mEncoder, &VideoTrackEncoder::SetStartOffset, aTrackOffset));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::VideoTrackEncoder::SetStartOffset",
mEncoder, &VideoTrackEncoder::SetStartOffset, aTrackOffset));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
mInitialized = true;
}
if (aQueuedMedia.IsNull()) {
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::VideoTrackEncoder::AdvanceBlockedInput",
mEncoder, &VideoTrackEncoder::AdvanceBlockedInput,
aQueuedMedia.GetDuration()));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::VideoTrackEncoder::AdvanceBlockedInput",
mEncoder, &VideoTrackEncoder::AdvanceBlockedInput,
aQueuedMedia.GetDuration()));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
return;
}
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::VideoTrackEncoder::AdvanceCurrentTime",
mEncoder, &VideoTrackEncoder::AdvanceCurrentTime,
aQueuedMedia.GetDuration()));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod<StreamTime>(
"mozilla::VideoTrackEncoder::AdvanceCurrentTime",
mEncoder, &VideoTrackEncoder::AdvanceCurrentTime,
aQueuedMedia.GetDuration()));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void SetCurrentFrames(const VideoSegment& aMedia) override
@ -273,10 +292,12 @@ public:
VideoSegment copy;
copy.AppendSlice(aMedia, 0, aMedia.GetDuration());
mEncoderThread->Dispatch(
NewRunnableMethod<StoreCopyPassByRRef<VideoSegment>>(
"mozilla::VideoTrackEncoder::AppendVideoSegment",
mEncoder, &VideoTrackEncoder::AppendVideoSegment, Move(copy)));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod<StoreCopyPassByRRef<VideoSegment>>(
"mozilla::VideoTrackEncoder::AppendVideoSegment",
mEncoder, &VideoTrackEncoder::AppendVideoSegment, Move(copy)));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void ClearFrames() override {}
@ -290,17 +311,21 @@ public:
return;
}
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::VideoTrackEncoder::NotifyEndOfStream",
mEncoder, &VideoTrackEncoder::NotifyEndOfStream));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::VideoTrackEncoder::NotifyEndOfStream",
mEncoder, &VideoTrackEncoder::NotifyEndOfStream));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void NotifyRemoved() override
{
if (!mShutdown) {
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::VideoTrackEncoder::NotifyEndOfStream",
mEncoder, &VideoTrackEncoder::NotifyEndOfStream));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::VideoTrackEncoder::NotifyEndOfStream",
mEncoder, &VideoTrackEncoder::NotifyEndOfStream));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
mRemoved = true;
@ -345,9 +370,11 @@ public:
return;
}
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::MediaEncoder::NotifyInitialized",
mEncoder, &MediaEncoder::NotifyInitialized));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::MediaEncoder::NotifyInitialized",
mEncoder, &MediaEncoder::NotifyInitialized));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void DataAvailable(TrackEncoder* aTrackEncoder) override
@ -363,9 +390,11 @@ public:
return;
}
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::MediaEncoder::EncoderListener::DataAvailableImpl",
this, &EncoderListener::DataAvailableImpl));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::MediaEncoder::EncoderListener::DataAvailableImpl",
this, &EncoderListener::DataAvailableImpl));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
mPendingDataAvailable = true;
}
@ -390,9 +419,11 @@ public:
return;
}
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::MediaEncoder::SetError",
mEncoder, &MediaEncoder::SetError));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::MediaEncoder::SetError",
mEncoder, &MediaEncoder::SetError));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
protected:
@ -423,18 +454,24 @@ MediaEncoder::MediaEncoder(TaskQueue* aEncoderThread,
if (mAudioEncoder) {
mAudioListener =
MakeAndAddRef<AudioTrackListener>(mAudioEncoder, mEncoderThread);
mEncoderThread->Dispatch(
NewRunnableMethod<RefPtr<EncoderListener>>(
"mozilla::AudioTrackEncoder::RegisterListener",
mAudioEncoder, &AudioTrackEncoder::RegisterListener, mEncoderListener));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod<RefPtr<EncoderListener>>(
"mozilla::AudioTrackEncoder::RegisterListener",
mAudioEncoder, &AudioTrackEncoder::RegisterListener,
mEncoderListener));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
if (mVideoEncoder) {
mVideoListener =
MakeAndAddRef<VideoTrackListener>(mVideoEncoder, mEncoderThread);
mEncoderThread->Dispatch(
NewRunnableMethod<RefPtr<EncoderListener>>(
"mozilla::VideoTrackEncoder::RegisterListener",
mVideoEncoder, &VideoTrackEncoder::RegisterListener, mEncoderListener));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod<RefPtr<EncoderListener>>(
"mozilla::VideoTrackEncoder::RegisterListener",
mVideoEncoder, &VideoTrackEncoder::RegisterListener,
mEncoderListener));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
}
@ -448,15 +485,17 @@ MediaEncoder::Suspend(TimeStamp aTime)
{
auto& ae = mAudioEncoder;
auto& ve = mVideoEncoder;
mEncoderThread->Dispatch(NewRunnableFrom([ae, ve, aTime]() {
if (ae) {
ae->Suspend(aTime);
}
if (ve) {
ve->Suspend(aTime);
}
return NS_OK;
}));
nsresult rv =
mEncoderThread->Dispatch(NewRunnableFrom([ae, ve, aTime]() {
if (ae) {
ae->Suspend(aTime);
}
if (ve) {
ve->Suspend(aTime);
}
return NS_OK;
}));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void
@ -464,15 +503,17 @@ MediaEncoder::Resume(TimeStamp aTime)
{
auto& ae = mAudioEncoder;
auto& ve = mVideoEncoder;
mEncoderThread->Dispatch(NewRunnableFrom([ae, ve, aTime]() {
if (ae) {
ae->Resume(aTime);
}
if (ve) {
ve->Resume(aTime);
}
return NS_OK;
}));
nsresult rv =
mEncoderThread->Dispatch(NewRunnableFrom([ae, ve, aTime]() {
if (ae) {
ae->Resume(aTime);
}
if (ve) {
ve->Resume(aTime);
}
return NS_OK;
}));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
void
@ -837,9 +878,11 @@ MediaEncoder::Shutdown()
for (auto& l : listeners) {
// We dispatch here since this method is typically called from
// a DataAvailable() handler.
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::MediaEncoderListener::Shutdown",
l, &MediaEncoderListener::Shutdown));
nsresult rv =
mEncoderThread->Dispatch(
NewRunnableMethod("mozilla::MediaEncoderListener::Shutdown",
l, &MediaEncoderListener::Shutdown));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
}
@ -917,18 +960,20 @@ MediaEncoder::Cancel()
MOZ_ASSERT(NS_IsMainThread());
RefPtr<MediaEncoder> self = this;
mEncoderThread->Dispatch(NewRunnableFrom([self]() mutable {
self->mCanceled = true;
nsresult rv =
mEncoderThread->Dispatch(NewRunnableFrom([self]() mutable {
self->mCanceled = true;
if (self->mAudioEncoder) {
self->mAudioEncoder->Cancel();
}
if (self->mVideoEncoder) {
self->mVideoEncoder->Cancel();
}
self->Shutdown();
return NS_OK;
}));
if (self->mAudioEncoder) {
self->mAudioEncoder->Cancel();
}
if (self->mVideoEncoder) {
self->mVideoEncoder->Cancel();
}
self->Shutdown();
return NS_OK;
}));
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
}
bool

Some files were not shown because too many files have changed in this diff Show More