Index: Source/modules/crypto/AesKeyAlgorithm.cpp |
diff --git a/Source/modules/crypto/Algorithm.cpp b/Source/modules/crypto/AesKeyAlgorithm.cpp |
similarity index 74% |
copy from Source/modules/crypto/Algorithm.cpp |
copy to Source/modules/crypto/AesKeyAlgorithm.cpp |
index f3cc089a18e78eb9944fc5dcb88a638aa1a811c3..1fc8188b8e5fc2528cae7813989b42ee2e525ef4 100644 |
--- a/Source/modules/crypto/Algorithm.cpp |
+++ b/Source/modules/crypto/AesKeyAlgorithm.cpp |
@@ -1,5 +1,5 @@ |
/* |
- * Copyright (C) 2013 Google Inc. All rights reserved. |
+ * Copyright (C) 2014 Google Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are |
@@ -29,29 +29,33 @@ |
*/ |
#include "config.h" |
-#include "modules/crypto/Algorithm.h" |
+#include "modules/crypto/AesKeyAlgorithm.h" |
#include "modules/crypto/NormalizeAlgorithm.h" |
#include "wtf/text/WTFString.h" |
namespace WebCore { |
-DEFINE_GC_INFO(Algorithm); |
+PassRefPtrWillBeRawPtr<AesKeyAlgorithm> AesKeyAlgorithm::create(const blink::WebCryptoKeyAlgorithm& algorithm) |
+{ |
+ return adoptRefWillBeNoop(new AesKeyAlgorithm(algorithm)); |
+} |
-PassRefPtrWillBeRawPtr<Algorithm> Algorithm::create(const blink::WebCryptoAlgorithm& algorithm) |
+unsigned short AesKeyAlgorithm::length() |
{ |
- return adoptRefWillBeNoop(new Algorithm(algorithm)); |
+ return m_algorithm.aesParams()->lengthBits(); |
} |
-Algorithm::Algorithm(const blink::WebCryptoAlgorithm& algorithm) |
- : m_algorithm(algorithm) |
+void AesKeyAlgorithm::trace(Visitor* visitor) |
{ |
- ScriptWrappable::init(this); |
+ KeyAlgorithm::trace(visitor); |
} |
-String Algorithm::name() |
+AesKeyAlgorithm::AesKeyAlgorithm(const blink::WebCryptoKeyAlgorithm& algorithm) |
+ : KeyAlgorithm(algorithm) |
{ |
- return algorithmIdToName(m_algorithm.id()); |
+ ASSERT(m_algorithm.aesParams()); |
+ ScriptWrappable::init(this); |
} |
} // namespace WebCore |