merge mozilla-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2016-03-01 12:01:58 +01:00
commit 82e4b3a48c
368 changed files with 9131 additions and 6829 deletions

View File

@ -43,7 +43,7 @@ static nsRoleMapEntry sWAIRoleMaps[] =
eNoValue,
eNoAction,
eNoLiveAttr,
kGenericAccType,
eAlert,
kNoReqStates
},
{ // alertdialog

View File

@ -68,20 +68,21 @@ enum AccType {
* type, the same accessible class can have several types.
*/
enum AccGenericType {
eAutoComplete = 1 << 0,
eAutoCompletePopup = 1 << 1,
eButton = 1 << 2,
eCombobox = 1 << 3,
eDocument = 1 << 4,
eHyperText = 1 << 5,
eLandmark = 1 << 6,
eList = 1 << 7,
eListControl = 1 << 8,
eMenuButton = 1 << 9,
eSelect = 1 << 10,
eTable = 1 << 11,
eTableCell = 1 << 12,
eTableRow = 1 << 13,
eAlert = 1 << 0,
eAutoComplete = 1 << 1,
eAutoCompletePopup = 1 << 2,
eButton = 1 << 3,
eCombobox = 1 << 4,
eDocument = 1 << 5,
eHyperText = 1 << 6,
eLandmark = 1 << 7,
eList = 1 << 8,
eListControl = 1 << 9,
eMenuButton = 1 << 10,
eSelect = 1 << 11,
eTable = 1 << 12,
eTableCell = 1 << 13,
eTableRow = 1 << 14,
eLastAccGenericType = eTableRow
};

View File

@ -1982,6 +1982,10 @@ Accessible::BindToParent(Accessible* aParent, uint32_t aIndexInParent)
if (mParent->IsARIAHidden() || aria::HasDefinedARIAHidden(mContent))
SetARIAHidden(true);
mContextFlags |=
static_cast<uint32_t>((mParent->IsAlert() ||
mParent->IsInsideAlert())) & eInsideAlert;
}
// Accessible protected
@ -1999,7 +2003,7 @@ Accessible::UnbindFromParent()
delete mBits.groupInfo;
mBits.groupInfo = nullptr;
mContextFlags &= ~eHasNameDependentParent;
mContextFlags &= ~eHasNameDependentParent & ~eInsideAlert;
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -568,6 +568,8 @@ public:
return mContent->IsAnyOfHTMLElements(nsGkAtoms::abbr, nsGkAtoms::acronym);
}
bool IsAlert() const { return HasGenericType(eAlert); }
bool IsApplication() const { return mType == eApplicationType; }
ApplicationAccessible* AsApplication();
@ -946,6 +948,11 @@ public:
bool IsARIAHidden() const { return mContextFlags & eARIAHidden; }
void SetARIAHidden(bool aIsDefined);
/**
* Return true if the element is inside an alert.
*/
bool IsInsideAlert() const { return mContextFlags & eInsideAlert; }
protected:
virtual ~Accessible();
@ -1034,8 +1041,9 @@ protected:
enum ContextFlags {
eHasNameDependentParent = 1 << 0, // Parent's name depends on this accessible.
eARIAHidden = 1 << 1,
eInsideAlert = 1 << 2,
eLastContextFlag = eARIAHidden
eLastContextFlag = eInsideAlert
};
protected:
@ -1141,9 +1149,9 @@ protected:
static const uint8_t kChildrenFlagsBits = 2;
static const uint8_t kStateFlagsBits = 11;
static const uint8_t kContextFlagsBits = 2;
static const uint8_t kContextFlagsBits = 3;
static const uint8_t kTypeBits = 6;
static const uint8_t kGenericTypesBits = 14;
static const uint8_t kGenericTypesBits = 15;
/**
* Keep in sync with ChildrenFlags, StateFlags, ContextFlags, and AccTypes.

View File

@ -1764,22 +1764,16 @@ DocAccessible::UpdateTreeOnInsertion(Accessible* aContainer)
// Check to see if change occurred inside an alert, and fire an EVENT_ALERT
// if it did.
if (!(updateFlags & eAlertAccessible)) {
// XXX: tree traversal is perf issue, accessible should know if they are
// children of alert accessible to avoid this.
if (!(updateFlags & eAlertAccessible) &&
(aContainer->IsAlert() || aContainer->IsInsideAlert())) {
Accessible* ancestor = aContainer;
while (ancestor) {
if (ancestor->ARIARole() == roles::ALERT) {
do {
if (ancestor->IsAlert()) {
FireDelayedEvent(nsIAccessibleEvent::EVENT_ALERT, ancestor);
break;
}
// Don't climb above this document.
if (ancestor == this)
break;
ancestor = ancestor->Parent();
}
while ((ancestor = ancestor->Parent()));
}
MaybeNotifyOfValueChange(aContainer);

View File

@ -19,6 +19,7 @@ XULAlertAccessible::
XULAlertAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
{
mGenericTypes |= eAlert;
}
XULAlertAccessible::~XULAlertAccessible()

View File

@ -0,0 +1,17 @@
Manifest-Version: 1.0
Name: install.rdf
Digest-Algorithms: MD5 SHA1
MD5-Digest: N643P4YjKKlwZUqrfLi4ow==
SHA1-Digest: XK/2qoOrnuYo8xNYeLvB8DlUIik=
Name: bootstrap.js
Digest-Algorithms: MD5 SHA1
MD5-Digest: XH+mMa/H9aj3hm/ZtVKviw==
SHA1-Digest: LMmd1aTash/onjS1eAYIshgrdnM=
Name: options.xul
Digest-Algorithms: MD5 SHA1
MD5-Digest: XeELNGdttv8Lq66lT8ykbQ==
SHA1-Digest: 4KO6/RBoe10rYOGS+gFSHuuWi4Y=

Binary file not shown.

View File

@ -0,0 +1,4 @@
Signature-Version: 1.0
MD5-Digest-Manifest: cnqbpqBEVoHgJi/ocCsKKA==
SHA1-Digest-Manifest: eDmvBAkodeNbk/0ujttYgF8KDgI=

View File

@ -61,7 +61,7 @@ exports.ZipWriter = function (zipPath, mode) {
let nsfile = createNsFile(filePath);
if (!nsfile.exists()) {
reject(new Error("This file doesn't exists : " + nsfile.path));
reject(new Error("This file doesn't exist: " + nsfile.path));
return promise;
}

View File

@ -13,7 +13,7 @@
"{workdir}/out/target/product/generic/tests/*.zip",
"{workdir}/out/emulator.tar.gz",
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
"{objdir}/dist/test_packages.json",
"{objdir}/dist/b2g-*.test_packages.json",
"{workdir}/sources.xml"
],
"upload_platform": "emulator-ics",

View File

@ -13,7 +13,7 @@
"{workdir}/out/target/product/generic/tests/*.zip",
"{workdir}/out/emulator.tar.gz",
"{objdir}/dist/b2g-*.crashreporter-symbols.zip",
"{objdir}/dist/test_packages.json",
"{objdir}/dist/b2g-*.test_packages.json",
"{workdir}/sources.xml"
],
"public_upload_files": [

View File

@ -1,6 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Branding Makefile
# - jars chrome artwork

View File

@ -1,6 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Branding Makefile
# - jars chrome artwork

View File

@ -1,6 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Branding Makefile
# - jars chrome artwork

View File

@ -1,6 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Branding Makefile
# - jars chrome artwork

View File

@ -3,18 +3,6 @@
let {AddonManager} = Components.utils.import("resource://gre/modules/AddonManager.jsm", {});
let {Extension} = Components.utils.import("resource://gre/modules/Extension.jsm", {});
function install(url) {
return new Promise((resolve, reject) => {
AddonManager.getInstallForURL(url, (install) => {
install.addListener({
onInstallEnded: (i, addon) => resolve(addon),
onInstallFailed: () => reject(),
});
install.install();
}, "application/x-xpinstall");
});
}
function* makeAndInstallXPI(id, backgroundScript, loadedURL) {
let xpi = Extension.generateXPI(id, {
background: "(" + backgroundScript.toString() + ")()",
@ -26,9 +14,9 @@ function* makeAndInstallXPI(id, backgroundScript, loadedURL) {
let loadPromise = BrowserTestUtils.waitForNewTab(gBrowser, loadedURL);
let fileURI = Services.io.newFileURI(xpi);
info(`installing ${fileURI.spec}`);
let addon = yield install(fileURI.spec);
info(`installing ${xpi.path}`);
let addon = yield AddonManager.installTemporaryAddon(xpi);
info("installed");
// A WebExtension is started asynchronously, we have our test extension

View File

@ -2509,7 +2509,7 @@ var SessionStoreInternal = {
let window = tab.ownerDocument && tab.ownerDocument.defaultView;
// The tab or its window might be gone.
if (!window || !window.__SSi) {
if (!window || !window.__SSi || window.closed) {
return;
}

View File

@ -45,9 +45,6 @@ def parse_args():
parser.add_argument("--jsshell", required=True,
action="store", dest="jsshell",
help="Name of the jsshell zip.")
parser.add_argument("--use-short-names", action="store_true",
help="Use short names for packages (target.$name.tests.zip "
"instead of $(PACKAGE_BASENAME).$name.tests.zip)")
for harness in PACKAGE_SPECIFIED_HARNESSES:
parser.add_argument("--%s" % harness, required=True,
action="store", dest=harness,
@ -61,6 +58,7 @@ def parse_args():
help="Path to the output file to be written.")
return parser.parse_args()
def generate_package_data(args):
# Generate a dictionary mapping test harness names (exactly as they're known to
# mozharness and testsuite-targets.mk, ideally) to the set of archive names that
@ -69,9 +67,6 @@ def generate_package_data(args):
# which will be an optimization once parts of the main zip are split to harness
# specific zips.
tests_common = args.tests_common
if args.use_short_names:
tests_common = 'target.common.tests.zip'
jsshell = args.jsshell
harness_requirements = dict([(k, [tests_common]) for k in ALL_HARNESSES])
@ -80,8 +75,6 @@ def generate_package_data(args):
pkg_name = getattr(args, harness, None)
if pkg_name is None:
continue
if args.use_short_names:
pkg_name = 'target.%s.tests.zip' % harness
harness_requirements[harness].append(pkg_name)
return harness_requirements

View File

@ -56,12 +56,16 @@ if __name__ == '__main__':
env["MOZ_CRASHREPORTER_NO_REPORT"] = "1"
env["XPCOM_DEBUG_BREAK"] = "warn"
# For VC12, make sure we can find the right bitness of pgort120.dll
if "VS120COMNTOOLS" in env and not substs["HAVE_64BIT_BUILD"]:
vc12dir = os.path.abspath(os.path.join(env["VS120COMNTOOLS"],
"../../VC/bin"))
if os.path.exists(vc12dir):
env["PATH"] = vc12dir + ";" + env["PATH"]
# For VC12+, make sure we can find the right bitness of pgort1x0.dll
if not substs['HAVE_64BIT_BUILD']:
for e in ('VS140COMNTOOLS', 'VS120COMNTOOLS'):
if e not in env:
continue
vcdir = os.path.abspath(os.path.join(env[e], '../../VC/bin'))
if os.path.exists(vcdir):
env['PATH'] = '%s;%s' % (vcdir, env['PATH'])
break
# Run Firefox a first time to initialize its profile
runner = FirefoxRunner(profile=profile,

52
build/util/count_ctors.py Normal file
View File

@ -0,0 +1,52 @@
#!/usr/bin/python
import subprocess
import re
import sys
def count_ctors(filename):
proc = subprocess.Popen(
['readelf', '-W', '-S', filename], stdout=subprocess.PIPE)
# Some versions of ld produce both .init_array and .ctors. So we have
# to check for both.
n_init_array_ctors = 0
have_init_array = False
n_ctors_ctors = 0
have_ctors = False
for line in proc.stdout:
f = line.split()
if len(f) != 11:
continue
# Don't try to int()-parse the header line for the section summaries.
if not re.match("\\[\\d+\\]", f[0]):
continue
section_name, contents, size, align = f[1], f[2], int(f[5], 16), int(f[10])
if section_name == ".ctors" and contents == "PROGBITS":
have_ctors = True
# Subtract 2 for the uintptr_t(-1) header and the null terminator.
n_ctors_ctors = size / align - 2
if section_name == ".init_array" and contents == "INIT_ARRAY":
have_init_array = True
n_init_array_ctors = size / align
if have_init_array:
# Even if we have .ctors, we shouldn't have any constructors in .ctors.
# Complain if .ctors does not look how we expect it to.
if have_ctors and n_ctors_ctors != 0:
print >>sys.stderr, "Unexpected .ctors contents for", filename
sys.exit(1)
return n_init_array_ctors
if have_ctors:
return n_ctors_ctors
# We didn't find anything; somebody switched initialization mechanisms on
# us, or the binary is completely busted. Complain either way.
print >>sys.stderr, "Couldn't find .init_array or .ctors in", filename
sys.exit(1)
if __name__ == '__main__':
for f in sys.argv[1:]:
output = {"framework": {"name": "build_metrics"}, "suites": [{"name": "compiler_metrics", "subtests": [{"name": "num_constructors", "value": count_ctors(f)}] } ]}
print "PERFHERDER_DATA: %s" % output

View File

@ -9,10 +9,13 @@ import itertools
import os
import subprocess
import sys
import re
base_dir = os.path.dirname(__file__)
sys.path.append(os.path.join(base_dir, 'python', 'which'))
sys.path.append(os.path.join(base_dir, 'python', 'mozbuild'))
from which import which, WhichError
from mozbuild.mozconfig import MozconfigLoader
# If feel dirty replicating this from python/mozbuild/mozbuild/mozconfig.py,
@ -24,7 +27,15 @@ if sys.platform == 'win32':
shell = shell + '.exe'
def is_absolute_or_relative(path):
if os.altsep and os.altsep in path:
return True
return os.sep in path
def find_program(file):
if is_absolute_or_relative(file):
return os.path.abspath(file) if os.path.isfile(file) else None
try:
return which(file)
except WhichError:
@ -45,7 +56,26 @@ def autoconf_refresh(configure):
else:
return
for ac in ('autoconf-2.13', 'autoconf2.13', 'autoconf213'):
mozconfig_autoconf = None
configure_dir = os.path.dirname(configure)
# Don't read the mozconfig for the js configure (yay backwards
# compatibility)
if not configure_dir.replace(os.sep, '/').endswith('/js/src'):
loader = MozconfigLoader(os.path.dirname(configure))
project = os.environ.get('MOZ_CURRENT_PROJECT')
mozconfig = loader.find_mozconfig(env=os.environ)
mozconfig = loader.read_mozconfig(mozconfig, moz_build_app=project)
make_extra = mozconfig['make_extra']
if make_extra:
for assignment in make_extra:
m = re.match('(?:export\s+)?AUTOCONF\s*:?=\s*(.+)$',
assignment)
if m:
mozconfig_autoconf = m.group(1)
for ac in (mozconfig_autoconf, os.environ.get('AUTOCONF'), 'autoconf-2.13',
'autoconf2.13', 'autoconf213'):
if ac:
autoconf = find_program(ac)
if autoconf:
break
@ -58,7 +88,10 @@ def autoconf_refresh(configure):
if not autoconf:
raise RuntimeError('Could not find autoconf 2.13')
print('Refreshing %s' % configure, file=sys.stderr)
# Add or adjust AUTOCONF for subprocesses, especially the js/src configure
os.environ['AUTOCONF'] = autoconf
print('Refreshing %s with %s' % (configure, autoconf), file=sys.stderr)
with open(configure, 'wb') as fh:
subprocess.check_call([

File diff suppressed because it is too large Load Diff

View File

@ -111,9 +111,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.10.2"
#define SQLITE_VERSION_NUMBER 3010002
#define SQLITE_SOURCE_ID "2016-01-20 15:27:19 17efb4209f97fb4971656086b138599a91a75ff9"
#define SQLITE_VERSION "3.11.0"
#define SQLITE_VERSION_NUMBER 3011000
#define SQLITE_SOURCE_ID "2016-02-15 17:29:24 3d862f207e3adc00f78066799ac5a8c282430a5f"
/*
** CAPI3REF: Run-Time Library Version Numbers
@ -347,7 +347,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
** from [sqlite3_malloc()] and passed back through the 5th parameter.
** To avoid memory leaks, the application should invoke [sqlite3_free()]
** on error message strings returned through the 5th parameter of
** of sqlite3_exec() after the error message string is no longer needed.
** sqlite3_exec() after the error message string is no longer needed.
** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
** NULL before returning.
@ -5697,7 +5697,7 @@ struct sqlite3_index_info {
/* Inputs */
int nConstraint; /* Number of entries in aConstraint */
struct sqlite3_index_constraint {
int iColumn; /* Column on left-hand side of constraint */
int iColumn; /* Column constrained. -1 for ROWID */
unsigned char op; /* Constraint operator */
unsigned char usable; /* True if this constraint is usable */
int iTermOffset; /* Used internally - xBestIndex should ignore */
@ -8193,6 +8193,9 @@ struct Fts5PhraseIter {
** an OOM condition or IO error), an appropriate SQLite error code is
** returned.
**
** This function may be quite inefficient if used with an FTS5 table
** created with the "columnsize=0" option.
**
** xColumnText:
** This function attempts to retrieve the text of column iCol of the
** current document. If successful, (*pz) is set to point to a buffer
@ -8213,15 +8216,29 @@ struct Fts5PhraseIter {
** the query within the current row. Return SQLITE_OK if successful, or
** an error code (i.e. SQLITE_NOMEM) if an error occurs.
**
** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option. If the FTS5 table is created
** with either "detail=none" or "detail=column" and "content=" option
** (i.e. if it is a contentless table), then this API always returns 0.
**
** xInst:
** Query for the details of phrase match iIdx within the current row.
** Phrase matches are numbered starting from zero, so the iIdx argument
** should be greater than or equal to zero and smaller than the value
** output by xInstCount().
**
** Usually, output parameter *piPhrase is set to the phrase number, *piCol
** to the column in which it occurs and *piOff the token offset of the
** first token of the phrase. The exception is if the table was created
** with the offsets=0 option specified. In this case *piOff is always
** set to -1.
**
** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM)
** if an error occurs.
**
** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option.
**
** xRowid:
** Returns the rowid of the current row.
**
@ -8305,7 +8322,7 @@ struct Fts5PhraseIter {
** Fts5PhraseIter iter;
** int iCol, iOff;
** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff);
** iOff>=0;
** iCol>=0;
** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff)
** ){
** // An instance of phrase iPhrase at offset iOff of column iCol
@ -8313,13 +8330,51 @@ struct Fts5PhraseIter {
**
** The Fts5PhraseIter structure is defined above. Applications should not
** modify this structure directly - it should only be used as shown above
** with the xPhraseFirst() and xPhraseNext() API methods.
** with the xPhraseFirst() and xPhraseNext() API methods (and by
** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below).
**
** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option. If the FTS5 table is created
** with either "detail=none" or "detail=column" and "content=" option
** (i.e. if it is a contentless table), then this API always iterates
** through an empty set (all calls to xPhraseFirst() set iCol to -1).
**
** xPhraseNext()
** See xPhraseFirst above.
**
** xPhraseFirstColumn()
** This function and xPhraseNextColumn() are similar to the xPhraseFirst()
** and xPhraseNext() APIs described above. The difference is that instead
** of iterating through all instances of a phrase in the current row, these
** APIs are used to iterate through the set of columns in the current row
** that contain one or more instances of a specified phrase. For example:
**
** Fts5PhraseIter iter;
** int iCol;
** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol);
** iCol>=0;
** pApi->xPhraseNextColumn(pFts, &iter, &iCol)
** ){
** // Column iCol contains at least one instance of phrase iPhrase
** }
**
** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" option. If the FTS5 table is created with either
** "detail=none" "content=" option (i.e. if it is a contentless table),
** then this API always iterates through an empty set (all calls to
** xPhraseFirstColumn() set iCol to -1).
**
** The information accessed using this API and its companion
** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext
** (or xInst/xInstCount). The chief advantage of this API is that it is
** significantly more efficient than those alternatives when used with
** "detail=column" tables.
**
** xPhraseNextColumn()
** See xPhraseFirstColumn above.
*/
struct Fts5ExtensionApi {
int iVersion; /* Currently always set to 1 */
int iVersion; /* Currently always set to 3 */
void *(*xUserData)(Fts5Context*);
@ -8349,8 +8404,11 @@ struct Fts5ExtensionApi {
int (*xSetAuxdata)(Fts5Context*, void *pAux, void(*xDelete)(void*));
void *(*xGetAuxdata)(Fts5Context*, int bClear);
void (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
int (*xPhraseFirst)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*, int*);
void (*xPhraseNext)(Fts5Context*, Fts5PhraseIter*, int *piCol, int *piOff);
int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
};
/*

View File

@ -298,7 +298,7 @@ public:
return false;
}
if (NS_WARN_IF(!mWorkerPrivate->AddFeature(cx, this))) {
if (NS_WARN_IF(!mWorkerPrivate->AddFeature(this))) {
return false;
}
@ -360,7 +360,7 @@ private:
mRunnable->ReleaseData();
mRunnable->mConsole = nullptr;
aWorkerPrivate->RemoveFeature(aCx, mRunnable);
aWorkerPrivate->RemoveFeature(mRunnable);
return true;
}

View File

@ -701,7 +701,7 @@ nsresult
FileReader::IncreaseBusyCounter()
{
if (mWorkerPrivate && mBusyCount++ == 0 &&
!mWorkerPrivate->AddFeature(mWorkerPrivate->GetJSContext(), this)) {
!mWorkerPrivate->AddFeature(this)) {
return NS_ERROR_FAILURE;
}
@ -713,7 +713,7 @@ FileReader::DecreaseBusyCounter()
{
MOZ_ASSERT_IF(mWorkerPrivate, mBusyCount);
if (mWorkerPrivate && --mBusyCount == 0) {
mWorkerPrivate->RemoveFeature(mWorkerPrivate->GetJSContext(), this);
mWorkerPrivate->RemoveFeature(this);
}
}
@ -742,7 +742,7 @@ FileReader::Shutdown()
}
if (mWorkerPrivate && mBusyCount != 0) {
mWorkerPrivate->RemoveFeature(mWorkerPrivate->GetJSContext(), this);
mWorkerPrivate->RemoveFeature(this);
mWorkerPrivate = nullptr;
mBusyCount = 0;
}

View File

@ -2130,8 +2130,7 @@ WebSocketImpl::RegisterFeature()
MOZ_ASSERT(!mWorkerFeature);
mWorkerFeature = new WebSocketWorkerFeature(this);
JSContext* cx = GetCurrentThreadJSContext();
if (!mWorkerPrivate->AddFeature(cx, mWorkerFeature)) {
if (!mWorkerPrivate->AddFeature(mWorkerFeature)) {
NS_WARNING("Failed to register a feature.");
mWorkerFeature = nullptr;
return false;
@ -2152,8 +2151,7 @@ WebSocketImpl::UnregisterFeature()
mWorkerPrivate->AssertIsOnWorkerThread();
MOZ_ASSERT(mWorkerFeature);
JSContext* cx = GetCurrentThreadJSContext();
mWorkerPrivate->RemoveFeature(cx, mWorkerFeature);
mWorkerPrivate->RemoveFeature(mWorkerFeature);
mWorkerFeature = nullptr;
mWorkerPrivate = nullptr;

View File

@ -3619,8 +3619,10 @@ nsDOMWindowUtils::GetContentAPZTestData(JSContext* aContext,
{
if (nsIWidget* widget = GetWidget()) {
RefPtr<LayerManager> lm = widget->GetLayerManager();
if (lm && lm->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
ClientLayerManager* clm = static_cast<ClientLayerManager*>(lm.get());
if (!lm) {
return NS_OK;
}
if (ClientLayerManager* clm = lm->AsClientLayerManager()) {
if (!clm->GetAPZTestData().ToJS(aOutContentTestData, aContext)) {
return NS_ERROR_FAILURE;
}
@ -3636,8 +3638,10 @@ nsDOMWindowUtils::GetCompositorAPZTestData(JSContext* aContext,
{
if (nsIWidget* widget = GetWidget()) {
RefPtr<LayerManager> lm = widget->GetLayerManager();
if (lm && lm->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
ClientLayerManager* clm = static_cast<ClientLayerManager*>(lm.get());
if (!lm) {
return NS_OK;
}
if (ClientLayerManager* clm = lm->AsClientLayerManager()) {
APZTestData compositorSideData;
clm->GetCompositorSideAPZTestData(&compositorSideData);
if (!compositorSideData.ToJS(aOutCompositorTestData, aContext)) {
@ -3857,9 +3861,8 @@ nsDOMWindowUtils::SetNextPaintSyncId(int32_t aSyncId)
{
if (nsIWidget* widget = GetWidget()) {
RefPtr<LayerManager> lm = widget->GetLayerManager();
if (lm && lm->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
ClientLayerManager* clm = static_cast<ClientLayerManager*>(lm.get());
clm->SetNextPaintSyncId(aSyncId);
if (lm && lm->AsClientLayerManager()) {
lm->AsClientLayerManager()->SetNextPaintSyncId(aSyncId);
return NS_OK;
}
}

View File

@ -1574,6 +1574,15 @@ nsDocument::~nsDocument()
Accumulate(Telemetry::MIXED_CONTENT_PAGE_LOAD, mixedContentLevel);
Accumulate(Telemetry::SCROLL_LINKED_EFFECT_FOUND, mHasScrollLinkedEffect);
// record mixed object subrequest telemetry
if (mHasMixedContentObjectSubrequest) {
/* mixed object subrequest loaded on page*/
Accumulate(Telemetry::MIXED_CONTENT_OBJECT_SUBREQUEST, 1);
} else {
/* no mixed object subrequests loaded on page*/
Accumulate(Telemetry::MIXED_CONTENT_OBJECT_SUBREQUEST, 0);
}
}
}
@ -2311,7 +2320,7 @@ nsDocument::RemoveDocStyleSheetsFromStyleSets()
void
nsDocument::RemoveStyleSheetsFromStyleSets(
nsTArray<StyleSheetHandle::RefPtr>& aSheets,
const nsTArray<StyleSheetHandle::RefPtr>& aSheets,
SheetType aType)
{
// The stylesheets should forget us
@ -4131,7 +4140,7 @@ nsDocument::GetStyleSheetAt(int32_t aIndex) const
}
int32_t
nsDocument::GetIndexOfStyleSheet(StyleSheetHandle aSheet) const
nsDocument::GetIndexOfStyleSheet(const StyleSheetHandle aSheet) const
{
return mStyleSheets.IndexOf(aSheet);
}
@ -4470,7 +4479,7 @@ nsDocument::RemoveAdditionalStyleSheet(additionalSheetType aType, nsIURI* aSheet
}
StyleSheetHandle
nsDocument::FirstAdditionalAuthorSheet()
nsDocument::GetFirstAdditionalAuthorSheet()
{
return mAdditionalSheets[eAuthorSheet].SafeElementAt(0, StyleSheetHandle());
}

