Merge latest green fx-team changeset and mozilla-central

This commit is contained in:
Ed Morley 2013-09-06 16:19:32 +01:00
commit 870b708409
325 changed files with 6004 additions and 3353 deletions

View File

@ -18,4 +18,4 @@
# Modifying this file will now automatically clobber the buildbot machines \o/
#
Bug 908977 - Generate XPIDL headers directly into dist/include
Bug 912832 - Inverse tiers and subtiers for build traversal

View File

@ -52,10 +52,10 @@ ifndef MOZ_PROFILE_USE
#
# We need to explicitly put backend.RecursiveMakeBackend.built here
# otherwise the rule in rules.mk doesn't run early enough.
default all export libs tools:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built
libs export tools:: CLOBBER $(topsrcdir)/configure config.status backend.RecursiveMakeBackend.built
$(call SUBMAKE,backend.RecursiveMakeBackend.built,js/src,1)
default all export::
export::
$(call py_action,purge_manifests,-d _build_manifests/purge .)
endif
@ -79,7 +79,7 @@ config.status: $(topsrcdir)/configure
@echo "but your build might not succeed."
@exit 1
default all export::
export::
$(RM) -r $(DIST)/sdk
ifdef ENABLE_TESTS
@ -87,20 +87,13 @@ ifdef ENABLE_TESTS
include $(topsrcdir)/testing/testsuite-targets.mk
endif
# Hacky way for precompile tier to bypass default tier traversal mechanism.
TIER_precompile_CUSTOM := 1
default all export::
export::
$(call py_action,process_install_manifest,$(DIST)/include _build_manifests/install/dist_include js/src/_build_manifests/install/dist_include)
include $(topsrcdir)/config/rules.mk
default all::
$(call BUILDSTATUS,TIERS $(TIERS))
$(foreach tier,$(TIERS),$(call SUBMAKE,tier_$(tier)))
$(call BUILDSTATUS,TIERS export compile libs tools)
include $(topsrcdir)/config/makefiles/tiers.mk
$(foreach tier,$(TIERS),$(eval $(call CREATE_TIER_RULE,$(tier))))
include $(topsrcdir)/config/rules.mk
distclean::
$(RM) $(DIST_GARBAGE)

View File

@ -3,10 +3,3 @@
# 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/.
MODULE = 'alerts'
CPP_SOURCES += [
'nsAccessibilityFactory.cpp',
]

View File

@ -3,6 +3,3 @@
# 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/.
MODULE = 'alerts'

View File

