mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 09:54:42 +00:00
Backed out changeset 7b759128b1ce (bug 1843453) for causing mochitests failures in test_simple.html.
This commit is contained in:
parent
61cd126457
commit
d9cfb537bd
@ -808,8 +808,6 @@ IdentityCredential::PromptUserToSelectProvider(
|
||||
resultPromise->Reject(
|
||||
Promise::TryExtractNSResultFromRejectionValue(aValue), __func__);
|
||||
});
|
||||
showPromptPromise->AppendNativeHandler(
|
||||
new MozPromiseRejectOnDestruction(resultPromise));
|
||||
|
||||
return resultPromise;
|
||||
}
|
||||
@ -888,8 +886,6 @@ IdentityCredential::PromptUserToSelectAccount(
|
||||
resultPromise->Reject(
|
||||
Promise::TryExtractNSResultFromRejectionValue(aValue), __func__);
|
||||
});
|
||||
showPromptPromise->AppendNativeHandler(
|
||||
new MozPromiseRejectOnDestruction(resultPromise));
|
||||
|
||||
return resultPromise;
|
||||
}
|
||||
@ -1011,8 +1007,6 @@ IdentityCredential::PromptUserWithPolicy(
|
||||
Promise::TryExtractNSResultFromRejectionValue(aValue),
|
||||
__func__);
|
||||
});
|
||||
showPromptPromise->AppendNativeHandler(
|
||||
new MozPromiseRejectOnDestruction(resultPromise));
|
||||
return resultPromise;
|
||||
},
|
||||
[](nsresult error) {
|
||||
|
@ -93,15 +93,11 @@ RefPtr<TPromise> FetchJSONStructure(Request* aRequest) {
|
||||
Promise::TryExtractNSResultFromRejectionValue(aValue),
|
||||
__func__);
|
||||
});
|
||||
jsonPromise->AppendNativeHandler(
|
||||
new MozPromiseRejectOnDestruction(resultPromise));
|
||||
},
|
||||
[resultPromise](JSContext*, JS::Handle<JS::Value> aValue, ErrorResult&) {
|
||||
resultPromise->Reject(
|
||||
Promise::TryExtractNSResultFromRejectionValue(aValue), __func__);
|
||||
});
|
||||
fetchPromise->AppendNativeHandler(
|
||||
new MozPromiseRejectOnDestruction(resultPromise));
|
||||
|
||||
return resultPromise;
|
||||
}
|
||||
|
@ -13,8 +13,6 @@
|
||||
|
||||
namespace mozilla::dom {
|
||||
|
||||
NS_IMPL_ISUPPORTS0(MozPromiseRejectOnDestructionBase)
|
||||
|
||||
NS_IMPL_ISUPPORTS0(DomPromiseListener)
|
||||
|
||||
DomPromiseListener::DomPromiseListener(CallbackTypeResolved&& aResolve,
|
||||
|
@ -35,42 +35,6 @@ class PromiseNativeHandler : public nsISupports {
|
||||
ErrorResult& aRv) = 0;
|
||||
};
|
||||
|
||||
// This base class exists solely to use NS_IMPL_ISUPPORTS because it doesn't
|
||||
// support template classes.
|
||||
class MozPromiseRejectOnDestructionBase : public PromiseNativeHandler {
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
void ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue,
|
||||
ErrorResult& aRv) override {}
|
||||
void RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue,
|
||||
ErrorResult& aRv) override {}
|
||||
|
||||
protected:
|
||||
~MozPromiseRejectOnDestructionBase() override = default;
|
||||
};
|
||||
|
||||
// Use this when you subscribe to a JS promise to settle a MozPromise that is
|
||||
// not guaranteed to be settled by anyone else.
|
||||
template <typename T>
|
||||
class MozPromiseRejectOnDestruction final
|
||||
: public MozPromiseRejectOnDestructionBase {
|
||||
public:
|
||||
// (Accepting RefPtr<T> instead of T* because compiler fails to implicitly
|
||||
// convert it at call sites)
|
||||
explicit MozPromiseRejectOnDestruction(const RefPtr<T>& aMozPromise)
|
||||
: mMozPromise(aMozPromise) {
|
||||
MOZ_ASSERT(aMozPromise);
|
||||
}
|
||||
|
||||
protected:
|
||||
~MozPromiseRejectOnDestruction() override {
|
||||
// Rejecting will be no-op if the promise is already settled
|
||||
mMozPromise->Reject(NS_BINDING_ABORTED, __func__);
|
||||
}
|
||||
|
||||
RefPtr<T> mMozPromise;
|
||||
};
|
||||
|
||||
// This class is used to set C++ callbacks once a dom Promise a resolved or
|
||||
// rejected.
|
||||
class DomPromiseListener final : public PromiseNativeHandler {
|
||||
|
@ -1,6 +1,7 @@
|
||||
[fedcm-csp.https.html]
|
||||
expected:
|
||||
if os == "mac": [TIMEOUT, OK]
|
||||
if os == "linux": [CRASH, TIMEOUT]
|
||||
if os == "mac": [TIMEOUT, OK, CRASH]
|
||||
TIMEOUT
|
||||
[Provider configURL should honor Content-Security-Policy.]
|
||||
expected:
|
||||
|
Loading…
Reference in New Issue
Block a user