mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-02 12:32:55 +00:00
Bug 1005375 - Add an API that allows CryptoTasks to be created without being dispatched
This commit is contained in:
parent
8fabc5d038
commit
5f5fc30c16
@ -29,6 +29,17 @@ namespace mozilla {
|
||||
* except CalculateResult might be skipped if NSS is shut down before it can
|
||||
* be called; in that case ReleaseNSSResources will be called and then
|
||||
* CallCallback will be called with an error code.
|
||||
*
|
||||
* That sequence of events is what happens if you call Dispatch. If for
|
||||
* some reason, you decide not to run the task (e.g., due to an error in the
|
||||
* constructor), you may call Skip, in which case the task is cleaned up and
|
||||
* not run. In that case, only ReleaseNSSResources is called. (So a
|
||||
* subclass must be prepared for ReleaseNSSResources to be run without
|
||||
* CalculateResult having been called first.)
|
||||
*
|
||||
* Once a CryptoTask is created, the calling code must call either
|
||||
* Dispatch or Skip.
|
||||
*
|
||||
*/
|
||||
class CryptoTask : public nsRunnable,
|
||||
public nsNSSShutDownObject
|
||||
@ -48,6 +59,11 @@ public:
|
||||
return rv;
|
||||
}
|
||||
|
||||
void Skip()
|
||||
{
|
||||
virtualDestroyNSSReference();
|
||||
}
|
||||
|
||||
protected:
|
||||
CryptoTask()
|
||||
: mRv(NS_ERROR_NOT_INITIALIZED),
|
||||
|
Loading…
x
Reference in New Issue
Block a user