View File

@ -805,7 +805,8 @@ public:
*/
virtual int32_t GetNumberOfStyleSheets() const override;
virtual mozilla::StyleSheetHandle GetStyleSheetAt(int32_t aIndex) const override;
virtual int32_t GetIndexOfStyleSheet(mozilla::StyleSheetHandle aSheet) const override;
virtual int32_t GetIndexOfStyleSheet(
const mozilla::StyleSheetHandle aSheet) const override;
virtual void AddStyleSheet(mozilla::StyleSheetHandle aSheet) override;
virtual void RemoveStyleSheet(mozilla::StyleSheetHandle aSheet) override;
@ -826,7 +827,7 @@ public:
mozilla::StyleSheetHandle aSheet) override;
virtual void RemoveAdditionalStyleSheet(additionalSheetType aType,
nsIURI* sheetURI) override;
virtual mozilla::StyleSheetHandle FirstAdditionalAuthorSheet() override;
virtual mozilla::StyleSheetHandle GetFirstAdditionalAuthorSheet() override;
virtual nsIChannel* GetChannel() const override {
return mChannel;
@ -1494,7 +1495,7 @@ protected:
void RemoveDocStyleSheetsFromStyleSets();
void RemoveStyleSheetsFromStyleSets(
nsTArray<mozilla::StyleSheetHandle::RefPtr>& aSheets,
const nsTArray<mozilla::StyleSheetHandle::RefPtr>& aSheets,
mozilla::SheetType aType);
void ResetStylesheetsToURI(nsIURI* aURI);
void FillStyleSet(mozilla::StyleSetHandle aStyleSet);

View File

@ -610,6 +610,14 @@ public:
mHasMixedDisplayContentBlocked = aHasMixedDisplayContentBlocked;
}
/**
* Set the mixed content object subrequest flag for this document.
*/
void SetHasMixedContentObjectSubrequest(bool aHasMixedContentObjectSubrequest)
{
mHasMixedContentObjectSubrequest = aHasMixedContentObjectSubrequest;
}
/**
* Get tracking content blocked flag for this document.
*/
@ -954,7 +962,8 @@ public:
* @param aSheet the sheet to get the index of
* @return aIndex the index of the sheet in the full list
*/
virtual int32_t GetIndexOfStyleSheet(mozilla::StyleSheetHandle aSheet) const = 0;
virtual int32_t GetIndexOfStyleSheet(
const mozilla::StyleSheetHandle aSheet) const = 0;
/**
* Replace the stylesheets in aOldSheets with the stylesheets in
@ -998,7 +1007,7 @@ public:
mozilla::StyleSheetHandle aSheet) = 0;
virtual void RemoveAdditionalStyleSheet(additionalSheetType aType,
nsIURI* sheetURI) = 0;
virtual mozilla::StyleSheetHandle FirstAdditionalAuthorSheet() = 0;
virtual mozilla::StyleSheetHandle GetFirstAdditionalAuthorSheet() = 0;
/**
* Get this document's CSSLoader. This is guaranteed to not return null.
@ -2907,6 +2916,9 @@ protected:
// True if a document has blocked Mixed Display/Passive Content (see nsMixedContentBlocker.cpp)
bool mHasMixedDisplayContentBlocked : 1;
// True if a document loads a plugin object that attempts to load mixed content subresources through necko(see nsMixedContentBlocker.cpp)
bool mHasMixedContentObjectSubrequest : 1;
// True if a document has blocked Tracking Content
bool mHasTrackingContentBlocked : 1;

View File

@ -1604,7 +1604,7 @@ DOMInterfaces = {
'workers': True,
'concrete': False,
'implicitJSContext': [
'close', 'importScripts',
'close',
],
# Rename a few things so we don't have both classes and methods
# with the same name

View File

@ -913,7 +913,8 @@ BluetoothAvrcpManager::VolumeChangeNotification(uint8_t aVolume,
}
void
BluetoothAvrcpManager::PassthroughCmdNotification(int aId, int aKeyState)
BluetoothAvrcpManager::PassthroughCmdNotification(uint8_t aId,
uint8_t aKeyState)
{
MOZ_ASSERT(NS_IsMainThread());

View File

@ -108,7 +108,7 @@ private:
void VolumeChangeNotification(uint8_t aVolume, uint8_t aCType) override;
void PassthroughCmdNotification(int aId, int aKeyState) override;
void PassthroughCmdNotification(uint8_t aId, uint8_t aKeyState) override;
BluetoothAddress mDeviceAddress;
RefPtr<BluetoothProfileController> mController;

View File

@ -550,7 +550,7 @@ public:
nsresult
operator () (uint8_t& aArg1,
nsAutoArrayPtr<BluetoothAvrcpPlayerAttribute>& aArg2) const
UniquePtr<BluetoothAvrcpPlayerAttribute[]>& aArg2) const
{
DaemonSocketPDU& pdu = GetPDU();
@ -591,7 +591,7 @@ public:
nsresult
operator () (uint8_t& aArg1,
nsAutoArrayPtr<BluetoothAvrcpPlayerAttribute>& aArg2) const
UniquePtr<BluetoothAvrcpPlayerAttribute[]>& aArg2) const
{
DaemonSocketPDU& pdu = GetPDU();
@ -632,7 +632,7 @@ public:
nsresult
operator () (uint8_t& aArg1, uint8_t& aArg2,
nsAutoArrayPtr<uint8_t>& aArg3) const
UniquePtr<uint8_t[]>& aArg3) const
{
DaemonSocketPDU& pdu = GetPDU();
@ -687,7 +687,7 @@ public:
nsresult
operator () (uint8_t& aArg1,
nsAutoArrayPtr<BluetoothAvrcpMediaAttribute>& aArg2) const
UniquePtr<BluetoothAvrcpMediaAttribute[]>& aArg2) const
{
DaemonSocketPDU& pdu = GetPDU();

View File

@ -199,19 +199,19 @@ protected:
typedef mozilla::ipc::DaemonNotificationRunnable2<
NotificationHandlerWrapper, void, uint8_t,
nsAutoArrayPtr<BluetoothAvrcpPlayerAttribute>,
UniquePtr<BluetoothAvrcpPlayerAttribute[]>,
uint8_t, const BluetoothAvrcpPlayerAttribute*>
GetPlayerAppValueNotification;
typedef mozilla::ipc::DaemonNotificationRunnable2<
NotificationHandlerWrapper, void, uint8_t,
nsAutoArrayPtr<BluetoothAvrcpPlayerAttribute>,
UniquePtr<BluetoothAvrcpPlayerAttribute[]>,
uint8_t, const BluetoothAvrcpPlayerAttribute*>
GetPlayerAppAttrsTextNotification;
typedef mozilla::ipc::DaemonNotificationRunnable3<
NotificationHandlerWrapper, void, uint8_t, uint8_t,
nsAutoArrayPtr<uint8_t>, uint8_t, uint8_t, const uint8_t*>
UniquePtr<uint8_t[]>, uint8_t, uint8_t, const uint8_t*>
GetPlayerAppValuesTextNotification;
typedef mozilla::ipc::DaemonNotificationRunnable1<
@ -221,7 +221,7 @@ protected:
typedef mozilla::ipc::DaemonNotificationRunnable2<
NotificationHandlerWrapper, void, uint8_t,
nsAutoArrayPtr<BluetoothAvrcpMediaAttribute>,
UniquePtr<BluetoothAvrcpMediaAttribute[]>,
uint8_t, const BluetoothAvrcpMediaAttribute*>
GetElementAttrNotification;
@ -234,7 +234,7 @@ protected:
VolumeChangeNotification;
typedef mozilla::ipc::DaemonNotificationRunnable2<
NotificationHandlerWrapper, void, uint8_t, uint8_t, int, int>
NotificationHandlerWrapper, void, uint8_t, uint8_t, uint8_t, uint8_t>
PassthroughCmdNotification;
class GetElementAttrInitOp;

View File

@ -796,7 +796,7 @@ public:
nsresult
operator () (BluetoothStatus& aArg1, int& aArg2,
nsAutoArrayPtr<BluetoothProperty>& aArg3) const
UniquePtr<BluetoothProperty[]>& aArg3) const
{
DaemonSocketPDU& pdu = GetPDU();
@ -845,7 +845,7 @@ public:
nsresult
operator () (BluetoothStatus& aArg1, BluetoothAddress& aArg2, int& aArg3,
nsAutoArrayPtr<BluetoothProperty>& aArg4) const
UniquePtr<BluetoothProperty[]>& aArg4) const
{
DaemonSocketPDU& pdu = GetPDU();
@ -899,7 +899,7 @@ public:
{ }
nsresult
operator () (int& aArg1, nsAutoArrayPtr<BluetoothProperty>& aArg2) const
operator () (int& aArg1, UniquePtr<BluetoothProperty[]>& aArg2) const
{
DaemonSocketPDU& pdu = GetPDU();
@ -986,7 +986,7 @@ public:
{ }
nsresult
operator () (uint16_t& aArg1, nsAutoArrayPtr<uint8_t>& aArg2,
operator () (uint16_t& aArg1, UniquePtr<uint8_t[]>& aArg2,
uint8_t& aArg3) const
{
DaemonSocketPDU& pdu = GetPDU();

View File

@ -244,18 +244,18 @@ private:
typedef mozilla::ipc::DaemonNotificationRunnable3<
NotificationHandlerWrapper, void, BluetoothStatus, int,
nsAutoArrayPtr<BluetoothProperty>, BluetoothStatus, int,
UniquePtr<BluetoothProperty[]>, BluetoothStatus, int,
const BluetoothProperty*>
AdapterPropertiesNotification;
typedef mozilla::ipc::DaemonNotificationRunnable4<
NotificationHandlerWrapper, void, BluetoothStatus, BluetoothAddress, int,
nsAutoArrayPtr<BluetoothProperty>, BluetoothStatus,
UniquePtr<BluetoothProperty[]>, BluetoothStatus,
const BluetoothAddress&, int, const BluetoothProperty*>
RemoteDevicePropertiesNotification;
typedef mozilla::ipc::DaemonNotificationRunnable2<
NotificationHandlerWrapper, void, int, nsAutoArrayPtr<BluetoothProperty>,
NotificationHandlerWrapper, void, int, UniquePtr<BluetoothProperty[]>,
int, const BluetoothProperty*>
DeviceFoundNotification;
@ -288,7 +288,7 @@ private:
AclStateChangedNotification;
typedef mozilla::ipc::DaemonNotificationRunnable3<
NotificationHandlerWrapper, void, uint16_t, nsAutoArrayPtr<uint8_t>,
NotificationHandlerWrapper, void, uint16_t, UniquePtr<uint8_t[]>,
uint8_t, uint16_t, const uint8_t*>
DutModeRecvNotification;

View File

@ -1972,7 +1972,7 @@ public:
BluetoothAttributeHandle& aArg4,
int& aArg5,
int& aArg6,
nsAutoArrayPtr<uint8_t>& aArg7,
UniquePtr<uint8_t[]>& aArg7,
bool& aArg8,
bool& aArg9) const
{

View File

@ -653,7 +653,7 @@ protected:
typedef mozilla::ipc::DaemonNotificationRunnable9<
NotificationHandlerWrapper, void,
int, int, BluetoothAddress, BluetoothAttributeHandle,
int, int, nsAutoArrayPtr<uint8_t>, bool, bool,
int, int, UniquePtr<uint8_t[]>, bool, bool,
int, int, const BluetoothAddress&, const BluetoothAttributeHandle&,
int, int, const uint8_t*, bool, bool>
ServerRequestWriteNotification;

View File

@ -1444,7 +1444,7 @@ BluetoothMapSmsManager::HandleSmsMmsPushMessage(const ObexHeaderSet& aHeader)
// Get Body
uint8_t* bodyPtr = nullptr;
aHeader.GetBody(&bodyPtr, &mBodySegmentLength);
mBodySegment = bodyPtr;
mBodySegment.reset(bodyPtr);
RefPtr<BluetoothMapBMessage> bmsg =
new BluetoothMapBMessage(bodyPtr, mBodySegmentLength);

View File

@ -285,7 +285,7 @@ private:
RefPtr<BluetoothSocket> mMnsSocket;
int mBodySegmentLength;
nsAutoArrayPtr<uint8_t> mBodySegment;
UniquePtr<uint8_t[]> mBodySegment;
/**
* The bMessage/message-listing data stream for current processing response

View File

@ -803,7 +803,7 @@ BluetoothOppManager::ExtractPacketHeaders(const ObexHeaderSet& aHeader)
aHeader.Has(ObexHeaderId::EndOfBody)) {
uint8_t* bodyPtr;
aHeader.GetBody(&bodyPtr, &mBodySegmentLength);
mBodySegment = bodyPtr;
mBodySegment.reset(bodyPtr);
}
}
@ -934,7 +934,7 @@ BluetoothOppManager::ComposePacket(uint8_t aOpCode, UnixSocketBuffer* aMessage)
* so here we keep a variable mPutPacketReceivedLength to indicate if
* current PUT request is done.
*/
mReceivedDataBuffer = new uint8_t[mPacketLength];
mReceivedDataBuffer.reset(new uint8_t[mPacketLength]);
mPutFinalFlag = (aOpCode == ObexRequestCode::PutFinal);
}

