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

Unified Diff: public/platform/WebCryptoAlgorithm.h

Issue 312393004: Expose WebCrypto's lookupAlgorithmInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@share_normalize
Patch Set: Addressed comment (removed redundant idToName). 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/WebCryptoAlgorithm.cpp ('k') | no next file » | 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 0a8e9b49c2d67ad6b5008af39e38771e1239afee..09896b44f6b871775ee3bc0dd0b3257458f0d754 100644
--- a/public/platform/WebCryptoAlgorithm.h
+++ b/public/platform/WebCryptoAlgorithm.h
@@ -85,6 +85,20 @@ enum WebCryptoAlgorithmParamsType {
WebCryptoAlgorithmParamsTypeAesCtrParams,
};
+struct WebCryptoAlgorithmInfo {
+ typedef char ParamsTypeOrUndefined;
+ static const ParamsTypeOrUndefined Undefined = -1;
+
+ // The canonical (case-sensitive) name for the algorithm as a
+ // null-terminated C-string literal.
+ const char* name;
+
+ // A map from the operation to the expected parameter type of the algorithm.
+ // If an operation is not applicable for the algorithm, set to Undefined.
+ const ParamsTypeOrUndefined operationToParamsType[WebCryptoOperationLast + 1];
+};
+
+
class WebCryptoAesCbcParams;
class WebCryptoAesKeyGenParams;
class WebCryptoHmacImportParams;
@@ -115,6 +129,11 @@ public:
BLINK_PLATFORM_EXPORT static WebCryptoAlgorithm createNull();
BLINK_PLATFORM_EXPORT static WebCryptoAlgorithm adoptParamsAndCreate(WebCryptoAlgorithmId, WebCryptoAlgorithmParams*);
+ // Returns a WebCryptoAlgorithmInfo for the algorithm with the given ID. If
+ // the ID is invalid, return 0. The caller can assume the pointer will be
+ // valid for the program's entire runtime.
+ BLINK_PLATFORM_EXPORT static const WebCryptoAlgorithmInfo* lookupAlgorithmInfo(WebCryptoAlgorithmId);
+
~WebCryptoAlgorithm() { reset(); }
WebCryptoAlgorithm(const WebCryptoAlgorithm& other) { assign(other); }
« no previous file with comments | « Source/platform/exported/WebCryptoAlgorithm.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698