diff options
Diffstat (limited to 'Source/WebCore/page/Crypto.cpp')
| -rw-r--r-- | Source/WebCore/page/Crypto.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/WebCore/page/Crypto.cpp b/Source/WebCore/page/Crypto.cpp index 5aaa709bd..335873051 100644 --- a/Source/WebCore/page/Crypto.cpp +++ b/Source/WebCore/page/Crypto.cpp @@ -39,6 +39,15 @@ namespace WebCore { +namespace { + +bool isIntegerArray(ArrayBufferView* array) +{ + return JSC::isInt(array->getType()); +} + +} + Crypto::Crypto(Document& document) : ContextDestructionObserver(&document) { @@ -50,12 +59,12 @@ Crypto::~Crypto() Document* Crypto::document() const { - return downcast<Document>(scriptExecutionContext()); + return toDocument(scriptExecutionContext()); } void Crypto::getRandomValues(ArrayBufferView* array, ExceptionCode& ec) { - if (!array || !JSC::isInt(array->getType())) { + if (!array || !isIntegerArray(array)) { ec = TYPE_MISMATCH_ERR; return; } |