View File

@ -207,8 +207,8 @@ private:
uint32_t mSentFileLength;
bool mWaitingToSendPutFinal;
nsAutoArrayPtr<uint8_t> mBodySegment;
nsAutoArrayPtr<uint8_t> mReceivedDataBuffer;
UniquePtr<uint8_t[]> mBodySegment;
UniquePtr<uint8_t[]> mReceivedDataBuffer;
int mCurrentBlobIndex;
RefPtr<Blob> mBlob;

View File

@ -795,14 +795,14 @@ BluetoothPbapManager::ReplyToConnect(const nsAString& aPassword)
// The request-digest is required and calculated as follows:
// H(nonce ":" password)
uint32_t hashStringLength = DIGEST_LENGTH + aPassword.Length() + 1;
nsAutoArrayPtr<char> hashString(new char[hashStringLength]);
UniquePtr<char[]> hashString(new char[hashStringLength]);
memcpy(hashString, mRemoteNonce, DIGEST_LENGTH);
memcpy(hashString.get(), mRemoteNonce, DIGEST_LENGTH);
hashString[DIGEST_LENGTH] = ':';
memcpy(&hashString[DIGEST_LENGTH + 1],
NS_ConvertUTF16toUTF8(aPassword).get(),
aPassword.Length());
MD5Hash(hashString, hashStringLength);
MD5Hash(hashString.get(), hashStringLength);
// 2 tag-length-value triplets: <request-digest:16><nonce:16>
uint8_t digestResponse[(DIGEST_LENGTH + 2) * 2];
@ -1090,8 +1090,8 @@ BluetoothPbapManager::ReplyToGet(uint16_t aPhonebookSize)
// Read vCard data from input stream
uint32_t numRead = 0;
nsAutoArrayPtr<char> buf(new char[remainingPacketSize]);
rv = mVCardDataStream->Read(buf, remainingPacketSize, &numRead);
UniquePtr<char[]> buf(new char[remainingPacketSize]);
rv = mVCardDataStream->Read(buf.get(), remainingPacketSize, &numRead);
if (NS_FAILED(rv)) {
BT_LOGR("Failed to read from input stream. rv=0x%x",
static_cast<uint32_t>(rv));

View File

@ -721,7 +721,7 @@ BluetoothOppManager::ExtractPacketHeaders(const ObexHeaderSet& aHeader)
aHeader.Has(ObexHeaderId::EndOfBody)) {
uint8_t* bodyPtr;
aHeader.GetBody(&bodyPtr, &mBodySegmentLength);
mBodySegment = bodyPtr;
mBodySegment.reset(bodyPtr);
}
}
@ -851,7 +851,7 @@ BluetoothOppManager::ComposePacket(uint8_t aOpCode, UnixSocketBuffer* aMessage)
* so here we keep a variable mPutPacketReceivedLength to indicate if
* current PUT request is done.
*/
mReceivedDataBuffer = new uint8_t[mPacketLength];
mReceivedDataBuffer.reset(new uint8_t[mPacketLength]);
mPutFinalFlag = (aOpCode == ObexRequestCode::PutFinal);
}

View File

@ -191,8 +191,8 @@ private:
uint32_t mSentFileLength;
bool mWaitingToSendPutFinal;
nsAutoArrayPtr<uint8_t> mBodySegment;
nsAutoArrayPtr<uint8_t> mReceivedDataBuffer;
UniquePtr<uint8_t[]> mBodySegment;
UniquePtr<uint8_t[]> mReceivedDataBuffer;
int mCurrentBlobIndex;
RefPtr<Blob> mBlob;

