mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 07:01:19 +00:00
Bug 1535384 part 9. Remove MOZ_CAN_RUN_SCRIPT_BOUNDARY for u2f callbacks. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D23780 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
3cd3acc695
commit
5869bb7df1
dom
@ -91,6 +91,7 @@ class U2F final : public WebAuthnManagerBase, public nsWrapperCache {
|
||||
virtual JSObject* WrapObject(JSContext* aCx,
|
||||
JS::Handle<JSObject*> aGivenProto) override;
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
void Register(const nsAString& aAppId,
|
||||
const Sequence<RegisterRequest>& aRegisterRequests,
|
||||
const Sequence<RegisteredKey>& aRegisteredKeys,
|
||||
@ -98,6 +99,7 @@ class U2F final : public WebAuthnManagerBase, public nsWrapperCache {
|
||||
const Optional<Nullable<int32_t>>& opt_aTimeoutSeconds,
|
||||
ErrorResult& aRv);
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
void Sign(const nsAString& aAppId, const nsAString& aChallenge,
|
||||
const Sequence<RegisteredKey>& aRegisteredKeys,
|
||||
U2FSignCallback& aCallback,
|
||||
@ -106,31 +108,35 @@ class U2F final : public WebAuthnManagerBase, public nsWrapperCache {
|
||||
|
||||
// WebAuthnManagerBase
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
void FinishMakeCredential(
|
||||
const uint64_t& aTransactionId,
|
||||
const WebAuthnMakeCredentialResult& aResult) override;
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
void FinishGetAssertion(const uint64_t& aTransactionId,
|
||||
const WebAuthnGetAssertionResult& aResult) override;
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
void RequestAborted(const uint64_t& aTransactionId,
|
||||
const nsresult& aError) override;
|
||||
|
||||
protected:
|
||||
// Cancels the current transaction (by sending a Cancel message to the
|
||||
// parent) and rejects it by calling RejectTransaction().
|
||||
void CancelTransaction(const nsresult& aError) override;
|
||||
MOZ_CAN_RUN_SCRIPT void CancelTransaction(const nsresult& aError) override;
|
||||
|
||||
private:
|
||||
~U2F();
|
||||
MOZ_CAN_RUN_SCRIPT ~U2F();
|
||||
|
||||
template <typename T, typename C>
|
||||
void ExecuteCallback(T& aResp, nsMainThreadPtrHandle<C>& aCb);
|
||||
MOZ_CAN_RUN_SCRIPT void ExecuteCallback(T& aResp,
|
||||
nsMainThreadPtrHandle<C>& aCb);
|
||||
|
||||
// Clears all information we have about the current transaction.
|
||||
void ClearTransaction();
|
||||
// Rejects the current transaction and clears it.
|
||||
void RejectTransaction(const nsresult& aError);
|
||||
MOZ_CAN_RUN_SCRIPT void RejectTransaction(const nsresult& aError);
|
||||
|
||||
nsString mOrigin;
|
||||
|
||||
|
@ -30,24 +30,27 @@ class WebAuthnManagerBase : public nsIDOMEventListener {
|
||||
|
||||
explicit WebAuthnManagerBase(nsPIDOMWindowInner* aParent);
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
virtual void FinishMakeCredential(
|
||||
const uint64_t& aTransactionId,
|
||||
const WebAuthnMakeCredentialResult& aResult) = 0;
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
virtual void FinishGetAssertion(
|
||||
const uint64_t& aTransactionId,
|
||||
const WebAuthnGetAssertionResult& aResult) = 0;
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
virtual void RequestAborted(const uint64_t& aTransactionId,
|
||||
const nsresult& aError) = 0;
|
||||
|
||||
void ActorDestroyed();
|
||||
|
||||
protected:
|
||||
virtual ~WebAuthnManagerBase();
|
||||
MOZ_CAN_RUN_SCRIPT virtual ~WebAuthnManagerBase();
|
||||
|
||||
// Needed by HandleEvent() to cancel transactions.
|
||||
virtual void CancelTransaction(const nsresult& aError) = 0;
|
||||
MOZ_CAN_RUN_SCRIPT virtual void CancelTransaction(const nsresult& aError) = 0;
|
||||
|
||||
// Visibility event handling.
|
||||
void ListenForVisibilityEvents();
|
||||
|
@ -25,14 +25,23 @@ class WebAuthnTransactionChild final : public PWebAuthnTransactionChild {
|
||||
NS_INLINE_DECL_REFCOUNTING(WebAuthnTransactionChild);
|
||||
explicit WebAuthnTransactionChild(WebAuthnManagerBase* aManager);
|
||||
|
||||
// MOZ_CAN_RUN_SCRIPT_BOUNDARY until we can do MOZ_CAN_RUN_SCRIPT in
|
||||
// IPDL-generated things.
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
||||
mozilla::ipc::IPCResult RecvConfirmRegister(
|
||||
const uint64_t& aTransactionId,
|
||||
const WebAuthnMakeCredentialResult& aResult);
|
||||
|
||||
// MOZ_CAN_RUN_SCRIPT_BOUNDARY until we can do MOZ_CAN_RUN_SCRIPT in
|
||||
// IPDL-generated things.
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
||||
mozilla::ipc::IPCResult RecvConfirmSign(
|
||||
const uint64_t& aTransactionId,
|
||||
const WebAuthnGetAssertionResult& aResult);
|
||||
|
||||
// MOZ_CAN_RUN_SCRIPT_BOUNDARY until we can do MOZ_CAN_RUN_SCRIPT in
|
||||
// IPDL-generated things.
|
||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
||||
mozilla::ipc::IPCResult RecvAbort(const uint64_t& aTransactionId,
|
||||
const nsresult& aError);
|
||||
|
||||
|
@ -64,9 +64,7 @@ dictionary SignResponse {
|
||||
DOMString? errorMessage;
|
||||
};
|
||||
|
||||
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
||||
callback U2FRegisterCallback = void(RegisterResponse response);
|
||||
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
||||
callback U2FSignCallback = void(SignResponse response);
|
||||
|
||||
[SecureContext, Pref="security.webauth.u2f"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user