@ -892,6 +892,8 @@ function getDocumentEncoder(element) {
.createInstance(Ci.nsIDocumentEncoder);
let flags = Ci.nsIDocumentEncoder.SkipInvisibleContent |
Ci.nsIDocumentEncoder.OutputRaw |
// Bug 902847. Don't trim trailing spaces of a line.
Ci.nsIDocumentEncoder.OutputDontRemoveLineEndingSpaces |
Ci.nsIDocumentEncoder.OutputLFLineBreak |
Ci.nsIDocumentEncoder.OutputNonTextContentAsPlaceholder;
encoder.init(element.ownerDocument, "text/plain", flags);

View File

@ -4,7 +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/. */
"use strict";
"use strict;"
const Cc = Components.classes;
const Ci = Components.interfaces;
@ -21,65 +21,47 @@ XPCOMUtils.defineLazyGetter(this, "libcutils", function () {
});
#endif
// Once Bug 731746 - Allow chrome JS object to implement nsIDOMEventTarget
// is resolved this helper could be removed.
var SettingsListener = {
// Timer to remove the lock.
_timer: null,
_callbacks: {},
// lock stores here
_lock: null,
/**
* getSettingsLock: create a lock or retrieve one that we saved.
* mozSettings.createLock() is expensive and lock should be reused
* whenever possible.
*/
getSettingsLock: function sl_getSettingsLock() {
// Each time there is a getSettingsLock call, we postpone the removal.
clearTimeout(this._timer);
this._timer = setTimeout((function() {
this._lock = null;
}).bind(this), 0);
// If there is a lock present we return that.
if (this._lock) {
return this._lock;
init: function sl_init() {
if ('mozSettings' in navigator && navigator.mozSettings) {
navigator.mozSettings.onsettingchange = this.onchange.bind(this);
}
},
// If there isn't we create a new one.
let settings = window.navigator.mozSettings;
return (this._lock = settings.createLock());
onchange: function sl_onchange(evt) {
var callback = this._callbacks[evt.settingName];
if (callback) {
callback(evt.settingValue);
}
},
observe: function sl_observe(name, defaultValue, callback) {
let settings = window.navigator.mozSettings;
let req;
try {
req = this.getSettingsLock().get(name);
} catch (e) {
// It is possible (but rare) for getSettingsLock() to return
// a SettingsLock object that is no longer valid.
// Until https://bugzilla.mozilla.org/show_bug.cgi?id=793239
// is fixed, we just catch the resulting exception and try
// again with a fresh lock
console.warn('Stale lock in settings.js.',
'See https://bugzilla.mozilla.org/show_bug.cgi?id=793239');
this._lock = null;
req = this.getSettingsLock().get(name);
var settings = window.navigator.mozSettings;
if (!settings) {
window.setTimeout(function() { callback(defaultValue); });
return;
}
if (!callback || typeof callback !== 'function') {
throw new Error('Callback is not a function');
}
var req = settings.createLock().get(name);
req.addEventListener('success', (function onsuccess() {
callback(typeof(req.result[name]) != 'undefined' ?
req.result[name] : defaultValue);
}));
settings.addObserver(name, function settingChanged(evt) {
callback(evt.settingValue);
});
this._callbacks[name] = callback;
}
};
SettingsListener.init();
// =================== Console ======================
SettingsListener.observe('debug.console.enabled', true, function(value) {
@ -446,6 +428,8 @@ SettingsListener.observe('app.reportCrashes', 'ask', function(value) {
} else {
Services.prefs.clearUserPref('app.reportCrashes');
}
// This preference is consulted during startup.
Services.prefs.savePrefFile(null);
});
// ================ Updates ================

View File

@ -1,4 +1,4 @@
{
"revision": "1bb5a08dd1a7b974168dfd7f03bb1246c592d304",
"revision": "3a11e24a45501f1fcad106ef588fcc7262722644",
"repo_path": "/integration/gaia-central"
}

View File

@ -164,7 +164,6 @@
@BINPATH@/components/dom_base.xpt
@BINPATH@/components/dom_system.xpt
#ifdef MOZ_B2G_RIL
@BINPATH@/components/dom_telephony.xpt
@BINPATH@/components/dom_voicemail.xpt
@BINPATH@/components/dom_wifi.xpt
@BINPATH@/components/dom_system_gonk.xpt
@ -203,6 +202,7 @@
@BINPATH@/components/dom_mobilemessage.xpt
@BINPATH@/components/dom_storage.xpt
@BINPATH@/components/dom_stylesheets.xpt
@BINPATH@/components/dom_telephony.xpt
@BINPATH@/components/dom_threads.xpt
@BINPATH@/components/dom_traversal.xpt
@BINPATH@/components/dom_views.xpt
@ -460,6 +460,8 @@
@BINPATH@/components/RadioInterfaceLayer.js
@BINPATH@/components/MmsService.manifest
@BINPATH@/components/MmsService.js
@BINPATH@/components/SmsService.manifest
@BINPATH@/components/SmsService.js
@BINPATH@/components/RILContentHelper.js
@BINPATH@/components/MobileMessageDatabaseService.manifest
@BINPATH@/components/MobileMessageDatabaseService.js
@ -471,6 +473,8 @@
@BINPATH@/components/NetworkStatsManager.manifest
@BINPATH@/components/NetworkInterfaceListService.manifest
@BINPATH@/components/NetworkInterfaceListService.js
@BINPATH@/components/TelephonyProvider.manifest
@BINPATH@/components/TelephonyProvider.js
#endif
#ifdef MOZ_ENABLE_DBUS
@BINPATH@/components/@DLL_PREFIX@dbusservice@DLL_SUFFIX@

View File

@ -6606,6 +6606,11 @@ var gIdentityHandler = {
label: gNavigatorBundle.getString("mixedContentBlocked.unblock.label"),
accessKey: gNavigatorBundle.getString("mixedContentBlocked.unblock.accesskey"),
callback: function() {
// Use telemetry to measure how often unblocking happens
const kMIXED_CONTENT_UNBLOCK_EVENT = 2;
let histogram =
Services.telemetry.getHistogramById("MIXED_CONTENT_UNBLOCK_COUNTER");
histogram.add(kMIXED_CONTENT_UNBLOCK_EVENT);
// Reload the page with the content unblocked
BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT);
}

View File

@ -4701,6 +4701,7 @@ let TabStateCacheTelemetry = {
// Avoid double initialization
return;
}
this._initialized = true;
Services.obs.addObserver(this, "profile-before-change", false);
},

View File

@ -176,7 +176,6 @@
@BINPATH@/components/dom_base.xpt
@BINPATH@/components/dom_system.xpt
#ifdef MOZ_B2G_RIL
@BINPATH@/components/dom_telephony.xpt
@BINPATH@/components/dom_voicemail.xpt
@BINPATH@/components/dom_wifi.xpt
@BINPATH@/components/dom_system_gonk.xpt
@ -212,6 +211,7 @@
@BINPATH@/components/dom_mobilemessage.xpt
@BINPATH@/components/dom_storage.xpt
@BINPATH@/components/dom_stylesheets.xpt
@BINPATH@/components/dom_telephony.xpt
@BINPATH@/components/dom_traversal.xpt
#ifdef MOZ_WEBSPEECH
@BINPATH@/components/dom_webspeechrecognition.xpt
@ -446,6 +446,8 @@
@BINPATH@/components/RadioInterfaceLayer.js
@BINPATH@/components/MmsService.manifest
@BINPATH@/components/MmsService.js
@BINPATH@/components/SmsService.manifest
@BINPATH@/components/SmsService.js
@BINPATH@/components/RILContentHelper.js
@BINPATH@/components/MobileMessageDatabaseService.manifest
@BINPATH@/components/MobileMessageDatabaseService.js

View File

@ -228,19 +228,16 @@ if test "$OS_TARGET" = "Android" -a -z "$gonkdir"; then
if test -n "$MOZ_ANDROID_LIBSTDCXX" ; then
if test -e "$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/libs/$ANDROID_CPU_ARCH/libgnustl_static.a"; then
# android-ndk-r8b
STLPORT_LDFLAGS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/libs/$ANDROID_CPU_ARCH/"
STLPORT_CPPFLAGS="-I$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/libs/$ANDROID_CPU_ARCH/include"
STLPORT_LIBS="-lgnustl_static"
STLPORT_LIBS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/libs/$ANDROID_CPU_ARCH/ -lgnustl_static"
STLPORT_CPPFLAGS="-I$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/libs/$ANDROID_CPU_ARCH/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/$android_gnu_compiler_version/include/backward"
elif test -e "$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/libgnustl_static.a"; then
# android-ndk-r7, android-ndk-r7b, android-ndk-r8
STLPORT_LDFLAGS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/"
STLPORT_LIBS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/ -lgnustl_static"
STLPORT_CPPFLAGS="-I$android_ndk/sources/cxx-stl/gnu-libstdc++/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/include"
STLPORT_LIBS="-lgnustl_static"
elif test -e "$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/libstdc++.a"; then
# android-ndk-r5c, android-ndk-r6, android-ndk-r6b
STLPORT_CPPFLAGS="-I$android_ndk/sources/cxx-stl/gnu-libstdc++/include -I$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/include"
STLPORT_LDFLAGS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/"
STLPORT_LIBS="-lstdc++"
STLPORT_LIBS="-L$android_ndk/sources/cxx-stl/gnu-libstdc++/libs/$ANDROID_CPU_ARCH/ -lstdc++"
else
AC_MSG_ERROR([Couldn't find path to gnu-libstdc++ in the android ndk])
fi

View File

@ -40,3 +40,12 @@ TESTFLAGS := -fsyntax-only -Xclang -verify \
$(TESTS): test-%: tests/%.cpp $(PLUGIN)
$(CXX) $(TESTFLAGS) $<
compile libs export tools: all
distclean clean:
rm -f $(OBJS) $(TESTS) $(PLUGIN)
check:
.PHONY: compile libs export tools distclean clean check

View File

@ -93,7 +93,7 @@ def parsecommandlineargs(args):
value=val, valueloc=Location('<command-line>', i, len(vname) + len(t)),
targetexp=None, source=data.Variables.SOURCE_COMMANDLINE))
else:
r.append(a)
r.append(data.stripdotslash(a))
return stmts, r, ' '.join(overrides)

View File

@ -0,0 +1,5 @@
all:
$(MAKE) -f $(TESTPATH)/cmd-stripdotslash.mk ./foo
./foo:
@echo TEST-PASS

View File

@ -13,10 +13,26 @@ import shutil
import subprocess
import sys
from distutils.version import StrictVersion
# Minimum version of Python required to build.
MINIMUM_PYTHON_VERSION = StrictVersion('2.7.3')
MINIMUM_PYTHON_MAJOR = 2
MINIMUM_PYTHON_MINOR = 7
UPGRADE_WINDOWS = '''
Please upgrade to the latest MozillaBuild development environments. See
https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Windows_Prerequisites
'''.lstrip()
UPGRADE_OTHER = '''
Run |mach bootstrap| to ensure your system is up to date.
If you still receive this error, your shell environment is likely detecting
another Python version. Ensure a modern Python can be found in the paths
defined by the $PATH environment variable and try again.
'''.lstrip()
class VirtualenvManager(object):
@ -343,13 +359,20 @@ class VirtualenvManager(object):
def verify_python_version(log_handle):
"""Ensure the current version of Python is sufficient."""
major, minor = sys.version_info[:2]
major, minor, micro = sys.version_info[:3]
our = StrictVersion('%d.%d.%d' % (major, minor, micro))
if major != MINIMUM_PYTHON_MAJOR or our < MINIMUM_PYTHON_VERSION:
log_handle.write('Python %s or greater (but not Python 3) is '
'required to build. ' % MINIMUM_PYTHON_VERSION)
log_handle.write('You are running Python %s.\n' % our)
if os.name in ('nt', 'ce'):
log_handle.write(UPGRADE_WINDOWS)
else:
log_handle.write(UPGRADE_OTHER)
if major != MINIMUM_PYTHON_MAJOR or minor < MINIMUM_PYTHON_MINOR:
log_handle.write('Python %d.%d or greater (but not Python 3) is '
'required to build. ' %
(MINIMUM_PYTHON_MAJOR, MINIMUM_PYTHON_MINOR))
log_handle.write('You are running Python %d.%d.\n' % (major, minor))
sys.exit(1)

View File

@ -120,6 +120,8 @@ endef
MOZCONFIG_CONTENT := $(subst ||,$(CR),$(subst || ,$(CR),$(shell _PYMAKE=$(.PYMAKE) $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) | sed 's/$$/||/')))
$(eval $(MOZCONFIG_CONTENT))
export FOUND_MOZCONFIG
# As '||' was used as a newline separator, it means it's not occurring in
# lines themselves. It can thus safely be used to replaces normal spaces,
# to then replace newlines with normal spaces. This allows to get a list

View File

@ -113,7 +113,7 @@ STL_WRAPPERS_SENTINEL = $(DIST)/stl_wrappers/sentinel
$(STL_WRAPPERS_SENTINEL): $(srcdir)/make-stl-wrappers.py $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers $(GLOBAL_DEPS)
$(PYTHON) $(srcdir)/make-stl-wrappers.py stl_wrappers $(stl_compiler) $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers
$(PYTHON) $(srcdir)/nsinstall.py stl_wrappers $(DIST)
$(PYTHON) $(srcdir)/nsinstall.py -t stl_wrappers $(DIST)
touch $(STL_WRAPPERS_SENTINEL)
export:: $(STL_WRAPPERS_SENTINEL)

View File

@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function
import os, re, string, sys
from mozbuild.util import FileAvoidWrite
def find_in_path(file, searchpath):
for dir in searchpath.split(os.pathsep):
@ -37,13 +38,10 @@ def main(outdir, compiler, template_file, header_list_file):
continue
path = header_path(header, compiler)
try:
f = open(os.path.join(outdir, header), 'w')
with FileAvoidWrite(os.path.join(outdir, header)) as f:
f.write(string.Template(template).substitute(HEADER=header,
HEADER_PATH=path,
NEW_HEADER_PATH=path_to_new))
finally:
f.close()
if __name__ == '__main__':

View File

@ -7,33 +7,18 @@
SUPPRESS_DEFAULT_RULES := 1
include $(topsrcdir)/config/rules.mk
# We don't print the build status messages unless we're in a top level build
# otherwise the output is unexpected and it confuses downstream parsers.
define make_subtier_dir
$(call BUILDSTATUS,SUBTIER_START precompile $(1))
+$(MAKE) -C $(2) $(3)
$(call BUILDSTATUS,SUBTIER_FINISH precompile $(1))
endef
default::
$(call BUILDSTATUS,TIER_START precompile IPDL WebIDL XPIDL)
+$(MAKE) export
$(call BUILDSTATUS,TIER_FINISH precompile)
export:: ipdl webidl xpidl
ipdl:
$(call make_subtier_dir,IPDL,$(DEPTH)/ipc/ipdl,ipdl)
$(call SUBMAKE,ipdl,$(DEPTH)/ipc/ipdl)
webidl:
$(call make_subtier_dir,WebIDL,$(DEPTH)/dom/bindings,webidl)
$(call SUBMAKE,webidl,$(DEPTH)/dom/bindings)
xpidl:
$(call BUILDSTATUS,SUBTIER_START precompile XPIDL)
+$(MAKE) -C $(DEPTH)/xpcom/idl-parser xpidl-parser
$(call SUBMAKE,xpidl-parser,$(DEPTH)/xpcom/idl-parser)
$(call py_action,process_install_manifest,$(DIST)/idl $(DEPTH)/_build_manifests/install/dist_idl)
+$(MAKE) -C $(DEPTH)/config/makefiles/xpidl xpidl
$(call BUILDSTATUS,SUBTIER_FINISH precompile XPIDL)
$(call SUBMAKE,xpidl,$(DEPTH)/config/makefiles/xpidl)

View File

@ -1,49 +0,0 @@
# -*- makefile -*-
# vim:set ts=8 sw=8 sts=8 noet:
#
# 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/.
# This file contains logic for tier traversal.
define CREATE_SUBTIER_RULE
$(2)_tier_$(1):
$$(call BUILDSTATUS,SUBTIER_START $(1) $(2) $$(tier_$(1)_dirs))
$$(foreach dir,$$(tier_$(1)_dirs),$$(call TIER_DIR_SUBMAKE,$(1),$(2),$$(dir),$(2)))
$$(call BUILDSTATUS,SUBTIER_FINISH $(1) $(2))
endef
# This function is called and evaluated to produce the rule to build the
# specified tier.
#
# Tiers are traditionally composed of directories that are invoked either
# once (so-called "static" directories) or 3 times with the export, libs, and
# tools sub-tiers.
#
# If the TIER_$(tier)_CUSTOM variable is defined, then these traditional
# tier rules are ignored and each directory in the tier is executed via a
# sub-make invocation (make -C).
define CREATE_TIER_RULE
tier_$(1)::
ifdef TIER_$(1)_CUSTOM
$$(foreach dir,$$($$@_dirs),$$(call SUBMAKE,,$$(dir)))
else
$(call BUILDSTATUS,TIER_START $(1) $(if $(tier_$(1)_staticdirs),static )$(if $(tier_$(1)_dirs),export libs tools))
ifneq (,$(tier_$(1)_staticdirs))
$(call BUILDSTATUS,SUBTIER_START $(1) static $$($$@_staticdirs))
$$(foreach dir,$$($$@_staticdirs),$$(call TIER_DIR_SUBMAKE,$(1),static,$$(dir),,1))
$(call BUILDSTATUS,SUBTIER_FINISH $(1) static)
endif
ifneq (,$(tier_$(1)_dirs))
$$(MAKE) export_$$@
$$(MAKE) libs_$$@
$$(MAKE) tools_$$@
endif
$(call BUILDSTATUS,TIER_FINISH $(1))
endif
$(foreach subtier,export libs tools,$(call CREATE_SUBTIER_RULE,$(1),$(subtier)))
endef

View File

@ -10,6 +10,19 @@ endif
# Tier traversal handling
#########################
ifdef TIERS
compile libs export tools::
$(call BUILDSTATUS,TIER_START $@ $(filter-out $(if $(filter export,$@),,precompile),$(TIERS)))
$(foreach tier,$(TIERS), $(if $(filter-out compile_precompile libs_precompile tools_precompile,$@_$(tier)), \
$(call BUILDSTATUS,SUBTIER_START $@ $(tier) $(if $(filter libs,$@),$(tier_$(tier)_staticdirs)) $(tier_$(tier)_dirs)) \
$(if $(filter libs,$@),$(foreach dir, $(tier_$(tier)_staticdirs), $(call TIER_DIR_SUBMAKE,$@,$(tier),$(dir),,1))) \
$(foreach dir, $(tier_$(tier)_dirs), $(call TIER_DIR_SUBMAKE,$@,$(tier),$(dir),$@)) \
$(call BUILDSTATUS,SUBTIER_FINISH $@ $(tier))))
$(call BUILDSTATUS,TIER_FINISH $@)
else
define CREATE_SUBTIER_TRAVERSAL_RULE
PARALLEL_DIRS_$(1) = $$(addsuffix _$(1),$$(PARALLEL_DIRS))
@ -28,10 +41,12 @@ endif
endef
$(foreach subtier,export libs tools,$(eval $(call CREATE_SUBTIER_TRAVERSAL_RULE,$(subtier))))
$(foreach subtier,export compile libs tools,$(eval $(call CREATE_SUBTIER_TRAVERSAL_RULE,$(subtier))))
export:: $(SUBMAKEFILES)
compile export:: $(SUBMAKEFILES)
$(LOOP_OVER_TOOL_DIRS)
tools:: $(SUBMAKEFILES)
$(foreach dir,$(TOOL_DIRS),$(call SUBMAKE,libs,$(dir)))
endif

View File

@ -436,7 +436,10 @@ endif
ifdef MACH
ifndef NO_BUILDSTATUS_MESSAGES
BUILDSTATUS=@echo "BUILDSTATUS $1"
define BUILDSTATUS
@echo "BUILDSTATUS $1"
endef
endif
endif
@ -458,7 +461,6 @@ $(call BUILDSTATUS,TIERDIR_FINISH $(1) $(2) $(3))
endef # Ths empty line is important.
ifneq (,$(strip $(DIRS)))
LOOP_OVER_DIRS = \
$(foreach dir,$(DIRS),$(call SUBMAKE,$@,$(dir)))
@ -688,12 +690,11 @@ SUBMAKEFILES += $(addsuffix /Makefile, $(DIRS) $(TOOL_DIRS) $(PARALLEL_DIRS))
# of something else. Makefiles which use this var *must* provide a sensible
# default rule before including rules.mk
ifndef SUPPRESS_DEFAULT_RULES
ifndef TIERS
default all::
$(MAKE) export
$(MAKE) compile
$(MAKE) libs
$(MAKE) tools
endif # TIERS
endif # SUPPRESS_DEFAULT_RULES
ifeq ($(findstring s,$(filter-out --%, $(MAKEFLAGS))),)
@ -730,6 +731,8 @@ GLOBAL_DEPS += Makefile.in
endif
##############################################
compile:: $(OBJS) $(HOST_OBJS)
include $(topsrcdir)/config/makefiles/target_libs.mk
##############################################

View File

@ -222,6 +222,11 @@ interface nsIDocumentEncoder : nsISupports
*/
const unsigned long OutputNonTextContentAsPlaceholder = (1 << 23);
/**
* Don't Strip ending spaces from a line (only for serializing to plaintext).
*/
const unsigned long OutputDontRemoveLineEndingSpaces = (1 << 24);
/**
* Initialize with a pointer to the document and the mime type.
* @param aDocument Document to encode.

View File

@ -14,7 +14,7 @@ interface nsIDOMClientRect;
interface nsIURI;
%{C++
#include "nsNPAPIPluginInstance.h"
class nsNPAPIPluginInstance;
%}
[ptr] native nsNPAPIPluginInstancePtr(nsNPAPIPluginInstance);

View File

@ -25,6 +25,8 @@
#include "js/Value.h"
#include "Layers.h"
#include "MediaDecoder.h"
// nsNPAPIPluginInstance must be included before nsIDocument.h, which is included in mozAutoDocUpdate.h.
#include "nsNPAPIPluginInstance.h"
#include "mozAutoDocUpdate.h"
#include "mozilla/Attributes.h"
#include "mozilla/AutoRestore.h"

View File

@ -1431,6 +1431,9 @@ nsDocument::~nsDocument()
}
if (!isAboutScheme) {
// Record the page load
uint32_t pageLoaded = 1;
Accumulate(Telemetry::MIXED_CONTENT_UNBLOCK_COUNTER, pageLoaded);
// Record the mixed content status of the docshell in Telemetry
enum {
NO_MIXED_CONTENT = 0, // There is no Mixed Content on the page

View File

@ -25,6 +25,7 @@
#include "nsIObjectFrame.h"
#include "nsIPermissionManager.h"
#include "nsPluginHost.h"
#include "nsPluginInstanceOwner.h"
#include "nsJSNPRuntime.h"
#include "nsIPresShell.h"
#include "nsIScriptGlobalObject.h"

View File

@ -19,7 +19,6 @@
#include "nsIChannelEventSink.h"
#include "nsIObjectLoadingContent.h"
#include "nsIRunnable.h"
#include "nsPluginInstanceOwner.h"
#include "nsIThreadInternal.h"
#include "nsIFrame.h"
#include "nsIFrameLoader.h"
@ -30,6 +29,7 @@ class AutoSetInstantiatingToFalse;
class nsObjectFrame;
class nsFrameLoader;
class nsXULElement;
class nsPluginInstanceOwner;
class nsObjectLoadingContent : public nsImageLoadingContent
, public nsIStreamListener

View File

@ -1373,6 +1373,7 @@ nsPlainTextSerializer::EndLine(bool aSoftlinebreak, bool aBreakBySpace)
* signed messages according to the OpenPGP standard (RFC 2440).
*/
if (!(mFlags & nsIDocumentEncoder::OutputPreformatted) &&
!(mFlags & nsIDocumentEncoder::OutputDontRemoveLineEndingSpaces) &&
(aSoftlinebreak ||
!(mCurrentLine.EqualsLiteral("-- ") || mCurrentLine.EqualsLiteral("- -- ")))) {
// Remove spaces from the end of the line.

View File

@ -17,7 +17,6 @@
#include "nsIContent.h"
#include "nsIStreamListener.h"
#include "nsWeakReference.h"
#include "jsapi.h"
#include "nsIChannelEventSink.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsIInterfaceRequestor.h"

View File

@ -580,6 +580,7 @@ MOCHITEST_FILES_C= \
test_processing_instruction_update_stylesheet.xhtml \
test_bug907892.html \
file_bug907892.html \
test_bug902847.html \
$(NULL)
# OOP tests don't work on Windows (bug 763081) or native-fennec

View File

@ -0,0 +1,58 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=902847
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 902847</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
function testPaintextSerializerWithPlaceHolder() {
const de = SpecialPowers.Ci.nsIDocumentEncoder;
const Cc = SpecialPowers.Cc;
// Create a plaintext encoder.
var encoder = Cc["@mozilla.org/layout/documentEncoder;1?type=text/plain"]
.createInstance(de);
var flags = de.OutputRaw |
de.OutputLFLineBreak |
de.OutputDontRemoveLineEndingSpaces;
encoder.init(document, "text/plain", flags);
function toPlaintext(id) {
var element = document.getElementById(id);
var range = document.createRange();
range.selectNodeContents(element);
encoder.setRange(range);
return encoder.encodeToString().replace('\n', '\\n', 'g')
.replace('\r', '\\r', 'g');
}
// Test cases.
is(toPlaintext("case1"), "Hello \\nboy!", "Case 1 failed.");
is(toPlaintext("case2"), "Hello \\nboy!", "Case 2 failed.");
is(toPlaintext("case3"), "Hello \\nboy!", "Case 3 failed.");
is(toPlaintext("case4"), "Hello \\nboy!", "Case 4 failed.");
SimpleTest.finish();
}
addLoadEvent(testPaintextSerializerWithPlaceHolder);
SimpleTest.waitForExplicitFinish();
</script>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=902847">Mozilla Bug 902847</a>
<p id="display"></p>
<div id="content">
<p id="case1">Hello <br>boy!</p>
<p id="case2">Hello <br>boy!</p>
<p id="case3">Hello&nbsp;<br>boy!</p>
<p id="case4">Hello&nbsp;&nbsp;<br>boy!</p>
</div>
<pre id="test">
</pre>
</body>
</html>

View File

@ -177,12 +177,8 @@ nsDOMEventTargetHelper::AddEventListener(const nsAString& aType,
"explicit by making aOptionalArgc non-zero.");
if (aOptionalArgc < 2) {
nsresult rv;
nsIScriptContext* context = GetContextForEventHandlers(&rv);
nsresult rv = WantsUntrusted(&aWantsUntrusted);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocument> doc =
nsContentUtils::GetDocumentFromScriptContext(context);
aWantsUntrusted = doc && !nsContentUtils::IsChromeDoc(doc);
}
nsEventListenerManager* elm = GetListenerManager(true);
@ -200,15 +196,11 @@ nsDOMEventTargetHelper::AddEventListener(const nsAString& aType,
{
bool wantsUntrusted;
if (aWantsUntrusted.IsNull()) {
nsresult rv;
nsIScriptContext* context = GetContextForEventHandlers(&rv);
nsresult rv = WantsUntrusted(&wantsUntrusted);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
return;
}
nsCOMPtr<nsIDocument> doc =
nsContentUtils::GetDocumentFromScriptContext(context);
wantsUntrusted = doc && !nsContentUtils::IsChromeDoc(doc);
} else {
wantsUntrusted = aWantsUntrusted.Value();
}
@ -234,12 +226,8 @@ nsDOMEventTargetHelper::AddSystemEventListener(const nsAString& aType,
"explicit by making aOptionalArgc non-zero.");
if (aOptionalArgc < 2) {
nsresult rv;
nsIScriptContext* context = GetContextForEventHandlers(&rv);
nsresult rv = WantsUntrusted(&aWantsUntrusted);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocument> doc =
nsContentUtils::GetDocumentFromScriptContext(context);
aWantsUntrusted = doc && !nsContentUtils::IsChromeDoc(doc);
}
return NS_AddSystemEventListener(this, aType, aListener, aUseCapture,
@ -353,3 +341,15 @@ nsDOMEventTargetHelper::GetContextForEventHandlers(nsresult* aRv)
: nullptr;
}
nsresult
nsDOMEventTargetHelper::WantsUntrusted(bool* aRetVal)
{
nsresult rv;
nsIScriptContext* context = GetContextForEventHandlers(&rv);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDocument> doc =
nsContentUtils::GetDocumentFromScriptContext(context);
// We can let listeners on workers to always handle all the events.
*aRetVal = (doc && !nsContentUtils::IsChromeDoc(doc)) || !NS_IsMainThread();
return rv;
}

View File

@ -120,6 +120,8 @@ public:
nsIGlobalObject* GetParentObject() const { return mParentObject; }
bool HasOrHasHadOwner() { return mHasOrHasHadOwnerWindow; }
protected:
nsresult WantsUntrusted(bool* aRetVal);
nsRefPtr<nsEventListenerManager> mListenerManager;
// Dispatch a trusted, non-cancellable and non-bubbling event to |this|.
nsresult DispatchTrustedEvent(const nsAString& aEventName);

View File

@ -4,10 +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/. */
#include "nsTArray.h"
#include "AudioAvailableEventManager.h"
#include "VideoUtils.h"
#include "MediaDecoder.h"
#include "nsIRunnable.h"
namespace mozilla {

View File

@ -7,13 +7,18 @@
#ifndef AudioAvailableEventManager_h__
#define AudioAvailableEventManager_h__
#include "nsCOMPtr.h"
#include "nsIRunnable.h"
#include "MediaDecoder.h"
#include "MediaDecoderReader.h"
#include "nsAutoPtr.h"
#include "nsTArray.h"
#include "AudioSampleFormat.h"
#include "mozilla/ReentrantMonitor.h"
class nsIRunnable;
template <class T> class nsCOMPtr;
namespace mozilla {
class MediaDecoder;
class AudioAvailableEventManager
{
public:

View File

@ -4,6 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "AudioChannelFormat.h"
#include "nsTArray.h"
#include <algorithm>

View File

@ -6,7 +6,10 @@
#ifndef MOZILLA_AUDIOCHANNELFORMAT_H_
#define MOZILLA_AUDIOCHANNELFORMAT_H_
#include "nsTArray.h"
#include <stdint.h>
template <class T>
class nsTArray;
namespace mozilla {

View File

@ -4,9 +4,9 @@
* 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 "mozilla/arm.h"
#include "AudioNodeEngine.h"
#ifdef BUILD_ARM_NEON
#include "mozilla/arm.h"
#include "AudioNodeEngineNEON.h"
#endif

View File

@ -8,13 +8,13 @@
#include "AudioSegment.h"
#include "mozilla/dom/AudioNode.h"
#include "mozilla/dom/AudioParam.h"
#include "mozilla/Mutex.h"
namespace mozilla {
namespace dom {
struct ThreeDPoint;
class AudioParamTimeline;
}
class AudioNodeStream;

View File

@ -3,9 +3,9 @@
* 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 "MediaStreamGraphImpl.h"
#include "AudioNodeEngine.h"
#include "AudioNodeExternalInputStream.h"
#include "AudioChannelFormat.h"
#include "speex/speex_resampler.h"
using namespace mozilla::dom;

View File

@ -7,11 +7,7 @@
#define MOZILLA_AUDIONODEEXTERNALINPUTSTREAM_H_
#include "MediaStreamGraph.h"
#include "AudioChannelFormat.h"
#include "AudioNodeEngine.h"
#include "AudioNodeStream.h"
#include "mozilla/dom/AudioParam.h"
#include <deque>
#ifdef PR_LOGGING
#define LOG(type, msg) PR_LOG(gMediaStreamGraphLog, type, msg)

View File

@ -8,6 +8,8 @@
#include "MediaStreamGraphImpl.h"
#include "AudioNodeEngine.h"
#include "ThreeDPoint.h"
#include "AudioChannelFormat.h"
#include "AudioParamTimeline.h"
using namespace mozilla::dom;

View File

@ -7,10 +7,8 @@
#define MOZILLA_AUDIONODESTREAM_H_
#include "MediaStreamGraph.h"
#include "AudioChannelFormat.h"
#include "AudioNodeEngine.h"
#include "mozilla/dom/AudioNodeBinding.h"
#include "mozilla/dom/AudioParam.h"
#include "AudioSegment.h"
#ifdef PR_LOGGING
#define LOG(type, msg) PR_LOG(gMediaStreamGraphLog, type, msg)
@ -26,6 +24,7 @@ class AudioParamTimeline;
}
class ThreadSharedFloatArrayBufferList;
class AudioNodeEngine;
/**
* An AudioNodeStream produces one audio track with ID AUDIO_TRACK.

View File

@ -7,7 +7,6 @@
#define MOZILLA_AUDIOSEGMENT_H_
#include "MediaSegment.h"
#include "nsISupportsImpl.h"
#include "AudioSampleFormat.h"
#include "SharedBuffer.h"

View File

@ -8,12 +8,12 @@
#include "prlog.h"
#include "prdtoa.h"
#include "AudioStream.h"
#include "nsAlgorithm.h"
#include "VideoUtils.h"
#include "mozilla/Monitor.h"
#include "mozilla/Mutex.h"
#include <algorithm>
#include "mozilla/Preferences.h"
#include "soundtouch/SoundTouch.h"
#if defined(MOZ_CUBEB)
#include "nsAutoRef.h"

View File

@ -6,12 +6,14 @@
#if !defined(AudioStream_h_)
#define AudioStream_h_
#include "nscore.h"
#include "AudioSampleFormat.h"
#include "AudioChannelCommon.h"
#include "soundtouch/SoundTouch.h"
#include "nsAutoPtr.h"
namespace soundtouch {
class SoundTouch;
}
namespace mozilla {
class AudioStream;

View File

@ -7,6 +7,7 @@
#define AUDIOSTREAMTRACK_H_
#include "MediaStreamTrack.h"
#include "DOMMediaStream.h"
namespace mozilla {
namespace dom {

View File

@ -4,7 +4,6 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "DOMMediaStream.h"
#include "nsDOMClassInfoID.h"
#include "nsContentUtils.h"
#include "mozilla/dom/MediaStreamBinding.h"
#include "mozilla/dom/LocalMediaStreamBinding.h"

View File

@ -8,13 +8,12 @@
#include "nsIDOMMediaStream.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIPrincipal.h"
#include "nsWrapperCache.h"
#include "nsIDOMWindow.h"
#include "StreamBuffer.h"
#include "nsIRunnable.h"
#include "nsIDOMWindow.h"
class nsXPCClassInfo;
class nsIPrincipal;
// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
// GetTickCount() and conflicts with NS_DECL_NSIDOMMEDIASTREAM, containing

View File

@ -8,7 +8,9 @@
#define DecoderTraits_h_
#include "nsCOMPtr.h"
#include "nsAString.h"
class nsAString;
class nsACString;
namespace mozilla {

View File

@ -6,7 +6,8 @@
#include "EncodedBufferCache.h"
#include "nsAnonymousTemporaryFile.h"
#include "nsLocalFile.h"
#include "nsDOMFile.h"
#include "prio.h"
namespace mozilla {

View File

@ -7,10 +7,12 @@
#ifndef EncodedBufferCache_h_
#define EncodedBufferCache_h_
#include "nsCOMPtr.h"
#include "nsTArray.h"
#include "mozilla/Mutex.h"
#include "prio.h"
#include "nsDOMFile.h"
struct PRFileDesc;
class nsIDOMBlob;
namespace mozilla {

View File

@ -4,9 +4,9 @@
* 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 "mozilla/XPCOM.h"
#include "FileBlockCache.h"
#include "VideoUtils.h"
#include "prio.h"
#include <algorithm>
namespace mozilla {

View File

@ -9,10 +9,12 @@
#include "mozilla/Attributes.h"
#include "mozilla/Monitor.h"
#include "prio.h"
#include "nsTArray.h"
#include "MediaCache.h"
#include "nsDeque.h"
#include "nsThreadUtils.h"
struct PRFileDesc;
namespace mozilla {

View File

@ -5,20 +5,21 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/ReentrantMonitor.h"
#include "mozilla/XPCOM.h"
#include "MediaCache.h"
#include "nsNetUtil.h"
#include "prio.h"
#include "nsContentUtils.h"
#include "nsThreadUtils.h"
#include "MediaResource.h"
#include "nsMathUtils.h"
#include "prlog.h"
#include "mozilla/Preferences.h"
#include "FileBlockCache.h"
#include "mozilla/Attributes.h"
#include "nsAnonymousTemporaryFile.h"
#include "nsIObserverService.h"
#include "nsISeekableStream.h"
#include "nsIPrincipal.h"
#include "mozilla/Attributes.h"
#include "mozilla/Services.h"
#include <algorithm>
namespace mozilla {
@ -364,6 +365,26 @@ MediaCacheFlusher::Observe(nsISupports *aSubject, char const *aTopic, PRUnichar
return NS_OK;
}
MediaCacheStream::MediaCacheStream(ChannelMediaResource* aClient)
: mClient(aClient),
mInitialized(false),
mHasHadUpdate(false),
mClosed(false),
mDidNotifyDataEnded(false),
mResourceID(0),
mIsTransportSeekable(false),
mCacheSuspended(false),
mChannelEnded(false),
mChannelOffset(0),
mStreamLength(-1),
mStreamOffset(0),
mPlaybackBytesPerSecond(10000),
mPinCount(0),
mCurrentMode(MODE_PLAYBACK),
mMetadataInPartialBlockBuffer(false)
{
}
void MediaCacheStream::BlockList::AddFirstBlock(int32_t aBlock)
{
NS_ASSERTION(!mEntries.GetEntry(aBlock), "Block already in list");

View File

@ -8,8 +8,11 @@
#define MediaCache_h_
#include "nsTArray.h"
#include "nsIPrincipal.h"
#include "nsCOMPtr.h"
#include "nsHashKeys.h"
#include "nsTHashtable.h"
class nsIPrincipal;
namespace mozilla {
// defined in MediaResource.h
@ -191,17 +194,7 @@ public:
// aClient provides the underlying transport that cache will use to read
// data for this stream.
MediaCacheStream(ChannelMediaResource* aClient)
: mClient(aClient), mInitialized(false),
mHasHadUpdate(false),
mClosed(false),
mDidNotifyDataEnded(false), mResourceID(0),
mIsTransportSeekable(false), mCacheSuspended(false),
mChannelEnded(false),
mChannelOffset(0), mStreamLength(-1),
mStreamOffset(0), mPlaybackBytesPerSecond(10000),
mPinCount(0), mCurrentMode(MODE_PLAYBACK),
mMetadataInPartialBlockBuffer(false) {}
MediaCacheStream(ChannelMediaResource* aClient);
~MediaCacheStream();
// Set up this stream with the cache. Can fail on OOM. One

View File

@ -8,11 +8,7 @@
#include "mozilla/FloatingPoint.h"
#include "mozilla/MathAlgorithms.h"
#include <limits>
#include "nsNetUtil.h"
#include "AudioStream.h"
#include "mozilla/dom/HTMLVideoElement.h"
#include "nsIObserver.h"
#include "nsIObserverService.h"
#include "nsTArray.h"
#include "VideoUtils.h"
#include "MediaDecoderStateMachine.h"
@ -22,6 +18,9 @@
#include "MediaResource.h"
#include "nsError.h"
#include "mozilla/Preferences.h"
#include "nsIMemoryReporter.h"
#include "nsComponentManagerUtils.h"
#include "nsITimer.h"
#include <algorithm>
#ifdef MOZ_WMF

View File

@ -180,19 +180,12 @@ destroying the MediaDecoder object.
#include "nsISupports.h"
#include "nsCOMPtr.h"
#include "nsIThread.h"
#include "nsIChannel.h"
#include "nsIObserver.h"
#include "nsAutoPtr.h"
#include "nsSize.h"
#include "prlog.h"
#include "gfxContext.h"
#include "gfxRect.h"
#include "MediaResource.h"
#include "mozilla/ReentrantMonitor.h"
#include "mozilla/TimeStamp.h"
#include "MediaStreamGraph.h"
#include "MediaDecoderOwner.h"
#include "AudioChannelCommon.h"
#include "AbstractMediaDecoder.h"
@ -214,9 +207,7 @@ namespace layers {
class Image;
} //namespace layers
class MediaByteRange;
class VideoFrameContainer;
class AudioStream;
class MediaDecoderStateMachine;
class MediaDecoderOwner;

View File

@ -4,10 +4,11 @@
* 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 "GrallocImages.h"
#include "MediaDecoderReader.h"
#ifdef MOZ_OMX_DECODER
#include "GrallocImages.h"
#endif
#include "AbstractMediaDecoder.h"
#include "MediaDecoderStateMachine.h"
#include "VideoUtils.h"
#include "ImageContainer.h"

View File

@ -9,15 +9,23 @@
#include <nsDeque.h>
#include "nsSize.h"
#include "mozilla/ReentrantMonitor.h"
#include "MediaStreamGraph.h"
#include "SharedBuffer.h"
#include "AudioSampleFormat.h"
#include "MediaResource.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "AbstractMediaDecoder.h"
#include "ImageTypes.h"
struct nsIntRect;
namespace mozilla {
class AbstractMediaDecoder;
namespace layers {
class Image;
class ImageContainer;
}
namespace dom {
class TimeRanges;
}
// Stores info relevant to presenting media frames.
class VideoInfo {

View File

@ -11,10 +11,8 @@
#include "mozilla/DebugOnly.h"
#include <stdint.h>
#include "mozilla/Util.h"
#include "MediaDecoderStateMachine.h"
#include <limits>
#include "AudioStream.h"
#include "nsTArray.h"
#include "MediaDecoder.h"
@ -26,6 +24,8 @@
#include "AudioSegment.h"
#include "VideoSegment.h"
#include "ImageContainer.h"
#include "nsComponentManagerUtils.h"
#include "nsITimer.h"
#include "prenv.h"
#include "mozilla/Preferences.h"
@ -726,8 +726,6 @@ void MediaDecoderStateMachine::SendStreamData()
if (mAudioCaptured) {
// Discard audio packets that are no longer needed.
int64_t audioPacketTimeToDiscard =
std::min(minLastAudioPacketTime, mStartTime + mCurrentFrameTime);
while (true) {
nsAutoPtr<AudioData> a(mReader->AudioQueue().PopFront());
if (!a)
@ -738,7 +736,7 @@ void MediaDecoderStateMachine::SendStreamData()
// very start. That's OK, we'll play silence instead for a brief moment.
// That's OK. Seeking to this time would have a similar issue for such
// badly muxed resources.
if (a->GetEnd() >= audioPacketTimeToDiscard) {
if (a->GetEnd() >= minLastAudioPacketTime) {
mReader->AudioQueue().PushFront(a.forget());
break;
}

View File

@ -81,13 +81,16 @@ hardware (via AudioStream).
#include "MediaDecoder.h"
#include "AudioAvailableEventManager.h"
#include "mozilla/ReentrantMonitor.h"
#include "nsITimer.h"
#include "AudioSegment.h"
#include "VideoSegment.h"
#include "MediaDecoderReader.h"
#include "MediaDecoderOwner.h"
#include "MediaMetadataManager.h"
class nsITimer;
namespace mozilla {
class MediaDecoderReader;
class AudioSegment;
class VideoSegment;
/*
The state machine class. This manages the decoding and seeking in the

View File

@ -7,17 +7,15 @@
#include "MediaRecorder.h"
#include "GeneratedEvents.h"
#include "MediaEncoder.h"
#include "mozilla/Util.h"
#include "nsDOMEventTargetHelper.h"
#include "nsDOMFile.h"
#include "nsError.h"
#include "nsIDocument.h"
#include "nsIDOMBlobEvent.h"
#include "nsIDOMRecordErrorEvent.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsIScriptSecurityManager.h"
#include "nsAString.h"
#include "nsTArray.h"
#include "DOMMediaStream.h"
#include "EncodedBufferCache.h"
#include "nsIDOMFile.h"
namespace mozilla {
@ -150,7 +148,7 @@ MediaRecorder::ExtractEncodedData()
do {
nsTArray<nsTArray<uint8_t> > outputBufs;
mEncoder->GetEncodedData(&outputBufs, mMimeType);
for (uint i = 0; i < outputBufs.Length(); i++) {
for (uint32_t i = 0; i < outputBufs.Length(); i++) {
mEncodedBufferCache->AppendBuffer(outputBufs[i]);
}

View File

@ -7,18 +7,19 @@
#ifndef MediaRecorder_h
#define MediaRecorder_h
#include "DOMMediaStream.h"
#include "MediaEncoder.h"
#include "mozilla/dom/MediaRecorderBinding.h"
#include "nsDOMEventTargetHelper.h"
#include "EncodedBufferCache.h"
#include "TrackUnionStream.h"
// Max size for allowing queue encoded data in memory
#define MAX_ALLOW_MEMORY_BUFFER 1024000
namespace mozilla {
class ErrorResult;
class DOMMediaStream;
class EncodedBufferCache;
class MediaEncoder;
class ProcessedMediaStream;
class MediaInputPort;
namespace dom {

View File

@ -18,7 +18,6 @@
#include "nsIHttpChannel.h"
#include "nsISeekableStream.h"
#include "nsIInputStream.h"
#include "nsIOutputStream.h"
#include "nsIRequestObserver.h"
#include "nsIStreamListener.h"
#include "nsIScriptSecurityManager.h"
@ -26,7 +25,6 @@
#include "mozilla/dom/HTMLMediaElement.h"
#include "nsError.h"
#include "nsICachingChannel.h"
#include "nsURILoader.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsContentUtils.h"
#include "nsHostObjectProtocolHandler.h"

View File

@ -7,11 +7,10 @@
#define MediaResource_h_
#include "mozilla/Mutex.h"
#include "mozilla/XPCOM.h"
#ifdef MOZ_DASH
#include "mozilla/ReentrantMonitor.h"
#endif
#include "nsIChannel.h"
#include "nsIHttpChannel.h"
#include "nsIPrincipal.h"
#include "nsIURI.h"
#include "nsIStreamListener.h"
#include "nsIChannelEventSink.h"
@ -19,6 +18,7 @@
#include "MediaCache.h"
#include "mozilla/Attributes.h"
#include "mozilla/TimeStamp.h"
#include "nsThreadUtils.h"
// For HTTP seeking, if number of bytes needing to be
// seeked forward is less than this value then a read is
@ -32,6 +32,9 @@ static const uint32_t HTTP_REQUESTED_RANGE_NOT_SATISFIABLE_CODE = 416;
// reach a CWND of 30 (See bug 831998)
static const int64_t RELIABLE_DATA_THRESHOLD = 57 * 1460;
class nsIHttpChannel;
class nsIPrincipal;
namespace mozilla {
class MediaDecoder;

View File

@ -13,9 +13,7 @@
#include "nsIObserver.h"
#include "nsServiceManagerUtils.h"
#include "nsWidgetsCID.h"
#include "nsXPCOMCIDInternal.h"
#include "prlog.h"
#include "VideoUtils.h"
#include "mozilla/Attributes.h"
#include "TrackUnionStream.h"
#include "ImageContainer.h"

View File

@ -11,7 +11,6 @@
#include "AudioStream.h"
#include "nsTArray.h"
#include "nsIRunnable.h"
#include "nsISupportsImpl.h"
#include "StreamBuffer.h"
#include "TimeVarying.h"
#include "VideoFrameContainer.h"

View File

@ -8,7 +8,6 @@
#include "DOMMediaStream.h"
#include "nsIUUIDGenerator.h"
#include "nsServiceManagerUtils.h"
#include "MediaStreamGraph.h"
namespace mozilla {
namespace dom {

View File

@ -7,11 +7,13 @@
#define MEDIASTREAMTRACK_H_
#include "nsDOMEventTargetHelper.h"
#include "DOMMediaStream.h"
#include "nsID.h"
#include "StreamBuffer.h"
namespace mozilla {
class DOMMediaStream;
namespace dom {
class AudioStreamTrack;

View File

@ -6,11 +6,8 @@
#ifndef MOZILLA_STREAMBUFFER_H_
#define MOZILLA_STREAMBUFFER_H_
#include "mozilla/DebugOnly.h"
#include "MediaSegment.h"
#include "nsAutoPtr.h"
#include <algorithm>
namespace mozilla {

View File

@ -6,6 +6,7 @@
#include "mozilla/dom/TextTrack.h"
#include "mozilla/dom/TextTrackBinding.h"
#include "mozilla/dom/TextTrackCueList.h"
namespace mozilla {
namespace dom {

View File

@ -8,13 +8,10 @@
#define mozilla_dom_TextTrack_h
#include "mozilla/dom/TextTrackBinding.h"
#include "mozilla/dom/TextTrackCue.h"
#include "mozilla/dom/TextTrackCueList.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsDOMEventTargetHelper.h"
#include "nsString.h"
#include "nsWrapperCache.h"
namespace mozilla {
namespace dom {

View File

@ -5,9 +5,7 @@
#include "mozilla/dom/HTMLTrackElement.h"
#include "mozilla/dom/TextTrackCue.h"
#include "mozilla/dom/ProcessingInstruction.h"
#include "nsIFrame.h"
#include "nsTextNode.h"
#include "nsVideoFrame.h"
// Alternate value for the 'auto' keyword.

View File

@ -7,7 +7,7 @@
#ifndef mozilla_dom_TextTrackCueList_h
#define mozilla_dom_TextTrackCueList_h
#include "mozilla/dom/TextTrackCue.h"
#include "nsTArray.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"

View File

@ -14,8 +14,6 @@
namespace mozilla {
namespace dom {
class TextTrack;
class TextTrackList MOZ_FINAL : public nsDOMEventTargetHelper
{
public:

View File

@ -9,7 +9,6 @@
#include "mozilla/Mutex.h"
#include "mozilla/TimeStamp.h"
#include "nsISupportsImpl.h"
#include "gfxPoint.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"

View File

@ -10,7 +10,6 @@
#include "mozilla/dom/VideoPlaybackQualityBinding.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
#include "MediaDecoder.h"
namespace mozilla {
namespace dom {

View File

@ -7,6 +7,7 @@
#define VIDEOSTREAMTRACK_H_
#include "MediaStreamTrack.h"
#include "DOMMediaStream.h"
namespace mozilla {
namespace dom {

View File

@ -6,6 +6,7 @@
#include "MediaResource.h"
#include "mozilla/dom/TimeRanges.h"
#include "nsMathUtils.h"
#include "nsSize.h"
#include <stdint.h>

View File

@ -11,8 +11,11 @@
#include "mozilla/ReentrantMonitor.h"
#include "mozilla/CheckedInt.h"
#include "nsRect.h"
#if !(defined(XP_WIN) || defined(XP_MACOSX) || defined(LINUX)) || \
defined(MOZ_ASAN)
// For MEDIA_THREAD_STACK_SIZE
#include "nsIThreadManager.h"
#endif
#include "nsThreadUtils.h"
#include "prtime.h"
@ -21,6 +24,8 @@ using mozilla::CheckedUint64;
using mozilla::CheckedInt32;
using mozilla::CheckedUint32;
struct nsIntSize;
// This file contains stuff we'd rather put elsewhere, but which is
// dependent on other changes which we don't want to wait for. We plan to
// remove this file in the near future.

View File

@ -5,8 +5,7 @@
#include "WebVTTLoadListener.h"
#include "mozilla/dom/TextTrackCue.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "VideoUtils.h"
#include "mozilla/dom/HTMLTrackElement.h"
namespace mozilla {
namespace dom {

View File

@ -9,11 +9,9 @@
#include "nsIStreamListener.h"
#include "nsIChannelEventSink.h"
#include "nsIInterfaceRequestor.h"
#include "nsIObserver.h"
#include "nsAutoPtr.h"
#include "nsAutoRef.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/dom/HTMLTrackElement.h"
struct webvtt_parser_t;
struct webvtt_cue;
@ -30,6 +28,9 @@ public:
namespace mozilla {
namespace dom {
class HTMLTrackElement;
/**
* Class that manages the libwebvtt parsing library and functions as an
* interface between Gecko and libwebvtt.

View File

@ -11,6 +11,8 @@
#include "SourceFilter.h"
#include "DirectShowUtils.h"
#include "SampleSink.h"
#include "MediaResource.h"
#include "VideoUtils.h"
namespace mozilla {

View File

@ -4,6 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "MediaEncoder.h"
#include "MediaDecoder.h"
#include "nsIPrincipal.h"
#ifdef MOZ_OGG
#include "OggWriter.h"
#endif

View File

@ -7,6 +7,7 @@
#include <string.h>
#include "GStreamerReader.h"
#include "GStreamerMozVideoBuffer.h"
#include "ImageContainer.h"
namespace mozilla {

View File

@ -144,14 +144,14 @@ nsresult GStreamerReader::Init(MediaDecoderReader* aCloneDonor)
mAudioSink = gst_parse_bin_from_description("capsfilter name=filter ! "
#ifdef MOZ_SAMPLE_TYPE_FLOAT32
"appsink name=audiosink max-buffers=2 sync=true caps=audio/x-raw-float,"
"appsink name=audiosink max-buffers=2 sync=false caps=audio/x-raw-float,"
#ifdef IS_LITTLE_ENDIAN
"channels={1,2},width=32,endianness=1234", TRUE, nullptr);
#else
"channels={1,2},width=32,endianness=4321", TRUE, nullptr);
#endif
#else
"appsink name=audiosink max-buffers=2 sync=true caps=audio/x-raw-int,"
"appsink name=audiosink max-buffers=2 sync=false caps=audio/x-raw-int,"
#ifdef IS_LITTLE_ENDIAN
"channels={1,2},width=16,endianness=1234", TRUE, nullptr);
#else

View File

@ -19,6 +19,7 @@
#pragma GCC diagnostic pop
#include <map>
#include "MediaDecoderReader.h"
#include "nsRect.h"
namespace mozilla {
@ -26,6 +27,10 @@ namespace dom {
class TimeRanges;
}
namespace layers {
class PlanarYCbCrImage;
}
class AbstractMediaDecoder;
class GStreamerReader : public MediaDecoderReader

View File

@ -17,6 +17,18 @@
#include "VideoUtils.h"
#include <algorithm>
// On Android JellyBean, the hardware.h header redefines version_major and
// version_minor, which breaks our build. See:
// https://bugzilla.mozilla.org/show_bug.cgi?id=912702#c6
#ifdef MOZ_WIDGET_GONK
#ifdef version_major
#undef version_major
#endif
#ifdef version_minor
#undef version_minor
#endif
#endif
namespace mozilla {
#ifdef PR_LOGGING

View File

@ -23,6 +23,7 @@ extern "C" {
#include "mozilla/TimeStamp.h"
#include "VorbisUtils.h"
#include "MediaMetadataManager.h"
#include "nsISeekableStream.h"
namespace mozilla {

View File

@ -8,6 +8,7 @@
#include "MediaResource.h"
#include "MediaDecoderReader.h"
#include "nsRect.h"
#include <ui/GraphicBuffer.h>
namespace android {

View File

@ -27,6 +27,7 @@
#include "GonkNativeWindowClient.h"
#include "OMXCodecProxy.h"
#include "OmxDecoder.h"
#include "nsISeekableStream.h"
#ifdef PR_LOGGING
PRLogModuleInfo *gOmxDecoderLog;

View File

@ -14,10 +14,16 @@
#include "nsIGfxInfo.h"
#include "gfxCrashReporterUtils.h"
#include "prmem.h"
#include "prlink.h"
#include "MediaResourceServer.h"
#include "nsServiceManagerUtils.h"
#include "MPAPI.h"
#if defined(ANDROID) && !defined(MOZ_WIDGET_GONK)
#include "nsIPropertyBag2.h"
#endif
#if defined(ANDROID) || defined(MOZ_WIDGET_GONK)
#include "android/log.h"
#define ALOG(args...) __android_log_print(ANDROID_LOG_INFO, "MediaPluginHost" , ## args)

View File

@ -8,6 +8,7 @@
#include "RawReader.h"
#include "RawDecoder.h"
#include "VideoUtils.h"
#include "nsISeekableStream.h"
using namespace mozilla;
@ -276,7 +277,7 @@ nsresult RawReader::Seek(int64_t aTime, int64_t aStartTime, int64_t aEndTime, in
return NS_OK;
}
nsresult RawReader::GetBuffered(TimeRanges* aBuffered, int64_t aStartTime)
nsresult RawReader::GetBuffered(dom::TimeRanges* aBuffered, int64_t aStartTime)
{
return NS_OK;
}

View File

@ -129,6 +129,9 @@ MOCHITEST_FILES = \
test_streams_srcObject.html \
test_reset_src.html \
test_streams_autoplay.html \
test_streams_element_capture.html \
test_streams_element_capture_reset.html \
test_streams_element_capture_createObjectURL.html \
test_streams_gc.html \
test_streams_tracks.html \
$(filter disabled-for-intermittent-failures--bug-608634, test_error_in_video_document.html) \
@ -143,18 +146,6 @@ MOCHITEST_FILES = \
test_bug895305.html \
$(NULL)
# Disabled on Windows for frequent intermittent failures
ifneq ($(OS_ARCH), WINNT)
MOCHITEST_FILES += \
test_streams_element_capture.html \
test_streams_element_capture_reset.html \
test_streams_element_capture_createObjectURL.html \
$(NULL)
else
$(filter disabled-on-windows-for-timeouts--bug-752796, test_streams_element_capture.html)
$(filter disabled-on-windows-for-timeouts--bug-752796, test_streams_element_capture_reset.html)
endif
# Don't run in suite
ifndef MOZ_SUITE
MOCHITEST_FILES += test_play_twice.html

View File

@ -10,10 +10,12 @@
#include "mozilla/dom/TimeRanges.h"
#include "MediaDecoderStateMachine.h"
#include "VideoUtils.h"
#include "nsISeekableStream.h"
#include <stdint.h>
#include "mozilla/Util.h"
#include "mozilla/CheckedInt.h"
#include "mozilla/Endian.h"
#include <algorithm>
namespace mozilla {
@ -69,11 +71,7 @@ namespace {
uint32_t
ReadUint32BE(const char** aBuffer)
{
uint32_t result =
uint8_t((*aBuffer)[0]) << 24 |
uint8_t((*aBuffer)[1]) << 16 |
uint8_t((*aBuffer)[2]) << 8 |
uint8_t((*aBuffer)[3]);
uint32_t result = BigEndian::readUint32(*aBuffer);
*aBuffer += sizeof(uint32_t);
return result;
}
@ -81,11 +79,7 @@ namespace {
uint32_t
ReadUint32LE(const char** aBuffer)
{
uint32_t result =
uint8_t((*aBuffer)[3]) << 24 |
uint8_t((*aBuffer)[2]) << 16 |
uint8_t((*aBuffer)[1]) << 8 |
uint8_t((*aBuffer)[0]);
uint32_t result = LittleEndian::readUint32(*aBuffer);
*aBuffer += sizeof(uint32_t);
return result;
}
@ -93,9 +87,7 @@ namespace {
uint16_t
ReadUint16LE(const char** aBuffer)
{
uint16_t result =
uint8_t((*aBuffer)[1]) << 8 |
uint8_t((*aBuffer)[0]) << 0;
uint16_t result = LittleEndian::readUint16(*aBuffer);
*aBuffer += sizeof(uint16_t);
return result;
}
@ -103,7 +95,9 @@ namespace {
int16_t
ReadInt16LE(const char** aBuffer)
{
return static_cast<int16_t>(ReadUint16LE(aBuffer));
uint16_t result = LittleEndian::readInt16(*aBuffer);
*aBuffer += sizeof(int16_t);
return result;
}
uint8_t
@ -141,7 +135,7 @@ nsresult WaveReader::ReadMetadata(VideoInfo* aInfo,
return NS_ERROR_FAILURE;
}
nsAutoPtr<HTMLMediaElement::MetadataTags> tags;
nsAutoPtr<dom::HTMLMediaElement::MetadataTags> tags;
bool loadAllChunks = LoadAllChunks(tags);
if (!loadAllChunks) {
@ -278,7 +272,7 @@ static double RoundToUsecs(double aSeconds) {
return floor(aSeconds * USECS_PER_S) / USECS_PER_S;
}
nsresult WaveReader::GetBuffered(TimeRanges* aBuffered, int64_t aStartTime)
nsresult WaveReader::GetBuffered(dom::TimeRanges* aBuffered, int64_t aStartTime)
{
if (!mInfo.mHasAudio) {
return NS_OK;
@ -542,7 +536,7 @@ WaveReader::GetNextChunk(uint32_t* aChunk, uint32_t* aChunkSize)
bool
WaveReader::LoadListChunk(uint32_t aChunkSize,
nsAutoPtr<HTMLMediaElement::MetadataTags> &aTags)
nsAutoPtr<dom::HTMLMediaElement::MetadataTags> &aTags)
{
// List chunks are always word (two byte) aligned.
NS_ABORT_IF_FALSE(mDecoder->GetResource()->Tell() % 2 == 0,
@ -576,7 +570,7 @@ WaveReader::LoadListChunk(uint32_t aChunkSize,
const char* const end = chunk.get() + aChunkSize;
aTags = new HTMLMediaElement::MetadataTags;
aTags = new dom::HTMLMediaElement::MetadataTags;
while (p + 8 < end) {
uint32_t id = ReadUint32BE(&p);
@ -618,7 +612,7 @@ WaveReader::LoadListChunk(uint32_t aChunkSize,
}
bool
WaveReader::LoadAllChunks(nsAutoPtr<HTMLMediaElement::MetadataTags> &aTags)
WaveReader::LoadAllChunks(nsAutoPtr<dom::HTMLMediaElement::MetadataTags> &aTags)
{
// Chunks are always word (two byte) aligned.
NS_ABORT_IF_FALSE(mDecoder->GetResource()->Tell() % 2 == 0,

View File

@ -7,6 +7,7 @@
#define WaveReader_h_
#include "MediaDecoderReader.h"
#include "mozilla/dom/HTMLMediaElement.h"
namespace mozilla {
namespace dom {

View File

@ -6,6 +6,7 @@
#include "AudioBufferSourceNode.h"
#include "mozilla/dom/AudioBufferSourceNodeBinding.h"
#include "mozilla/dom/AudioParam.h"
#include "nsMathUtils.h"
#include "AudioNodeEngine.h"
#include "AudioNodeStream.h"

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