Backed out changeset 399888cb68ba (bug 1806694) for causing webtransport wpt failures. CLOSED TREE

This commit is contained in:
Cosmin Sabou 2022-12-22 20:52:03 +02:00
Родитель 43d29dd465
Коммит b0844a16d6
8 изменённых файлов: 14 добавлений и 147 удалений

Просмотреть файл

@ -113,23 +113,11 @@ bool WebTransport::Init(const GlobalObject& aGlobal, const nsAString& aURL,
aError.ThrowSyntaxError("Invalid WebTransport URL");
return false;
}
bool dedicated =
!aOptions.mAllowPooling; // spec language, optimizer will eliminate this
bool requireUnreliable = aOptions.mRequireUnreliable;
WebTransportCongestionControl congestionControl = aOptions.mCongestionControl;
if (aOptions.mServerCertificateHashes.WasPassed()) {
// XXX bug 1806693
aError.ThrowNotSupportedError("No support for serverCertificateHashes yet");
// XXX if dedicated is false and serverCertificateHashes is non-null, then
// throw a TypeError. Also should enforce in parent
return false;
}
// XXX and other steps in the constructor requirement (TypeError). Order is
// important.
// https://w3c.github.io/webtransport/#webtransport-constructor Spec 5.2
backgroundChild
->SendCreateWebTransportParent(aURL, dedicated, requireUnreliable,
(uint32_t)congestionControl,
// XXX serverCertHashes,
->SendCreateWebTransportParent(aURL /*, aOptions*/,
std::move(parentEndpoint))
->Then(
GetCurrentSerialEventTarget(), __func__,

Просмотреть файл

@ -7,7 +7,6 @@
#include "WebTransportParent.h"
#include "mozilla/StaticPrefs_network.h"
#include "mozilla/dom/WebTransportBinding.h"
#include "mozilla/dom/WebTransportLog.h"
#include "mozilla/ipc/BackgroundParent.h"
@ -20,22 +19,12 @@ WebTransportParent::~WebTransportParent() {
}
bool WebTransportParent::Init(
const nsAString& aURL, const bool& aDedicated,
const bool& aRequireUnreliable, const uint32_t& aCongestionControl,
// Sequence<WebTransportHash>* aServerCertHashes,
const nsAString& aURL,
// WebTransportOptions aOptions,
Endpoint<PWebTransportParent>&& aParentEndpoint,
std::function<void(const nsresult&)>&& aResolver) {
LOG(("Created WebTransportParent %p %s %s %s congestion=%s", this,
NS_ConvertUTF16toUTF8(aURL).get(),
aDedicated ? "Dedicated" : "AllowPooling",
aRequireUnreliable ? "RequireUnreliable" : "",
aCongestionControl ==
(uint32_t)dom::WebTransportCongestionControl::Throughput
? "ThroughPut"
: (aCongestionControl ==
(uint32_t)dom::WebTransportCongestionControl::Low_latency
? "Low-Latency"
: "Default")));
LOG(("Created WebTransportParent %p %s", this,
NS_ConvertUTF16toUTF8(aURL).get()));
if (!StaticPrefs::network_webtransport_enabled()) {
aResolver(NS_ERROR_DOM_NOT_ALLOWED_ERR);

Просмотреть файл

@ -22,9 +22,7 @@ class WebTransportParent : public PWebTransportParent {
// XXX Threadsafe??
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebTransportParent, override)
bool Init(const nsAString& aURL, const bool& aDedicated,
const bool& aRequireUnreliable, const uint32_t& aCongestionControl,
// Sequence<WebTransportHash>* aServerCertHashes,
bool Init(const nsAString& aURL, // WebTransportOptions aOptions,
Endpoint<PWebTransportParent>&& aParentEndpoint,
std::function<void(const nsresult&)>&& aResolver);

Просмотреть файл

@ -504,9 +504,8 @@ mozilla::ipc::IPCResult BackgroundParentImpl::RecvCreateFileSystemManagerParent(
}
mozilla::ipc::IPCResult BackgroundParentImpl::RecvCreateWebTransportParent(
const nsAString& aURL, const bool& aDedicated,
const bool& aRequireUnreliable, const uint32_t& aCongestionControl,
// Sequence<WebTransportHash>* aServerCertHashes,
const nsAString& aURL,
// WebTransportOptions aOptions,
Endpoint<PWebTransportParent>&& aParentEndpoint,
CreateWebTransportParentResolver&& aResolver) {
AssertIsInMainProcess();
@ -514,8 +513,7 @@ mozilla::ipc::IPCResult BackgroundParentImpl::RecvCreateWebTransportParent(
RefPtr<mozilla::dom::WebTransportParent> webt =
new mozilla::dom::WebTransportParent();
if (!webt->Init(aURL, aDedicated, aRequireUnreliable, aCongestionControl,
/*aServerCertHashes, */ std::move(aParentEndpoint),
if (!webt->Init(aURL, /*aOptions, */ std::move(aParentEndpoint),
std::move(aResolver))) {
webt->Close();
}

Просмотреть файл

@ -138,9 +138,8 @@ class BackgroundParentImpl : public PBackgroundParent {
CreateFileSystemManagerParentResolver&& aResolver) override;
mozilla::ipc::IPCResult RecvCreateWebTransportParent(
const nsAString& aURL, const bool& aDedicated,
const bool& aRequireUnreliable, const uint32_t& aCongestionControl,
// Sequence<WebTransportHash>* aServerCertHashes,
const nsAString& aURL,
// WebTransportOptions aOptions,
Endpoint<PWebTransportParent>&& aParentEndpoint,
CreateWebTransportParentResolver&& aResolver) override;

Просмотреть файл

@ -203,10 +203,7 @@ parent:
*/
async CreateWebTransportParent(
nsString aURL,
bool aDedicated,
bool aRequireUnreliable,
uint32_t aCongestionControl,
/* Sequence<WebTransportHash>* aServerCertHashes, */
/* WebTransportOptions aOptions, */
Endpoint<PWebTransportParent> aParentEndpoint)
returns(nsresult rv);

Просмотреть файл

@ -28,26 +28,6 @@
[Connection to port 0 should fail]
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true" }']
expected: FAIL
[WebTransport constructor should allow options '{ "requireUnreliable": "true"} ']
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true", "requireUnreliable": "true" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "default" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "throughput" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "low-latency" }']
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true", "requireUnreliable": "true", "congestionControl": "low-latency" }']
expected: FAIL
[constructor.https.any.html]
expected:
@ -79,27 +59,6 @@
[Connection to port 0 should fail]
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true" }']
expected: FAIL
[WebTransport constructor should allow options '{ "requireUnreliable": "true"} ']
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true", "requireUnreliable": "true" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "default" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "throughput" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "low-latency" }']
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true", "requireUnreliable": "true", "congestionControl": "low-latency" }']
expected: FAIL
[constructor.https.any.sharedworker.html]
expected:
@ -131,27 +90,6 @@
[Connection to port 0 should fail]
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true" }']
expected: FAIL
[WebTransport constructor should allow options '{ "requireUnreliable": "true"} ']
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true", "requireUnreliable": "true" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "default" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "throughput" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "low-latency" }']
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true", "requireUnreliable": "true", "congestionControl": "low-latency" }']
expected: FAIL
[constructor.https.any.worker.html]
expected:
@ -182,24 +120,3 @@
[Connection to port 0 should fail]
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true" }']
expected: FAIL
[WebTransport constructor should allow options '{ "requireUnreliable": "true"} ']
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true", "requireUnreliable": "true" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "default" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "throughput" }']
expected: FAIL
[WebTransport constructor should allow options '{ "congestionControl": "low-latency" }']
expected: FAIL
[WebTransport constructor should allow options '{ "allowPooling": "true", "requireUnreliable": "true", "congestionControl": "low-latency" }']
expected: FAIL

Просмотреть файл

@ -20,25 +20,6 @@ for (const url of BAD_URLS) {
}, `WebTransport constructor should reject URL '${url}'`);
}
const OPTIONS = [
{ allowPooling: true },
{ requireUnreliable: true },
{ allowPooling: true, requireUnreliable: true },
{ congestionControl: "default" },
{ congestionControl: "throughput" },
{ congestionControl: "low-latency" },
{ allowPooling: true, requireUnreliable: true, congestionControl: "low-latency" },
// XXX Need to test serverCertificateHashes
];
for (const options of OPTIONS) {
promise_test(async t => {
const wt = new WebTransport(`https://${HOST}:0/`, options );
await wt.ready;
wt.close();
}, "WebTransport constructor should allow options " + JSON.stringify(options));
}
promise_test(async t => {
const wt = new WebTransport(`https://${HOST}:0/`);