Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: public/platform/WebCrypto.h

Issue 343723003: [webcrypto] Allow crypto operations to be cancelled by the platform implementation. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix comment typo Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/exported/WebCryptoResult.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebCrypto.h
diff --git a/public/platform/WebCrypto.h b/public/platform/WebCrypto.h
index 606957792e26db49fcc655d7d76c91db90eea2fd..cc8d15b910b9de146c75f9c506e4fd302b921e22 100644
--- a/public/platform/WebCrypto.h
+++ b/public/platform/WebCrypto.h
@@ -44,6 +44,9 @@ namespace WebCore { class CryptoResult; }
namespace WTF { template <typename T> class PassRefPtr; }
#endif
+// FIXME: Remove once chromium side rolls.
+#define WEBCRYPTO_RESULT_HAS_CANCELLED 1
+
namespace blink {
class WebArrayBuffer;
@@ -95,6 +98,10 @@ public:
BLINK_PLATFORM_EXPORT void completeWithKey(const WebCryptoKey&);
BLINK_PLATFORM_EXPORT void completeWithKeyPair(const WebCryptoKey& publicKey, const WebCryptoKey& privateKey);
+ // Returns true if the underlying operation was cancelled.
+ // This method can be called from any thread.
+ BLINK_PLATFORM_EXPORT bool cancelled() const;
+
#if INSIDE_BLINK
BLINK_PLATFORM_EXPORT explicit WebCryptoResult(const WTF::PassRefPtr<WebCore::CryptoResult>&);
#endif
@@ -146,6 +153,9 @@ public:
// asynchronously make a copy of the WebCryptoResult and call it from the
// same thread that started the request.
//
+ // If the request was cancelled it is not necessary for implementations to
+ // set the result.
+ //
// -----------------------
// Threading
// -----------------------
« no previous file with comments | « Source/platform/exported/WebCryptoResult.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698