View File

@ -565,7 +565,7 @@ BluetoothAvrcpNotificationHandler::VolumeChangeNotification(
void
BluetoothAvrcpNotificationHandler::PassthroughCmdNotification(
int aId, int aKeyState)
uint8_t aId, uint8_t aKeyState)
{ }
// Result handling

View File

@ -562,7 +562,7 @@ public:
VolumeChangeNotification(uint8_t aVolume, uint8_t aCType);
virtual void
PassthroughCmdNotification(int aId, int aKeyState);
PassthroughCmdNotification(uint8_t aId, uint8_t aKeyState);
protected:
BluetoothAvrcpNotificationHandler();

View File

@ -144,8 +144,8 @@ public:
, mDataLength(aDataLength)
, mData(nullptr)
{
mData = new uint8_t[mDataLength];
memcpy(mData, aData, aDataLength);
mData.reset(new uint8_t[mDataLength]);
memcpy(mData.get(), aData, aDataLength);
}
~ObexHeader()
@ -154,7 +154,7 @@ public:
ObexHeaderId mId;
int mDataLength;
nsAutoArrayPtr<uint8_t> mData;
UniquePtr<uint8_t[]> mData;
};
class ObexHeaderSet

View File

@ -421,8 +421,7 @@ BroadcastChannel::Constructor(const GlobalObject& aGlobal,
}
} else {
bc->mWorkerFeature = new BroadcastChannelFeature(bc);
JSContext* cx = workerPrivate->GetJSContext();
if (NS_WARN_IF(!workerPrivate->AddFeature(cx, bc->mWorkerFeature))) {
if (NS_WARN_IF(!workerPrivate->AddFeature(bc->mWorkerFeature))) {
NS_WARNING("Failed to register the BroadcastChannel worker feature.");
bc->mWorkerFeature = nullptr;
aRv.Throw(NS_ERROR_FAILURE);
@ -546,7 +545,7 @@ BroadcastChannel::Shutdown()
if (mWorkerFeature) {
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
workerPrivate->RemoveFeature(workerPrivate->GetJSContext(), mWorkerFeature);
workerPrivate->RemoveFeature(mWorkerFeature);
mWorkerFeature = nullptr;
}

View File

@ -25,7 +25,7 @@ Feature::Create(WorkerPrivate* aWorkerPrivate)
RefPtr<Feature> feature = new Feature(aWorkerPrivate);
if (!aWorkerPrivate->AddFeature(aWorkerPrivate->GetJSContext(), feature)) {
if (!aWorkerPrivate->AddFeature(feature)) {
return nullptr;
}
@ -102,7 +102,7 @@ Feature::~Feature()
NS_ASSERT_OWNINGTHREAD(Feature);
MOZ_ASSERT(mActorList.IsEmpty());
mWorkerPrivate->RemoveFeature(mWorkerPrivate->GetJSContext(), this);
mWorkerPrivate->RemoveFeature(this);
}
} // namespace cache

View File

@ -184,7 +184,7 @@ WebGLContextLossHandler::RunTimer()
nsCOMPtr<nsIEventTarget> target = workerPrivate->GetEventTarget();
mTimer->SetTarget(new ContextLossWorkerEventTarget(target));
if (!mFeatureAdded) {
workerPrivate->AddFeature(workerPrivate->GetJSContext(), this);
workerPrivate->AddFeature(this);
mFeatureAdded = true;
}
}
@ -207,7 +207,7 @@ WebGLContextLossHandler::DisableTimer()
dom::workers::WorkerPrivate* workerPrivate =
dom::workers::GetCurrentThreadWorkerPrivate();
MOZ_RELEASE_ASSERT(workerPrivate);
workerPrivate->RemoveFeature(workerPrivate->GetJSContext(), this);
workerPrivate->RemoveFeature(this);
mFeatureAdded = false;
}

View File

