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

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 7 years, 11 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
« no previous file with comments | « WebCore/Modules/indexeddb/IDBObjectStore.cpp ('k') | WebCore/Modules/websockets/WebSocketChannel.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « WebCore/Modules/indexeddb/IDBObjectStore.cpp ('k') | WebCore/Modules/websockets/WebSocketChannel.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698