Index: Source/modules/crypto/Crypto.cpp |
diff --git a/Source/modules/crypto/Crypto.cpp b/Source/modules/crypto/Crypto.cpp |
index a2e55daaa82295fd417022c3b1cbe7a6cb09e019..211d679fc6af2aa0807e77d0a26f1abd15a48abe 100644 |
--- a/Source/modules/crypto/Crypto.cpp |
+++ b/Source/modules/crypto/Crypto.cpp |
@@ -30,46 +30,13 @@ |
#include "config.h" |
#include "modules/crypto/Crypto.h" |
-#include "core/dom/ExceptionCode.h" |
-#include "wtf/ArrayBufferView.h" |
-#include "wtf/CryptographicallyRandomNumber.h" |
- |
namespace WebCore { |
-namespace { |
- |
-bool isIntegerArray(ArrayBufferView* array) |
-{ |
- ArrayBufferView::ViewType type = array->getType(); |
- return type == ArrayBufferView::TypeInt8 |
- || type == ArrayBufferView::TypeUint8 |
- || type == ArrayBufferView::TypeUint8Clamped |
- || type == ArrayBufferView::TypeInt16 |
- || type == ArrayBufferView::TypeUint16 |
- || type == ArrayBufferView::TypeInt32 |
- || type == ArrayBufferView::TypeUint32; |
-} |
- |
-} |
- |
Crypto::Crypto() |
{ |
ScriptWrappable::init(this); |
} |
-void Crypto::getRandomValues(ArrayBufferView* array, ExceptionCode& ec) |
-{ |
- if (!array || !isIntegerArray(array)) { |
- ec = TYPE_MISMATCH_ERR; |
- return; |
- } |
- if (array->byteLength() > 65536) { |
- ec = QUOTA_EXCEEDED_ERR; |
- return; |
- } |
- cryptographicallyRandomValues(array->baseAddress(), array->byteLength()); |
-} |
- |
SubtleCrypto* Crypto::subtle() |
{ |
if (!m_subtleCrypto) |