Index: WebCore/Modules/websockets/WebSocket.cpp |
=================================================================== |
--- WebCore/Modules/websockets/WebSocket.cpp (revision 140218) |
+++ WebCore/Modules/websockets/WebSocket.cpp (working copy) |
@@ -353,7 +353,7 @@ |
bool WebSocket::send(Blob* binaryData, ExceptionCode& ec) |
{ |
- LOG(Network, "WebSocket %p send blob %s", this, binaryData->url().string().utf8().data()); |
+ LOG(Network, "WebSocket %p send blob %s", this, binaryData->uuid().utf8().data()); |
ASSERT(binaryData); |
if (m_state == CONNECTING) { |
ec = INVALID_STATE_ERR; |
@@ -523,12 +523,15 @@ |
{ |
switch (m_binaryType) { |
case BinaryTypeBlob: { |
+ // FIXME: What if this is a very large amount of data, too large to reasonably fit |
+ // into a Vector<char>? As data is received, we should be spooling it out incrementally |
+ // to construct the blob. |
size_t size = binaryData->size(); |
RefPtr<RawData> rawData = RawData::create(); |
binaryData->swap(*rawData->mutableData()); |
OwnPtr<BlobData> blobData = BlobData::create(); |
blobData->appendData(rawData.release(), 0, BlobDataItem::toEndOfFile); |
- RefPtr<Blob> blob = Blob::create(blobData.release(), size); |
+ RefPtr<Blob> blob = Blob::create(BlobDataHandle::create(blobData.release(), size)); |
dispatchEvent(MessageEvent::create(blob.release(), SecurityOrigin::create(m_url)->toString())); |
break; |
} |