| Index: Source/modules/crypto/CryptoResultImpl.h
|
| diff --git a/Source/modules/crypto/CryptoResultImpl.h b/Source/modules/crypto/CryptoResultImpl.h
|
| index b6cb6e90126c8290fdfbbd3a2172afc230868247..311f9c674e2c8e6b609331396fe76adc3729b704 100644
|
| --- a/Source/modules/crypto/CryptoResultImpl.h
|
| +++ b/Source/modules/crypto/CryptoResultImpl.h
|
| @@ -37,10 +37,10 @@
|
| #include "platform/CryptoResult.h"
|
| #include "public/platform/WebCrypto.h"
|
| #include "wtf/Forward.h"
|
| +#include "wtf/ThreadingPrimitives.h"
|
|
|
| namespace blink {
|
|
|
| -class ScriptPromiseResolver;
|
| MODULES_EXPORT ExceptionCode webCryptoErrorToExceptionCode(WebCryptoErrorType);
|
|
|
| // Wrapper around a Promise to notify completion of the crypto operation.
|
| @@ -50,15 +50,16 @@ MODULES_EXPORT ExceptionCode webCryptoErrorToExceptionCode(WebCryptoErrorType);
|
| //
|
| // * At creation time there must be an active ExecutionContext.
|
| // * The CryptoResult interface must only be called from the origin thread.
|
| -// * ref(), deref(), cancelled() and cancel() can be called from any thread.
|
| +// * cancel() can only be called from the origin thread.
|
| +// * ref(), deref() can be called from any thread.
|
| // * One of the completeWith***() functions must be called, or the
|
| // m_resolver will be leaked until the ExecutionContext is destroyed.
|
| class CryptoResultImpl final : public CryptoResult {
|
| public:
|
| - ~CryptoResultImpl();
|
| -
|
| static PassRefPtrWillBeRawPtr<CryptoResultImpl> create(ScriptState*);
|
|
|
| + ~CryptoResultImpl();
|
| +
|
| void completeWithError(WebCryptoErrorType, const WebString&) override;
|
| void completeWithBuffer(const void* bytes, unsigned bytesSize) override;
|
| void completeWithJson(const char* utf8Data, unsigned length) override;
|
| @@ -71,19 +72,24 @@ public:
|
| // ScriptPromise.
|
| ScriptPromise promise();
|
|
|
| + WebCryptoResult result()
|
| + {
|
| + return WebCryptoResult(this);
|
| + }
|
| +
|
| + DECLARE_VIRTUAL_TRACE();
|
| +
|
| private:
|
| class Resolver;
|
| explicit CryptoResultImpl(ScriptState*);
|
|
|
| - void clearResolver();
|
| void cancel();
|
| + void clearResolver();
|
|
|
| - // FIXME: ScriptPromiseResolver should not be exported.
|
| - // Instead, use ScriptPromise.
|
| - ScriptPromiseResolver* m_resolver;
|
| + RawPtrWillBeMember<Resolver> m_resolver;
|
| volatile int m_cancelled;
|
| };
|
|
|
| } // namespace blink
|
|
|
| -#endif
|
| +#endif // CryptoResultImpl_h
|
|
|