| 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 0c98fdae9247ea245416f2128f4eae1356289334..96b5e47d713f3d3bb4c974efcf1e2064a9d30d2f 100644
|
| --- a/third_party/WebKit/Source/modules/crypto/Crypto.cpp
|
| +++ b/third_party/WebKit/Source/modules/crypto/Crypto.cpp
|
| @@ -50,29 +50,27 @@
|
|
|
| } // namespace
|
|
|
| -NotShared<DOMArrayBufferView> Crypto::getRandomValues(
|
| - NotShared<DOMArrayBufferView> array,
|
| - ExceptionState& exception_state) {
|
| - DCHECK(array);
|
| - if (!IsIntegerArray(array.View())) {
|
| +DOMArrayBufferView* Crypto::getRandomValues(DOMArrayBufferView* array,
|
| + ExceptionState& exception_state) {
|
| + ASSERT(array);
|
| + if (!IsIntegerArray(array)) {
|
| exception_state.ThrowDOMException(
|
| kTypeMismatchError,
|
| String::Format("The provided ArrayBufferView is of type '%s', which is "
|
| "not an integer array type.",
|
| - array.View()->TypeName()));
|
| - return NotShared<DOMArrayBufferView>(nullptr);
|
| + array->TypeName()));
|
| + return nullptr;
|
| }
|
| - if (array.View()->byteLength() > 65536) {
|
| + if (array->byteLength() > 65536) {
|
| exception_state.ThrowDOMException(
|
| kQuotaExceededError,
|
| String::Format("The ArrayBufferView's byte length (%u) exceeds the "
|
| "number of bytes of entropy available via this API "
|
| "(65536).",
|
| - array.View()->byteLength()));
|
| - return NotShared<DOMArrayBufferView>(nullptr);
|
| + array->byteLength()));
|
| + return nullptr;
|
| }
|
| - CryptographicallyRandomValues(array.View()->BaseAddress(),
|
| - array.View()->byteLength());
|
| + CryptographicallyRandomValues(array->BaseAddress(), array->byteLength());
|
| return array;
|
| }
|
|
|
|
|