@ -324,7 +324,7 @@ struct TreeForType {};
template<>
struct TreeForType<uint8_t>
{
static ScopedDeletePtr<WebGLElementArrayCacheTree<uint8_t>>&
static UniquePtr<WebGLElementArrayCacheTree<uint8_t>>&
Value(WebGLElementArrayCache* b) {
return b->mUint8Tree;
}
@ -333,7 +333,7 @@ struct TreeForType<uint8_t>
template<>
struct TreeForType<uint16_t>
{
static ScopedDeletePtr<WebGLElementArrayCacheTree<uint16_t>>&
static UniquePtr<WebGLElementArrayCacheTree<uint16_t>>&
Value(WebGLElementArrayCache* b) {
return b->mUint16Tree;
}
@ -342,7 +342,7 @@ struct TreeForType<uint16_t>
template<>
struct TreeForType<uint32_t>
{
static ScopedDeletePtr<WebGLElementArrayCacheTree<uint32_t>>&
static UniquePtr<WebGLElementArrayCacheTree<uint32_t>>&
Value(WebGLElementArrayCache* b) {
return b->mUint32Tree;
}
@ -536,9 +536,9 @@ WebGLElementArrayCache::Validate(uint32_t maxAllowed, size_t firstElement,
if (!mBytes.Length() || !countElements)
return true;
ScopedDeletePtr<WebGLElementArrayCacheTree<T>>& tree = TreeForType<T>::Value(this);
UniquePtr<WebGLElementArrayCacheTree<T>>& tree = TreeForType<T>::Value(this);
if (!tree) {
tree = new WebGLElementArrayCacheTree<T>(*this);
tree = MakeUnique<WebGLElementArrayCacheTree<T>>(*this);
if (mBytes.Length()) {
bool valid = tree->Update(0, mBytes.Length() - 1);
if (!valid) {

View File

@ -8,7 +8,7 @@
#include "GLDefs.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/Scoped.h"
#include "mozilla/UniquePtr.h"
#include "nscore.h"
#include "nsTArray.h"
#include <stdint.h>
@ -93,9 +93,9 @@ private:
friend struct TreeForType;
FallibleTArray<uint8_t> mBytes;
ScopedDeletePtr<WebGLElementArrayCacheTree<uint8_t>> mUint8Tree;
ScopedDeletePtr<WebGLElementArrayCacheTree<uint16_t>> mUint16Tree;
ScopedDeletePtr<WebGLElementArrayCacheTree<uint32_t>> mUint32Tree;
UniquePtr<WebGLElementArrayCacheTree<uint8_t>> mUint8Tree;
UniquePtr<WebGLElementArrayCacheTree<uint16_t>> mUint16Tree;
UniquePtr<WebGLElementArrayCacheTree<uint32_t>> mUint32Tree;
};
} // end namespace mozilla

View File

@ -199,6 +199,7 @@ x-euc-jp=EUC-JP
csiso2022jp=ISO-2022-JP
iso-2022-jp=ISO-2022-JP
csshiftjis=Shift_JIS
ms932=Shift_JIS
ms_kanji=Shift_JIS
shift-jis=Shift_JIS
shift_jis=Shift_JIS

View File

@ -359,7 +359,7 @@ function testDecoderGetEncoding()
{encoding: "big5", labels: ["big5", "cn-big5", "csbig5", "x-x-big5", "big5-hkscs"]},
{encoding: "euc-jp", labels: ["cseucpkdfmtjapanese", "euc-jp", "x-euc-jp"]},
{encoding: "iso-2022-jp", labels: ["csiso2022jp", "iso-2022-jp"]},
{encoding: "shift_jis", labels: ["csshiftjis", "ms_kanji", "shift-jis", "shift_jis", "sjis", "windows-31j", "x-sjis"]},
{encoding: "shift_jis", labels: ["csshiftjis", "ms932", "ms_kanji", "shift-jis", "shift_jis", "sjis", "windows-31j", "x-sjis"]},
{encoding: "euc-kr", labels: ["cseuckr", "csksc56011987", "euc-kr", "iso-ir-149", "korean", "ks_c_5601-1987", "ks_c_5601-1989", "ksc5601", "ksc_5601", "windows-949"]},
{encoding: "utf-16le", labels: ["utf-16", "utf-16le"]},
{encoding: "utf-16be", labels: ["utf-16be"]},

View File

@ -309,7 +309,6 @@ function testPointerEventCTORS()
}
function runTests() {
SpecialPowers.setBoolPref("dom.w3c_pointer_events.enabled", true); // Enable Pointer Events
testTarget = document.getElementById("testTarget");
parent = testTarget.parentNode;
gOnPointerPropHandled = new Array;

View File

@ -93,26 +93,28 @@ function onZoomReset(aCallback) {
}, topic, false);
}
function setDeltaMultiplierSettings(aSettings)
function setDeltaMultiplierSettings(aSettings, aCallback)
{
SpecialPowers.setIntPref("mousewheel.default.delta_multiplier_x", aSettings.deltaMultiplierX * 100);
SpecialPowers.setIntPref("mousewheel.default.delta_multiplier_y", aSettings.deltaMultiplierY * 100);
SpecialPowers.setIntPref("mousewheel.default.delta_multiplier_z", aSettings.deltaMultiplierZ * 100);
SpecialPowers.setIntPref("mousewheel.with_alt.delta_multiplier_x", aSettings.deltaMultiplierX * 100);
SpecialPowers.setIntPref("mousewheel.with_alt.delta_multiplier_y", aSettings.deltaMultiplierY * 100);
SpecialPowers.setIntPref("mousewheel.with_alt.delta_multiplier_z", aSettings.deltaMultiplierZ * 100);
SpecialPowers.setIntPref("mousewheel.with_control.delta_multiplier_x", aSettings.deltaMultiplierX * 100);
SpecialPowers.setIntPref("mousewheel.with_control.delta_multiplier_y", aSettings.deltaMultiplierY * 100);
SpecialPowers.setIntPref("mousewheel.with_control.delta_multiplier_z", aSettings.deltaMultiplierZ * 100);
SpecialPowers.setIntPref("mousewheel.with_meta.delta_multiplier_x", aSettings.deltaMultiplierX * 100);
SpecialPowers.setIntPref("mousewheel.with_meta.delta_multiplier_y", aSettings.deltaMultiplierY * 100);
SpecialPowers.setIntPref("mousewheel.with_meta.delta_multiplier_z", aSettings.deltaMultiplierZ * 100);
SpecialPowers.setIntPref("mousewheel.with_shift.delta_multiplier_x", aSettings.deltaMultiplierX * 100);
SpecialPowers.setIntPref("mousewheel.with_shift.delta_multiplier_y", aSettings.deltaMultiplierY * 100);
SpecialPowers.setIntPref("mousewheel.with_shift.delta_multiplier_z", aSettings.deltaMultiplierZ * 100);
SpecialPowers.setIntPref("mousewheel.with_win.delta_multiplier_x", aSettings.deltaMultiplierX * 100);
SpecialPowers.setIntPref("mousewheel.with_win.delta_multiplier_y", aSettings.deltaMultiplierY * 100);
SpecialPowers.setIntPref("mousewheel.with_win.delta_multiplier_z", aSettings.deltaMultiplierZ * 100);
SpecialPowers.pushPrefEnv({"set": [
["mousewheel.default.delta_multiplier_x", aSettings.deltaMultiplierX * 100],
["mousewheel.default.delta_multiplier_y", aSettings.deltaMultiplierY * 100],
["mousewheel.default.delta_multiplier_z", aSettings.deltaMultiplierZ * 100],
["mousewheel.with_alt.delta_multiplier_x", aSettings.deltaMultiplierX * 100],
["mousewheel.with_alt.delta_multiplier_y", aSettings.deltaMultiplierY * 100],
["mousewheel.with_alt.delta_multiplier_z", aSettings.deltaMultiplierZ * 100],
["mousewheel.with_control.delta_multiplier_x", aSettings.deltaMultiplierX * 100],
["mousewheel.with_control.delta_multiplier_y", aSettings.deltaMultiplierY * 100],
["mousewheel.with_control.delta_multiplier_z", aSettings.deltaMultiplierZ * 100],
["mousewheel.with_meta.delta_multiplier_x", aSettings.deltaMultiplierX * 100],
["mousewheel.with_meta.delta_multiplier_y", aSettings.deltaMultiplierY * 100],
["mousewheel.with_meta.delta_multiplier_z", aSettings.deltaMultiplierZ * 100],
["mousewheel.with_shift.delta_multiplier_x", aSettings.deltaMultiplierX * 100],
["mousewheel.with_shift.delta_multiplier_y", aSettings.deltaMultiplierY * 100],
["mousewheel.with_shift.delta_multiplier_z", aSettings.deltaMultiplierZ * 100],
["mousewheel.with_win.delta_multiplier_x", aSettings.deltaMultiplierX * 100],
["mousewheel.with_win.delta_multiplier_y", aSettings.deltaMultiplierY * 100],
["mousewheel.with_win.delta_multiplier_z", aSettings.deltaMultiplierZ * 100]
]}, aCallback);
}
function doTestScroll(aSettings, aCallback)
@ -502,8 +504,8 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: 0, expectedOverflowDeltaY: 0,
shiftKey: false, ctrlKey: true, altKey: false, metaKey: false, osKey: false },
expected: kNoScroll,
prepare: function () { SpecialPowers.setIntPref("mousewheel.default.action", 0); },
cleanup: function () { SpecialPowers.setIntPref("mousewheel.default.action", 1); } },
prepare: function (cb) { SpecialPowers.pushPrefEnv({"set": [["mousewheel.default.action", 0]]}, cb); },
cleanup: function (cb) { SpecialPowers.pushPrefEnv({"set": [["mousewheel.default.action", 1]]}, cb); } },
// momentum scroll should cause scroll even if the action is history, but if the default action is none,
// shouldn't do it.
@ -605,8 +607,8 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: 0, expectedOverflowDeltaY: 0,
shiftKey: true, ctrlKey: false, altKey: false, metaKey: false, osKey: false },
expected: kNoScroll,
prepare: function () { SpecialPowers.setIntPref("mousewheel.default.action", 0); },
cleanup: function () { SpecialPowers.setIntPref("mousewheel.default.action", 1); } },
prepare: function (cb) { SpecialPowers.pushPrefEnv({"set": [["mousewheel.default.action", 0]]}, cb); },
cleanup: function (cb) { SpecialPowers.pushPrefEnv({"set": [["mousewheel.default.action", 1]]}, cb); } },
// Don't scroll along axis whose overflow style is hidden.
{ description: "Scroll to only bottom by oblique pixel wheel event with overflow-x: hidden",
@ -616,7 +618,7 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: 1, expectedOverflowDeltaY: 0,
shiftKey: false, ctrlKey: false, altKey: false, metaKey: false, osKey: false },
expected: kScrollDown,
prepare: function() { gScrollableElement.style.overflowX = "hidden"; } },
prepare: function(cb) { gScrollableElement.style.overflowX = "hidden"; cb(); } },
{ description: "Scroll to only bottom by oblique line wheel event with overflow-x: hidden",
event: { deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaX: 1.0, deltaY: 1.0, deltaZ: 0.0,
@ -652,7 +654,7 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: -1, expectedOverflowDeltaY: 0,
shiftKey: false, ctrlKey: false, altKey: false, metaKey: false, osKey: false },
expected: kScrollUp,
cleanup: function () { gScrollableElement.style.overflowX = "auto"; } },
cleanup: function (cb) { gScrollableElement.style.overflowX = "auto"; cb(); } },
{ description: "Scroll to only right by oblique pixel wheel event with overflow-y: hidden",
event: { deltaMode: WheelEvent.DOM_DELTA_PIXEL,
deltaX: 16.0, deltaY: 16.0, deltaZ: 0.0,
@ -660,7 +662,7 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: 0, expectedOverflowDeltaY: 1,
shiftKey: false, ctrlKey: false, altKey: false, metaKey: false, osKey: false },
expected: kScrollRight,
prepare: function() { gScrollableElement.style.overflowY = "hidden"; } },
prepare: function(cb) { gScrollableElement.style.overflowY = "hidden"; cb(); } },
{ description: "Scroll to only right by oblique line wheel event with overflow-y: hidden",
event: { deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaX: 1.0, deltaY: 1.0, deltaZ: 0.0,
@ -696,7 +698,7 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: 0, expectedOverflowDeltaY: -1,
shiftKey: false, ctrlKey: false, altKey: false, metaKey: false, osKey: false },
expected: kScrollLeft,
cleanup: function () { gScrollableElement.style.overflowY = "auto"; } },
cleanup: function (cb) { gScrollableElement.style.overflowY = "auto"; cb(); } },
{ description: "Don't be scrolled by oblique pixel wheel event with overflow: hidden",
event: { deltaMode: WheelEvent.DOM_DELTA_PIXEL,
deltaX: 16.0, deltaY: 16.0, deltaZ: 0.0,
@ -704,7 +706,7 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: 1, expectedOverflowDeltaY: 1,
shiftKey: false, ctrlKey: false, altKey: false, metaKey: false, osKey: false },
expected: kNoScroll,
prepare: function() { gScrollableElement.style.overflow = "hidden"; } },
prepare: function(cb) { gScrollableElement.style.overflow = "hidden"; cb(); } },
{ description: "Don't be scrolled by oblique line wheel event with overflow: hidden",
event: { deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaX: 1.0, deltaY: 1.0, deltaZ: 0.0,
@ -740,7 +742,7 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: -1, expectedOverflowDeltaY: -1,
shiftKey: false, ctrlKey: false, altKey: false, metaKey: false, osKey: false },
expected: kNoScroll,
cleanup: function () { gScrollableElement.style.overflow = "auto"; } },
cleanup: function (cb) { gScrollableElement.style.overflow = "auto"; cb(); } },
// Don't scroll along axis whose overflow style is hidden and overflow delta values should
// be zero if there is ancestor scrollable element.
@ -751,7 +753,7 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: 0, expectedOverflowDeltaY: 0,
shiftKey: false, ctrlKey: false, altKey: false, metaKey: false, osKey: false },
expected: kScrollDown,
prepare: function() {
prepare: function(cb) {
gScrollableElement.style.overflowX = "hidden";
gScrollableElement.style.position = "fixed";
gScrollableElement.style.top = "30px";
@ -761,6 +763,7 @@ function doTestScroll(aSettings, aCallback)
gSpacerForBodyElement.style.height = "5000px";
document.documentElement.scrollTop = 500;
document.documentElement.scrollLeft = 500;
cb();
} },
{ description: "Scroll to only bottom by oblique line wheel event with overflow-x: hidden (body is scrollable)",
event: { deltaMode: WheelEvent.DOM_DELTA_LINE,
@ -796,7 +799,7 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: 0, expectedOverflowDeltaY: 0,
shiftKey: false, ctrlKey: false, altKey: false, metaKey: false, osKey: false },
expected: kScrollUp,
cleanup: function () { gScrollableElement.style.overflowX = "auto"; } },
cleanup: function (cb) { gScrollableElement.style.overflowX = "auto"; cb(); } },
{ description: "Scroll to only right by oblique pixel wheel event with overflow-y: hidden (body is scrollable)",
event: { deltaMode: WheelEvent.DOM_DELTA_PIXEL,
deltaX: 16.0, deltaY: 16.0, deltaZ: 0.0,
@ -804,7 +807,7 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: 0, expectedOverflowDeltaY: 0,
shiftKey: false, ctrlKey: false, altKey: false, metaKey: false, osKey: false },
expected: kScrollRight,
prepare: function() { gScrollableElement.style.overflowY = "hidden"; } },
prepare: function(cb) { gScrollableElement.style.overflowY = "hidden"; cb(); } },
{ description: "Scroll to only right by oblique line wheel event with overflow-y: hidden (body is scrollable)",
event: { deltaMode: WheelEvent.DOM_DELTA_LINE,
deltaX: 1.0, deltaY: 1.0, deltaZ: 0.0,
@ -840,11 +843,12 @@ function doTestScroll(aSettings, aCallback)
expectedOverflowDeltaX: 0, expectedOverflowDeltaY: 0,
shiftKey: false, ctrlKey: false, altKey: false, metaKey: false, osKey: false },
expected: kScrollLeft,
cleanup: function () {
cleanup: function (cb) {
gScrollableElement.style.overflowY = "auto";
gScrollableElement.style.position = "static";
gSpacerForBodyElement.style.width = "";
gSpacerForBodyElement.style.height = "";
cb();
} },
];
@ -867,9 +871,14 @@ function doTestScroll(aSettings, aCallback)
var currentTest = kTests[currentTestIndex];
description = "doTestScroll(aSettings=" + aSettings.description + "), " + currentTest.description + ": ";
if (currentTest.prepare) {
currentTest.prepare();
currentTest.prepare(doTestCurrentScroll);
} else {
doTestCurrentScroll();
}
}
function doTestCurrentScroll() {
var currentTest = kTests[currentTestIndex];
sendWheelAndWait(10, 10, currentTest.event, function () {
if (currentTest.expected == kNoScroll) {
is(gScrollableElement.scrollTop, 1000, description + "scrolled vertical");
@ -899,10 +908,15 @@ function doTestScroll(aSettings, aCallback)
}
}
if (currentTest.cleanup) {
currentTest.cleanup();
currentTest.cleanup(nextStep);
} else {
nextStep();
}
function nextStep() {
winUtils.advanceTimeAndRefresh(100);
doNextTest();
}
}, 10);
}
doNextTest();
@ -1334,9 +1348,14 @@ function doTestZoomedScroll(aCallback)
function doTestWholeScroll(aCallback)
{
SpecialPowers.setIntPref("mousewheel.default.delta_multiplier_x", 99999999);
SpecialPowers.setIntPref("mousewheel.default.delta_multiplier_y", 99999999);
SpecialPowers.pushPrefEnv({"set": [
["mousewheel.default.delta_multiplier_x", 99999999],
["mousewheel.default.delta_multiplier_y", 99999999]]},
function() { doTestWholeScroll2(aCallback); });
}
function doTestWholeScroll2(aCallback)
{
const kTests = [
{ description: "try whole-scroll to top (line)",
prepare: function () {
@ -1574,9 +1593,6 @@ function doTestWholeScroll(aCallback)
is(gScrollableElement.scrollLeft, kTest.expectedScrollLeft,
"doTestWholeScroll, " + kTest.description + ": unexpected scrollLeft");
if (++index == kTests.length) {
SpecialPowers.clearUserPref("mousewheel.default.delta_multiplier_x");
SpecialPowers.clearUserPref("mousewheel.default.delta_multiplier_y");
SpecialPowers.clearUserPref("mousewheel.default.delta_multiplier_z");
SimpleTest.executeSoon(aCallback);
} else {
doIt();
@ -1708,14 +1724,22 @@ function doTestActionOverride(aCallback)
var index = 0;
function doIt()
{
const kTest = kTests[index];
SpecialPowers.pushPrefEnv({"set": [
["mousewheel.default.action", kTest.action],
["mousewheel.default.action.override_x", kTest.override_x]]},
doIt2
);
}
function doIt2()
{
const kTest = kTests[index];
description = "doTestActionOverride(action=" + kTest.action + ", " +
"override_x=" + kTest.override_x + ", " +
"deltaX=" + kTest.event.deltaX + ", " +
"deltaY=" + kTest.event.deltaY + "): ";
SpecialPowers.setIntPref("mousewheel.default.action", kTest.action);
SpecialPowers.setIntPref("mousewheel.default.action.override_x", kTest.override_x);
gScrollableElement.scrollTop = 1000;
gScrollableElement.scrollLeft = 1000;
sendWheelAndWait(10, 10, kTest.event, function () {
@ -1734,8 +1758,6 @@ function doTestActionOverride(aCallback)
is(gScrollableElement.scrollLeft, 1000, description + "scrolled horizontal");
}
if (++index == kTests.length) {
SpecialPowers.setIntPref("mousewheel.default.action", 1);
SpecialPowers.setIntPref("mousewheel.default.action.override_x", -1);
SimpleTest.executeSoon(aCallback);
} else {
doIt();
@ -1747,15 +1769,19 @@ function doTestActionOverride(aCallback)
function runTests()
{
SpecialPowers.setBoolPref("general.smoothScroll", false);
SpecialPowers.setIntPref("mousewheel.default.action", 1); // scroll
SpecialPowers.setIntPref("mousewheel.default.action.override_x", -1);
SpecialPowers.setIntPref("mousewheel.with_shift.action", 2); // history
SpecialPowers.setIntPref("mousewheel.with_shift.action.override_x", -1);
SpecialPowers.setIntPref("mousewheel.with_control.action", 3); // zoom
SpecialPowers.setIntPref("mousewheel.with_control.action.override_x", -1);
SpecialPowers.pushPrefEnv({"set": [
["general.smoothScroll", false],
["mousewheel.default.action", 1], // scroll
["mousewheel.default.action.override_x", -1],
["mousewheel.with_shift.action", 2], // history
["mousewheel.with_shift.action.override_x", -1],
["mousewheel.with_control.action", 3], // zoom
["mousewheel.with_control.action.override_x", -1]]},
runTests2);
}
function runTests2()
{
const kSettings = [
{ description: "all delta values are not customized",
deltaMultiplierX: 1.0, deltaMultiplierY: 1.0, deltaMultiplierZ: 1.0 },
@ -1782,11 +1808,11 @@ function runTests()
var index = 0;
function doTest() {
setDeltaMultiplierSettings(kSettings[index]);
setDeltaMultiplierSettings(kSettings[index], function () {
doTestScroll(kSettings[index], function () {
doTestZoom(kSettings[index], function() {
if (++index == kSettings.length) {
setDeltaMultiplierSettings(kSettings[0]);
setDeltaMultiplierSettings(kSettings[0], function() {
doTestZoomedScroll(function() {
doTestWholeScroll(function() {
doTestActionOverride(function() {
@ -1794,44 +1820,20 @@ function runTests()
});
});
});
});
} else {
doTest();
}
});
});
});
}
doTest();
}
function finishTests()
{
SpecialPowers.clearUserPref("general.smoothScroll");
SpecialPowers.clearUserPref("mousewheel.default.action");
SpecialPowers.clearUserPref("mousewheel.default.action.override_x");
SpecialPowers.clearUserPref("mousewheel.with_shift.action");
SpecialPowers.clearUserPref("mousewheel.with_shift.action.override_x");
SpecialPowers.clearUserPref("mousewheel.with_control.action");
SpecialPowers.clearUserPref("mousewheel.with_control.action.override_x");
SpecialPowers.clearUserPref("mousewheel.default.delta_multiplier_x");
SpecialPowers.clearUserPref("mousewheel.default.delta_multiplier_y");
SpecialPowers.clearUserPref("mousewheel.default.delta_multiplier_z");
SpecialPowers.clearUserPref("mousewheel.with_alt.delta_multiplier_x");
SpecialPowers.clearUserPref("mousewheel.with_alt.delta_multiplier_y");
SpecialPowers.clearUserPref("mousewheel.with_alt.delta_multiplier_z");
SpecialPowers.clearUserPref("mousewheel.with_control.delta_multiplier_x");
SpecialPowers.clearUserPref("mousewheel.with_control.delta_multiplier_y");
SpecialPowers.clearUserPref("mousewheel.with_control.delta_multiplier_z");
SpecialPowers.clearUserPref("mousewheel.with_meta.delta_multiplier_x");
SpecialPowers.clearUserPref("mousewheel.with_meta.delta_multiplier_y");
SpecialPowers.clearUserPref("mousewheel.with_meta.delta_multiplier_z");
SpecialPowers.clearUserPref("mousewheel.with_shift.delta_multiplier_x");
SpecialPowers.clearUserPref("mousewheel.with_shift.delta_multiplier_y");
SpecialPowers.clearUserPref("mousewheel.with_shift.delta_multiplier_z");
SpecialPowers.clearUserPref("mousewheel.with_win.delta_multiplier_x");
SpecialPowers.clearUserPref("mousewheel.with_win.delta_multiplier_y");
SpecialPowers.clearUserPref("mousewheel.with_win.delta_multiplier_z");
winUtils.restoreNormalRefresh();

View File

@ -307,7 +307,7 @@ public:
MOZ_ASSERT(aWorkerPrivate);
aWorkerPrivate->AssertIsOnWorkerThread();
mResolver->mPromiseProxy->CleanUp(aCx);
mResolver->mPromiseProxy->CleanUp();
return true;
}
};
@ -818,7 +818,7 @@ FetchBody<Derived>::RegisterFeature()
MOZ_ASSERT(!mFeature);
mFeature = new FetchBodyFeature<Derived>(this);
if (!mWorkerPrivate->AddFeature(mWorkerPrivate->GetJSContext(), mFeature)) {
if (!mWorkerPrivate->AddFeature(mFeature)) {
NS_WARNING("Failed to add feature");
mFeature = nullptr;
return false;
@ -835,7 +835,7 @@ FetchBody<Derived>::UnregisterFeature()
mWorkerPrivate->AssertIsOnWorkerThread();
MOZ_ASSERT(mFeature);
mWorkerPrivate->RemoveFeature(mWorkerPrivate->GetJSContext(), mFeature);
mWorkerPrivate->RemoveFeature(mFeature);
mFeature = nullptr;
}

View File

@ -141,6 +141,12 @@ public:
, mUnsafeRequest(false)
, mUseURLCredentials(false)
{
// Normally we strip the fragment from the URL in Request::Constructor.
// If internal code is directly constructing this object they must
// strip the fragment first. Since these should be well formed URLs we
// can use a simple check for a fragment here. The full parser is
// difficult to use off the main thread.
MOZ_ASSERT(mURL.Find(NS_LITERAL_CSTRING("#")) == kNotFound);
}
already_AddRefed<InternalRequest> Clone();

View File

@ -959,8 +959,7 @@ public:
mActor = nullptr;
mWorkerPrivate->AssertIsOnWorkerThread();
JSContext* cx = mWorkerPrivate->GetJSContext();
mWorkerPrivate->RemoveFeature(cx, this);
mWorkerPrivate->RemoveFeature(this);
}
private:
@ -1412,10 +1411,7 @@ BackgroundFactoryRequestChild::RecvPermissionChallenge(
new WorkerPermissionChallenge(workerPrivate, this, mFactory,
aPrincipalInfo);
JSContext* cx = workerPrivate->GetJSContext();
MOZ_ASSERT(cx);
if (NS_WARN_IF(!workerPrivate->AddFeature(cx, challenge))) {
if (NS_WARN_IF(!workerPrivate->AddFeature(challenge))) {
return false;
}

View File

@ -491,7 +491,7 @@ public:
MOZ_COUNT_DTOR(IDBOpenDBRequest::WorkerFeature);
if (mWorkerPrivate) {
mWorkerPrivate->RemoveFeature(mWorkerPrivate->GetJSContext(), this);
mWorkerPrivate->RemoveFeature(this);
}
}
@ -572,11 +572,8 @@ IDBOpenDBRequest::CreateForJS(IDBFactory* aFactory,
workerPrivate->AssertIsOnWorkerThread();
JSContext* cx = workerPrivate->GetJSContext();
MOZ_ASSERT(cx);
nsAutoPtr<WorkerFeature> feature(new WorkerFeature(workerPrivate));
if (NS_WARN_IF(!workerPrivate->AddFeature(cx, feature))) {
if (NS_WARN_IF(!workerPrivate->AddFeature(feature))) {
feature->NoteAddFeatureFailed();
return nullptr;
}

View File

@ -62,7 +62,7 @@ public:
MOZ_COUNT_DTOR(IDBTransaction::WorkerFeature);
mWorkerPrivate->RemoveFeature(mWorkerPrivate->GetJSContext(), this);
mWorkerPrivate->RemoveFeature(this);
}
private:
@ -239,11 +239,8 @@ IDBTransaction::Create(IDBDatabase* aDatabase,
workerPrivate->AssertIsOnWorkerThread();
JSContext* cx = workerPrivate->GetJSContext();
MOZ_ASSERT(cx);
transaction->mWorkerFeature = new WorkerFeature(workerPrivate, transaction);
MOZ_ALWAYS_TRUE(workerPrivate->AddFeature(cx, transaction->mWorkerFeature));
MOZ_ALWAYS_TRUE(workerPrivate->AddFeature(transaction->mWorkerFeature));
}
return transaction.forget();

View File

@ -3254,15 +3254,6 @@ ContentChild::RecvEndDragSession(const bool& aDoneDrag,
return true;
}
bool
ContentChild::RecvTestGraphicsDeviceReset(const uint32_t& aResetReason)
{
#if defined(XP_WIN)
gfxPlatform::GetPlatform()->TestDeviceReset(DeviceResetReason(aResetReason));
#endif
return true;
}
bool
ContentChild::RecvPush(const nsCString& aScope,
const IPC::Principal& aPrincipal)

View File

@ -610,8 +610,6 @@ public:
virtual bool RecvGamepadUpdate(const GamepadChangeEvent& aGamepadEvent) override;
virtual bool RecvTestGraphicsDeviceReset(const uint32_t& aResetReason) override;
private:
virtual void ActorDestroy(ActorDestroyReason why) override;

View File

@ -710,12 +710,6 @@ child:
*/
async GamepadUpdate(GamepadChangeEvent aGamepadEvent);
/**
* Tell the child that for testing purposes, a graphics device reset has
* occurred.
*/
async TestGraphicsDeviceReset(uint32_t aReason);
/**
* Notify the child that presentation receiver has been launched with the
* correspondent iframe.

View File

@ -109,6 +109,7 @@
#include "nsIScriptError.h"
#include "mozilla/EventForwards.h"
#include "nsDeviceContext.h"
#include "FrameLayerBuilder.h"
#define BROWSER_ELEMENT_CHILD_SCRIPT \
NS_LITERAL_STRING("chrome://global/content/BrowserElementChild.js")
@ -2830,8 +2831,7 @@ TabChild::DidComposite(uint64_t aTransactionId,
MOZ_ASSERT(mPuppetWidget->GetLayerManager()->GetBackendType() ==
LayersBackend::LAYERS_CLIENT);
ClientLayerManager *manager =
static_cast<ClientLayerManager*>(mPuppetWidget->GetLayerManager());
ClientLayerManager *manager = mPuppetWidget->GetLayerManager()->AsClientLayerManager();
manager->DidComposite(aTransactionId, aCompositeStart, aCompositeEnd);
}
@ -2864,11 +2864,35 @@ TabChild::ClearCachedResources()
MOZ_ASSERT(mPuppetWidget->GetLayerManager()->GetBackendType() ==
LayersBackend::LAYERS_CLIENT);
ClientLayerManager *manager =
static_cast<ClientLayerManager*>(mPuppetWidget->GetLayerManager());
ClientLayerManager *manager = mPuppetWidget->GetLayerManager()->AsClientLayerManager();
manager->ClearCachedResources();
}
void
TabChild::InvalidateLayers()
{
MOZ_ASSERT(mPuppetWidget);
MOZ_ASSERT(mPuppetWidget->GetLayerManager());
MOZ_ASSERT(mPuppetWidget->GetLayerManager()->GetBackendType() ==
LayersBackend::LAYERS_CLIENT);
RefPtr<LayerManager> lm = mPuppetWidget->GetLayerManager();
FrameLayerBuilder::InvalidateAllLayers(lm);
}
void
TabChild::CompositorUpdated(const TextureFactoryIdentifier& aNewIdentifier)
{
gfxPlatform::GetPlatform()->UpdateRenderModeIfDeviceReset();
RefPtr<LayerManager> lm = mPuppetWidget->GetLayerManager();
ClientLayerManager* clm = lm->AsClientLayerManager();
mTextureFactoryIdentifier = aNewIdentifier;
clm->UpdateTextureFactoryIdentifier(aNewIdentifier);
FrameLayerBuilder::InvalidateAllLayers(clm);
}
NS_IMETHODIMP
TabChild::OnShowTooltip(int32_t aXCoords, int32_t aYCoords, const char16_t *aTipText)
{

View File

@ -545,6 +545,8 @@ public:
const TimeStamp& aCompositeReqEnd);
void ClearCachedResources();
void InvalidateLayers();
void CompositorUpdated(const TextureFactoryIdentifier& aNewIdentifier);
static inline TabChild* GetFrom(nsIDOMWindow* aWindow)
{

View File

@ -249,11 +249,25 @@ VideoTrackEncoder::AppendVideoSegment(const VideoSegment& aSegment)
VideoSegment::ChunkIterator iter(const_cast<VideoSegment&>(aSegment));
while (!iter.IsEnded()) {
VideoChunk chunk = *iter;
mTotalFrameDuration += chunk.GetDuration();
// Send only the unique video frames for encoding
if (mLastFrame != chunk.mFrame) {
RefPtr<layers::Image> image = chunk.mFrame.GetImage();
// Because we may get chunks with a null image (due to input blocking),
// accumulate duration and give it to the next frame that arrives.
// Canonically incorrect - the duration should go to the previous frame
// - but that would require delaying until the next frame arrives.
// Best would be to do like OMXEncoder and pass an effective timestamp
// in with each frame (don't zero mTotalFrameDuration)
if (image) {
mRawSegment.AppendFrame(image.forget(),
chunk.GetDuration(),
mTotalFrameDuration,
chunk.mFrame.GetIntrinsicSize(),
chunk.mFrame.GetForceBlack());
mTotalFrameDuration = 0;
}
}
mLastFrame.TakeFrom(&chunk.mFrame);
iter.Next();
}

View File

@ -112,7 +112,9 @@ VP8TrackEncoder::Init(int32_t aWidth, int32_t aHeight, int32_t aDisplayWidth,
config.rc_dropframe_thresh = 0;
config.rc_end_usage = VPX_CBR;
config.g_pass = VPX_RC_ONE_PASS;
config.rc_resize_allowed = 1;
// ffmpeg doesn't currently support streams that use resize.
// Therefore, for safety, we should turn it off until it does.
config.rc_resize_allowed = 0;
config.rc_undershoot_pct = 100;
config.rc_overshoot_pct = 15;
config.rc_buf_initial_sz = 500;

View File

@ -56,7 +56,7 @@ VorbisTrackEncoder::Init(int aChannels, int aSamplingRate)
double quality = mAudioBitrate ? (double)mAudioBitrate/aSamplingRate :
BASE_QUALITY;
printf("quality %f \n", quality);
VORBISLOG("quality %f", quality);
ret = vorbis_encode_init_vbr(&mVorbisInfo, mChannels, mSamplingRate,
quality);

View File

@ -347,8 +347,7 @@ MessagePort::Initialize(const nsID& aUUID,
MOZ_ASSERT(!mWorkerFeature);
nsAutoPtr<WorkerFeature> feature(new MessagePortFeature(this));
JSContext* cx = workerPrivate->GetJSContext();
if (NS_WARN_IF(!workerPrivate->AddFeature(cx, feature))) {
if (NS_WARN_IF(!workerPrivate->AddFeature(feature))) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
@ -884,8 +883,7 @@ MessagePort::UpdateMustKeepAlive()
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
MOZ_ASSERT(workerPrivate);
workerPrivate->RemoveFeature(workerPrivate->GetJSContext(),
mWorkerFeature);
workerPrivate->RemoveFeature(mWorkerFeature);
mWorkerFeature = nullptr;
}

View File

@ -389,7 +389,7 @@ protected:
{
aWorkerPrivate->AssertIsOnWorkerThread();
aWorkerPrivate->ModifyBusyCountFromWorker(true);
WorkerRunInternal(aCx, aWorkerPrivate);
WorkerRunInternal(aWorkerPrivate);
return true;
}
@ -401,7 +401,7 @@ protected:
}
virtual void
WorkerRunInternal(JSContext* aCx, WorkerPrivate* aWorkerPrivate) = 0;
WorkerRunInternal(WorkerPrivate* aWorkerPrivate) = 0;
};
// Overrides dispatch and run handlers so we can directly dispatch from main
@ -419,7 +419,7 @@ public:
{}
void
WorkerRunInternal(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
WorkerRunInternal(WorkerPrivate* aWorkerPrivate) override
{
mNotification->DispatchTrustedEvent(mEventName);
}
@ -435,7 +435,7 @@ public:
{}
void
WorkerRunInternal(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
WorkerRunInternal(WorkerPrivate* aWorkerPrivate) override
{
mNotification->ReleaseObject();
}
@ -1364,7 +1364,7 @@ public:
}
void
WorkerRunInternal(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
WorkerRunInternal(WorkerPrivate* aWorkerPrivate) override
{
bool doDefaultAction = mNotification->DispatchClickEvent();
MOZ_ASSERT_IF(mWorkerPrivate->IsServiceWorker(), !doDefaultAction);
@ -2080,7 +2080,7 @@ public:
}
void
WorkerRunInternal(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
WorkerRunInternal(WorkerPrivate* aWorkerPrivate) override
{
RefPtr<Promise> workerPromise = mPromiseProxy->WorkerPromise();
@ -2110,7 +2110,7 @@ public:
}
workerPromise->MaybeResolve(notifications);
mPromiseProxy->CleanUp(aCx);
mPromiseProxy->CleanUp();
}
};
@ -2510,8 +2510,7 @@ Notification::RegisterFeature()
mWorkerPrivate->AssertIsOnWorkerThread();
MOZ_ASSERT(!mFeature);
mFeature = MakeUnique<NotificationFeature>(this);
bool added = mWorkerPrivate->AddFeature(mWorkerPrivate->GetJSContext(),
mFeature.get());
bool added = mWorkerPrivate->AddFeature(mFeature.get());
if (!added) {
mFeature = nullptr;
}
@ -2525,8 +2524,7 @@ Notification::UnregisterFeature()
MOZ_ASSERT(mWorkerPrivate);
mWorkerPrivate->AssertIsOnWorkerThread();
MOZ_ASSERT(mFeature);
mWorkerPrivate->RemoveFeature(mWorkerPrivate->GetJSContext(),
mFeature.get());
mWorkerPrivate->RemoveFeature(mFeature.get());
mFeature = nullptr;
}

View File

@ -694,7 +694,6 @@ NP_GetValue(void* future, NPPVariable aVariable, void* aValue) {
break;
default:
return NPERR_INVALID_PARAM;
break;
}
return NPERR_NO_ERROR;
}
@ -2206,7 +2205,9 @@ compareVariants(NPP instance, const NPVariant* var1, const NPVariant* var2)
return false;
}
switch (var1->type) {
// Cast var1->type from NPVariantType to int to avoid compiler warnings about
// not needing a default case when we have cases for every enum value.
switch (static_cast<int>(var1->type)) {
case NPVariantType_Int32: {
int32_t result = NPVARIANT_TO_INT32(*var1);
int32_t expected = NPVARIANT_TO_INT32(*var2);
@ -2299,6 +2300,7 @@ compareVariants(NPP instance, const NPVariant* var1, const NPVariant* var2)
default:
id->err << "Unknown variant type";
success = false;
MOZ_ASSERT_UNREACHABLE("Unknown variant type?!");
}
return success;
@ -3981,4 +3983,3 @@ getAudioMuted(NPObject* npobj, const NPVariant* args, uint32_t argCount, NPVaria
BOOLEAN_TO_NPVARIANT(id->audioMuted, *result);
return true;
}

View File

@ -471,8 +471,7 @@ int32_t pluginGetEdge(InstanceData* instanceData, RectEdge edge)
case EDGE_BOTTOM:
return pluginY + pluginHeight;
}
return NPTEST_INT32_ERROR;
MOZ_CRASH("Unexpected RectEdge?!");
}
#ifdef MOZ_X11

View File

@ -275,7 +275,7 @@ int32_t pluginGetEdge(InstanceData* instanceData, RectEdge edge)
case EDGE_BOTTOM:
return w->y + w->height;
}
return NPTEST_INT32_ERROR;
MOZ_CRASH("Unexpected RectEdge?!");
}
int32_t pluginGetClipRegionRectCount(InstanceData* instanceData)
@ -304,7 +304,7 @@ int32_t pluginGetClipRegionRectEdge(InstanceData* instanceData,
case EDGE_BOTTOM:
return w->clipRect.bottom + COCOA_TITLEBAR_HEIGHT;
}
return NPTEST_INT32_ERROR;
MOZ_CRASH("Unexpected RectEdge?!");
}
void pluginDoInternalConsistencyCheck(InstanceData* instanceData, string& error)

View File

@ -2607,7 +2607,7 @@ Promise::Settle(JS::Handle<JS::Value> aValue, PromiseState aState)
worker->AssertIsOnWorkerThread();
mFeature = new PromiseReportRejectFeature(this);
if (NS_WARN_IF(!worker->AddFeature(worker->GetJSContext(), mFeature))) {
if (NS_WARN_IF(!worker->AddFeature(mFeature))) {
// To avoid a false RemoveFeature().
mFeature = nullptr;
// Worker is shutting down, report rejection immediately since it is
@ -2657,7 +2657,7 @@ Promise::RemoveFeature()
if (mFeature) {
workers::WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
MOZ_ASSERT(worker);
worker->RemoveFeature(worker->GetJSContext(), mFeature);
worker->RemoveFeature(mFeature);
mFeature = nullptr;
}
}
@ -2747,7 +2747,7 @@ public:
(workerPromise->*mFunc)(aCx, value);
// Release the Promise because it has been resolved/rejected for sure.
mPromiseWorkerProxy->CleanUp(aCx);
mPromiseWorkerProxy->CleanUp();
return true;
}
@ -2833,8 +2833,7 @@ PromiseWorkerProxy::AddRefObject()
MOZ_ASSERT(mWorkerPrivate);
mWorkerPrivate->AssertIsOnWorkerThread();
MOZ_ASSERT(!mFeatureAdded);
if (!mWorkerPrivate->AddFeature(mWorkerPrivate->GetJSContext(),
this)) {
if (!mWorkerPrivate->AddFeature(this)) {
return false;
}
@ -2926,14 +2925,14 @@ bool
PromiseWorkerProxy::Notify(JSContext* aCx, Status aStatus)
{
if (aStatus >= Canceling) {
CleanUp(aCx);
CleanUp();
}
return true;
}
void
PromiseWorkerProxy::CleanUp(JSContext* aCx)
PromiseWorkerProxy::CleanUp()
{
// Can't release Mutex while it is still locked, so scope the lock.
{
@ -2947,13 +2946,12 @@ PromiseWorkerProxy::CleanUp(JSContext* aCx)
MOZ_ASSERT(mWorkerPrivate);
mWorkerPrivate->AssertIsOnWorkerThread();
MOZ_ASSERT(mWorkerPrivate->GetJSContext() == aCx);
// Release the Promise and remove the PromiseWorkerProxy from the features of
// the worker thread since the Promise has been resolved/rejected or the
// worker thread has been cancelled.
MOZ_ASSERT(mFeatureAdded);
mWorkerPrivate->RemoveFeature(mWorkerPrivate->GetJSContext(), this);
mWorkerPrivate->RemoveFeature(this);
mFeatureAdded = false;
CleanProperties();
}

View File

@ -101,7 +101,7 @@ class WorkerPrivate;
// aWorkerPrivate->AssertIsOnWorkerThread();
// RefPtr<Promise> promise = mProxy->WorkerPromise();
// promise->MaybeResolve(mResult);
// mProxy->CleanUp(aCx);
// mProxy->CleanUp();
// }
//
// Note: If a PromiseWorkerProxy is not cleaned up by a WorkerRunnable - this
@ -154,7 +154,7 @@ public:
// sure this is the last thing you do.
// 1. WorkerPrivate() will no longer return a valid worker.
// 2. WorkerPromise() will crash!
void CleanUp(JSContext* aCx);
void CleanUp();
Mutex& Lock()
{

View File

@ -406,7 +406,7 @@ public:
promise->MaybeReject(NS_ERROR_DOM_PUSH_SERVICE_UNREACHABLE);
}
mProxy->CleanUp(aCx);
mProxy->CleanUp();
return true;
}
private:
@ -601,7 +601,7 @@ public:
promise->MaybeReject(NS_ERROR_DOM_PUSH_ABORT_ERR);
}
mProxy->CleanUp(aCx);
mProxy->CleanUp();
return true;
}
private:
@ -872,7 +872,7 @@ public:
promise->MaybeReject(aCx, JS::UndefinedHandleValue);
}
mProxy->CleanUp(aCx);
mProxy->CleanUp();
return true;
}

View File

@ -773,6 +773,11 @@ nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect,
}
}
// set hasMixedContentObjectSubrequest on this object if necessary
if (aContentType == TYPE_OBJECT_SUBREQUEST) {
rootDoc->SetHasMixedContentObjectSubrequest(true);
}
// If the content is display content, and the pref says display content should be blocked, block it.
if (sBlockMixedDisplay && classification == eMixedDisplay) {
if (allowMixedContent) {

View File

@ -911,7 +911,7 @@ DataStoreChangeEventProxy::DataStoreChangeEventProxy(
// We do this to make sure the worker thread won't shut down before the event
// is dispatched to the WorkerStore on the worker thread.
if (!mWorkerPrivate->AddFeature(mWorkerPrivate->GetJSContext(), this)) {
if (!mWorkerPrivate->AddFeature(this)) {
MOZ_ASSERT(false, "cannot add the worker feature!");
return;
}
@ -980,7 +980,7 @@ DataStoreChangeEventProxy::Notify(JSContext* aCx, Status aStatus)
// features of the worker thread since the worker thread has been cancelled.
if (aStatus >= Canceling) {
mWorkerStore = nullptr;
mWorkerPrivate->RemoveFeature(aCx, this);
mWorkerPrivate->RemoveFeature(this);
mCleanedUp = true;
}

View File

@ -1776,7 +1776,7 @@ ScriptExecutorRunnable::WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
MOZ_ASSERT(!mScriptLoader.mRv.Failed(), "Who failed it and why?");
mScriptLoader.mRv.MightThrowJSException();
if (NS_FAILED(loadInfo.mLoadResult)) {
scriptloader::ReportLoadError(aCx, mScriptLoader.mRv,
scriptloader::ReportLoadError(mScriptLoader.mRv,
loadInfo.mLoadResult, loadInfo.mURL);
// Top level scripts only!
if (mIsWorkerScript) {
@ -1897,7 +1897,7 @@ ScriptExecutorRunnable::ShutdownScriptLoader(JSContext* aCx,
}
}
aWorkerPrivate->RemoveFeature(aCx, &mScriptLoader);
aWorkerPrivate->RemoveFeature(&mScriptLoader);
aWorkerPrivate->StopSyncLoop(mSyncLoopTarget, aResult);
}
@ -1933,7 +1933,7 @@ ScriptExecutorRunnable::LogExceptionToConsole(JSContext* aCx,
}
void
LoadAllScripts(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
LoadAllScripts(WorkerPrivate* aWorkerPrivate,
nsTArray<ScriptLoadInfo>& aLoadInfos, bool aIsMainScript,
WorkerScriptType aWorkerScriptType, ErrorResult& aRv)
{
@ -1949,7 +1949,7 @@ LoadAllScripts(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
NS_ASSERTION(aLoadInfos.IsEmpty(), "Should have swapped!");
if (!aWorkerPrivate->AddFeature(aCx, loader)) {
if (!aWorkerPrivate->AddFeature(loader)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
@ -1957,7 +1957,7 @@ LoadAllScripts(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
if (NS_FAILED(NS_DispatchToMainThread(loader))) {
NS_ERROR("Failed to dispatch!");
aWorkerPrivate->RemoveFeature(aCx, loader);
aWorkerPrivate->RemoveFeature(loader);
aRv.Throw(NS_ERROR_FAILURE);
return;
}
@ -2019,7 +2019,7 @@ ChannelFromScriptURLWorkerThread(JSContext* aCx,
return getter->GetResult();
}
void ReportLoadError(JSContext* aCx, ErrorResult& aRv, nsresult aLoadResult,
void ReportLoadError(ErrorResult& aRv, nsresult aLoadResult,
const nsAString& aScriptURL)
{
MOZ_ASSERT(!aRv.Failed());
@ -2072,23 +2072,21 @@ void ReportLoadError(JSContext* aCx, ErrorResult& aRv, nsresult aLoadResult,
}
void
LoadMainScript(JSContext* aCx, const nsAString& aScriptURL,
LoadMainScript(WorkerPrivate* aWorkerPrivate,
const nsAString& aScriptURL,
WorkerScriptType aWorkerScriptType,
ErrorResult& aRv)
{
WorkerPrivate* worker = GetWorkerPrivateFromContext(aCx);
NS_ASSERTION(worker, "This should never be null!");
nsTArray<ScriptLoadInfo> loadInfos;
ScriptLoadInfo* info = loadInfos.AppendElement();
info->mURL = aScriptURL;
LoadAllScripts(aCx, worker, loadInfos, true, aWorkerScriptType, aRv);
LoadAllScripts(aWorkerPrivate, loadInfos, true, aWorkerScriptType, aRv);
}
void
Load(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
Load(WorkerPrivate* aWorkerPrivate,
const nsTArray<nsString>& aScriptURLs, WorkerScriptType aWorkerScriptType,
ErrorResult& aRv)
{
@ -2110,7 +2108,7 @@ Load(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
loadInfos[index].mURL = aScriptURLs[index];
}
LoadAllScripts(aCx, aWorkerPrivate, loadInfos, false, aWorkerScriptType, aRv);
LoadAllScripts(aWorkerPrivate, loadInfos, false, aWorkerScriptType, aRv);
}
} // namespace scriptloader

View File

@ -47,15 +47,15 @@ ChannelFromScriptURLWorkerThread(JSContext* aCx,
const nsAString& aScriptURL,
nsIChannel** aChannel);
void ReportLoadError(JSContext* aCx, ErrorResult& aRv, nsresult aLoadResult,
void ReportLoadError(ErrorResult& aRv, nsresult aLoadResult,
const nsAString& aScriptURL);
void LoadMainScript(JSContext* aCx, const nsAString& aScriptURL,
void LoadMainScript(WorkerPrivate* aWorkerPrivate,
const nsAString& aScriptURL,
WorkerScriptType aWorkerScriptType,
ErrorResult& aRv);
void Load(JSContext* aCx,
WorkerPrivate* aWorkerPrivate,
void Load(WorkerPrivate* aWorkerPrivate,
const nsTArray<nsString>& aScriptURLs,
WorkerScriptType aWorkerScriptType,
mozilla::ErrorResult& aRv);

View File

@ -94,7 +94,7 @@ class GetRunnable final : public nsRunnable
} else {
promise->MaybeResolve(JS::UndefinedHandleValue);
}
mPromiseProxy->CleanUp(aCx);
mPromiseProxy->CleanUp();
return true;
}
};
@ -172,7 +172,7 @@ class MatchAllRunnable final : public nsRunnable
}
promise->MaybeResolve(ret);
mPromiseProxy->CleanUp(aCx);
mPromiseProxy->CleanUp();
return true;
}
};
@ -246,7 +246,7 @@ public:
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
}
mPromiseProxy->CleanUp(aCx);
mPromiseProxy->CleanUp();
return true;
}
};
@ -326,7 +326,7 @@ public:
promise->MaybeResolve(JS::NullHandleValue);
}
mPromiseProxy->CleanUp(aCx);
mPromiseProxy->CleanUp();
return true;
}

View File

@ -390,8 +390,7 @@ class LifeCycleEventWatcher final : public PromiseNativeHandler,
// the resulting Promise.all will be cycle collected and it will drop its
// native handlers (including this object). Instead of waiting for a timeout
// we report the failure now.
JSContext* cx = mWorkerPrivate->GetJSContext();
ReportResult(cx, false);
ReportResult(false);
}
public:
@ -412,7 +411,6 @@ public:
{
MOZ_ASSERT(mWorkerPrivate);
mWorkerPrivate->AssertIsOnWorkerThread();
JSContext* cx = mWorkerPrivate->GetJSContext();
// We need to listen for worker termination in case the event handler
// never completes or never resolves the waitUntil promise. There are
@ -421,9 +419,9 @@ public:
// case the registration/update promise will be rejected
// 2. A new service worker is registered which will terminate the current
// installing worker.
if (NS_WARN_IF(!mWorkerPrivate->AddFeature(cx, this))) {
if (NS_WARN_IF(!mWorkerPrivate->AddFeature(this))) {
NS_WARNING("LifeCycleEventWatcher failed to add feature.");
ReportResult(cx, false);
ReportResult(false);
return false;
}
@ -438,13 +436,13 @@ public:
}
MOZ_ASSERT(GetCurrentThreadWorkerPrivate() == mWorkerPrivate);
ReportResult(aCx, false);
ReportResult(false);
return true;
}
void
ReportResult(JSContext* aCx, bool aResult)
ReportResult(bool aResult)
{
mWorkerPrivate->AssertIsOnWorkerThread();
@ -459,7 +457,7 @@ public:
NS_RUNTIMEABORT("Failed to dispatch life cycle event handler.");
}
mWorkerPrivate->RemoveFeature(aCx, this);
mWorkerPrivate->RemoveFeature(this);
}
void
@ -468,7 +466,7 @@ public:
MOZ_ASSERT(GetCurrentThreadWorkerPrivate() == mWorkerPrivate);
mWorkerPrivate->AssertIsOnWorkerThread();
ReportResult(aCx, true);
ReportResult(true);
}
void
@ -477,7 +475,7 @@ public:
MOZ_ASSERT(GetCurrentThreadWorkerPrivate() == mWorkerPrivate);
mWorkerPrivate->AssertIsOnWorkerThread();
ReportResult(aCx, false);
ReportResult(false);
// Note, all WaitUntil() rejections are reported to client consoles
// by the WaitUntilHandler in ServiceWorkerEvents. This ensures that
@ -525,7 +523,7 @@ LifecycleEventWorkerRunnable::DispatchLifecycleEvent(JSContext* aCx,
if (waitUntil) {
waitUntil->AppendNativeHandler(watcher);
} else {
watcher->ReportResult(aCx, false);
watcher->ReportResult(false);
}
return true;
@ -1044,7 +1042,15 @@ public:
rv = mInterceptedChannel->GetSecureUpgradedChannelURI(getter_AddRefs(uri));
NS_ENSURE_SUCCESS(rv, rv);
rv = uri->GetSpec(mSpec);
// Normally we rely on the Request constructor to strip the fragment, but
// when creating the FetchEvent we bypass the constructor. So strip the
// fragment manually here instead. We can't do it later when we create
// the Request because that code executes off the main thread.
nsCOMPtr<nsIURI> uriNoFragment;
rv = uri->CloneIgnoringRef(getter_AddRefs(uriNoFragment));
NS_ENSURE_SUCCESS(rv, rv);
rv = uriNoFragment->GetSpec(mSpec);
NS_ENSURE_SUCCESS(rv, rv);
uint32_t loadFlags;

View File

@ -333,7 +333,7 @@ public:
promise->MaybeResolve(JS::UndefinedHandleValue);
}
mStatus.SuppressException();
mPromiseProxy->CleanUp(aCx);
mPromiseProxy->CleanUp();
return true;
}
@ -498,7 +498,7 @@ public:
promise->MaybeReject(NS_ERROR_DOM_SECURITY_ERR);
}
mPromiseWorkerProxy->CleanUp(aCx);
mPromiseWorkerProxy->CleanUp();
return true;
}
};
@ -1070,7 +1070,7 @@ ServiceWorkerRegistrationWorkerThread::InitListener()
worker->AssertIsOnWorkerThread();
mListener = new WorkerListener(worker, this);
if (!worker->AddFeature(worker->GetJSContext(), this)) {
if (!worker->AddFeature(this)) {
mListener = nullptr;
NS_WARNING("Could not add feature");
return;
@ -1128,7 +1128,7 @@ ServiceWorkerRegistrationWorkerThread::ReleaseListener(Reason aReason)
// be null and we won't reach here.
// 2) Otherwise, worker is still around even if we are going away.
mWorkerPrivate->AssertIsOnWorkerThread();
mWorkerPrivate->RemoveFeature(mWorkerPrivate->GetJSContext(), this);
mWorkerPrivate->RemoveFeature(this);
mListener->ClearRegistration();

View File

@ -63,7 +63,7 @@ public:
}
// Release the reference on the worker thread.
mPromiseProxy->CleanUp(aCx);
mPromiseProxy->CleanUp();
return true;
}

View File

@ -504,7 +504,7 @@ private:
aWorkerPrivate->AssertIsOnWorkerThread();
ErrorResult rv;
scriptloader::LoadMainScript(aCx, mScriptURL, WorkerScript, rv);
scriptloader::LoadMainScript(aWorkerPrivate, mScriptURL, WorkerScript, rv);
rv.WouldReportJSException();
// Explicitly ignore NS_BINDING_ABORTED on rv. Or more precisely, still
// return false and don't SetWorkerScriptExecutedSuccessfully() in that
@ -563,7 +563,8 @@ private:
ErrorResult rv;
JSAutoCompartment ac(aCx, global);
scriptloader::LoadMainScript(aCx, mScriptURL, DebuggerScript, rv);
scriptloader::LoadMainScript(aWorkerPrivate, mScriptURL,
DebuggerScript, rv);
rv.WouldReportJSException();
// Explicitly ignore NS_BINDING_ABORTED on rv. Or more precisely, still
// return false and don't SetWorkerScriptExecutedSuccessfully() in that
@ -574,7 +575,7 @@ private:
return false;
}
// Make sure to propagate exceptions from rv onto aCx, so that our PostRun
// can report it. We do this for alll failures on rv, because now we're
// can report it. We do this for all failures on rv, because now we're
// using rv to track all the state we care about.
if (rv.MaybeSetPendingException(aCx)) {
return false;
@ -607,9 +608,6 @@ private:
virtual bool
WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
{
JS::Rooted<JSObject*> target(aCx, JS::CurrentGlobalOrNull(aCx));
NS_ASSERTION(target, "This must never be null!");
aWorkerPrivate->CloseHandlerStarted();
WorkerGlobalScope* globalScope = aWorkerPrivate->GlobalScope();
@ -903,7 +901,7 @@ private:
virtual bool
WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
{
return aWorkerPrivate->FreezeInternal(aCx);
return aWorkerPrivate->FreezeInternal();
}
};
@ -918,7 +916,7 @@ private:
virtual bool
WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override
{
return aWorkerPrivate->ThawInternal(aCx);
return aWorkerPrivate->ThawInternal();
}
};
@ -4031,7 +4029,7 @@ WorkerPrivate::Constructor(JSContext* aCx,
aWorkerType, stackLoadInfo.ptr());
aRv.MightThrowJSException();
if (NS_FAILED(rv)) {
scriptloader::ReportLoadError(aCx, aRv, rv, aScriptURL);
scriptloader::ReportLoadError(aRv, rv, aScriptURL);
return nullptr;
}
@ -5000,7 +4998,7 @@ WorkerPrivate::RemainingRunTimeMS() const
}
bool
WorkerPrivate::FreezeInternal(JSContext* aCx)
WorkerPrivate::FreezeInternal()
{
AssertIsOnWorkerThread();
@ -5011,7 +5009,7 @@ WorkerPrivate::FreezeInternal(JSContext* aCx)
}
bool
WorkerPrivate::ThawInternal(JSContext* aCx)
WorkerPrivate::ThawInternal()
{
AssertIsOnWorkerThread();
@ -5102,7 +5100,7 @@ WorkerPrivate::RemoveChildWorker(JSContext* aCx, ParentType* aChildWorker)
}
bool
WorkerPrivate::AddFeature(JSContext* aCx, WorkerFeature* aFeature)
WorkerPrivate::AddFeature(WorkerFeature* aFeature)
{
AssertIsOnWorkerThread();
@ -5125,7 +5123,7 @@ WorkerPrivate::AddFeature(JSContext* aCx, WorkerFeature* aFeature)
}
void
WorkerPrivate::RemoveFeature(JSContext* aCx, WorkerFeature* aFeature)
WorkerPrivate::RemoveFeature(WorkerFeature* aFeature)
{
AssertIsOnWorkerThread();

View File

@ -1053,10 +1053,10 @@ public:
}
bool
FreezeInternal(JSContext* aCx);
FreezeInternal();
bool
ThawInternal(JSContext* aCx);
ThawInternal();
void
TraceTimeouts(const TraceCallbacks& aCallbacks, void* aClosure) const;
@ -1071,10 +1071,10 @@ public:
RemoveChildWorker(JSContext* aCx, ParentType* aChildWorker);
bool
AddFeature(JSContext* aCx, WorkerFeature* aFeature);
AddFeature(WorkerFeature* aFeature);
void
RemoveFeature(JSContext* aCx, WorkerFeature* aFeature);
RemoveFeature(WorkerFeature* aFeature);
void
NotifyFeatures(JSContext* aCx, Status aStatus);

View File

@ -213,12 +213,11 @@ WorkerGlobalScope::SetOnerror(OnErrorEventHandlerNonNull* aHandler)
}
void
WorkerGlobalScope::ImportScripts(JSContext* aCx,
const Sequence<nsString>& aScriptURLs,
WorkerGlobalScope::ImportScripts(const Sequence<nsString>& aScriptURLs,
ErrorResult& aRv)
{
mWorkerPrivate->AssertIsOnWorkerThread();
scriptloader::Load(aCx, mWorkerPrivate, aScriptURLs, WorkerScript, aRv);
scriptloader::Load(mWorkerPrivate, aScriptURLs, WorkerScript, aRv);
}
int32_t
@ -560,7 +559,7 @@ public:
promise->MaybeResolve(JS::UndefinedHandleValue);
// Release the reference on the worker thread.
mPromiseProxy->CleanUp(aCx);
mPromiseProxy->CleanUp();
return true;
}
@ -887,7 +886,7 @@ WorkerDebuggerGlobalScope::LoadSubScript(JSContext* aCx,
nsTArray<nsString> urls;
urls.AppendElement(aURL);
scriptloader::Load(aCx, mWorkerPrivate, urls, DebuggerScript, aRv);
scriptloader::Load(mWorkerPrivate, urls, DebuggerScript, aRv);
}
void

View File

@ -105,8 +105,7 @@ public:
SetOnerror(OnErrorEventHandlerNonNull* aHandler);
void
ImportScripts(JSContext* aCx, const Sequence<nsString>& aScriptURLs,
ErrorResult& aRv);
ImportScripts(const Sequence<nsString>& aScriptURLs, ErrorResult& aRv);
int32_t
SetTimeout(JSContext* aCx, Function& aHandler, const int32_t aTimeout,

View File

@ -13,6 +13,8 @@
#include "nsIXPConnect.h"
#include "jsfriendapi.h"
#include "js/TracingAPI.h"
#include "js/GCPolicyAPI.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/dom/Exceptions.h"
#include "mozilla/dom/File.h"
@ -30,11 +32,19 @@
#include "WorkerRunnable.h"
#include "XMLHttpRequestUpload.h"
#include "mozilla/UniquePtr.h"
using namespace mozilla;
using namespace mozilla::dom;
USING_WORKERS_NAMESPACE
/* static */ void
XMLHttpRequest::StateData::trace(JSTracer *aTrc)
{
JS::TraceEdge(aTrc, &mResponse, "XMLHttpRequest::StateData::mResponse");
}
/**
* XMLHttpRequest in workers
*
@ -559,27 +569,6 @@ class EventRunnable final : public MainThreadProxyRunnable
JS::PersistentRooted<JSObject*> mScopeObj;
public:
class MOZ_RAII StateDataAutoRooter : private JS::CustomAutoRooter
{
XMLHttpRequest::StateData* mStateData;
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
public:
explicit StateDataAutoRooter(JSContext* aCx, XMLHttpRequest::StateData* aData
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
: CustomAutoRooter(aCx), mStateData(aData)
{
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
}
private:
virtual void trace(JSTracer* aTrc)
{
JS::TraceEdge(aTrc, &mStateData->mResponse,
"XMLHttpRequest::StateData::mResponse");
}
};
EventRunnable(Proxy* aProxy, bool aUploadEvent, const nsString& aType,
bool aLengthComputable, uint64_t aLoaded, uint64_t aTotal,
JS::Handle<JSObject*> aScopeObj)
@ -1347,8 +1336,7 @@ EventRunnable::WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
}
}
nsAutoPtr<XMLHttpRequest::StateData> state(new XMLHttpRequest::StateData());
StateDataAutoRooter rooter(aCx, state);
JS::Rooted<UniquePtr<XMLHttpRequest::StateData>> state(aCx, new XMLHttpRequest::StateData());
state->mResponseTextResult = mResponseTextResult;
state->mResponseText = mResponseText;
@ -1391,7 +1379,7 @@ EventRunnable::WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
state->mResponseURL = mResponseURL;
XMLHttpRequest* xhr = mProxy->mXMLHttpRequestPrivate;
xhr->UpdateState(*state, mUseCachedArrayBufferResponse);
xhr->UpdateState(*state.get(), mUseCachedArrayBufferResponse);
if (mUploadEvent && !xhr->GetUploadObjectNoCreate()) {
return true;
@ -1726,9 +1714,7 @@ XMLHttpRequest::MaybePin(ErrorResult& aRv)
return;
}
JSContext* cx = GetCurrentThreadJSContext();
if (!mWorkerPrivate->AddFeature(cx, this)) {
if (!mWorkerPrivate->AddFeature(this)) {
aRv.Throw(NS_ERROR_FAILURE);
return;
}
@ -1846,9 +1832,7 @@ XMLHttpRequest::Unpin()
MOZ_ASSERT(mRooted, "Mismatched calls to Unpin!");
JSContext* cx = GetCurrentThreadJSContext();
mWorkerPrivate->RemoveFeature(cx, this);
mWorkerPrivate->RemoveFeature(this);
mRooted = false;

View File

@ -50,6 +50,8 @@ public:
mResponseTextResult(NS_OK), mStatusResult(NS_OK),
mResponseResult(NS_OK)
{ }
void trace(JSTracer* trc);
};
private:

View File

@ -20,7 +20,23 @@
function start() {
return navigator.serviceWorker.register("xslt_worker.js",
{ scope: "./" })
.then((swr) => registration = swr);
.then((swr) => {
registration = swr;
// Ensure the registration is active before continuing
var worker = registration.installing;
return new Promise((resolve) => {
if (worker.state === 'activated') {
resolve();
return;
}
worker.addEventListener('statechange', () => {
if (worker.state === 'activated') {
resolve();
}
});
});
});
}
function unregister() {

View File

@ -32,7 +32,7 @@ namespace gl {
class GLXLibrary
{
public:
GLXLibrary()
MOZ_CONSTEXPR GLXLibrary()
: xDestroyContextInternal(nullptr)
, xMakeCurrentInternal(nullptr)
, xGetCurrentContextInternal(nullptr)

View File

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* 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
@ -8,7 +8,7 @@
#define HEAPCOPYOFSTACKARRAY_H_
#include "mozilla/Attributes.h"
#include "mozilla/Scoped.h"
#include "mozilla/UniquePtr.h"
#include <string.h>
@ -25,12 +25,12 @@ public:
template<size_t N>
MOZ_IMPLICIT HeapCopyOfStackArray(ElemType (&array)[N])
: mArrayLength(N)
, mArrayData(new ElemType[N])
, mArrayData(MakeUnique<ElemType[]>(N))
{
memcpy(mArrayData, &array[0], N * sizeof(ElemType));
memcpy(mArrayData.get(), &array[0], N * sizeof(ElemType));
}
ElemType* Data() const { return mArrayData; }
ElemType* Data() const { return mArrayData.get(); }
size_t ArrayLength() const { return mArrayLength; }
size_t ByteLength() const { return mArrayLength * sizeof(ElemType); }
@ -39,7 +39,7 @@ private:
HeapCopyOfStackArray(const HeapCopyOfStackArray&) = delete;
const size_t mArrayLength;
ScopedDeletePtr<ElemType> const mArrayData;
UniquePtr<ElemType[]> const mArrayData;
};
} // namespace mozilla

View File

@ -1,3 +1,3 @@
This directory contains the Graphite2 library release 1.3.5 from
https://github.com/silnrsi/graphite/releases/download/1.3.5/graphite2-minimal-1.3.5.tgz
See gfx/graphite2/moz-gr-update.sh for update procedure.
This directory contains the Graphite2 library release 1.3.6 from
https://github.com/silnrsi/graphite/releases/download/1.3.6/graphite-minimal-1.3.6.tgz
See ./gfx/graphite2/moz-gr-update.sh for update procedure.

View File

@ -30,7 +30,7 @@
#define GR2_VERSION_MAJOR 1
#define GR2_VERSION_MINOR 3
#define GR2_VERSION_BUGFIX 5
#define GR2_VERSION_BUGFIX 6
#ifdef __cplusplus
extern "C"

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