/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
If any of these steps produces an error (setting mEarlyRv), then subsequent steps will not proceed. If the constructor or BeforeCrypto sets mEarlyComplete to true, then we will skip step 3, saving the thread overhead.
In general, the constructor should handle any parsing steps that require JS context, and otherwise just cache information for later steps to use.
All steps besides step 3 occur on the main thread, so they should avoid blocking operations.
Only step 3 is guarded to ensure that NSS has not been shutdown, so all NSS interactions should occur in DoCrypto
Cleanup should execute regardless of what else happens.
// For things that need to happen on the main thread // either before or after CalculateResult virtual nsresult BeforeCrypto() { return NS_OK; } virtual nsresult DoCrypto() { return NS_OK; } virtual nsresult AfterCrypto() { return NS_OK; } virtualvoid Resolve() {} virtualvoid Cleanup() {}
// XXX This class is declared here (unlike others) to enable reuse by WebRTC. class GenerateAsymmetricKeyTask : public WebCryptoTask { public:
GenerateAsymmetricKeyTask(nsIGlobalObject* aGlobal, JSContext* aCx, const ObjectOrString& aAlgorithm, bool aExtractable, const Sequence<nsString>& aKeyUsages);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.