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

Unified Diff: Source/modules/crypto/KeyAlgorithm.h

Issue 179353002: [webcrypto] Add the KeyAlgorithm interface. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase yet again (another conflict) Created 6 years, 10 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/modules/crypto/Key.idl ('k') | Source/modules/crypto/KeyAlgorithm.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/crypto/KeyAlgorithm.h
diff --git a/Source/modules/crypto/Algorithm.h b/Source/modules/crypto/KeyAlgorithm.h
similarity index 66%
rename from Source/modules/crypto/Algorithm.h
rename to Source/modules/crypto/KeyAlgorithm.h
index b71e875ac6aaa9193931f60549e24053c446a380..81c292321b225bd1dbee7842e8a2aed50bb98c1b 100644
--- a/Source/modules/crypto/Algorithm.h
+++ b/Source/modules/crypto/KeyAlgorithm.h
@@ -28,34 +28,44 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Algorithm_h
-#define Algorithm_h
+#ifndef KeyAlgorithm_h
+#define KeyAlgorithm_h
#include "bindings/v8/ScriptWrappable.h"
#include "heap/Handle.h"
-#include "public/platform/WebCryptoAlgorithm.h"
+#include "public/platform/WebCryptoKeyAlgorithm.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
namespace WebCore {
-class Algorithm : public RefCountedWillBeGarbageCollectedFinalized<Algorithm>, public ScriptWrappable {
+class KeyAlgorithm : public RefCountedWillBeGarbageCollectedFinalized<KeyAlgorithm>, public ScriptWrappable {
public:
- static PassRefPtrWillBeRawPtr<Algorithm> create(const blink::WebCryptoAlgorithm&);
+ virtual ~KeyAlgorithm();
+
+ static PassRefPtrWillBeRawPtr<KeyAlgorithm> create(const blink::WebCryptoKeyAlgorithm&);
+ static PassRefPtrWillBeRawPtr<KeyAlgorithm> createHash(const blink::WebCryptoAlgorithm&);
String name();
- blink::WebCryptoAlgorithmParamsType type() const { return m_algorithm.paramsType(); }
+ // Needed by SpecialWrapFor and for casting.
+ bool isAesKeyAlgorithm() const;
+ bool isHmacKeyAlgorithm() const;
+ bool isRsaHashedKeyAlgorithm() const;
+ bool isRsaKeyAlgorithm() const;
- void trace(Visitor*) { }
+ virtual void trace(Visitor*);
protected:
- explicit Algorithm(const blink::WebCryptoAlgorithm&);
+ explicit KeyAlgorithm(const blink::WebCryptoKeyAlgorithm&);
- const blink::WebCryptoAlgorithm m_algorithm;
+ blink::WebCryptoKeyAlgorithm m_algorithm;
};
+#define DEFINE_KEY_ALGORITHM_TYPE_CASTS(thisType) \
+ DEFINE_TYPE_CASTS(thisType, KeyAlgorithm, value, value->is##thisType(), value.is##thisType())
+
} // namespace WebCore
#endif
« no previous file with comments | « Source/modules/crypto/Key.idl ('k') | Source/modules/crypto/KeyAlgorithm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698