Index: third_party/WebKit/Source/modules/crypto/Crypto.cpp |
diff --git a/third_party/WebKit/Source/modules/crypto/Crypto.cpp b/third_party/WebKit/Source/modules/crypto/Crypto.cpp |
index 96506e4cbf0cb348a792b610801ac025c14969de..58f804537fd2c4d2d9a91b67c1d8ac8759ffa617 100644 |
--- a/third_party/WebKit/Source/modules/crypto/Crypto.cpp |
+++ b/third_party/WebKit/Source/modules/crypto/Crypto.cpp |
@@ -50,28 +50,30 @@ bool isIntegerArray(DOMArrayBufferView* array) { |
} // namespace |
-DOMArrayBufferView* Crypto::getRandomValues(DOMArrayBufferView* array, |
- ExceptionState& exceptionState) { |
- ASSERT(array); |
- if (!isIntegerArray(array)) { |
+DOMArrayBufferView* Crypto::getRandomValues( |
+ const NotShared<DOMArrayBufferView>& array, |
+ ExceptionState& exceptionState) { |
+ DCHECK(array.view()); |
+ if (!isIntegerArray(array.view())) { |
exceptionState.throwDOMException( |
TypeMismatchError, |
String::format("The provided ArrayBufferView is of type '%s', which is " |
"not an integer array type.", |
- array->typeName())); |
+ array.view()->typeName())); |
return nullptr; |
} |
- if (array->byteLength() > 65536) { |
+ if (array.view()->byteLength() > 65536) { |
exceptionState.throwDOMException( |
QuotaExceededError, |
String::format("The ArrayBufferView's byte length (%u) exceeds the " |
"number of bytes of entropy available via this API " |
"(65536).", |
- array->byteLength())); |
+ array.view()->byteLength())); |
return nullptr; |
} |
- cryptographicallyRandomValues(array->baseAddress(), array->byteLength()); |
- return array; |
+ cryptographicallyRandomValues(array.view()->baseAddress(), |
+ array.view()->byteLength()); |
+ return array.view(); |
} |
SubtleCrypto* Crypto::subtle() { |