mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 07:15:46 +00:00
9ac166b3da
Summary: This patch aims to clean up the U2FManager's state machine, especially to make cancellation of transactions clearer. To fix bug 1403818, we'll have to later introduce a unique id that is forwarded to the U2FTokenManager. There are multiple stages of cancellation/cleanup after a transaction was started. All of the places where we previously called Cancel() or MaybeClearTransaction() are listed below: [stage 1] ClearTransaction This is the most basic stage, we only clean up what information we have about the current transaction. This means that the request was completed successfully. It is used at the end of FinishRegister() and FinishSign(). [stage 2] RejectTransaction The second stage will reject the transaction promise we returned to the caller. Then it will call ClearTransaction, i.e. stage 1. It is used when one of the two Finish*() functions aborts before completion, or when the parent process sends a RequestAborted message. [stage 2b] MaybeRejectTransaction This is the same as stage 2, but will only run if there's an active transaction. It is used by ~U2FManager() to reject and clean up when we the manager goes away. [stage 3] CancelTransaction The third stage sends a "Cancel" message to the parent process before rejecting the transaction promise (stage 2) and cleaning up (stage 1). It's used by HandleEvent(), i.e. the document becomes inactive. [stage 3b] MaybeCancelTransaction This is the same as stage 3, but will only run if there's an active transaction. It is used at the top of Register() and Sign() so that any active transaction is cancelled before we handle a new request. It's also used by U2F::Cancel() as long as bug 1410346 isn't fixed. Reviewers: jcj Reviewed By: jcj Bug #: 1410345 Differential Revision: https://phabricator.services.mozilla.com/D144 |
||
---|---|---|
.. | ||
tests | ||
moz.build | ||
U2F.cpp | ||
U2F.h | ||
U2FAuthenticator.h | ||
U2FManager.cpp | ||
U2FManager.h | ||
U2FTransactionChild.cpp | ||
U2FTransactionChild.h | ||
U2FTransactionParent.cpp | ||
U2FTransactionParent.h | ||
U2FUtil.h |