Index: third_party/WebKit/Source/web/WebSocketImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebSocketImpl.cpp b/third_party/WebKit/Source/web/WebSocketImpl.cpp |
index 9f453f13a1310e4b483d5e26c27698bcec77ed41..39a9a0ff72f8913262fd41578fde73c151c42e40 100644 |
--- a/third_party/WebKit/Source/web/WebSocketImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebSocketImpl.cpp |
@@ -172,7 +172,13 @@ void WebSocketImpl::didReceiveBinaryMessage(PassOwnPtr<Vector<char>> payload) |
// FIXME: Handle Blob after supporting WebBlob. |
break; |
case BinaryTypeArrayBuffer: |
- m_client->didReceiveArrayBuffer(WebArrayBuffer(DOMArrayBuffer::create(payload->data(), payload->size()))); |
+ // FIXME(crbug.com/536816): |
+ // Avoid crashing when out of memory by calling createOrNull. Requires |
+ // determining appropriate alternate behavior for dealing with allocation |
+ // failures. Should the notification be droped? Should we just pass null |
+ // data? Should we signal an error somehow? |
+ RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::deprecatedCreateOrCrash(payload->data(), payload->size()); |
+ m_client->didReceiveArrayBuffer(WebArrayBuffer(buffer.release())); |
break; |
} |
} |