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

Unified Diff: public/platform/WebCryptoAlgorithm.h

Issue 44993003: [webcrypto] Make WebCryptoAlgorithm "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') | public/platform/WebCryptoAlgorithmParams.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebCryptoAlgorithm.h
diff --git a/public/platform/WebCryptoAlgorithm.h b/public/platform/WebCryptoAlgorithm.h
index 9d89e9accf04ea391059d9817f45dc70225f9d26..06d112aec94e88af7860203560401cb3e241e528 100644
--- a/public/platform/WebCryptoAlgorithm.h
+++ b/public/platform/WebCryptoAlgorithm.h
@@ -85,6 +85,9 @@ class WebCryptoAlgorithmPrivate;
// * Immutable
// * Threadsafe
// * Copiable (cheaply)
+//
+// If WebCryptoAlgorithm "isNull()" then it is invalid to call any of the other
+// methods on it (other than destruction, assignment, or isNull()).
class WebCryptoAlgorithm {
public:
#if BLINK_IMPLEMENTATION
@@ -92,6 +95,7 @@ public:
WebCryptoAlgorithm(WebCryptoAlgorithmId, PassOwnPtr<WebCryptoAlgorithmParams>);
#endif
+ BLINK_EXPORT static WebCryptoAlgorithm createNull();
BLINK_EXPORT static WebCryptoAlgorithm adoptParamsAndCreate(WebCryptoAlgorithmId, WebCryptoAlgorithmParams*);
~WebCryptoAlgorithm() { reset(); }
@@ -103,6 +107,8 @@ public:
return *this;
}
+ BLINK_EXPORT bool isNull() const;
+
BLINK_EXPORT WebCryptoAlgorithmId id() const;
BLINK_EXPORT WebCryptoAlgorithmParamsType paramsType() const;
« no previous file with comments | « public/platform/WebCrypto.h ('k') | public/platform/WebCryptoAlgorithmParams.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698