| Index: third_party/WebKit/Source/core/testing/Internals.cpp
|
| diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
|
| index 0f9f83c1a76863edcbfc8ba0c4753a04180bc60e..5cd32cc0724d2ce7051580469b0eb31f7ab83ce7 100644
|
| --- a/third_party/WebKit/Source/core/testing/Internals.cpp
|
| +++ b/third_party/WebKit/Source/core/testing/Internals.cpp
|
| @@ -2127,10 +2127,16 @@ bool Internals::cursorUpdatePending() const
|
| return frame()->eventHandler().cursorUpdatePending();
|
| }
|
|
|
| +void Internals::fakeOutOfMemoryForNextArrayBufferAllocation() const
|
| +{
|
| + WTF::ArrayBufferContents::fakeOutOfMemoryForNextArrayBufferAllocationForTesting();
|
| +}
|
| +
|
| PassRefPtr<DOMArrayBuffer> Internals::serializeObject(PassRefPtr<SerializedScriptValue> value) const
|
| {
|
| String stringValue = value->toWireString();
|
| - RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::createUninitialized(stringValue.length(), sizeof(UChar));
|
| + RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::createUninitializedOrNull(stringValue.length(), sizeof(UChar));
|
| + RELEASE_ASSERT(buffer); // Crash here means out of memory.
|
| stringValue.copyTo(static_cast<UChar*>(buffer->data()), 0, stringValue.length());
|
| return buffer.release();
|
| }
|
|
|