Index: Source/modules/crypto/CryptoResultImpl.h |
diff --git a/Source/modules/crypto/CryptoResultImpl.h b/Source/modules/crypto/CryptoResultImpl.h |
index 63a0193e001c53cc9a19ad67065fb7cb57ead704..b3aa64f47a520c9d0c8d1ffd5f47887547c61940 100644 |
--- a/Source/modules/crypto/CryptoResultImpl.h |
+++ b/Source/modules/crypto/CryptoResultImpl.h |
@@ -50,7 +50,7 @@ ExceptionCode webCryptoErrorToExceptionCode(blink::WebCryptoErrorType); |
// |
// * At creation time there must be an active ExecutionContext. |
// * The CryptoResult interface must only be called from the origin thread. |
-// * addref() and deref() can be called from any thread. |
+// * ref(), deref(), cancelled() and cancel() 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 { |
@@ -65,14 +65,19 @@ public: |
virtual void completeWithBoolean(bool) OVERRIDE; |
virtual void completeWithKey(const blink::WebCryptoKey&) OVERRIDE; |
virtual void completeWithKeyPair(const blink::WebCryptoKey& publicKey, const blink::WebCryptoKey& privateKey) OVERRIDE; |
+ virtual bool cancelled() const OVERRIDE; |
// It is only valid to call this before completion. |
ScriptPromise promise(); |
private: |
+ class WeakResolver; |
explicit CryptoResultImpl(ScriptState*); |
+ void cancel(); |
+ |
WeakPtr<ScriptPromiseResolverWithContext> m_resolver; |
+ volatile int m_cancelled; |
}; |
} // namespace WebCore |