Index: third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp |
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp |
index 00b41011c1a4a635e19d3bd5bc174438560672a7..9f9549f9f61594a09a0b0ffb3262275010a64898 100644 |
--- a/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp |
+++ b/third_party/WebKit/Source/modules/push_messaging/PushMessageData.cpp |
@@ -56,7 +56,14 @@ PushMessageData::~PushMessageData() |
PassRefPtr<DOMArrayBuffer> PushMessageData::arrayBuffer() const |
{ |
- return DOMArrayBuffer::create(m_data.data(), m_data.size()); |
+ // TODO(junov): crbug.com/536816 |
+ // Use createOrNull instead of deprecatedCreateOrCrash. Requires |
+ // defining behavior for when allocation fails. ECMAScript spec says |
+ // allocation failure should throw a RangeError exception, but the |
+ // spec for PushMessageData.arrayBuffer() does not state that |
+ // such exceptions should be re-thrown. So for now, we just crash. |
+ RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::deprecatedCreateOrCrash(m_data.data(), m_data.size()); |
+ return buffer.release(); |
} |
Blob* PushMessageData::blob() const |