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

Unified Diff: public/platform/WebCryptoKey.h

Issue 48753003: [webcrypto] Make WebCryptoKey nullable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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 | « public/platform/WebCrypto.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebCryptoKey.h
diff --git a/public/platform/WebCryptoKey.h b/public/platform/WebCryptoKey.h
index 095e3de1c69bb5bea8e38db9dfb717f6b82bd58c..1d765f28776b95724cf30b8b6f10363eb7514527 100644
--- a/public/platform/WebCryptoKey.h
+++ b/public/platform/WebCryptoKey.h
@@ -84,6 +84,9 @@ class WebCryptoKeyHandle;
// safely assume any details regarding the type of the wrapped
// WebCryptoKeyHandle*.
//
+// If WebCryptoKey "isNull()" then it is invalid to call any of the other
+// methods on it (other than destruction, assignment, or isNull()).
+//
// FIXME: Define the interface to use for structured clone.
// Cloning across a process boundary will need serialization,
// however cloning for in-process workers could just share the same
@@ -105,6 +108,8 @@ public:
// Note that the caller is passing ownership of the WebCryptoKeyHandle*.
BLINK_PLATFORM_EXPORT static WebCryptoKey create(WebCryptoKeyHandle*, WebCryptoKeyType, bool extractable, const WebCryptoAlgorithm&, WebCryptoKeyUsageMask);
+ BLINK_PLATFORM_EXPORT static WebCryptoKey createNull();
+
// Returns the opaque key handle that was set by the embedder.
// * Safe to downcast to known type (since embedder creates all the keys)
// * Returned pointer's lifetime is bound to |this|
@@ -115,6 +120,8 @@ public:
BLINK_PLATFORM_EXPORT const WebCryptoAlgorithm& algorithm() const;
BLINK_PLATFORM_EXPORT WebCryptoKeyUsageMask usages() const;
+ BLINK_PLATFORM_EXPORT bool isNull() const;
+
private:
WebCryptoKey() { }
BLINK_PLATFORM_EXPORT void assign(const WebCryptoKey& other);
« no previous file with comments | « public/platform/WebCrypto.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698