Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1762)

Unified Diff: WebCore/Modules/websockets/WebSocket.cpp

Issue 11192017: ********** WebCore blob hacking (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: WebCore/Modules/websockets/WebSocket.cpp
===================================================================
--- WebCore/Modules/websockets/WebSocket.cpp (revision 132804)
+++ WebCore/Modules/websockets/WebSocket.cpp (working copy)
@@ -315,7 +315,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;
@@ -491,12 +491,14 @@
{
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>?
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()));
break;
}

Powered by Google App Engine
This is Rietveld 408576698