From 4b6b71262b1626ea064d71f317141e0aab9e33fc Mon Sep 17 00:00:00 2001
From: Dragana Damjanovic
Date: Mon, 8 Jan 2018 19:28:10 +0100
Subject: [PATCH 01/33] Bug 1426710 - The telemetry on how often a backup
connection wins should be histogram. r=mayhemer
---
netwerk/protocol/http/nsHttpConnectionMgr.cpp | 6 +++---
toolkit/components/telemetry/Histograms.json | 8 ++++++++
toolkit/components/telemetry/Scalars.yaml | 15 ---------------
3 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
index 3efc2799eda6..ac9942210990 100644
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -4335,10 +4335,10 @@ nsHalfOpenSocket::OnOutputStreamReady(nsIAsyncOutputStream *out)
// connection. We want to collect this telemetry only for cases where
// TFO is not used.
mBackupConnStatsSet = true;
- Telemetry::ScalarSet(Telemetry::ScalarID::NETWORK_HTTP_BACKUP_CONN_WON,
- (out == mBackupStreamOut));
+ Telemetry::Accumulate(Telemetry::NETWORK_HTTP_BACKUP_CONN_WON_1,
+ (out == mBackupStreamOut));
}
-
+
nsresult rv = SetupConn(out, false);
if (mEnt) {
mEnt->mDoNotDestroy = false;
diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json
index 97d28ec38fa5..79a395fee5d3 100644
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -2441,6 +2441,14 @@
"alert_emails": ["necko@mozilla.com", "ddamjanovic@mozilla.com"],
"bug_numbers": [1390881]
},
+ "NETWORK_HTTP_BACKUP_CONN_WON_1" : {
+ "record_in_processes": ["main"],
+ "expires_in_version": "61",
+ "kind": "boolean",
+ "description": "For connection where TFO has not be use, collect telemetry on whether the backup connection or the primary connection was faster.",
+ "alert_emails": ["necko@mozilla.com", "ddamjanovic@mozilla.com"],
+ "bug_numbers": [1426710]
+ },
"TLS_EARLY_DATA_NEGOTIATED": {
"record_in_processes": ["main", "content"],
"expires_in_version": "62",
diff --git a/toolkit/components/telemetry/Scalars.yaml b/toolkit/components/telemetry/Scalars.yaml
index a00d910873ca..3ba287d1afc4 100644
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -1267,21 +1267,6 @@ screenshots:
record_in_processes:
- 'main'
-network.http:
- backup_conn_won:
- bug_numbers:
- - 1402811
- description: >
- For connection where TFO has not be use, collect telemetry on whether the
- backup connection or the primary connection was faster.
- expires: "61"
- kind: boolean
- notification_emails:
- - necko@mozilla.com
- - ddamjanovic@mozilla.com
- record_in_processes:
- - 'main'
-
idb.type:
persistent_count:
bug_numbers:
From 0c092c0ffe04ef9cb014eef4ba93ba60a068ef51 Mon Sep 17 00:00:00 2001
From: David Keeler
Date: Thu, 4 Jan 2018 11:31:22 -0800
Subject: [PATCH 02/33] bug 1428498 - don't require importing the server
certificate for overrides to succeed r=jcj
Previously, adding a permanent certificate error override would depend on
successfully importing the server's certificate into the user's certificate
database. Consequently, if the user's database were in read-only mode (or if the
database couldn't be created due to code page issues on Windows), this would
prevent adding new certificate error overrides. It turns out this isn't even
necessary, because the implementation relies on the stored hash of the
certificate rather than the certificate itself. The stored certificate is only
for display purposes (and there's a fallback if the certificate can't be
stored).
There are remaining issues with non-ASCII characters in 8.3 paths on Windows
when the code page isn't western, but this is a larger issue that must be
addressed in other layers (i.e. NSS/NSPR).
MozReview-Commit-ID: KEzjxtAoeb4
--HG--
rename : security/manager/ssl/tests/unit/test_cert_overrides.js => security/manager/ssl/tests/unit/test_cert_overrides_read_only.js
extra : rebase_source : b41e863d8c85d80335dd56c8f5765b19b1de4e0c
---
.../manager/ssl/nsCertOverrideService.cpp | 13 ++-
security/manager/ssl/tests/unit/head_psm.js | 10 +-
.../unit/test_cert_overrides_read_only.js | 93 ++++++++++++++++++
.../test_cert_overrides_read_only/cert9.db | Bin 0 -> 28672 bytes
.../test_cert_overrides_read_only/key4.db | Bin 0 -> 36864 bytes
security/manager/ssl/tests/unit/xpcshell.ini | 3 +
6 files changed, 110 insertions(+), 9 deletions(-)
create mode 100644 security/manager/ssl/tests/unit/test_cert_overrides_read_only.js
create mode 100644 security/manager/ssl/tests/unit/test_cert_overrides_read_only/cert9.db
create mode 100644 security/manager/ssl/tests/unit/test_cert_overrides_read_only/key4.db
diff --git a/security/manager/ssl/nsCertOverrideService.cpp b/security/manager/ssl/nsCertOverrideService.cpp
index d98748a4d5d2..c35ad054b170 100644
--- a/security/manager/ssl/nsCertOverrideService.cpp
+++ b/security/manager/ssl/nsCertOverrideService.cpp
@@ -11,6 +11,7 @@
#include "SharedSSLState.h"
#include "mozilla/Assertions.h"
#include "mozilla/Telemetry.h"
+#include "mozilla/Unused.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsCRT.h"
#include "nsILineInputStream.h"
@@ -378,11 +379,13 @@ nsCertOverrideService::RememberValidityOverride(const nsACString& aHostName,
return NS_ERROR_FAILURE;
}
- SECStatus srv = PK11_ImportCert(slot.get(), nsscert.get(), CK_INVALID_HANDLE,
- nickname.get(), false);
- if (srv != SECSuccess) {
- return NS_ERROR_FAILURE;
- }
+ // This can fail (for example, if we're in read-only mode). Luckily, we
+ // don't even need it to succeed - we always match on the stored hash of the
+ // certificate rather than the full certificate. It makes the display a bit
+ // less informative (since we won't have a certificate to display), but it's
+ // better than failing the entire operation.
+ Unused << PK11_ImportCert(slot.get(), nsscert.get(), CK_INVALID_HANDLE,
+ nickname.get(), false);
}
nsAutoCString fpStr;
diff --git a/security/manager/ssl/tests/unit/head_psm.js b/security/manager/ssl/tests/unit/head_psm.js
index 7b7e01dabe8b..6e0d41125549 100644
--- a/security/manager/ssl/tests/unit/head_psm.js
+++ b/security/manager/ssl/tests/unit/head_psm.js
@@ -339,9 +339,9 @@ function run_test() {
}
*/
-function add_tls_server_setup(serverBinName, certsPath) {
+function add_tls_server_setup(serverBinName, certsPath, addDefaultRoot = true) {
add_test(function() {
- _setupTLSServerTest(serverBinName, certsPath);
+ _setupTLSServerTest(serverBinName, certsPath, addDefaultRoot);
});
}
@@ -491,11 +491,13 @@ function _getBinaryUtil(binaryUtilName) {
}
// Do not call this directly; use add_tls_server_setup
-function _setupTLSServerTest(serverBinName, certsPath) {
+function _setupTLSServerTest(serverBinName, certsPath, addDefaultRoot) {
let certdb = Cc["@mozilla.org/security/x509certdb;1"]
.getService(Ci.nsIX509CertDB);
// The trusted CA that is typically used for "good" certificates.
- addCertFromFile(certdb, `${certsPath}/test-ca.pem`, "CTu,u,u");
+ if (addDefaultRoot) {
+ addCertFromFile(certdb, `${certsPath}/test-ca.pem`, "CTu,u,u");
+ }
const CALLBACK_PORT = 8444;
diff --git a/security/manager/ssl/tests/unit/test_cert_overrides_read_only.js b/security/manager/ssl/tests/unit/test_cert_overrides_read_only.js
new file mode 100644
index 000000000000..91b52d119d37
--- /dev/null
+++ b/security/manager/ssl/tests/unit/test_cert_overrides_read_only.js
@@ -0,0 +1,93 @@
+// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at http://mozilla.org/MPL/2.0/.
+"use strict";
+
+// Tests that permanent certificate error overrides can be added even if the
+// certificate/key databases are in read-only mode.
+
+// Helper function for add_read_only_cert_override_test. Probably doesn't need
+// to be called directly.
+function add_read_only_cert_override(aHost, aExpectedBits, aSecurityInfo) {
+ let sslstatus = aSecurityInfo.QueryInterface(Ci.nsISSLStatusProvider)
+ .SSLStatus;
+ let bits =
+ (sslstatus.isUntrusted ? Ci.nsICertOverrideService.ERROR_UNTRUSTED : 0) |
+ (sslstatus.isDomainMismatch ? Ci.nsICertOverrideService.ERROR_MISMATCH : 0) |
+ (sslstatus.isNotValidAtThisTime ? Ci.nsICertOverrideService.ERROR_TIME : 0);
+
+ Assert.equal(bits, aExpectedBits,
+ "Actual and expected override bits should match");
+ let cert = sslstatus.serverCert;
+ let certOverrideService = Cc["@mozilla.org/security/certoverride;1"]
+ .getService(Ci.nsICertOverrideService);
+ // Setting the last argument to false here ensures that we attempt to store a
+ // permanent override (which is what was failing in bug 1427273).
+ certOverrideService.rememberValidityOverride(aHost, 8443, cert, aExpectedBits,
+ false);
+}
+
+// Given a host, expected error bits (see nsICertOverrideService.idl), and an
+// expected error code, tests that an initial connection to the host fails with
+// the expected errors and that adding an override results in a subsequent
+// connection succeeding.
+function add_read_only_cert_override_test(aHost, aExpectedBits, aExpectedError) {
+ add_connection_test(aHost, aExpectedError, null,
+ add_read_only_cert_override.bind(this, aHost, aExpectedBits));
+ add_connection_test(aHost, PRErrorCodeSuccess, null, aSecurityInfo => {
+ Assert.ok(aSecurityInfo.securityState &
+ Ci.nsIWebProgressListener.STATE_CERT_USER_OVERRIDDEN,
+ "Cert override flag should be set on the security state");
+ });
+}
+
+function run_test() {
+ let profile = do_get_profile();
+ const KEY_DB_NAME = "key4.db";
+ const CERT_DB_NAME = "cert9.db";
+ let srcKeyDBFile = do_get_file(`test_cert_overrides_read_only/${KEY_DB_NAME}`);
+ srcKeyDBFile.copyTo(profile, KEY_DB_NAME);
+ let srcCertDBFile = do_get_file(`test_cert_overrides_read_only/${CERT_DB_NAME}`);
+ srcCertDBFile.copyTo(profile, CERT_DB_NAME);
+
+ // set the databases to read-only
+ let keyDBFile = do_get_profile();
+ keyDBFile.append(KEY_DB_NAME);
+ keyDBFile.permissions = 0o400;
+ let certDBFile = do_get_profile();
+ certDBFile.append(CERT_DB_NAME);
+ certDBFile.permissions = 0o400;
+
+ Services.prefs.setIntPref("security.OCSP.enabled", 1);
+ // Specifying false as the last argument means we don't try to add the default
+ // test root CA (which would fail).
+ add_tls_server_setup("BadCertServer", "bad_certs", false);
+
+ let fakeOCSPResponder = new HttpServer();
+ fakeOCSPResponder.registerPrefixHandler("/", function (request, response) {
+ response.setStatusLine(request.httpVersion, 500, "Internal Server Error");
+ });
+ fakeOCSPResponder.start(8888);
+
+ // Since we can't add the root CA to the (read-only) trust db, all of these
+ // will result in an "unknown issuer error" and need the "untrusted" error bit
+ // set in addition to whatever other specific error bits are necessary.
+ add_read_only_cert_override_test("expired.example.com",
+ Ci.nsICertOverrideService.ERROR_TIME |
+ Ci.nsICertOverrideService.ERROR_UNTRUSTED,
+ SEC_ERROR_UNKNOWN_ISSUER);
+ add_read_only_cert_override_test("selfsigned.example.com",
+ Ci.nsICertOverrideService.ERROR_UNTRUSTED,
+ SEC_ERROR_UNKNOWN_ISSUER);
+ add_read_only_cert_override_test("mismatch.example.com",
+ Ci.nsICertOverrideService.ERROR_MISMATCH |
+ Ci.nsICertOverrideService.ERROR_UNTRUSTED,
+ SEC_ERROR_UNKNOWN_ISSUER);
+
+ add_test(function () {
+ fakeOCSPResponder.stop(run_next_test);
+ });
+
+ run_next_test();
+}
diff --git a/security/manager/ssl/tests/unit/test_cert_overrides_read_only/cert9.db b/security/manager/ssl/tests/unit/test_cert_overrides_read_only/cert9.db
new file mode 100644
index 0000000000000000000000000000000000000000..3d452f335c286da96cd47711ed7bcbb92ed9f841
GIT binary patch
literal 28672
zcmeH~&2G~`6ou_JO%b7L7f2Ceky#Q6q4}|0cY~Uyt`t$yHlz|=pvq2MDG*xGBoa>m
zJKl;NFTq=|WbXCYX}e*G6dg;xJu`RinVHYiNb~OOcrwq$)y?habS{jycI*U_hRGQOV8P8Zp9GTQ78lFl#@z5ZeHUT{vF^hK2yFH$9S
z`}GDpoU_9;&GKnAqJGbTa}OO%`>%Uy4-PSJ_wF*O2B8>QU4cQ!}P!%uN~+2NXgI
z5rtg}F@-$}DTU02J+_iXWJgIJN*42wi;`rcB>5;wMoN;Cl4PYMc_~R|N{%SH>YRP$;BX&Qo0e_c}YeRMm
z*)8PSQ68GWgkS;lx=@3Jf^%cA9StSpyf
zWw{(H%jH;E`dV2o$I8;z$~(SvW@uvDO9#hEIz3L(5pr_8l=)I#Rgw=vF*aK+C!^(z
z!&HtlCLYtbm5iOn1}55TtF?MFY5899^YLYBZ}gYxVt&Kz%j$pkQdM%@{?tCApW7`8
zI~4GM00@8p2!H?xfB*=900@8p2!H?xtSW)Wv@zWOSM~E^UmySiAOHd&00JNY0w4ea
zAOHd&zyxsr$3XxA5C8!X009sH0T2KI5C8!X0D;vffcyXIe`D+r1V8`;KmY_l00ck)
z1V8`;KmY`A|Hl~s0T2KI5C8!X009sH0T2KI5CDPICxH9^>VISG5ClK~1V8`;KmY_l
N00ck)1V8`;{sM?+P}%?h
literal 0
HcmV?d00001
diff --git a/security/manager/ssl/tests/unit/test_cert_overrides_read_only/key4.db b/security/manager/ssl/tests/unit/test_cert_overrides_read_only/key4.db
new file mode 100644
index 0000000000000000000000000000000000000000..44d0cb172812d17b8f8de88bce066142d1c0cf2f
GIT binary patch
literal 36864
zcmeI)&u`mg7zc1WKio7~)gC6IfdX%C4UF-=w&SK^hoz|p5nbDbPIQ7PavDzxr0Zy0
z;KE@XwhQ787moZJpb3P=PUFOlX-5u#wrOzVeIDEMs;Uw6O
z+c;64zg_vh@@eJu@{{s*`G?~sVLt>Q009U<00Izz!2eHRJTp_R)yx~OM8RMj?uJpY
z8bm?*Uh4Gx_LeWU+AC|mNcW1x(NJvmx)<8L%i=BnvbeO~y?DtN8|$L8v3`E7+u0I5
ze{-$f@lOl=Q|qpZ-|WU~C9B%0na1eaF#Kfl;aGR}gM(;~Klju8zDldv70aqt>*l*W
zVCREiG`u#MZ0?Uf3Zif(SzLF0)!!D}NlVBEh{ZrjyK%0_8Sik$I2eTEY>0IzgFBC8
zIF0iKtNKFS?8nPK7`z|uL|I1hP{t(gK9ZuOYIO2e^;CK`qsinT+|ObPhhpO1BPlJ_
zxaFBM)q36hVu>$V7LZlBBr3ja+5UfX;o2)3y{*$Ckou*sTVULpAT9J&Ja<=wpjM
zw)i6rX}Q!isqv^;qNYX7GBp7;1Klihl#E+Wl$4=ld>l$ql46vk93?48NlH?ZqLid8
zB`HkF9cq*1#p~l_JFYp|=46|bZBDj1+2&-MlO3Mr@GOUCIXuhZSswR#-0N|#$Gu+M
z%b6Z$F7ZhAQ4D1Bnc9-(+I*%quhx}%vlZ=5O3HP3w8Ntv9<4ihNIa0nxGd#LI=0JF
zE=#$5RF{wH@^xwQ+$N_rIjzZacfzLQI!%g9O3F=2I
Date: Thu, 7 Dec 2017 12:13:14 -0700
Subject: [PATCH 03/33] Bug 1423999: Improved UIA detection that eliminates
handle duplication; r=Jamie
MozReview-Commit-ID: 5CqjkyDoPs8
--HG--
extra : amend_source : 877a3d6cadab0645274c9542249fc35cfd682d41
---
accessible/windows/msaa/CompatibilityUIA.cpp | 324 ++++++++++---------
accessible/windows/msaa/NtUndoc.h | 44 +++
accessible/windows/msaa/moz.build | 4 +
mozglue/build/WindowsDllServices.h | 4 +-
widget/windows/nsAppShell.cpp | 32 +-
5 files changed, 246 insertions(+), 162 deletions(-)
diff --git a/accessible/windows/msaa/CompatibilityUIA.cpp b/accessible/windows/msaa/CompatibilityUIA.cpp
index 907dc731dc33..72fb30661ae7 100644
--- a/accessible/windows/msaa/CompatibilityUIA.cpp
+++ b/accessible/windows/msaa/CompatibilityUIA.cpp
@@ -7,10 +7,13 @@
#include "Compatibility.h"
#include "mozilla/Telemetry.h"
+#include "mozilla/WindowsVersion.h"
+#include "nsDataHashtable.h"
#include "nsPrintfCString.h"
#include "nsReadableUtils.h"
#include "nsString.h"
+#include "nsTHashtable.h"
#include "nsUnicharUtils.h"
#include "nsWinUtils.h"
@@ -31,32 +34,102 @@
#endif // defined(UIA_LOGGING)
-static bool
-GetLocalObjectHandle(DWORD aSrcPid, HANDLE aSrcHandle, nsAutoHandle& aProcess,
- nsAutoHandle& aLocal)
+struct ByteArrayDeleter
{
- aLocal.reset();
-
- if (!aProcess) {
- HANDLE rawProcess = ::OpenProcess(PROCESS_DUP_HANDLE, FALSE, aSrcPid);
- if (!rawProcess) {
- LOG_ERROR(OpenProcess);
- return false;
- }
-
- aProcess.own(rawProcess);
+ void operator()(void* aBuf)
+ {
+ delete[] reinterpret_cast(aBuf);
}
+};
- HANDLE rawDuped;
- if (!::DuplicateHandle(aProcess.get(), aSrcHandle, ::GetCurrentProcess(),
- &rawDuped, GENERIC_READ, FALSE, 0)) {
- LOG_ERROR(DuplicateHandle);
+typedef UniquePtr ObjDirInfoPtr;
+
+// ComparatorFnT returns true to continue searching, or else false to indicate
+// search completion.
+template
+static bool
+FindNamedObject(ComparatorFnT aComparator)
+{
+ // We want to enumerate every named kernel object in our session. We do this
+ // by opening a directory object using a path constructed using the session
+ // id under which our process resides.
+ DWORD sessionId;
+ if (!::ProcessIdToSessionId(::GetCurrentProcessId(), &sessionId)) {
return false;
}
- aLocal.own(rawDuped);
+ nsAutoString path;
+ path.AppendPrintf("\\Sessions\\%u\\BaseNamedObjects", sessionId);
- return true;
+ UNICODE_STRING baseNamedObjectsName;
+ ::RtlInitUnicodeString(&baseNamedObjectsName, path.get());
+
+ OBJECT_ATTRIBUTES attributes;
+ InitializeObjectAttributes(&attributes, &baseNamedObjectsName, 0,
+ nullptr, nullptr);
+
+ HANDLE rawBaseNamedObjects;
+ NTSTATUS ntStatus = ::NtOpenDirectoryObject(&rawBaseNamedObjects,
+ DIRECTORY_QUERY | DIRECTORY_TRAVERSE,
+ &attributes);
+ if (!NT_SUCCESS(ntStatus)) {
+ return false;
+ }
+
+ nsAutoHandle baseNamedObjects(rawBaseNamedObjects);
+
+ ULONG context = 0, returnedLen;
+
+ ULONG objDirInfoBufLen = 1024 * sizeof(OBJECT_DIRECTORY_INFORMATION);
+ ObjDirInfoPtr objDirInfo(
+ reinterpret_cast(new char[objDirInfoBufLen]));
+
+ // Now query that directory object for every named object that it contains.
+
+ BOOL firstCall = TRUE;
+
+ do {
+ ntStatus = ::NtQueryDirectoryObject(baseNamedObjects, objDirInfo.get(),
+ objDirInfoBufLen, FALSE, firstCall,
+ &context, &returnedLen);
+#if defined(HAVE_64BIT_BUILD)
+ if (!NT_SUCCESS(ntStatus)) {
+ return false;
+ }
+#else
+ if (ntStatus == STATUS_BUFFER_TOO_SMALL) {
+ // This case only occurs on 32-bit builds running atop WOW64.
+ // (See https://bugzilla.mozilla.org/show_bug.cgi?id=1423999#c3)
+ objDirInfo.reset(reinterpret_cast(new char[returnedLen]));
+ objDirInfoBufLen = returnedLen;
+ continue;
+ } else if (!NT_SUCCESS(ntStatus)) {
+ return false;
+ }
+#endif
+
+ // NtQueryDirectoryObject gave us an array of OBJECT_DIRECTORY_INFORMATION
+ // structures whose final entry is zeroed out.
+ OBJECT_DIRECTORY_INFORMATION* curDir = objDirInfo.get();
+ while (curDir->mName.Length && curDir->mTypeName.Length) {
+ // We use nsDependentSubstring here because UNICODE_STRINGs are not
+ // guaranteed to be null-terminated.
+ nsDependentSubstring objName(curDir->mName.Buffer,
+ curDir->mName.Length / sizeof(wchar_t));
+ nsDependentSubstring typeName(curDir->mTypeName.Buffer,
+ curDir->mTypeName.Length / sizeof(wchar_t));
+
+ if (!aComparator(objName, typeName)) {
+ return true;
+ }
+
+ ++curDir;
+ }
+
+ firstCall = FALSE;
+ } while (ntStatus == STATUS_MORE_ENTRIES);
+
+ return false;
}
namespace mozilla {
@@ -74,15 +147,6 @@ Compatibility::OnUIAMessage(WPARAM aWParam, LPARAM aLParam)
Telemetry::AutoTimer timer;
- static auto pNtQuerySystemInformation =
- reinterpret_cast(
- ::GetProcAddress(::GetModuleHandleW(L"ntdll.dll"),
- "NtQuerySystemInformation"));
-
- static auto pNtQueryObject =
- reinterpret_cast(
- ::GetProcAddress(::GetModuleHandleW(L"ntdll.dll"), "NtQueryObject"));
-
// UIA creates a section containing the substring "HOOK_SHMEM_"
NS_NAMED_LITERAL_STRING(kStrHookShmem, "HOOK_SHMEM_");
@@ -90,7 +154,27 @@ Compatibility::OnUIAMessage(WPARAM aWParam, LPARAM aLParam)
// current thread id and the UIA message's WPARAM and LPARAM.
nsAutoString partialSectionSuffix;
partialSectionSuffix.AppendPrintf("_%08x_%08x_%08x", ::GetCurrentThreadId(),
- aLParam, aWParam);
+ static_cast(aLParam), aWParam);
+
+ // Find any named Section that matches the naming convention of the UIA shared
+ // memory.
+ nsAutoHandle section;
+ auto comparator = [&](const nsDependentSubstring& aName,
+ const nsDependentSubstring& aType) -> bool {
+ if (aType.Equals(NS_LITERAL_STRING("Section")) &&
+ FindInReadable(kStrHookShmem, aName) &&
+ StringEndsWith(aName, partialSectionSuffix)) {
+ section.own(::OpenFileMapping(GENERIC_READ, FALSE,
+ PromiseFlatString(aName).get()));
+ return false;
+ }
+
+ return true;
+ };
+
+ if (!FindNamedObject(comparator) || !section) {
+ return Nothing();
+ }
NTSTATUS ntStatus;
@@ -105,7 +189,7 @@ Compatibility::OnUIAMessage(WPARAM aWParam, LPARAM aLParam)
while (true) {
handleInfoBuf = MakeUnique(handleInfoBufLen);
- ntStatus = pNtQuerySystemInformation(
+ ntStatus = ::NtQuerySystemInformation(
(SYSTEM_INFORMATION_CLASS) SystemExtendedHandleInformation,
handleInfoBuf.get(), handleInfoBufLen, &handleInfoBufLen);
if (ntStatus == STATUS_INFO_LENGTH_MISMATCH) {
@@ -119,161 +203,99 @@ Compatibility::OnUIAMessage(WPARAM aWParam, LPARAM aLParam)
break;
}
- // Now we iterate through the system handle list, searching for a section
- // handle whose name matches the section name used by UIA.
-
- static Maybe sSectionObjTypeIndex;
-
const DWORD ourPid = ::GetCurrentProcessId();
-
Maybe kernelObject;
-
- ULONG lastPid = 0;
- nsAutoHandle process;
+ static Maybe sectionObjTypeIndex;
+ nsTHashtable nonSectionObjTypes;
+ nsDataHashtable objMap;
auto handleInfo = reinterpret_cast(handleInfoBuf.get());
for (ULONG index = 0; index < handleInfo->mHandleCount; ++index) {
SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX& curHandle = handleInfo->mHandles[index];
- if (lastPid && lastPid == curHandle.mPid && !process) {
- // During the previous iteration, we could not obtain a handle for this
- // pid. Skip any remaining handles belonging to that pid.
+ HANDLE handle = reinterpret_cast(curHandle.mHandle);
+
+ // The mapping of the curHandle.mObjectTypeIndex field depends on the
+ // underlying OS kernel. As we scan through the handle list, we record the
+ // type indices such that we may use those values to skip over handles that
+ // refer to non-section objects.
+ if (sectionObjTypeIndex) {
+ // If we know the type index for Sections, that's the fastest check...
+ if (sectionObjTypeIndex.value() != curHandle.mObjectTypeIndex) {
+ // Not a section
+ continue;
+ }
+ } else if (nonSectionObjTypes.Contains(static_cast(
+ curHandle.mObjectTypeIndex))) {
+ // Otherwise we check whether or not the object type is definitely _not_
+ // a Section...
continue;
- }
-
- // As a perf optimization, we reuse the same process handle as long as we're
- // still looking at the same pid. Once the pid changes, we need to reset
- // process so that we open a new handle to the newly-seen process.
- if (lastPid != curHandle.mPid) {
- process.reset();
- }
-
- nsAutoHandle handle;
-
- if (kernelObject.isSome() && kernelObject.value() == curHandle.mObject) {
- // If we know the value of the underlying kernel object, we can immediately
- // check for equality by comparing against curHandle.mObject
- remotePid = Some(static_cast(curHandle.mPid));
- break;
- } else if (sSectionObjTypeIndex.isSome()) {
- // Otherwise, if we know which object type value corresponds to a Section
- // object, we can use that to eliminate any handles that are not sections.
- if (curHandle.mObjectTypeIndex != sSectionObjTypeIndex.value()) {
- // Not a section handle
- continue;
- }
- } else {
- // Otherwise we need to query the handle to determine its type. Note that
- // each handle in the system list is relative to its owning process, so
- // we cannot do anything with it until we duplicate the handle into our
- // own process.
-
- lastPid = curHandle.mPid;
-
- if (!GetLocalObjectHandle((DWORD) curHandle.mPid,
- (HANDLE) curHandle.mHandle,
- process, handle)) {
- // We don't have access to do this, assume this handle isn't relevant
- continue;
- }
-
- // Now we have our own handle to the object, lets find out what type of
- // object this handle represents. Any handle whose type is not "Section"
- // is of no interest to us.
+ } else if (ourPid == curHandle.mPid) {
+ // Otherwise we need to issue some system calls to find out the object
+ // type corresponding to the current handle's type index.
ULONG objTypeBufLen;
- ntStatus = pNtQueryObject(handle, ObjectTypeInformation, nullptr,
- 0, &objTypeBufLen);
+ ntStatus = ::NtQueryObject(handle, ObjectTypeInformation,
+ nullptr, 0, &objTypeBufLen);
if (ntStatus != STATUS_INFO_LENGTH_MISMATCH) {
continue;
}
auto objTypeBuf = MakeUnique(objTypeBufLen);
- ntStatus = pNtQueryObject(handle, ObjectTypeInformation, objTypeBuf.get(),
- objTypeBufLen, &objTypeBufLen);
+ ntStatus = ::NtQueryObject(handle, ObjectTypeInformation, objTypeBuf.get(),
+ objTypeBufLen, &objTypeBufLen);
if (!NT_SUCCESS(ntStatus)) {
- // We don't have access to do this, assume this handle isn't relevant
continue;
}
auto objType =
reinterpret_cast(objTypeBuf.get());
- nsDependentString objTypeName(objType->TypeName.Buffer,
- objType->TypeName.Length / sizeof(wchar_t));
+ // Now we check whether the object's type name matches "Section"
+ nsDependentSubstring objTypeName(objType->TypeName.Buffer,
+ objType->TypeName.Length / sizeof(wchar_t));
if (!objTypeName.Equals(NS_LITERAL_STRING("Section"))) {
- // Not a section, so we don't care about this handle anymore.
+ nonSectionObjTypes.PutEntry(static_cast(curHandle.mObjectTypeIndex));
continue;
}
- // We have a section, save this handle's type code so that we can go
- // faster in future iterations.
- sSectionObjTypeIndex = Some(curHandle.mObjectTypeIndex);
+ sectionObjTypeIndex = Some(curHandle.mObjectTypeIndex);
}
- // If we reached this point without needing to query the handle, then we
- // need to open it here so that we can query its name.
- lastPid = curHandle.mPid;
+ // At this point we know that curHandle references a Section object.
+ // Now we can do some actual tests on it.
- if ((!process || !handle) &&
- !GetLocalObjectHandle((DWORD) curHandle.mPid, (HANDLE) curHandle.mHandle,
- process, handle)) {
- // We don't have access to do this, assume this handle isn't relevant
- continue;
- }
+ if (ourPid != curHandle.mPid) {
+ if (kernelObject && kernelObject.value() == curHandle.mObject) {
+ // The kernel objects match -- we have found the remote pid!
+ remotePid = Some(curHandle.mPid);
+ break;
+ }
- // At this point, |handle| is a valid section handle. Let's try to find
- // out the name of its underlying object.
- ULONG objNameBufLen;
- ntStatus = pNtQueryObject(handle,
- (OBJECT_INFORMATION_CLASS)ObjectNameInformation,
- nullptr, 0, &objNameBufLen);
- if (ntStatus != STATUS_INFO_LENGTH_MISMATCH) {
- continue;
- }
-
- auto objNameBuf = MakeUnique(objNameBufLen);
- ntStatus = pNtQueryObject(handle,
- (OBJECT_INFORMATION_CLASS)ObjectNameInformation,
- objNameBuf.get(), objNameBufLen, &objNameBufLen);
- if (!NT_SUCCESS(ntStatus)) {
- continue;
- }
-
- auto objNameInfo = reinterpret_cast(objNameBuf.get());
- if (!objNameInfo->mName.Length) {
- // This section is unnamed. We don't care about those.
- continue;
- }
-
- nsDependentString objName(objNameInfo->mName.Buffer,
- objNameInfo->mName.Length / sizeof(wchar_t));
-
- // Check to see if the section's name matches our expected name.
- if (!FindInReadable(kStrHookShmem, objName) ||
- !StringEndsWith(objName, partialSectionSuffix)) {
- // The names don't match, continue searching.
- continue;
- }
-
- // At this point we have a section handle whose name matches the one that
- // we're looking for.
-
- if (curHandle.mPid == ourPid) {
- // Our own process also has a handle to the section of interest. While we
- // don't want our own pid, this *does* give us an opportunity to speed up
- // future iterations by examining each handle for its kernel object (which
- // is the same for all processes) instead of searching by name.
+ // An object that is not ours. Since we do not yet know which kernel
+ // object we're interested in, we'll save the current object for later.
+ objMap.Put(curHandle.mObject, curHandle.mPid);
+ } else if (handle == section.get()) {
+ // This is the file mapping that we opened above. We save this mObject
+ // in order to compare to Section objects opened by other processes.
kernelObject = Some(curHandle.mObject);
- continue;
}
-
- // Bingo! We want this pid!
- remotePid = Some(static_cast(curHandle.mPid));
-
- break;
}
+ if (!kernelObject) {
+ return Nothing();
+ }
+
+ if (!remotePid) {
+ // We found kernelObject *after* we saw the remote process's copy. Now we
+ // must look it up in objMap.
+ DWORD pid;
+ if (objMap.Get(kernelObject.value(), &pid)) {
+ remotePid = Some(pid);
+ }
+ }
+
+
if (!remotePid) {
return Nothing();
}
diff --git a/accessible/windows/msaa/NtUndoc.h b/accessible/windows/msaa/NtUndoc.h
index e9689518069b..053bb97dc84b 100644
--- a/accessible/windows/msaa/NtUndoc.h
+++ b/accessible/windows/msaa/NtUndoc.h
@@ -9,10 +9,22 @@
#include
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
#ifndef STATUS_INFO_LENGTH_MISMATCH
#define STATUS_INFO_LENGTH_MISMATCH ((NTSTATUS)0xC0000004L)
#endif
+#ifndef STATUS_BUFFER_TOO_SMALL
+#define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L)
+#endif
+
+#ifndef STATUS_MORE_ENTRIES
+#define STATUS_MORE_ENTRIES ((NTSTATUS)0x00000105L)
+#endif
+
enum UndocSystemInformationClass
{
SystemExtendedHandleInformation = 64
@@ -47,4 +59,36 @@ struct OBJECT_NAME_INFORMATION
UNICODE_STRING mName;
};
+// The following declarations are documented on MSDN but are not included in
+// public user-mode headers.
+
+enum DirectoryObjectAccessFlags
+{
+ DIRECTORY_QUERY = 0x0001,
+ DIRECTORY_TRAVERSE = 0x0002,
+ DIRECTORY_CREATE_OBJECT = 0x0004,
+ DIRECTORY_CREATE_SUBDIRECTORY = 0x0008,
+ DIRECTORY_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | 0x000F
+};
+
+NTSTATUS WINAPI
+NtOpenDirectoryObject(PHANDLE aDirectoryHandle, ACCESS_MASK aDesiredAccess,
+ POBJECT_ATTRIBUTES aObjectAttributes);
+
+struct OBJECT_DIRECTORY_INFORMATION
+{
+ UNICODE_STRING mName;
+ UNICODE_STRING mTypeName;
+};
+
+NTSTATUS WINAPI
+NtQueryDirectoryObject(HANDLE aDirectoryHandle, PVOID aOutBuffer,
+ ULONG aBufferLength, BOOLEAN aReturnSingleEntry,
+ BOOLEAN aRestartScan, PULONG aContext,
+ PULONG aOutReturnLength);
+
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
#endif // mozilla_NtUndoc_h
diff --git a/accessible/windows/msaa/moz.build b/accessible/windows/msaa/moz.build
index 1af552ed0e68..499df9db21a5 100644
--- a/accessible/windows/msaa/moz.build
+++ b/accessible/windows/msaa/moz.build
@@ -46,6 +46,10 @@ SOURCES += [
'ServiceProvider.cpp',
]
+OS_LIBS += [
+ 'ntdll',
+]
+
if CONFIG['MOZ_XUL']:
UNIFIED_SOURCES += [
'XULListboxAccessibleWrap.cpp',
diff --git a/mozglue/build/WindowsDllServices.h b/mozglue/build/WindowsDllServices.h
index 1632ca1f7aa1..b31c7535c410 100644
--- a/mozglue/build/WindowsDllServices.h
+++ b/mozglue/build/WindowsDllServices.h
@@ -64,8 +64,8 @@ class DllServices : public detail::DllServicesBase
public:
virtual void DispatchDllLoadNotification(PCUNICODE_STRING aDllName) override final
{
- nsDependentString strDllName(aDllName->Buffer,
- aDllName->Length / sizeof(wchar_t));
+ nsDependentSubstring strDllName(aDllName->Buffer,
+ aDllName->Length / sizeof(wchar_t));
nsCOMPtr runnable(
NewRunnableMethod("DllServices::NotifyDllLoad",
diff --git a/widget/windows/nsAppShell.cpp b/widget/windows/nsAppShell.cpp
index 352c03d8146e..638c7ca2af77 100644
--- a/widget/windows/nsAppShell.cpp
+++ b/widget/windows/nsAppShell.cpp
@@ -170,6 +170,8 @@ nsAppShell::~nsAppShell()
static ULONG gUiaMsg;
static HHOOK gUiaHook;
+static uint32_t gUiaAttempts;
+static const uint32_t kMaxUiaAttempts = 5;
static void InitUIADetection();
@@ -182,17 +184,29 @@ UiaHookProc(int aCode, WPARAM aWParam, LPARAM aLParam)
auto cwp = reinterpret_cast(aLParam);
if (gUiaMsg && cwp->message == gUiaMsg) {
- Maybe shouldCallNextHook =
- a11y::Compatibility::OnUIAMessage(cwp->wParam, cwp->lParam);
+ if (gUiaAttempts < kMaxUiaAttempts) {
+ ++gUiaAttempts;
- // Unconditionally remove the hook, as UIA detection is too expensive to
- // leave running for every single request.
- if (::UnhookWindowsHookEx(gUiaHook)) {
- gUiaHook = nullptr;
- }
+ Maybe shouldCallNextHook =
+ a11y::Compatibility::OnUIAMessage(cwp->wParam, cwp->lParam);
+ if (shouldCallNextHook.isSome()) {
+ // We've got an instantiator, disconnect this hook.
+ if (::UnhookWindowsHookEx(gUiaHook)) {
+ gUiaHook = nullptr;
+ }
- if (shouldCallNextHook.isSome() && !shouldCallNextHook.value()) {
- return 0;
+ if (!shouldCallNextHook.value()) {
+ return 0;
+ }
+ } else {
+ // Our hook might be firing after UIA; let's try reinstalling ourselves.
+ InitUIADetection();
+ }
+ } else {
+ // We've maxed out our attempts. Let's unhook.
+ if (::UnhookWindowsHookEx(gUiaHook)) {
+ gUiaHook = nullptr;
+ }
}
}
From 8dfd9e72ac7d39daea4f80df6c1e5081dae7f568 Mon Sep 17 00:00:00 2001
From: Lee Salzman
Date: Mon, 8 Jan 2018 15:43:46 -0500
Subject: [PATCH 04/33] Bug 1428874 - pass gfxMacFont synthetic bold status to
ScaledFontMac. r=gankro
MozReview-Commit-ID: Dn3l5UJlDQL
---
gfx/thebes/gfxMacFont.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gfx/thebes/gfxMacFont.cpp b/gfx/thebes/gfxMacFont.cpp
index af0187649280..86be69b5fb3d 100644
--- a/gfx/thebes/gfxMacFont.cpp
+++ b/gfx/thebes/gfxMacFont.cpp
@@ -508,7 +508,8 @@ gfxMacFont::GetScaledFont(DrawTarget *aTarget)
GetUnscaledFont(),
GetAdjustedSize(),
Color::FromABGR(mFontSmoothingBackgroundColor),
- !mStyle.useGrayscaleAntialiasing);
+ !mStyle.useGrayscaleAntialiasing,
+ IsSyntheticBold());
if (!mAzureScaledFont) {
return nullptr;
}
From 5cd6c645250bf05e70e59af96bd7eae6a15f19b0 Mon Sep 17 00:00:00 2001
From: Kyle Machulis
Date: Fri, 5 Jan 2018 13:28:24 -0800
Subject: [PATCH 05/33] Bug 952453 - Remove mozNotification API; r=mattn r=baku
MozReview-Commit-ID: 3TMxnPRSh1j
--HG--
rename : dom/tests/mochitest/notification/desktop-notification/test_system_principal.xul => dom/notification/test/chrome/test_notification_system_principal.xul
rename : dom/tests/mochitest/notification/desktop-notification/create_notification.html => dom/notification/test/mochitest/create_notification.html
rename : dom/tests/mochitest/notification/desktop-notification/test_notification_tag.html => dom/notification/test/mochitest/test_notification_tag.html
---
dom/base/Navigator.cpp | 23 --
dom/base/Navigator.h | 3 -
dom/notification/DesktopNotification.cpp | 332 ------------------
dom/notification/DesktopNotification.h | 178 ----------
dom/notification/moz.build | 4 +-
dom/notification/test/chrome/chrome.ini | 1 +
.../test_notification_system_principal.xul} | 0
.../test/mochitest}/create_notification.html | 0
dom/notification/test/mochitest/mochitest.ini | 2 +
.../mochitest}/test_notification_tag.html | 0
.../mochitest/general/test_interfaces.js | 4 -
.../desktop-notification/moz.build | 6 -
.../notification_common.js | 70 ----
.../test_basic_notification.html | 50 ---
.../test_basic_notification_click.html | 53 ---
.../test_leak_windowClose.html | 34 --
dom/webidl/DesktopNotification.webidl | 26 --
dom/webidl/Navigator.webidl | 6 -
dom/webidl/moz.build | 4 -
modules/libpref/init/all.js | 3 -
widget/cocoa/OSXNotificationCenter.h | 5 +
21 files changed, 10 insertions(+), 794 deletions(-)
delete mode 100644 dom/notification/DesktopNotification.cpp
delete mode 100644 dom/notification/DesktopNotification.h
create mode 100644 dom/notification/test/chrome/chrome.ini
rename dom/{tests/mochitest/notification/desktop-notification/test_system_principal.xul => notification/test/chrome/test_notification_system_principal.xul} (100%)
rename dom/{tests/mochitest/notification/desktop-notification => notification/test/mochitest}/create_notification.html (100%)
rename dom/{tests/mochitest/notification/desktop-notification => notification/test/mochitest}/test_notification_tag.html (100%)
delete mode 100644 dom/tests/mochitest/notification/desktop-notification/moz.build
delete mode 100644 dom/tests/mochitest/notification/desktop-notification/notification_common.js
delete mode 100644 dom/tests/mochitest/notification/desktop-notification/test_basic_notification.html
delete mode 100644 dom/tests/mochitest/notification/desktop-notification/test_basic_notification_click.html
delete mode 100644 dom/tests/mochitest/notification/desktop-notification/test_leak_windowClose.html
delete mode 100644 dom/webidl/DesktopNotification.webidl
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index cdda6fd67448..9e63e708eb1e 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -13,7 +13,6 @@
#include "nsMimeTypeArray.h"
#include "mozilla/MemoryReporting.h"
#include "mozilla/dom/BodyExtractor.h"
-#include "mozilla/dom/DesktopNotification.h"
#include "mozilla/dom/FetchBinding.h"
#include "mozilla/dom/File.h"
#include "nsGeolocation.h"
@@ -195,7 +194,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPlugins)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPermissions)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGeolocation)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNotification)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mBatteryPromise)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConnection)
@@ -238,11 +236,6 @@ Navigator::Invalidate()
mGeolocation = nullptr;
}
- if (mNotification) {
- mNotification->Shutdown();
- mNotification = nullptr;
- }
-
if (mBatteryManager) {
mBatteryManager->Shutdown();
mBatteryManager = nullptr;
@@ -1316,22 +1309,6 @@ Navigator::MozGetUserMediaDevices(const MediaStreamConstraints& aConstraints,
aInnerWindowID, aCallID);
}
-DesktopNotificationCenter*
-Navigator::GetMozNotification(ErrorResult& aRv)
-{
- if (mNotification) {
- return mNotification;
- }
-
- if (!mWindow || !mWindow->GetDocShell()) {
- aRv.Throw(NS_ERROR_FAILURE);
- return nullptr;
- }
-
- mNotification = new DesktopNotificationCenter(mWindow);
- return mNotification;
-}
-
//*****************************************************************************
// Navigator::nsINavigatorBattery
//*****************************************************************************
diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h
index eb31ff7b3699..04326a96a3f2 100644
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -59,7 +59,6 @@ class BatteryManager;
class Promise;
-class DesktopNotificationCenter;
class MozIdleObserver;
class Gamepad;
class GamepadServiceTest;
@@ -178,7 +177,6 @@ public:
void AddIdleObserver(MozIdleObserver& aObserver, ErrorResult& aRv);
void RemoveIdleObserver(MozIdleObserver& aObserver, ErrorResult& aRv);
- DesktopNotificationCenter* GetMozNotification(ErrorResult& aRv);
already_AddRefed MozTCPSocket();
network::Connection* GetConnection(ErrorResult& aRv);
MediaDevices* GetMediaDevices(ErrorResult& aRv);
@@ -275,7 +273,6 @@ private:
RefPtr mPlugins;
RefPtr mPermissions;
RefPtr mGeolocation;
- RefPtr mNotification;
RefPtr mBatteryManager;
RefPtr mBatteryPromise;
RefPtr mConnection;
diff --git a/dom/notification/DesktopNotification.cpp b/dom/notification/DesktopNotification.cpp
deleted file mode 100644
index 2ba872398282..000000000000
--- a/dom/notification/DesktopNotification.cpp
+++ /dev/null
@@ -1,332 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 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
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#include "mozilla/dom/DesktopNotification.h"
-#include "mozilla/dom/DesktopNotificationBinding.h"
-#include "mozilla/dom/AppNotificationServiceOptionsBinding.h"
-#include "mozilla/dom/ToJSValue.h"
-#include "mozilla/EventStateManager.h"
-#include "nsComponentManagerUtils.h"
-#include "nsContentPermissionHelper.h"
-#include "nsXULAppAPI.h"
-#include "mozilla/dom/PBrowserChild.h"
-#include "mozilla/Preferences.h"
-#include "nsGlobalWindow.h"
-#include "nsIScriptSecurityManager.h"
-#include "nsServiceManagerUtils.h"
-#include "PermissionMessageUtils.h"
-#include "nsILoadContext.h"
-
-namespace mozilla {
-namespace dom {
-
-/*
- * Simple Request
- */
-class DesktopNotificationRequest : public nsIContentPermissionRequest
- , public Runnable
-{
- virtual ~DesktopNotificationRequest()
- {
- }
-
- nsCOMPtr mRequester;
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_NSICONTENTPERMISSIONREQUEST
-
- explicit DesktopNotificationRequest(DesktopNotification* aNotification)
- : Runnable("dom::DesktopNotificationRequest")
- , mDesktopNotification(aNotification)
- {
- mRequester = new nsContentPermissionRequester(mDesktopNotification->GetOwner());
- }
-
- NS_IMETHOD Run() override
- {
- nsCOMPtr window = mDesktopNotification->GetOwner();
- nsContentPermissionUtils::AskPermission(this, window);
- return NS_OK;
- }
-
- RefPtr mDesktopNotification;
-};
-
-/* ------------------------------------------------------------------------ */
-/* AlertServiceObserver */
-/* ------------------------------------------------------------------------ */
-
-NS_IMPL_ISUPPORTS(AlertServiceObserver, nsIObserver)
-
-/* ------------------------------------------------------------------------ */
-/* DesktopNotification */
-/* ------------------------------------------------------------------------ */
-
-uint32_t DesktopNotification::sCount = 0;
-
-nsresult
-DesktopNotification::PostDesktopNotification()
-{
- if (!mObserver) {
- mObserver = new AlertServiceObserver(this);
- }
-
- nsCOMPtr alerts = do_GetService("@mozilla.org/alerts-service;1");
- if (!alerts) {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
-
- // Generate a unique name (which will also be used as a cookie) because
- // the nsIAlertsService will coalesce notifications with the same name.
- // In the case of IPC, the parent process will use the cookie to map
- // to nsIObservers, thus cookies must be unique to differentiate observers.
- nsString uniqueName = NS_LITERAL_STRING("desktop-notification:");
- uniqueName.AppendInt(sCount++);
- nsCOMPtr owner = GetOwner();
- if (!owner) {
- return NS_ERROR_FAILURE;
- }
- nsCOMPtr doc = owner->GetDoc();
- nsIPrincipal* principal = doc->NodePrincipal();
- nsCOMPtr loadContext = doc->GetLoadContext();
- bool inPrivateBrowsing = loadContext && loadContext->UsePrivateBrowsing();
- nsCOMPtr alert =
- do_CreateInstance(ALERT_NOTIFICATION_CONTRACTID);
- NS_ENSURE_TRUE(alert, NS_ERROR_FAILURE);
- nsresult rv = alert->Init(uniqueName, mIconURL, mTitle,
- mDescription,
- true,
- uniqueName,
- NS_LITERAL_STRING("auto"),
- EmptyString(),
- EmptyString(),
- principal,
- inPrivateBrowsing,
- false /* requireInteraction */);
- NS_ENSURE_SUCCESS(rv, rv);
- return alerts->ShowAlert(alert, mObserver);
-}
-
-DesktopNotification::DesktopNotification(const nsAString & title,
- const nsAString & description,
- const nsAString & iconURL,
- nsPIDOMWindowInner* aWindow,
- bool aIsHandlingUserInput,
- nsIPrincipal* principal)
- : DOMEventTargetHelper(aWindow)
- , mTitle(title)
- , mDescription(description)
- , mIconURL(iconURL)
- , mPrincipal(principal)
- , mIsHandlingUserInput(aIsHandlingUserInput)
- , mAllow(false)
- , mShowHasBeenCalled(false)
-{
- if (Preferences::GetBool("notification.disabled", false)) {
- return;
- }
-
- // If we are in testing mode (running mochitests, for example)
- // and we are suppose to allow requests, then just post an allow event.
- if (Preferences::GetBool("notification.prompt.testing", false) &&
- Preferences::GetBool("notification.prompt.testing.allow", true)) {
- mAllow = true;
- }
-}
-
-void
-DesktopNotification::Init()
-{
- RefPtr request = new DesktopNotificationRequest(this);
-
- NS_DispatchToMainThread(request);
-}
-
-DesktopNotification::~DesktopNotification()
-{
- if (mObserver) {
- mObserver->Disconnect();
- }
-}
-
-void
-DesktopNotification::DispatchNotificationEvent(const nsString& aName)
-{
- if (NS_FAILED(CheckInnerWindowCorrectness())) {
- return;
- }
-
- RefPtr event = NS_NewDOMEvent(this, nullptr, nullptr);
- // it doesn't bubble, and it isn't cancelable
- event->InitEvent(aName, false, false);
- event->SetTrusted(true);
- bool dummy;
- DispatchEvent(event, &dummy);
-}
-
-nsresult
-DesktopNotification::SetAllow(bool aAllow)
-{
- mAllow = aAllow;
-
- // if we have called Show() already, lets go ahead and post a notification
- if (mShowHasBeenCalled && aAllow) {
- return PostDesktopNotification();
- }
-
- return NS_OK;
-}
-
-void
-DesktopNotification::HandleAlertServiceNotification(const char *aTopic)
-{
- if (NS_FAILED(CheckInnerWindowCorrectness())) {
- return;
- }
-
- if (!strcmp("alertclickcallback", aTopic)) {
- DispatchNotificationEvent(NS_LITERAL_STRING("click"));
- } else if (!strcmp("alertfinished", aTopic)) {
- DispatchNotificationEvent(NS_LITERAL_STRING("close"));
- }
-}
-
-void
-DesktopNotification::Show(ErrorResult& aRv)
-{
- mShowHasBeenCalled = true;
-
- if (!mAllow) {
- return;
- }
-
- aRv = PostDesktopNotification();
-}
-
-JSObject*
-DesktopNotification::WrapObject(JSContext* aCx, JS::Handle aGivenProto)
-{
- return DesktopNotificationBinding::Wrap(aCx, this, aGivenProto);
-}
-
-/* ------------------------------------------------------------------------ */
-/* DesktopNotificationCenter */
-/* ------------------------------------------------------------------------ */
-
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(DesktopNotificationCenter)
-NS_IMPL_CYCLE_COLLECTING_ADDREF(DesktopNotificationCenter)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(DesktopNotificationCenter)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DesktopNotificationCenter)
- NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
- NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-already_AddRefed
-DesktopNotificationCenter::CreateNotification(const nsAString& aTitle,
- const nsAString& aDescription,
- const nsAString& aIconURL)
-{
- MOZ_ASSERT(mOwner);
-
- RefPtr notification =
- new DesktopNotification(aTitle,
- aDescription,
- aIconURL,
- mOwner,
- EventStateManager::IsHandlingUserInput(),
- mPrincipal);
- notification->Init();
- return notification.forget();
-}
-
-JSObject*
-DesktopNotificationCenter::WrapObject(JSContext* aCx, JS::Handle aGivenProto)
-{
- return DesktopNotificationCenterBinding::Wrap(aCx, this, aGivenProto);
-}
-
-/* ------------------------------------------------------------------------ */
-/* DesktopNotificationRequest */
-/* ------------------------------------------------------------------------ */
-
-NS_IMPL_ISUPPORTS_INHERITED(DesktopNotificationRequest, Runnable,
- nsIContentPermissionRequest)
-
-NS_IMETHODIMP
-DesktopNotificationRequest::GetPrincipal(nsIPrincipal * *aRequestingPrincipal)
-{
- if (!mDesktopNotification) {
- return NS_ERROR_NOT_INITIALIZED;
- }
-
- NS_IF_ADDREF(*aRequestingPrincipal = mDesktopNotification->mPrincipal);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DesktopNotificationRequest::GetWindow(mozIDOMWindow** aRequestingWindow)
-{
- if (!mDesktopNotification) {
- return NS_ERROR_NOT_INITIALIZED;
- }
-
- NS_IF_ADDREF(*aRequestingWindow = mDesktopNotification->GetOwner());
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DesktopNotificationRequest::GetElement(nsIDOMElement * *aElement)
-{
- NS_ENSURE_ARG_POINTER(aElement);
- *aElement = nullptr;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DesktopNotificationRequest::GetIsHandlingUserInput(bool *aIsHandlingUserInput)
-{
- *aIsHandlingUserInput = mDesktopNotification->mIsHandlingUserInput;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DesktopNotificationRequest::Cancel()
-{
- nsresult rv = mDesktopNotification->SetAllow(false);
- mDesktopNotification = nullptr;
- return rv;
-}
-
-NS_IMETHODIMP
-DesktopNotificationRequest::Allow(JS::HandleValue aChoices)
-{
- MOZ_ASSERT(aChoices.isUndefined());
- nsresult rv = mDesktopNotification->SetAllow(true);
- mDesktopNotification = nullptr;
- return rv;
-}
-
-NS_IMETHODIMP
-DesktopNotificationRequest::GetRequester(nsIContentPermissionRequester** aRequester)
-{
- NS_ENSURE_ARG_POINTER(aRequester);
-
- nsCOMPtr requester = mRequester;
- requester.forget(aRequester);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DesktopNotificationRequest::GetTypes(nsIArray** aTypes)
-{
- nsTArray emptyOptions;
- return nsContentPermissionUtils::CreatePermissionArray(NS_LITERAL_CSTRING("desktop-notification"),
- NS_LITERAL_CSTRING("unused"),
- emptyOptions,
- aTypes);
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/notification/DesktopNotification.h b/dom/notification/DesktopNotification.h
deleted file mode 100644
index 763b5744393d..000000000000
--- a/dom/notification/DesktopNotification.h
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 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
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_DesktopNotification_h
-#define mozilla_dom_DesktopNotification_h
-
-#include "nsIPrincipal.h"
-#include "nsIAlertsService.h"
-#include "nsIContentPermissionPrompt.h"
-
-#include "nsIObserver.h"
-#include "nsString.h"
-#include "nsWeakPtr.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsIDOMWindow.h"
-#include "nsIScriptObjectPrincipal.h"
-
-#include "nsIDOMEvent.h"
-
-#include "mozilla/Attributes.h"
-#include "mozilla/DOMEventTargetHelper.h"
-#include "mozilla/ErrorResult.h"
-#include "nsWrapperCache.h"
-
-
-namespace mozilla {
-namespace dom {
-
-class AlertServiceObserver;
-class DesktopNotification;
-
-/*
- * DesktopNotificationCenter
- * Object hangs off of the navigator object and hands out DesktopNotification objects
- */
-class DesktopNotificationCenter final : public nsISupports,
- public nsWrapperCache
-{
-public:
- NS_DECL_CYCLE_COLLECTING_ISUPPORTS
- NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DesktopNotificationCenter)
-
- explicit DesktopNotificationCenter(nsPIDOMWindowInner* aWindow)
- {
- MOZ_ASSERT(aWindow);
- mOwner = aWindow;
-
- nsCOMPtr sop = do_QueryInterface(aWindow);
- MOZ_ASSERT(sop);
-
- mPrincipal = sop->GetPrincipal();
- MOZ_ASSERT(mPrincipal);
- }
-
- void Shutdown() {
- mOwner = nullptr;
- }
-
- nsPIDOMWindowInner* GetParentObject() const
- {
- return mOwner;
- }
-
- virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override;
-
- already_AddRefed
- CreateNotification(const nsAString& title,
- const nsAString& description,
- const nsAString& iconURL);
-
-private:
- virtual ~DesktopNotificationCenter()
- {
- }
-
- nsCOMPtr mOwner;
- nsCOMPtr mPrincipal;
-};
-
-class DesktopNotificationRequest;
-
-class DesktopNotification final : public DOMEventTargetHelper
-{
- friend class DesktopNotificationRequest;
-
-public:
-
- DesktopNotification(const nsAString& aTitle,
- const nsAString& aDescription,
- const nsAString& aIconURL,
- nsPIDOMWindowInner* aWindow,
- bool aIsHandlingUserInput,
- nsIPrincipal* principal);
-
- virtual ~DesktopNotification();
-
- void Init();
-
- /*
- * PostDesktopNotification
- * Uses alert service to display a notification
- */
- nsresult PostDesktopNotification();
-
- nsresult SetAllow(bool aAllow);
-
- /*
- * Creates and dispatches a dom event of type aName
- */
- void DispatchNotificationEvent(const nsString& aName);
-
- void HandleAlertServiceNotification(const char *aTopic);
-
- // WebIDL
-
- nsPIDOMWindowInner* GetParentObject() const
- {
- return GetOwner();
- }
-
- virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override;
-
- void Show(ErrorResult& aRv);
-
- IMPL_EVENT_HANDLER(click)
- IMPL_EVENT_HANDLER(close)
-
-protected:
-
- nsString mTitle;
- nsString mDescription;
- nsString mIconURL;
-
- RefPtr mObserver;
- nsCOMPtr mPrincipal;
- bool mIsHandlingUserInput;
- bool mAllow;
- bool mShowHasBeenCalled;
-
- static uint32_t sCount;
-};
-
-class AlertServiceObserver: public nsIObserver
-{
- public:
- NS_DECL_ISUPPORTS
-
- explicit AlertServiceObserver(DesktopNotification* notification)
- : mNotification(notification) {}
-
- void Disconnect() { mNotification = nullptr; }
-
- NS_IMETHOD
- Observe(nsISupports* aSubject,
- const char* aTopic,
- const char16_t* aData) override
- {
-
- // forward to parent
- if (mNotification) {
- mNotification->HandleAlertServiceNotification(aTopic);
- }
- return NS_OK;
- };
-
- private:
- virtual ~AlertServiceObserver() {}
-
- DesktopNotification* mNotification;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif /* mozilla_dom_DesktopNotification_h */
diff --git a/dom/notification/moz.build b/dom/notification/moz.build
index 819743b1fd28..7137cda48ba4 100644
--- a/dom/notification/moz.build
+++ b/dom/notification/moz.build
@@ -17,13 +17,11 @@ EXTRA_JS_MODULES += [
]
EXPORTS.mozilla.dom += [
- 'DesktopNotification.h',
'Notification.h',
'NotificationEvent.h',
]
UNIFIED_SOURCES += [
- 'DesktopNotification.cpp',
'Notification.cpp',
'NotificationEvent.cpp',
]
@@ -40,6 +38,8 @@ LOCAL_INCLUDES += [
BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']
+MOCHITEST_CHROME_MANIFESTS += ['test/chrome/chrome.ini']
+
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
diff --git a/dom/notification/test/chrome/chrome.ini b/dom/notification/test/chrome/chrome.ini
new file mode 100644
index 000000000000..e049dc98c108
--- /dev/null
+++ b/dom/notification/test/chrome/chrome.ini
@@ -0,0 +1 @@
+[test_notification_system_principal.xul]
\ No newline at end of file
diff --git a/dom/tests/mochitest/notification/desktop-notification/test_system_principal.xul b/dom/notification/test/chrome/test_notification_system_principal.xul
similarity index 100%
rename from dom/tests/mochitest/notification/desktop-notification/test_system_principal.xul
rename to dom/notification/test/chrome/test_notification_system_principal.xul
diff --git a/dom/tests/mochitest/notification/desktop-notification/create_notification.html b/dom/notification/test/mochitest/create_notification.html
similarity index 100%
rename from dom/tests/mochitest/notification/desktop-notification/create_notification.html
rename to dom/notification/test/mochitest/create_notification.html
diff --git a/dom/notification/test/mochitest/mochitest.ini b/dom/notification/test/mochitest/mochitest.ini
index c0de5ed461a4..32045f1c80f9 100644
--- a/dom/notification/test/mochitest/mochitest.ini
+++ b/dom/notification/test/mochitest/mochitest.ini
@@ -1,6 +1,7 @@
[DEFAULT]
support-files =
+ create_notification.html
MockServices.js
NotificationTest.js
@@ -8,3 +9,4 @@ support-files =
[test_notification_storage.html]
[test_bug931307.html]
skip-if = (os == 'android') # Bug 1258975 on android.
+[test_notification_tag.html]
\ No newline at end of file
diff --git a/dom/tests/mochitest/notification/desktop-notification/test_notification_tag.html b/dom/notification/test/mochitest/test_notification_tag.html
similarity index 100%
rename from dom/tests/mochitest/notification/desktop-notification/test_notification_tag.html
rename to dom/notification/test/mochitest/test_notification_tag.html
diff --git a/dom/tests/mochitest/general/test_interfaces.js b/dom/tests/mochitest/general/test_interfaces.js
index 56979977fd87..259f0d186867 100644
--- a/dom/tests/mochitest/general/test_interfaces.js
+++ b/dom/tests/mochitest/general/test_interfaces.js
@@ -270,10 +270,6 @@ var interfaceNamesInGlobalScope =
"DataTransferItemList",
// IMPORTANT: Do not change this list without review from a DOM peer!
"DelayNode",
-// IMPORTANT: Do not change this list without review from a DOM peer!
- "DesktopNotification",
-// IMPORTANT: Do not change this list without review from a DOM peer!
- "DesktopNotificationCenter",
// IMPORTANT: Do not change this list without review from a DOM peer!
"DeviceLightEvent",
// IMPORTANT: Do not change this list without review from a DOM peer!
diff --git a/dom/tests/mochitest/notification/desktop-notification/moz.build b/dom/tests/mochitest/notification/desktop-notification/moz.build
deleted file mode 100644
index 28919c271d33..000000000000
--- a/dom/tests/mochitest/notification/desktop-notification/moz.build
+++ /dev/null
@@ -1,6 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
diff --git a/dom/tests/mochitest/notification/desktop-notification/notification_common.js b/dom/tests/mochitest/notification/desktop-notification/notification_common.js
deleted file mode 100644
index 921b1e753cd8..000000000000
--- a/dom/tests/mochitest/notification/desktop-notification/notification_common.js
+++ /dev/null
@@ -1,70 +0,0 @@
-const MOCK_ALERTS_CID = SpecialPowers.wrap(SpecialPowers.Components).ID("{48068bc2-40ab-4904-8afd-4cdfb3a385f3}");
-const ALERTS_SERVICE_CONTRACT_ID = "@mozilla.org/alerts-service;1";
-
-const MOCK_SYSTEM_ALERTS_CID = SpecialPowers.wrap(SpecialPowers.Components).ID("{e86d888c-e41b-4b78-9104-2f2742a532de}");
-const SYSTEM_ALERTS_SERVICE_CONTRACT_ID = "@mozilla.org/system-alerts-service;1";
-
-var registrar = SpecialPowers.wrap(SpecialPowers.Components).manager.
- QueryInterface(SpecialPowers.Ci.nsIComponentRegistrar);
-
-var mockAlertsService = {
- showAlert: function(alert, alertListener) {
- // probably should do this async....
- SpecialPowers.wrap(alertListener).observe(null, "alertshow", alert.cookie);
-
- if (SpecialPowers.getBoolPref("notification.prompt.testing.click_on_notification") == true) {
- SpecialPowers.wrap(alertListener).observe(null, "alertclickcallback", alert.cookie);
- }
-
- SpecialPowers.wrap(alertListener).observe(null, "alertfinished", alert.cookie);
- },
-
- showAlertNotification: function(imageUrl, title, text, textClickable,
- cookie, alertListener, name, bidi,
- lang, data) {
- return this.showAlert({
- cookie: cookie
- }, alertListener);
- },
-
- QueryInterface: function(aIID) {
- if (SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsISupports) ||
- SpecialPowers.wrap(aIID).equals(SpecialPowers.Ci.nsIAlertsService)) {
- return this;
- }
- throw SpecialPowers.Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- createInstance: function(aOuter, aIID) {
- if (aOuter != null) {
- throw SpecialPowers.Components.results.NS_ERROR_NO_AGGREGATION;
- }
- return this.QueryInterface(aIID);
- }
-};
-mockAlertsService = SpecialPowers.wrapCallbackObject(mockAlertsService);
-
-function setup_notifications(allowPrompt, forceClick, callback) {
- SpecialPowers.pushPrefEnv({'set': [["notification.prompt.testing", true],
- ["notification.prompt.testing.allow", allowPrompt],
- ["notification.prompt.testing.click_on_notification", forceClick]]},
- callback);
-
- registrar.registerFactory(MOCK_SYSTEM_ALERTS_CID, "system alerts service",
- SYSTEM_ALERTS_SERVICE_CONTRACT_ID,
- mockAlertsService);
-
- registrar.registerFactory(MOCK_ALERTS_CID, "alerts service",
- ALERTS_SERVICE_CONTRACT_ID,
- mockAlertsService);
-}
-
-function reset_notifications() {
- registrar.unregisterFactory(MOCK_SYSTEM_ALERTS_CID, mockAlertsService);
- registrar.unregisterFactory(MOCK_ALERTS_CID, mockAlertsService);
-}
-
-function is_feature_enabled() {
- return navigator.mozNotification && SpecialPowers.getBoolPref("notification.feature.enabled");
-}
-
diff --git a/dom/tests/mochitest/notification/desktop-notification/test_basic_notification.html b/dom/tests/mochitest/notification/desktop-notification/test_basic_notification.html
deleted file mode 100644
index 75f3c84b4ab9..000000000000
--- a/dom/tests/mochitest/notification/desktop-notification/test_basic_notification.html
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
- Basic functional test
-
-
-
-
-
-Basic property tests
-
-
-
-
-
-
-
-
diff --git a/dom/tests/mochitest/notification/desktop-notification/test_basic_notification_click.html b/dom/tests/mochitest/notification/desktop-notification/test_basic_notification_click.html
deleted file mode 100644
index defa0f412099..000000000000
--- a/dom/tests/mochitest/notification/desktop-notification/test_basic_notification_click.html
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
- Basic functional test
-
-
-
-
-
-Basic property tests
-
-
-
-
-
-
-
-
diff --git a/dom/tests/mochitest/notification/desktop-notification/test_leak_windowClose.html b/dom/tests/mochitest/notification/desktop-notification/test_leak_windowClose.html
deleted file mode 100644
index 136ea049565f..000000000000
--- a/dom/tests/mochitest/notification/desktop-notification/test_leak_windowClose.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
- Test for leak when window closes
-
-
-
-
-
-
-
- I like to write tests
-
-
diff --git a/dom/webidl/DesktopNotification.webidl b/dom/webidl/DesktopNotification.webidl
deleted file mode 100644
index 18bfce9dc5fe..000000000000
--- a/dom/webidl/DesktopNotification.webidl
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-interface MozObserver;
-
-[HeaderFile="mozilla/dom/DesktopNotification.h"]
-interface DesktopNotificationCenter
-{
- [NewObject]
- DesktopNotification createNotification(DOMString title,
- DOMString description,
- optional DOMString iconURL = "");
-};
-
-interface DesktopNotification : EventTarget
-{
- [Throws]
- void show();
-
- attribute EventHandler onclick;
-
- attribute EventHandler onclose;
-};
diff --git a/dom/webidl/Navigator.webidl b/dom/webidl/Navigator.webidl
index 5ec8743ab92f..f10fa4b0cd3f 100644
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -200,12 +200,6 @@ partial interface Navigator {
void removeIdleObserver(MozIdleObserver aIdleObserver);
};
-// nsIDOMNavigatorDesktopNotification
-partial interface Navigator {
- [Throws, Pref="notification.feature.enabled", UnsafeInPrerendering]
- readonly attribute DesktopNotificationCenter mozNotification;
-};
-
// NetworkInformation
partial interface Navigator {
[Throws, Pref="dom.netinfo.enabled"]
diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build
index 25aad128ef7a..3929d2b9d928 100644
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -97,9 +97,6 @@ with Files("DelayNode.webidl"):
with Files("DynamicsCompressorNode.webidl"):
BUG_COMPONENT = ("Core", "Web Audio")
-with Files("DesktopNotification.webidl"):
- BUG_COMPONENT = ("Toolkit", "Notifications and Alerts")
-
with Files("FakePluginTagInit.webidl"):
BUG_COMPONENT = ("Core", "Plug-ins")
@@ -478,7 +475,6 @@ WEBIDL_FILES = [
'DecoderDoctorNotification.webidl',
'DedicatedWorkerGlobalScope.webidl',
'DelayNode.webidl',
- 'DesktopNotification.webidl',
'DeviceMotionEvent.webidl',
'Directory.webidl',
'Document.webidl',
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index 2118cb4058a3..10b7611fb275 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5026,9 +5026,6 @@ pref("extensions.webcompat-reporter.enabled", false);
pref("network.buffer.cache.count", 24);
pref("network.buffer.cache.size", 32768);
-// Desktop Notification
-pref("notification.feature.enabled", false);
-
// Web Notification
pref("dom.webnotifications.enabled", true);
pref("dom.webnotifications.serviceworker.enabled", true);
diff --git a/widget/cocoa/OSXNotificationCenter.h b/widget/cocoa/OSXNotificationCenter.h
index 30767b5c55a6..4c356dad2c99 100644
--- a/widget/cocoa/OSXNotificationCenter.h
+++ b/widget/cocoa/OSXNotificationCenter.h
@@ -13,6 +13,11 @@
#include "nsTArray.h"
#include "mozilla/RefPtr.h"
+// mozNotificationCenterDelegate is used to access the macOS notification
+// center. It is not related to the DesktopNotificationCenter object, which was
+// removed in bug 952453. While there are no direct references to this class
+// elsewhere, removing this will cause push notifications on macOS to stop
+// working.
@class mozNotificationCenterDelegate;
#if !defined(MAC_OS_X_VERSION_10_8) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8)
From efe66e5e3a5d50e91ed7fd980af23fc816bbc4c9 Mon Sep 17 00:00:00 2001
From: Kyle Machulis
Date: Fri, 5 Jan 2018 13:32:18 -0800
Subject: [PATCH 06/33] Bug 952453 - Fix test_notification_tag to point to
correct location for create_notification.html; r=mattn
MozReview-Commit-ID: 9T3zhihWGvC
---
dom/notification/test/mochitest/test_notification_tag.html | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/dom/notification/test/mochitest/test_notification_tag.html b/dom/notification/test/mochitest/test_notification_tag.html
index 37bcb16c0299..86efaece6abc 100644
--- a/dom/notification/test/mochitest/test_notification_tag.html
+++ b/dom/notification/test/mochitest/test_notification_tag.html
@@ -91,12 +91,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=782211
// Load two frames with the same origin that create notification with the same tag.
// Both pages should generate notifications with the same name, and thus the second
// notification should replace the first.
- frames["sameDomain"].location.href = "http://test1.example.org:80/tests/dom/tests/mochitest/notification/create_notification.html";
- frames["anotherSameDomain"].location.href = "http://test1.example.org:80/tests/dom/tests/mochitest/notification/create_notification.html";
-
+ frames["sameDomain"].location.href = "http://test1.example.org:80/tests/dom/notification/test/mochitest/create_notification.html";
+ frames["anotherSameDomain"].location.href = "http://test1.example.org:80/tests/dom/notification/test/mochitest/create_notification.html";
// Load a frame with a different origin that creates a notification with the same tag.
// The notification name should be different and thus no notifications should be replaced.
- frames["crossDomain"].location.href = "http://test2.example.org:80/tests/dom/tests/mochitest/notification/create_notification.html";
+ frames["crossDomain"].location.href = "http://test2.example.org:80/tests/dom/notification/test/mochitest/create_notification.html";
}
SpecialPowers.pushPrefEnv({'set': [["notification.prompt.testing", true],
From 14221de9402e7cc70789ef4ff6d67d142d851736 Mon Sep 17 00:00:00 2001
From: Robert Longson
Date: Mon, 8 Jan 2018 14:17:25 -0800
Subject: [PATCH 07/33] (no bug): Fix typo in code-comment, in
nsSVGElement.cpp. r=dholbert DONTBUILD because comment-only
---
dom/svg/nsSVGElement.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dom/svg/nsSVGElement.cpp b/dom/svg/nsSVGElement.cpp
index aa1d342ffcee..df53980a3178 100644
--- a/dom/svg/nsSVGElement.cpp
+++ b/dom/svg/nsSVGElement.cpp
@@ -2385,12 +2385,12 @@ nsSVGElement::DidAnimateTransformList(int32_t aModType)
transformAttr,
aModType);
// When script changes the 'transform' attribute, Element::SetAttrAndNotify
- // will call nsNodeUtills::AttributeChanged, under which
+ // will call nsNodeUtils::AttributeChanged, under which
// SVGTransformableElement::GetAttributeChangeHint will be called and an
// appropriate change event posted to update our frame's overflow rects.
// The SetAttrAndNotify doesn't happen for transform changes caused by
// 'animateTransform' though (and sending out the mutation events that
- // nsNodeUtills::AttributeChanged dispatches would be inappropriate
+ // nsNodeUtils::AttributeChanged dispatches would be inappropriate
// anyway), so we need to post the change event ourself.
nsChangeHint changeHint = GetAttributeChangeHint(transformAttr, aModType);
if (changeHint) {
From 48ac04d542e238a4ee445b592bb62900d8a25737 Mon Sep 17 00:00:00 2001
From: Mike Hommey
Date: Tue, 9 Jan 2018 08:22:02 +0900
Subject: [PATCH 08/33] Bug 1420449 - Fixup after bug 1427312. r=me
---
taskcluster/taskgraph/transforms/diffoscope.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/taskcluster/taskgraph/transforms/diffoscope.py b/taskcluster/taskgraph/transforms/diffoscope.py
index 7a80f5923514..6236138ec847 100644
--- a/taskcluster/taskgraph/transforms/diffoscope.py
+++ b/taskcluster/taskgraph/transforms/diffoscope.py
@@ -53,9 +53,10 @@ diff_description_schema = Schema({
@transforms.add
def validate(config, tasks):
for task in tasks:
- yield validate_schema(
+ validate_schema(
diff_description_schema, task,
"In diff task {!r}:".format(task.get('name', 'unknown')))
+ yield task
@transforms.add
From 71de2763a6ee29a574025db14c0dfa367b29a017 Mon Sep 17 00:00:00 2001
From: Matt Woodrow
Date: Wed, 3 Jan 2018 18:31:31 +1300
Subject: [PATCH 09/33] Bug 1427476 - Don't try to retain display lists for
popups since their display root isn't the root frame of a document. r=miko
--HG--
extra : rebase_source : a924322e5cae1ba25526bc258ab18af50d37d66a
---
layout/base/nsLayoutUtils.cpp | 5 ++++-
layout/generic/nsFrame.cpp | 4 +++-
layout/painting/RetainedDisplayListBuilder.cpp | 4 ++++
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp
index 594cff43d9de..095d8333a1c3 100644
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -3636,7 +3636,10 @@ nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
const bool isForPainting = (aFlags & PaintFrameFlags::PAINT_WIDGET_LAYERS) &&
aBuilderMode == nsDisplayListBuilderMode::PAINTING;
- const bool retainingEnabled = isForPainting && AreRetainedDisplayListsEnabled();
+ // Only allow retaining for painting when preffed on, and for root frames (since
+ // the modified frame tracking is per-root-frame).
+ const bool retainingEnabled =
+ isForPainting && AreRetainedDisplayListsEnabled() && !aFrame->GetParent();
RetainedDisplayListBuilder* retainedBuilder =
GetOrCreateRetainedDisplayListBuilder(aFrame, retainingEnabled, buildCaret);
diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp
index 67bd331a9302..5c20786934c6 100644
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -997,7 +997,9 @@ nsIFrame::RemoveDisplayItemDataForDeletion()
void
nsIFrame::MarkNeedsDisplayItemRebuild()
{
- if (!nsLayoutUtils::AreRetainedDisplayListsEnabled() || IsFrameModified()) {
+ if (!nsLayoutUtils::AreRetainedDisplayListsEnabled() ||
+ IsFrameModified() ||
+ HasAnyStateBits(NS_FRAME_IN_POPUP)) {
// Skip frames that are already marked modified.
return;
}
diff --git a/layout/painting/RetainedDisplayListBuilder.cpp b/layout/painting/RetainedDisplayListBuilder.cpp
index 9bac90963b65..c8c35fe644be 100644
--- a/layout/painting/RetainedDisplayListBuilder.cpp
+++ b/layout/painting/RetainedDisplayListBuilder.cpp
@@ -603,6 +603,10 @@ RetainedDisplayListBuilder::ComputeRebuildRegion(nsTArray& aModifiedF
aOutFramesWithProps->AppendElement(f);
}
+ if (f->HasAnyStateBits(NS_FRAME_IN_POPUP)) {
+ continue;
+ }
+
// TODO: There is almost certainly a faster way of doing this, probably can be combined with the ancestor
// walk for TransformFrameRectToAncestor.
AnimatedGeometryRoot* agr = mBuilder.FindAnimatedGeometryRootFor(f)->GetAsyncAGR();
From b4f92760970b19f58e87e56a77ed02d721e2222f Mon Sep 17 00:00:00 2001
From: Matt Woodrow
Date: Tue, 9 Jan 2018 11:56:44 +1300
Subject: [PATCH 10/33] Bug 1427914 - Move the AnyContentAncestorModified check
up into ComputeVisibleRectForFrame since it affects the resulting dirty rect.
r=miko
--HG--
extra : rebase_source : b450b026ba3e28b76e2176f7e58bbbd138c9d342
---
layout/painting/nsDisplayList.cpp | 26 --------------------------
layout/painting/nsDisplayList.h | 25 +++++++++++++++++++++++++
2 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp
index 62658a9ea7e0..190bc9f02503 100644
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -1169,24 +1169,6 @@ nsDisplayListBuilder::FindAnimatedGeometryRootFor(nsDisplayItem* aItem)
return FindAnimatedGeometryRootFor(aItem->Frame());
}
-static bool
-AnyContentAncestorModified(nsIFrame* aFrame,
- nsIFrame* aStopAtFrame = nullptr)
-{
- for (nsIFrame* f = aFrame; f;
- f = nsLayoutUtils::GetParentOrPlaceholderForCrossDoc(f)) {
- if (f->IsFrameModified()) {
- return true;
- }
-
- if (aStopAtFrame && f == aStopAtFrame) {
- break;
- }
- }
-
- return false;
-}
-
bool nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame,
nsIFrame* aFrame)
{
@@ -1200,14 +1182,6 @@ bool nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame,
return false;
}
- // If the nearest stacking context for the modified frame is an ancestor of
- // of it, and if the stacking context is a descendant of the containing block
- // of this OOF frame, we override the dirty rect to ensure that the frame will
- // get marked.
- if (AnyContentAncestorModified(aFrame, aDirtyFrame)) {
- dirty = visible;
- }
-
// Only MarkFrameForDisplay if we're dirty. If this is a nested out-of-flow frame, then it will
// also mark any outer frames to ensure that building reaches the dirty feame.
if (!dirty.IsEmpty() ||
diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h
index e43c6a6b67d6..4628f230eb92 100644
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -1458,6 +1458,23 @@ public:
nsRect mVisibleRect;
nsRect mDirtyRect;
+ static bool
+ AnyContentAncestorModified(nsIFrame* aFrame,
+ nsIFrame* aStopAtFrame = nullptr)
+ {
+ for (nsIFrame* f = aFrame; f;
+ f = nsLayoutUtils::GetParentOrPlaceholderForCrossDoc(f)) {
+ if (f->IsFrameModified()) {
+ return true;
+ }
+
+ if (aStopAtFrame && f == aStopAtFrame) {
+ break;
+ }
+ }
+
+ return false;
+ }
static nsRect ComputeVisibleRectForFrame(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame,
@@ -1503,6 +1520,14 @@ public:
visible.IntersectRect(visible, overflowRect);
aOutDirtyRect->IntersectRect(*aOutDirtyRect, overflowRect);
+
+ // If the nearest stacking context for the modified frame is an ancestor of
+ // of it, and if the stacking context is a descendant of the containing block
+ // of this OOF frame, we override the dirty rect to ensure that the frame will
+ // get marked.
+ if (AnyContentAncestorModified(aFrame, aFrame->GetParent())) {
+ *aOutDirtyRect = visible;
+ }
return visible;
}
From 878412c69ae64f65289b1d2ae20665d523fc341f Mon Sep 17 00:00:00 2001
From: Matt Woodrow
Date: Tue, 9 Jan 2018 11:59:56 +1300
Subject: [PATCH 11/33] Bug 1427968 - Don't check for the force descend flag
when checking for the presence of OutOfFlowDisplayData. r=miko
--HG--
extra : rebase_source : 4ac2cce6aa0dd6e6299601da880770d938c6a513
---
layout/painting/nsDisplayList.cpp | 2 +-
layout/painting/nsDisplayList.h | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp
index 190bc9f02503..7a2f856b46c3 100644
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -1189,7 +1189,7 @@ bool nsDisplayListBuilder::MarkOutOfFlowFrameForDisplay(nsIFrame* aDirtyFrame,
MarkFrameForDisplay(aFrame, aDirtyFrame);
}
- return (aFrame->GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO);
+ return true;
}
static void UnmarkFrameForDisplay(nsIFrame* aFrame, nsIFrame* aStopAtFrame) {
diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h
index 4628f230eb92..204db39e9845 100644
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -1550,8 +1550,7 @@ public:
static OutOfFlowDisplayData* GetOutOfFlowData(nsIFrame* aFrame)
{
- if (!(aFrame->GetStateBits() & NS_FRAME_FORCE_DISPLAY_LIST_DESCEND_INTO) ||
- !aFrame->GetParent()) {
+ if (!aFrame->GetParent()) {
return nullptr;
}
return aFrame->GetParent()->GetProperty(OutOfFlowDisplayDataProperty());
From b9fc4558b8fbccfc91a8008636f4aabc329989a0 Mon Sep 17 00:00:00 2001
From: Gerald Squelart
Date: Sat, 25 Nov 2017 10:02:20 +1100
Subject: [PATCH 12/33] Bug 1418840 - Use the modified frames list for the
subdoc that painting will use, which isn't always the current subdoc of the
FrameOuter. r=mstange
--HG--
extra : rebase_source : a01a93a91da776e3fc43debc5990440f8dc8dafc
---
.../painting/RetainedDisplayListBuilder.cpp | 58 ++++++++++++++-----
1 file changed, 44 insertions(+), 14 deletions(-)
diff --git a/layout/painting/RetainedDisplayListBuilder.cpp b/layout/painting/RetainedDisplayListBuilder.cpp
index c8c35fe644be..4ca467c20ad7 100644
--- a/layout/painting/RetainedDisplayListBuilder.cpp
+++ b/layout/painting/RetainedDisplayListBuilder.cpp
@@ -7,6 +7,7 @@
#include "RetainedDisplayListBuilder.h"
#include "nsSubDocumentFrame.h"
+#include "nsViewManager.h"
/**
* Code for doing display list building for a modified subset of the window,
@@ -518,20 +519,48 @@ TakeAndAddModifiedFramesFromRootFrame(nsTArray& aFrames,
frames->Clear();
}
+struct CbData {
+ nsDisplayListBuilder* builder;
+ nsTArray modifiedFrames;
+};
+
static bool
SubDocEnumCb(nsIDocument* aDocument, void* aData)
{
MOZ_ASSERT(aDocument);
MOZ_ASSERT(aData);
- nsTArray* modifiedFrames =
- static_cast*>(aData);
+ CbData* data = static_cast(aData);
+
+ // Although this is the actual subdocument, it might not be
+ // what painting uses. Walk up to the nsSubDocumentFrame owning
+ // us, and then ask that which subdoc it's going to paint.
nsIPresShell* presShell = aDocument->GetShell();
- nsIFrame* rootFrame = presShell ? presShell->GetRootFrame() : nullptr;
+ if (presShell) {
+ nsView* rootView = presShell->GetViewManager()->GetRootView();
+ MOZ_ASSERT(rootView);
- if (rootFrame) {
- TakeAndAddModifiedFramesFromRootFrame(*modifiedFrames, rootFrame);
+ // There should be an anonymous inner view between the root view
+ // of the subdoc, and the view for the nsSubDocumentFrame.
+ nsView* innerView = rootView->GetParent();
+ MOZ_ASSERT(innerView);
+
+ nsView* subDocView = innerView->GetParent();
+ MOZ_ASSERT(subDocView);
+
+ nsIFrame* subDocFrame = subDocView->GetFrame();
+ MOZ_ASSERT(subDocFrame);
+ nsSubDocumentFrame* subdocumentFrame = do_QueryFrame(subDocFrame);
+ MOZ_ASSERT(subdocumentFrame);
+
+ presShell = subdocumentFrame->GetSubdocumentPresShellForPainting(
+ data->builder->IsIgnoringPaintSuppression() ? nsSubDocumentFrame::IGNORE_PAINT_SUPPRESSION : 0);
+ nsIFrame* rootFrame = presShell ? presShell->GetRootFrame() : nullptr;
+
+ if (rootFrame) {
+ TakeAndAddModifiedFramesFromRootFrame(data->modifiedFrames, rootFrame);
+ }
}
aDocument->EnumerateSubDocuments(SubDocEnumCb, aData);
@@ -539,20 +568,21 @@ SubDocEnumCb(nsIDocument* aDocument, void* aData)
}
static nsTArray
-GetModifiedFrames(nsIFrame* aDisplayRootFrame)
+GetModifiedFrames(nsDisplayListBuilder* aBuilder)
{
- MOZ_ASSERT(aDisplayRootFrame);
+ MOZ_ASSERT(aBuilder->RootReferenceFrame());
- nsTArray modifiedFrames;
- TakeAndAddModifiedFramesFromRootFrame(modifiedFrames, aDisplayRootFrame);
+ CbData data;
+ data.builder = aBuilder;
+ TakeAndAddModifiedFramesFromRootFrame(data.modifiedFrames, aBuilder->RootReferenceFrame());
- nsIDocument* rootdoc = aDisplayRootFrame->PresContext()->Document();
+ nsIDocument* rootdoc = aBuilder->RootReferenceFrame()->PresContext()->Document();
if (rootdoc) {
- rootdoc->EnumerateSubDocuments(SubDocEnumCb, &modifiedFrames);
+ rootdoc->EnumerateSubDocuments(SubDocEnumCb, &data);
}
- return modifiedFrames;
+ return Move(data.modifiedFrames);
}
// ComputeRebuildRegion debugging
@@ -786,7 +816,7 @@ void
RetainedDisplayListBuilder::ClearModifiedFrameProps()
{
nsTArray modifiedFrames =
- GetModifiedFrames(mBuilder.RootReferenceFrame());
+ GetModifiedFrames(&mBuilder);
ClearFrameProps(modifiedFrames);
}
@@ -802,7 +832,7 @@ RetainedDisplayListBuilder::AttemptPartialUpdate(nscolor aBackstop)
mBuilder.EnterPresShell(mBuilder.RootReferenceFrame());
nsTArray modifiedFrames =
- GetModifiedFrames(mBuilder.RootReferenceFrame());
+ GetModifiedFrames(&mBuilder);
// Do not allow partial builds if the retained display list is empty, or if
// ShouldBuildPartial heuristic fails.
From 05a9191b3240c9ef15b0f458104d717f892a6c52 Mon Sep 17 00:00:00 2001
From: Luke Wagner
Date: Mon, 8 Jan 2018 17:43:51 -0600
Subject: [PATCH 13/33] Bug 1428453 - Baldr: move code and remove dead
argument/field (r=bbouvier)
MozReview-Commit-ID: IHXAThgE5VH
--HG--
extra : rebase_source : 123a1376c40d00cbbf3b838e61b0b451dd975313
---
js/src/jscntxt.h | 3 ++
js/src/vm/Runtime.h | 3 --
js/src/vm/Stack.cpp | 2 +-
js/src/wasm/WasmCode.cpp | 80 ++++++++++++++---------------
js/src/wasm/WasmCode.h | 2 +-
js/src/wasm/WasmFrameIter.cpp | 82 ++++++++++++++----------------
js/src/wasm/WasmFrameIter.h | 5 +-
js/src/wasm/WasmGenerator.cpp | 4 +-
js/src/wasm/WasmProcess.cpp | 2 +-
js/src/wasm/WasmSignalHandlers.cpp | 5 +-
js/src/wasm/WasmTypes.h | 2 -
11 files changed, 91 insertions(+), 99 deletions(-)
diff --git a/js/src/jscntxt.h b/js/src/jscntxt.h
index e04e8c65a4ea..3a49af316dad 100644
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -20,6 +20,9 @@
#include "vm/ErrorReporting.h"
#include "vm/MallocProvider.h"
#include "vm/Runtime.h"
+#ifdef XP_DARWIN
+# include "wasm/WasmSignalHandlers.h"
+#endif
#ifdef _MSC_VER
#pragma warning(push)
diff --git a/js/src/vm/Runtime.h b/js/src/vm/Runtime.h
index 1316c53f0660..fe6e795abdd6 100644
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -22,9 +22,6 @@
#include "jsatom.h"
#include "jsscript.h"
-#ifdef XP_DARWIN
-# include "wasm/WasmSignalHandlers.h"
-#endif
#include "builtin/AtomicsObject.h"
#include "builtin/Intl.h"
#include "builtin/Promise.h"
diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp
index 53a5ff086c80..c6f39b43589e 100644
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -1709,7 +1709,7 @@ jit::JitActivation::startWasmInterrupt(const JS::ProfilingFrameIterator::Registe
bool ignoredUnwound;
wasm::UnwindState unwindState;
- MOZ_ALWAYS_TRUE(wasm::StartUnwinding(*this, state, &unwindState, &ignoredUnwound));
+ MOZ_ALWAYS_TRUE(wasm::StartUnwinding(state, &unwindState, &ignoredUnwound));
void* pc = unwindState.pc;
MOZ_ASSERT(wasm::LookupCode(pc)->lookupRange(pc)->isFunction());
diff --git a/js/src/wasm/WasmCode.cpp b/js/src/wasm/WasmCode.cpp
index a01a72696707..97194666bd29 100644
--- a/js/src/wasm/WasmCode.cpp
+++ b/js/src/wasm/WasmCode.cpp
@@ -767,46 +767,6 @@ struct CallSiteRetAddrOffset
}
};
-size_t
-Code::serializedSize() const
-{
- return metadata().serializedSize() +
- segment(Tier::Serialized).serializedSize();
-}
-
-uint8_t*
-Code::serialize(uint8_t* cursor, const LinkData& linkData) const
-{
- MOZ_RELEASE_ASSERT(!metadata().debugEnabled);
-
- cursor = metadata().serialize(cursor);
- cursor = segment(Tier::Serialized).serialize(cursor, linkData.linkData(Tier::Serialized));
- return cursor;
-}
-
-const uint8_t*
-Code::deserialize(const uint8_t* cursor, const SharedBytes& bytecode, const LinkData& linkData,
- Metadata& metadata)
-{
- cursor = metadata.deserialize(cursor);
- if (!cursor)
- return nullptr;
-
- UniqueCodeSegment codeSegment = js::MakeUnique();
- if (!codeSegment)
- return nullptr;
-
- cursor = codeSegment->deserialize(cursor, *bytecode, linkData.linkData(Tier::Serialized),
- metadata);
- if (!cursor)
- return nullptr;
-
- segment1_ = takeOwnership(Move(codeSegment));
- metadata_ = &metadata;
-
- return cursor;
-}
-
const CallSite*
Code::lookupCallSite(void* returnAddress) const
{
@@ -959,3 +919,43 @@ Code::addSizeOfMiscIfNotSeen(MallocSizeOf mallocSizeOf,
for (auto t : tiers())
segment(t).addSizeOfMisc(mallocSizeOf, code, data);
}
+
+size_t
+Code::serializedSize() const
+{
+ return metadata().serializedSize() +
+ segment(Tier::Serialized).serializedSize();
+}
+
+uint8_t*
+Code::serialize(uint8_t* cursor, const LinkData& linkData) const
+{
+ MOZ_RELEASE_ASSERT(!metadata().debugEnabled);
+
+ cursor = metadata().serialize(cursor);
+ cursor = segment(Tier::Serialized).serialize(cursor, linkData.linkData(Tier::Serialized));
+ return cursor;
+}
+
+const uint8_t*
+Code::deserialize(const uint8_t* cursor, const SharedBytes& bytecode, const LinkData& linkData,
+ Metadata& metadata)
+{
+ cursor = metadata.deserialize(cursor);
+ if (!cursor)
+ return nullptr;
+
+ UniqueCodeSegment codeSegment = js::MakeUnique();
+ if (!codeSegment)
+ return nullptr;
+
+ cursor = codeSegment->deserialize(cursor, *bytecode, linkData.linkData(Tier::Serialized),
+ metadata);
+ if (!cursor)
+ return nullptr;
+
+ segment1_ = takeOwnership(Move(codeSegment));
+ metadata_ = &metadata;
+
+ return cursor;
+}
diff --git a/js/src/wasm/WasmCode.h b/js/src/wasm/WasmCode.h
index 466c14d5910f..772a661a6bb6 100644
--- a/js/src/wasm/WasmCode.h
+++ b/js/src/wasm/WasmCode.h
@@ -130,7 +130,7 @@ class CodeSegment
code_ = code;
}
- const Code* code() const { MOZ_ASSERT(code_); return code_; }
+ const Code& code() const { MOZ_ASSERT(code_); return *code_; }
Tier tier() const { return tier_; }
uint8_t* base() const { return bytes_.get(); }
diff --git a/js/src/wasm/WasmFrameIter.cpp b/js/src/wasm/WasmFrameIter.cpp
index 9ef5b5132926..1723d63385b4 100644
--- a/js/src/wasm/WasmFrameIter.cpp
+++ b/js/src/wasm/WasmFrameIter.cpp
@@ -42,17 +42,6 @@ WasmFrameIter::WasmFrameIter(JitActivation* activation, wasm::Frame* fp)
{
MOZ_ASSERT(fp_);
- // Normally, execution exits wasm code via an exit stub which sets exitFP
- // to the exit stub's frame. Thus, in this case, we want to start iteration
- // at the caller of the exit frame, whose Code, CodeRange and CallSite are
- // indicated by the returnAddress of the exit stub's frame.
-
- if (!activation->isWasmInterrupted()) {
- popFrame();
- MOZ_ASSERT(!done());
- return;
- }
-
// When asynchronously interrupted, exitFP is set to the interrupted frame
// itself and so we do not want to skip it. Instead, we can recover the
// Code and CodeRange from the JitActivation, which are set when control
@@ -61,12 +50,23 @@ WasmFrameIter::WasmFrameIter(JitActivation* activation, wasm::Frame* fp)
// for which we can use the beginning of the function from the CodeRange
// instead.
- code_ = &fp_->tls->instance->code();
- MOZ_ASSERT(code_ == LookupCode(activation->wasmUnwindPC()));
+ if (activation->isWasmInterrupted()) {
+ code_ = &fp_->tls->instance->code();
+ MOZ_ASSERT(code_ == LookupCode(activation->wasmUnwindPC()));
- codeRange_ = code_->lookupRange(activation->wasmUnwindPC());
- MOZ_ASSERT(codeRange_->kind() == CodeRange::Function);
+ codeRange_ = code_->lookupRange(activation->wasmUnwindPC());
+ MOZ_ASSERT(codeRange_->kind() == CodeRange::Function);
+ MOZ_ASSERT(!done());
+ return;
+ }
+
+ // Otherwise, execution exits wasm code via an exit stub which sets exitFP
+ // to the exit stub's frame. Thus, in this case, we want to start iteration
+ // at the caller of the exit frame, whose Code, CodeRange and CallSite are
+ // indicated by the returnAddress of the exit stub's frame.
+
+ popFrame();
MOZ_ASSERT(!done());
}
@@ -547,8 +547,7 @@ wasm::GenerateJitExitEpilogue(MacroAssembler& masm, unsigned framePushed, Callab
// ProfilingFrameIterator
ProfilingFrameIterator::ProfilingFrameIterator()
- : activation_(nullptr),
- code_(nullptr),
+ : code_(nullptr),
codeRange_(nullptr),
callerFP_(nullptr),
callerPC_(nullptr),
@@ -559,8 +558,7 @@ ProfilingFrameIterator::ProfilingFrameIterator()
}
ProfilingFrameIterator::ProfilingFrameIterator(const JitActivation& activation)
- : activation_(&activation),
- code_(nullptr),
+ : code_(nullptr),
codeRange_(nullptr),
callerFP_(nullptr),
callerPC_(nullptr),
@@ -571,8 +569,7 @@ ProfilingFrameIterator::ProfilingFrameIterator(const JitActivation& activation)
}
ProfilingFrameIterator::ProfilingFrameIterator(const JitActivation& activation, const Frame* fp)
- : activation_(&activation),
- code_(nullptr),
+ : code_(nullptr),
codeRange_(nullptr),
callerFP_(nullptr),
callerPC_(nullptr),
@@ -584,7 +581,7 @@ ProfilingFrameIterator::ProfilingFrameIterator(const JitActivation& activation,
}
static inline void
-AssertMatchesCallSite(const JitActivation& activation, void* callerPC, Frame* callerFP)
+AssertMatchesCallSite(void* callerPC, Frame* callerFP)
{
#ifdef DEBUG
const Code* code = LookupCode(callerPC);
@@ -633,7 +630,7 @@ ProfilingFrameIterator::initFromExitFP(const Frame* fp)
fp = fp->callerFP;
callerPC_ = fp->returnAddress;
callerFP_ = fp->callerFP;
- AssertMatchesCallSite(*activation_, callerPC_, callerFP_);
+ AssertMatchesCallSite(callerPC_, callerFP_);
break;
case CodeRange::ImportJitExit:
case CodeRange::ImportInterpExit:
@@ -652,8 +649,8 @@ ProfilingFrameIterator::initFromExitFP(const Frame* fp)
}
bool
-js::wasm::StartUnwinding(const JitActivation& activation, const RegisterState& registers,
- UnwindState* unwindState, bool* unwoundCaller)
+js::wasm::StartUnwinding(const RegisterState& registers, UnwindState* unwindState,
+ bool* unwoundCaller)
{
// Shorthands.
uint8_t* const pc = (uint8_t*) registers.pc;
@@ -673,7 +670,7 @@ js::wasm::StartUnwinding(const JitActivation& activation, const RegisterState& r
const CodeSegment* codeSegment = LookupCodeSegment(pc);
if (codeSegment) {
- code = codeSegment->code();
+ code = &codeSegment->code();
codeRange = code->lookupRange(pc);
codeBase = codeSegment->base();
} else if (!LookupBuiltinThunk(pc, &codeRange, &codeBase)) {
@@ -731,14 +728,14 @@ js::wasm::StartUnwinding(const JitActivation& activation, const RegisterState& r
// fp holds the caller's fp.
fixedPC = (uint8_t*) registers.lr;
fixedFP = fp;
- AssertMatchesCallSite(activation, fixedPC, fixedFP);
+ AssertMatchesCallSite(fixedPC, fixedFP);
} else
#elif defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_ARM64)
if (offsetFromEntry == BeforePushRetAddr || codeRange->isThunk()) {
// The return address is still in lr and fp holds the caller's fp.
fixedPC = (uint8_t*) registers.lr;
fixedFP = fp;
- AssertMatchesCallSite(activation, fixedPC, fixedFP);
+ AssertMatchesCallSite(fixedPC, fixedFP);
} else
#endif
if (offsetFromEntry == PushedRetAddr || codeRange->isThunk()) {
@@ -746,26 +743,26 @@ js::wasm::StartUnwinding(const JitActivation& activation, const RegisterState& r
// points to the caller's fp.
fixedPC = sp[0];
fixedFP = fp;
- AssertMatchesCallSite(activation, fixedPC, fixedFP);
+ AssertMatchesCallSite(fixedPC, fixedFP);
} else if (offsetFromEntry >= PushedTLS && offsetFromEntry < PushedFP) {
// The return address and caller's TLS have been pushed on the
// stack; fp is still the caller's fp.
fixedPC = sp[1];
fixedFP = fp;
- AssertMatchesCallSite(activation, fixedPC, fixedFP);
+ AssertMatchesCallSite(fixedPC, fixedFP);
} else if (offsetFromEntry == PushedFP) {
// The full Frame has been pushed; fp is still the caller's fp.
MOZ_ASSERT(fp == reinterpret_cast(sp)->callerFP);
fixedPC = reinterpret_cast(sp)->returnAddress;
fixedFP = fp;
- AssertMatchesCallSite(activation, fixedPC, fixedFP);
+ AssertMatchesCallSite(fixedPC, fixedFP);
} else if (offsetInCode >= codeRange->ret() - PoppedFP &&
offsetInCode < codeRange->ret() - PoppedTLSReg)
{
// The fixedFP field of the Frame has been popped into fp.
fixedPC = sp[1];
fixedFP = fp;
- AssertMatchesCallSite(activation, fixedPC, fixedFP);
+ AssertMatchesCallSite(fixedPC, fixedFP);
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
} else if (offsetInCode >= codeRange->ret() - PoppedTLSReg &&
offsetInCode < codeRange->ret())
@@ -774,20 +771,20 @@ js::wasm::StartUnwinding(const JitActivation& activation, const RegisterState& r
// exit reason hasn't been popped yet.
fixedPC = sp[0];
fixedFP = fp;
- AssertMatchesCallSite(activation, fixedPC, fixedFP);
+ AssertMatchesCallSite(fixedPC, fixedFP);
} else if (offsetInCode == codeRange->ret()) {
// Both the TLS, fixedFP and ra have been popped and fp now
// points to the caller's frame.
fixedPC = (uint8_t*) registers.lr;
fixedFP = fp;
- AssertMatchesCallSite(activation, fixedPC, fixedFP);
+ AssertMatchesCallSite(fixedPC, fixedFP);
#else
} else if (offsetInCode == codeRange->ret()) {
// Both the TLS and fixedFP fields have been popped and fp now
// points to the caller's frame.
fixedPC = sp[0];
fixedFP = fp;
- AssertMatchesCallSite(activation, fixedPC, fixedFP);
+ AssertMatchesCallSite(fixedPC, fixedFP);
#endif
} else {
if (codeRange->kind() == CodeRange::ImportJitExit) {
@@ -804,7 +801,7 @@ js::wasm::StartUnwinding(const JitActivation& activation, const RegisterState& r
fixedPC = pc;
fixedFP = fp;
*unwoundCaller = false;
- AssertMatchesCallSite(activation, fp->returnAddress, fp->callerFP);
+ AssertMatchesCallSite(fp->returnAddress, fp->callerFP);
break;
}
break;
@@ -815,7 +812,7 @@ js::wasm::StartUnwinding(const JitActivation& activation, const RegisterState& r
fixedPC = pc;
fixedFP = fp;
*unwoundCaller = false;
- AssertMatchesCallSite(activation, fp->returnAddress, fp->callerFP);
+ AssertMatchesCallSite(fp->returnAddress, fp->callerFP);
break;
case CodeRange::InterpEntry:
// The entry trampoline is the final frame in an wasm JitActivation. The
@@ -843,8 +840,7 @@ js::wasm::StartUnwinding(const JitActivation& activation, const RegisterState& r
ProfilingFrameIterator::ProfilingFrameIterator(const JitActivation& activation,
const RegisterState& state)
- : activation_(&activation),
- code_(nullptr),
+ : code_(nullptr),
codeRange_(nullptr),
callerFP_(nullptr),
callerPC_(nullptr),
@@ -862,7 +858,7 @@ ProfilingFrameIterator::ProfilingFrameIterator(const JitActivation& activation,
bool unwoundCaller;
UnwindState unwindState;
- if (!StartUnwinding(*activation_, state, &unwindState, &unwoundCaller)) {
+ if (!StartUnwinding(state, &unwindState, &unwoundCaller)) {
MOZ_ASSERT(done());
return;
}
@@ -924,7 +920,7 @@ ProfilingFrameIterator::operator++()
case CodeRange::FarJumpIsland:
stackAddress_ = callerFP_;
callerPC_ = callerFP_->returnAddress;
- AssertMatchesCallSite(*activation_, callerPC_, callerFP_->callerFP);
+ AssertMatchesCallSite(callerPC_, callerFP_->callerFP);
callerFP_ = callerFP_->callerFP;
break;
case CodeRange::InterpEntry:
@@ -1096,7 +1092,7 @@ wasm::LookupFaultingInstance(const CodeSegment& codeSegment, void* pc, void* fp)
// simulators which call this function at every load/store before even
// knowing whether there is a fault.
- const CodeRange* codeRange = codeSegment.code()->lookupRange(pc);
+ const CodeRange* codeRange = codeSegment.code().lookupRange(pc);
if (!codeRange || !codeRange->isFunction())
return nullptr;
@@ -1107,7 +1103,7 @@ wasm::LookupFaultingInstance(const CodeSegment& codeSegment, void* pc, void* fp)
return nullptr;
Instance* instance = reinterpret_cast(fp)->tls->instance;
- MOZ_RELEASE_ASSERT(&instance->code() == codeSegment.code());
+ MOZ_RELEASE_ASSERT(&instance->code() == &codeSegment.code());
return instance;
}
diff --git a/js/src/wasm/WasmFrameIter.h b/js/src/wasm/WasmFrameIter.h
index 8668b82c45fa..292bc0b5dafc 100644
--- a/js/src/wasm/WasmFrameIter.h
+++ b/js/src/wasm/WasmFrameIter.h
@@ -160,7 +160,6 @@ class ExitReason
// asynchronously-interrupted thread's state.
class ProfilingFrameIterator
{
- const jit::JitActivation* activation_;
const Code* code_;
const CodeRange* codeRange_;
Frame* callerFP_;
@@ -253,8 +252,8 @@ typedef JS::ProfilingFrameIterator::RegisterState RegisterState;
// frame should be ignored.
bool
-StartUnwinding(const jit::JitActivation& activation, const RegisterState& registers,
- UnwindState* unwindState, bool* unwoundCaller);
+StartUnwinding(const RegisterState& registers, UnwindState* unwindState,
+ bool* unwoundCaller);
} // namespace wasm
} // namespace js
diff --git a/js/src/wasm/WasmGenerator.cpp b/js/src/wasm/WasmGenerator.cpp
index 7a875028a8df..070966ad92d5 100644
--- a/js/src/wasm/WasmGenerator.cpp
+++ b/js/src/wasm/WasmGenerator.cpp
@@ -206,8 +206,8 @@ ModuleGenerator::init(Metadata* maybeAsmJSMetadata)
if (!metadataTier_->codeRanges.reserve(2 * env_->numFuncDefs()))
return false;
- const size_t CallSitesPerByteCode = 10;
- if (!metadataTier_->callSites.reserve(codeSectionSize / CallSitesPerByteCode))
+ const size_t ByteCodesPerCallSite = 10;
+ if (!metadataTier_->callSites.reserve(codeSectionSize / ByteCodesPerCallSite))
return false;
const size_t MemoryAccessesPerByteCode = 10;
diff --git a/js/src/wasm/WasmProcess.cpp b/js/src/wasm/WasmProcess.cpp
index 9a9920bdb22a..d2b405faa129 100644
--- a/js/src/wasm/WasmProcess.cpp
+++ b/js/src/wasm/WasmProcess.cpp
@@ -235,7 +235,7 @@ const Code*
wasm::LookupCode(const void* pc)
{
const CodeSegment* found = LookupCodeSegment(pc);
- return found ? found->code() : nullptr;
+ return found ? &found->code() : nullptr;
}
void
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
index 0f0ed976f12a..25953a9003dc 100644
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -1432,9 +1432,8 @@ wasm::InInterruptibleCode(JSContext* cx, uint8_t* pc, const CodeSegment** cs)
if (!*cs)
return false;
- const Code* code = (*cs)->code();
-
- const CodeRange* codeRange = code->lookupRange(pc);
+ const Code& code = (*cs)->code();
+ const CodeRange* codeRange = code.lookupRange(pc);
return codeRange && codeRange->isFunction();
}
diff --git a/js/src/wasm/WasmTypes.h b/js/src/wasm/WasmTypes.h
index f07ae6042af2..a1d76deefc28 100644
--- a/js/src/wasm/WasmTypes.h
+++ b/js/src/wasm/WasmTypes.h
@@ -41,8 +41,6 @@
namespace js {
-class PropertyName;
-class WasmFunctionCallObject;
namespace jit {
struct BaselineScript;
enum class RoundingMode;
From d99d8b74c3321c5f16106542be8cffb52316b228 Mon Sep 17 00:00:00 2001
From: Luke Wagner
Date: Mon, 8 Jan 2018 17:47:34 -0600
Subject: [PATCH 14/33] Bug 1428453 - Baldr: prefix current trap mechanism
names with 'Old' (r=bbouvier)
MozReview-Commit-ID: JeNcXpbKL2s
--HG--
extra : rebase_source : 452f6891e9f97ce254e6d8616595bf9d37737d8f
---
js/src/jit/CodeGenerator.cpp | 10 ++--
js/src/jit/MacroAssembler.cpp | 22 ++++-----
js/src/jit/MacroAssembler.h | 2 +-
js/src/jit/arm/Assembler-arm.cpp | 6 +--
js/src/jit/arm/Assembler-arm.h | 4 +-
js/src/jit/arm/CodeGenerator-arm.cpp | 16 +++----
js/src/jit/arm/MacroAssembler-arm.cpp | 10 ++--
js/src/jit/arm/MacroAssembler-arm.h | 4 +-
js/src/jit/arm64/Assembler-arm64.h | 2 +-
js/src/jit/arm64/MacroAssembler-arm64.h | 6 +--
.../jit/mips-shared/Assembler-mips-shared.cpp | 4 +-
.../jit/mips-shared/Assembler-mips-shared.h | 2 +-
.../mips-shared/CodeGenerator-mips-shared.cpp | 14 +++---
.../MacroAssembler-mips-shared.cpp | 18 +++----
.../mips-shared/MacroAssembler-mips-shared.h | 4 +-
js/src/jit/mips32/CodeGenerator-mips32.cpp | 6 +--
js/src/jit/mips32/MacroAssembler-mips32.cpp | 8 ++--
js/src/jit/mips32/MacroAssembler-mips32.h | 2 +-
js/src/jit/mips64/CodeGenerator-mips64.cpp | 6 +--
js/src/jit/mips64/MacroAssembler-mips64.cpp | 8 ++--
js/src/jit/mips64/MacroAssembler-mips64.h | 2 +-
js/src/jit/none/MacroAssembler-none.h | 2 +-
js/src/jit/shared/Assembler-shared.h | 48 +++++++++----------
js/src/jit/shared/CodeGenerator-shared.h | 4 +-
js/src/jit/x64/CodeGenerator-x64.cpp | 6 +--
js/src/jit/x86-shared/Assembler-x86-shared.h | 8 ++--
.../x86-shared/CodeGenerator-x86-shared.cpp | 18 +++----
.../x86-shared/MacroAssembler-x86-shared.cpp | 4 +-
.../x86-shared/MacroAssembler-x86-shared.h | 2 +-
js/src/jit/x86/CodeGenerator-x86.cpp | 6 +--
js/src/wasm/WasmBaselineCompile.cpp | 28 +++++------
js/src/wasm/WasmBuiltins.cpp | 12 ++---
js/src/wasm/WasmFrameIter.cpp | 12 ++---
js/src/wasm/WasmGenerator.cpp | 34 ++++++-------
js/src/wasm/WasmGenerator.h | 18 +++----
js/src/wasm/WasmStubs.cpp | 10 ++--
js/src/wasm/WasmTypes.cpp | 4 +-
js/src/wasm/WasmTypes.h | 16 +++----
38 files changed, 194 insertions(+), 194 deletions(-)
diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
index 33d626ddfb0a..ff911c2e3a1b 100644
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -9478,7 +9478,7 @@ CodeGenerator::generateWasm(wasm::SigIdDesc sigId, wasm::BytecodeOffset trapOffs
// Since we just overflowed the stack, to be on the safe side, pop the
// stack so that, when the trap exit stub executes, it is a safe
// distance away from the end of the native stack.
- wasm::TrapDesc trap(trapOffset, wasm::Trap::StackOverflow, /* framePushed = */ 0);
+ wasm::OldTrapDesc trap(trapOffset, wasm::Trap::StackOverflow, /* framePushed = */ 0);
if (frameSize() > 0) {
masm.bind(&onOverflow);
masm.addToStackPtr(Imm32(frameSize()));
@@ -9496,7 +9496,7 @@ CodeGenerator::generateWasm(wasm::SigIdDesc sigId, wasm::BytecodeOffset trapOffs
if (!generateOutOfLineCode())
return false;
- masm.wasmEmitTrapOutOfLineCode();
+ masm.wasmEmitOldTrapOutOfLineCode();
masm.flush();
if (masm.oom())
@@ -12350,7 +12350,7 @@ CodeGenerator::visitWasmTrap(LWasmTrap* lir)
MOZ_ASSERT(gen->compilingWasm());
const MWasmTrap* mir = lir->mir();
- masm.jump(trap(mir, mir->trap()));
+ masm.jump(oldTrap(mir, mir->trap()));
}
void
@@ -12363,7 +12363,7 @@ CodeGenerator::visitWasmBoundsCheck(LWasmBoundsCheck* ins)
Register ptr = ToRegister(ins->ptr());
Register boundsCheckLimit = ToRegister(ins->boundsCheckLimit());
masm.wasmBoundsCheck(Assembler::AboveOrEqual, ptr, boundsCheckLimit,
- trap(mir, wasm::Trap::OutOfBounds));
+ oldTrap(mir, wasm::Trap::OutOfBounds));
#endif
}
@@ -12373,7 +12373,7 @@ CodeGenerator::visitWasmAlignmentCheck(LWasmAlignmentCheck* ins)
const MWasmAlignmentCheck* mir = ins->mir();
Register ptr = ToRegister(ins->ptr());
masm.branchTest32(Assembler::NonZero, ptr, Imm32(mir->byteSize() - 1),
- trap(mir, wasm::Trap::UnalignedAccess));
+ oldTrap(mir, wasm::Trap::UnalignedAccess));
}
void
diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp
index f8042ba300fc..a2c33b3bd162 100644
--- a/js/src/jit/MacroAssembler.cpp
+++ b/js/src/jit/MacroAssembler.cpp
@@ -2844,7 +2844,7 @@ MacroAssembler::callWithABINoProfiler(void* fun, MoveOp::Type result, CheckUnsaf
}
void
-MacroAssembler::callWithABI(wasm::BytecodeOffset callOffset, wasm::SymbolicAddress imm,
+MacroAssembler::callWithABI(wasm::BytecodeOffset bytecode, wasm::SymbolicAddress imm,
MoveOp::Type result)
{
MOZ_ASSERT(wasm::NeedsBuiltinThunk(imm));
@@ -2861,7 +2861,7 @@ MacroAssembler::callWithABI(wasm::BytecodeOffset callOffset, wasm::SymbolicAddre
// points when placing arguments.
loadWasmTlsRegFromFrame();
- call(wasm::CallSiteDesc(callOffset.bytecodeOffset, wasm::CallSite::Symbolic), imm);
+ call(wasm::CallSiteDesc(bytecode.offset, wasm::CallSite::Symbolic), imm);
callWithABIPost(stackAdjust, result, /* callFromWasm = */ true);
Pop(WasmTlsReg);
@@ -3006,7 +3006,7 @@ MacroAssembler::wasmCallIndirect(const wasm::CallSiteDesc& desc, const wasm::Cal
if (needsBoundsCheck) {
loadWasmGlobalPtr(callee.tableLengthGlobalDataOffset(), scratch);
- wasm::TrapDesc oobTrap(trapOffset, wasm::Trap::OutOfBounds, framePushed());
+ wasm::OldTrapDesc oobTrap(trapOffset, wasm::Trap::OutOfBounds, framePushed());
branch32(Assembler::Condition::AboveOrEqual, index, scratch, oobTrap);
}
@@ -3014,7 +3014,7 @@ MacroAssembler::wasmCallIndirect(const wasm::CallSiteDesc& desc, const wasm::Cal
loadWasmGlobalPtr(callee.tableBaseGlobalDataOffset(), scratch);
// Load the callee from the table.
- wasm::TrapDesc nullTrap(trapOffset, wasm::Trap::IndirectCallToNull, framePushed());
+ wasm::OldTrapDesc nullTrap(trapOffset, wasm::Trap::IndirectCallToNull, framePushed());
if (callee.wasmTableIsExternal()) {
static_assert(sizeof(wasm::ExternalTableElem) == 8 || sizeof(wasm::ExternalTableElem) == 16,
"elements of external tables are two words");
@@ -3040,21 +3040,21 @@ MacroAssembler::wasmCallIndirect(const wasm::CallSiteDesc& desc, const wasm::Cal
}
void
-MacroAssembler::wasmEmitTrapOutOfLineCode()
+MacroAssembler::wasmEmitOldTrapOutOfLineCode()
{
- for (const wasm::TrapSite& site : trapSites()) {
+ for (const wasm::OldTrapSite& site : oldTrapSites()) {
// Trap out-of-line codes are created for two kinds of trap sites:
// - jumps, which are bound directly to the trap out-of-line path
// - memory accesses, which can fault and then have control transferred
// to the out-of-line path directly via signal handler setting pc
switch (site.kind) {
- case wasm::TrapSite::Jump: {
+ case wasm::OldTrapSite::Jump: {
RepatchLabel jump;
jump.use(site.codeOffset);
bind(&jump);
break;
}
- case wasm::TrapSite::MemoryAccess: {
+ case wasm::OldTrapSite::MemoryAccess: {
append(wasm::MemoryAccess(site.codeOffset, currentOffset()));
break;
}
@@ -3072,7 +3072,7 @@ MacroAssembler::wasmEmitTrapOutOfLineCode()
// directly to the trap exit stub. This takes advantage of the fact
// that there is already a CallSite for call_indirect and the
// current pre-prologue stack/register state.
- append(wasm::TrapFarJump(site.trap, farJumpWithPatch()));
+ append(wasm::OldTrapFarJump(site.trap, farJumpWithPatch()));
} else {
// Inherit the frame depth of the trap site. This value is captured
// by the wasm::CallSite to allow unwinding this frame.
@@ -3098,7 +3098,7 @@ MacroAssembler::wasmEmitTrapOutOfLineCode()
// trap-handling function. The frame iterator knows to skip the trap
// exit's frame so that unwinding begins at the frame and offset of
// the trapping instruction.
- wasm::CallSiteDesc desc(site.bytecodeOffset, wasm::CallSiteDesc::TrapExit);
+ wasm::CallSiteDesc desc(site.offset, wasm::CallSiteDesc::OldTrapExit);
call(desc, site.trap);
}
@@ -3113,7 +3113,7 @@ MacroAssembler::wasmEmitTrapOutOfLineCode()
// iterator to find the right CodeRange while walking the stack.
breakpoint();
- trapSites().clear();
+ oldTrapSites().clear();
}
void
diff --git a/js/src/jit/MacroAssembler.h b/js/src/jit/MacroAssembler.h
index 79b12cc133f1..1dda6a53c1f0 100644
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -1506,7 +1506,7 @@ class MacroAssembler : public MacroAssemblerSpecific
// Emit the out-of-line trap code to which trapping jumps/branches are
// bound. This should be called once per function after all other codegen,
// including "normal" OutOfLineCode.
- void wasmEmitTrapOutOfLineCode();
+ void wasmEmitOldTrapOutOfLineCode();
// Perform a stack-overflow test, branching to the given Label on overflow.
void wasmEmitStackCheck(Register sp, Register scratch, Label* onOverflow);
diff --git a/js/src/jit/arm/Assembler-arm.cpp b/js/src/jit/arm/Assembler-arm.cpp
index a0f2e1b402b5..2c2a99b04fdb 100644
--- a/js/src/jit/arm/Assembler-arm.cpp
+++ b/js/src/jit/arm/Assembler-arm.cpp
@@ -2453,7 +2453,7 @@ Assembler::as_b(Label* l, Condition c)
}
BufferOffset
-Assembler::as_b(wasm::TrapDesc target, Condition c)
+Assembler::as_b(wasm::OldTrapDesc target, Condition c)
{
Label l;
BufferOffset ret = as_b(&l, c);
@@ -2894,12 +2894,12 @@ Assembler::bind(Label* label, BufferOffset boff)
}
void
-Assembler::bindLater(Label* label, wasm::TrapDesc target)
+Assembler::bindLater(Label* label, wasm::OldTrapDesc target)
{
if (label->used()) {
BufferOffset b(label);
do {
- append(wasm::TrapSite(target, b.getOffset()));
+ append(wasm::OldTrapSite(target, b.getOffset()));
} while (nextLink(b, &b));
}
label->reset();
diff --git a/js/src/jit/arm/Assembler-arm.h b/js/src/jit/arm/Assembler-arm.h
index b8777408bac3..7eed65197edf 100644
--- a/js/src/jit/arm/Assembler-arm.h
+++ b/js/src/jit/arm/Assembler-arm.h
@@ -1614,7 +1614,7 @@ class Assembler : public AssemblerShared
BufferOffset as_b(BOffImm off, Condition c, Label* documentation = nullptr);
BufferOffset as_b(Label* l, Condition c = Always);
- BufferOffset as_b(wasm::TrapDesc target, Condition c = Always);
+ BufferOffset as_b(wasm::OldTrapDesc target, Condition c = Always);
BufferOffset as_b(BOffImm off, Condition c, BufferOffset inst);
// blx can go to either an immediate or a register. When blx'ing to a
@@ -1722,7 +1722,7 @@ class Assembler : public AssemblerShared
bool nextLink(BufferOffset b, BufferOffset* next);
void bind(Label* label, BufferOffset boff = BufferOffset());
void bind(RepatchLabel* label);
- void bindLater(Label* label, wasm::TrapDesc target);
+ void bindLater(Label* label, wasm::OldTrapDesc target);
uint32_t currentOffset() {
return nextOffset().getOffset();
}
diff --git a/js/src/jit/arm/CodeGenerator-arm.cpp b/js/src/jit/arm/CodeGenerator-arm.cpp
index c7be4884715b..5d87af4acfe0 100644
--- a/js/src/jit/arm/CodeGenerator-arm.cpp
+++ b/js/src/jit/arm/CodeGenerator-arm.cpp
@@ -531,7 +531,7 @@ CodeGeneratorARM::divICommon(MDiv* mir, Register lhs, Register rhs, Register out
masm.ma_cmp(rhs, Imm32(-1), scratch, Assembler::Equal);
if (mir->canTruncateOverflow()) {
if (mir->trapOnError()) {
- masm.ma_b(trap(mir, wasm::Trap::IntegerOverflow), Assembler::Equal);
+ masm.ma_b(oldTrap(mir, wasm::Trap::IntegerOverflow), Assembler::Equal);
} else {
// (-INT32_MIN)|0 = INT32_MIN
Label skip;
@@ -551,7 +551,7 @@ CodeGeneratorARM::divICommon(MDiv* mir, Register lhs, Register rhs, Register out
masm.as_cmp(rhs, Imm8(0));
if (mir->canTruncateInfinities()) {
if (mir->trapOnError()) {
- masm.ma_b(trap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Equal);
+ masm.ma_b(oldTrap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Equal);
} else {
// Infinity|0 == 0
Label skip;
@@ -714,7 +714,7 @@ CodeGeneratorARM::modICommon(MMod* mir, Register lhs, Register rhs, Register out
// wasm allows negative lhs and return 0 in this case.
MOZ_ASSERT(mir->isTruncated());
masm.as_cmp(rhs, Imm8(0));
- masm.ma_b(trap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Equal);
+ masm.ma_b(oldTrap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Equal);
return;
}
@@ -2120,7 +2120,7 @@ CodeGeneratorARM::visitWasmAddOffset(LWasmAddOffset* lir)
ScratchRegisterScope scratch(masm);
masm.ma_add(base, Imm32(mir->offset()), out, scratch, SetCC);
- masm.ma_b(trap(mir, wasm::Trap::OutOfBounds), Assembler::CarrySet);
+ masm.ma_b(oldTrap(mir, wasm::Trap::OutOfBounds), Assembler::CarrySet);
}
template
@@ -2417,7 +2417,7 @@ CodeGeneratorARM::generateUDivModZeroCheck(Register rhs, Register output, Label*
masm.as_cmp(rhs, Imm8(0));
if (mir->isTruncated()) {
if (mir->trapOnError()) {
- masm.ma_b(trap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Equal);
+ masm.ma_b(oldTrap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Equal);
} else {
Label skip;
masm.ma_b(&skip, Assembler::NotEqual);
@@ -2768,7 +2768,7 @@ CodeGeneratorARM::visitDivOrModI64(LDivOrModI64* lir)
if (lir->canBeDivideByZero()) {
Register temp = WasmGetTemporaryForDivOrMod(lhs, rhs);
masm.branchTest64(Assembler::Zero, rhs, rhs, temp,
- trap(lir, wasm::Trap::IntegerDivideByZero));
+ oldTrap(lir, wasm::Trap::IntegerDivideByZero));
}
auto* mir = lir->mir();
@@ -2781,7 +2781,7 @@ CodeGeneratorARM::visitDivOrModI64(LDivOrModI64* lir)
if (mir->isMod())
masm.xor64(output, output);
else
- masm.jump(trap(lir, wasm::Trap::IntegerOverflow));
+ masm.jump(oldTrap(lir, wasm::Trap::IntegerOverflow));
masm.jump(&done);
masm.bind(¬min);
}
@@ -2814,7 +2814,7 @@ CodeGeneratorARM::visitUDivOrModI64(LUDivOrModI64* lir)
if (lir->canBeDivideByZero()) {
Register temp = WasmGetTemporaryForDivOrMod(lhs, rhs);
masm.branchTest64(Assembler::Zero, rhs, rhs, temp,
- trap(lir, wasm::Trap::IntegerDivideByZero));
+ oldTrap(lir, wasm::Trap::IntegerDivideByZero));
}
masm.setupWasmABICall();
diff --git a/js/src/jit/arm/MacroAssembler-arm.cpp b/js/src/jit/arm/MacroAssembler-arm.cpp
index 11e32f59f97f..4d0b3625db6d 100644
--- a/js/src/jit/arm/MacroAssembler-arm.cpp
+++ b/js/src/jit/arm/MacroAssembler-arm.cpp
@@ -1390,7 +1390,7 @@ MacroAssemblerARM::ma_b(Label* dest, Assembler::Condition c)
}
BufferOffset
-MacroAssemblerARM::ma_b(wasm::TrapDesc target, Assembler::Condition c)
+MacroAssemblerARM::ma_b(wasm::OldTrapDesc target, Assembler::Condition c)
{
return as_b(target, c);
}
@@ -5751,12 +5751,12 @@ MacroAssemblerARM::outOfLineWasmTruncateToIntCheck(FloatRegister input, MIRType
// Handle errors.
bind(&fail);
- asMasm().jump(wasm::TrapDesc(trapOffset, wasm::Trap::IntegerOverflow,
- asMasm().framePushed()));
+ asMasm().jump(wasm::OldTrapDesc(trapOffset, wasm::Trap::IntegerOverflow,
+ asMasm().framePushed()));
bind(&inputIsNaN);
- asMasm().jump(wasm::TrapDesc(trapOffset, wasm::Trap::InvalidConversionToInteger,
- asMasm().framePushed()));
+ asMasm().jump(wasm::OldTrapDesc(trapOffset, wasm::Trap::InvalidConversionToInteger,
+ asMasm().framePushed()));
}
void
diff --git a/js/src/jit/arm/MacroAssembler-arm.h b/js/src/jit/arm/MacroAssembler-arm.h
index f75d26aec1fe..4d8fd6e9f3e9 100644
--- a/js/src/jit/arm/MacroAssembler-arm.h
+++ b/js/src/jit/arm/MacroAssembler-arm.h
@@ -346,7 +346,7 @@ class MacroAssemblerARM : public Assembler
// Branches when done from within arm-specific code.
BufferOffset ma_b(Label* dest, Condition c = Always);
- BufferOffset ma_b(wasm::TrapDesc target, Condition c = Always);
+ BufferOffset ma_b(wasm::OldTrapDesc target, Condition c = Always);
void ma_b(void* target, Condition c = Always);
void ma_bx(Register dest, Condition c = Always);
@@ -677,7 +677,7 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM
ma_ldr(addr, scratch, scratch2);
ma_bx(scratch);
}
- void jump(wasm::TrapDesc target) {
+ void jump(wasm::OldTrapDesc target) {
as_b(target);
}
diff --git a/js/src/jit/arm64/Assembler-arm64.h b/js/src/jit/arm64/Assembler-arm64.h
index 4014a50ad415..e13601a51213 100644
--- a/js/src/jit/arm64/Assembler-arm64.h
+++ b/js/src/jit/arm64/Assembler-arm64.h
@@ -215,7 +215,7 @@ class Assembler : public vixl::Assembler
void bind(Label* label) { bind(label, nextOffset()); }
void bind(Label* label, BufferOffset boff);
void bind(RepatchLabel* label);
- void bindLater(Label* label, wasm::TrapDesc target) {
+ void bindLater(Label* label, wasm::OldTrapDesc target) {
MOZ_CRASH("NYI");
}
diff --git a/js/src/jit/arm64/MacroAssembler-arm64.h b/js/src/jit/arm64/MacroAssembler-arm64.h
index ce04e2f975b6..fd9c70db3011 100644
--- a/js/src/jit/arm64/MacroAssembler-arm64.h
+++ b/js/src/jit/arm64/MacroAssembler-arm64.h
@@ -493,10 +493,10 @@ class MacroAssemblerCompat : public vixl::MacroAssembler
}
using vixl::MacroAssembler::B;
- void B(wasm::TrapDesc) {
+ void B(wasm::OldTrapDesc) {
MOZ_CRASH("NYI");
}
- void B(wasm::TrapDesc, Condition cond) {
+ void B(wasm::OldTrapDesc, Condition cond) {
MOZ_CRASH("NYI");
}
@@ -673,7 +673,7 @@ class MacroAssemblerCompat : public vixl::MacroAssembler
loadPtr(addr, ip0);
Br(vixl::ip0);
}
- void jump(wasm::TrapDesc target) {
+ void jump(wasm::OldTrapDesc target) {
MOZ_CRASH("NYI");
}
diff --git a/js/src/jit/mips-shared/Assembler-mips-shared.cpp b/js/src/jit/mips-shared/Assembler-mips-shared.cpp
index 825c9039e7e4..c811dd10cf5e 100644
--- a/js/src/jit/mips-shared/Assembler-mips-shared.cpp
+++ b/js/src/jit/mips-shared/Assembler-mips-shared.cpp
@@ -1809,7 +1809,7 @@ AssemblerMIPSShared::bind(Label* label, BufferOffset boff)
}
void
-AssemblerMIPSShared::bindLater(Label* label, wasm::TrapDesc target)
+AssemblerMIPSShared::bindLater(Label* label, wasm::OldTrapDesc target)
{
if (label->used()) {
int32_t next;
@@ -1818,7 +1818,7 @@ AssemblerMIPSShared::bindLater(Label* label, wasm::TrapDesc target)
do {
Instruction* inst = editSrc(b);
- append(wasm::TrapSite(target, b.getOffset()));
+ append(wasm::OldTrapSite(target, b.getOffset()));
next = inst[1].encode();
inst[1].makeNop();
diff --git a/js/src/jit/mips-shared/Assembler-mips-shared.h b/js/src/jit/mips-shared/Assembler-mips-shared.h
index a7ee19a7d7f1..d8ae55838de1 100644
--- a/js/src/jit/mips-shared/Assembler-mips-shared.h
+++ b/js/src/jit/mips-shared/Assembler-mips-shared.h
@@ -1231,7 +1231,7 @@ class AssemblerMIPSShared : public AssemblerShared
// label operations
void bind(Label* label, BufferOffset boff = BufferOffset());
- void bindLater(Label* label, wasm::TrapDesc target);
+ void bindLater(Label* label, wasm::OldTrapDesc target);
virtual void bind(InstImm* inst, uintptr_t branch, uintptr_t target) = 0;
void bind(CodeOffset* label) {
label->bind(currentOffset());
diff --git a/js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp b/js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp
index 58384c680bcb..7c0a67615bfb 100644
--- a/js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp
+++ b/js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp
@@ -568,7 +568,7 @@ CodeGeneratorMIPSShared::visitDivI(LDivI* ins)
// Handle divide by zero.
if (mir->canBeDivideByZero()) {
if (mir->trapOnError()) {
- masm.ma_b(rhs, rhs, trap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Zero);
+ masm.ma_b(rhs, rhs, oldTrap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Zero);
} else if (mir->canTruncateInfinities()) {
// Truncated division by zero is zero (Infinity|0 == 0)
Label notzero;
@@ -590,7 +590,7 @@ CodeGeneratorMIPSShared::visitDivI(LDivI* ins)
masm.move32(Imm32(-1), temp);
if (mir->trapOnError()) {
- masm.ma_b(rhs, temp, trap(mir, wasm::Trap::IntegerOverflow), Assembler::Equal);
+ masm.ma_b(rhs, temp, oldTrap(mir, wasm::Trap::IntegerOverflow), Assembler::Equal);
} else if (mir->canTruncateOverflow()) {
// (-INT32_MIN)|0 == INT32_MIN
Label skip;
@@ -718,7 +718,7 @@ CodeGeneratorMIPSShared::visitModI(LModI* ins)
if (mir->canBeDivideByZero()) {
if (mir->isTruncated()) {
if (mir->trapOnError()) {
- masm.ma_b(rhs, rhs, trap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Zero);
+ masm.ma_b(rhs, rhs, oldTrap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Zero);
} else {
Label skip;
masm.ma_b(rhs, Imm32(0), &skip, Assembler::NotEqual, ShortJump);
@@ -1559,10 +1559,10 @@ CodeGeneratorMIPSShared::visitOutOfLineWasmTruncateCheck(OutOfLineWasmTruncateCh
// Handle errors.
masm.bind(&fail);
- masm.jump(trap(ool, wasm::Trap::IntegerOverflow));
+ masm.jump(oldTrap(ool, wasm::Trap::IntegerOverflow));
masm.bind(&inputIsNaN);
- masm.jump(trap(ool, wasm::Trap::InvalidConversionToInteger));
+ masm.jump(oldTrap(ool, wasm::Trap::InvalidConversionToInteger));
}
void
@@ -2415,7 +2415,7 @@ CodeGeneratorMIPSShared::visitUDivOrMod(LUDivOrMod* ins)
if (ins->canBeDivideByZero()) {
if (ins->mir()->isTruncated()) {
if (ins->trapOnError()) {
- masm.ma_b(rhs, rhs, trap(ins, wasm::Trap::IntegerDivideByZero), Assembler::Zero);
+ masm.ma_b(rhs, rhs, oldTrap(ins, wasm::Trap::IntegerDivideByZero), Assembler::Zero);
} else {
// Infinity|0 == 0
Label notzero;
@@ -2767,7 +2767,7 @@ CodeGeneratorMIPSShared::visitWasmAddOffset(LWasmAddOffset* lir)
Register base = ToRegister(lir->base());
Register out = ToRegister(lir->output());
- masm.ma_addTestCarry(out, base, Imm32(mir->offset()), trap(mir, wasm::Trap::OutOfBounds));
+ masm.ma_addTestCarry(out, base, Imm32(mir->offset()), oldTrap(mir, wasm::Trap::OutOfBounds));
}
template
diff --git a/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp b/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
index 97efbc7bbcda..aec6c0416978 100644
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
@@ -337,8 +337,8 @@ template void
MacroAssemblerMIPSShared::ma_addTestCarry
+
+ W3C Web Authentication - Authenticator Transports
+ Mozilla Bug 1406467
+
+
+
+
diff --git a/dom/webauthn/tests/test_webauthn_authenticator_transports.html b/dom/webauthn/tests/test_webauthn_authenticator_transports.html
new file mode 100644
index 000000000000..56a3879c67e9
--- /dev/null
+++ b/dom/webauthn/tests/test_webauthn_authenticator_transports.html
@@ -0,0 +1,150 @@
+
+
+
+
W3C Web Authentication - Authenticator Transports
+
+
+
+
+
+
+