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

Unified Diff: Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp

Issue 23992003: blob hacking webcore style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
« no previous file with comments | « Source/modules/websockets/WorkerThreadableWebSocketChannel.h ('k') | Source/web/WebBlob.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp
diff --git a/Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp b/Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp
index 6c6a705c166ee77dfc42b2784be0950d25623d21..dad982ea2850ce263eb90f958f5eb4e1448202f2 100644
--- a/Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp
+++ b/Source/modules/websockets/WorkerThreadableWebSocketChannel.cpp
@@ -115,11 +115,11 @@ WebSocketChannel::SendResult WorkerThreadableWebSocketChannel::send(const ArrayB
return m_bridge->send(binaryData, byteOffset, byteLength);
}
-WebSocketChannel::SendResult WorkerThreadableWebSocketChannel::send(const Blob& binaryData)
+WebSocketChannel::SendResult WorkerThreadableWebSocketChannel::send(PassRefPtr<BlobDataHandle> blobData)
{
if (!m_bridge)
return WebSocketChannel::SendFail;
- return m_bridge->send(binaryData);
+ return m_bridge->send(blobData);
}
unsigned long WorkerThreadableWebSocketChannel::bufferedAmount() const
@@ -231,12 +231,12 @@ void WorkerThreadableWebSocketChannel::Peer::send(const ArrayBuffer& binaryData)
m_loaderProxy.postTaskForModeToWorkerGlobalScope(createCallbackTask(&workerGlobalScopeDidSend, m_workerClientWrapper, sendRequestResult), m_taskMode);
}
-void WorkerThreadableWebSocketChannel::Peer::send(const Blob& binaryData)
+void WorkerThreadableWebSocketChannel::Peer::send(PassRefPtr<BlobDataHandle> blobData)
{
ASSERT(isMainThread());
if (!m_mainWebSocketChannel || !m_workerClientWrapper)
return;
- WebSocketChannel::SendResult sendRequestResult = m_mainWebSocketChannel->send(binaryData);
+ WebSocketChannel::SendResult sendRequestResult = m_mainWebSocketChannel->send(blobData);
m_loaderProxy.postTaskForModeToWorkerGlobalScope(createCallbackTask(&workerGlobalScopeDidSend, m_workerClientWrapper, sendRequestResult), m_taskMode);
}
@@ -498,14 +498,12 @@ void WorkerThreadableWebSocketChannel::mainThreadSendArrayBuffer(ExecutionContex
peer->send(*arrayBuffer);
}
-void WorkerThreadableWebSocketChannel::mainThreadSendBlob(ExecutionContext* context, Peer* peer, const KURL& url, const String& type, long long size)
+void WorkerThreadableWebSocketChannel::mainThreadSendBlob(ExecutionContext* context, Peer* peer, PassRefPtr<BlobDataHandle> data)
{
ASSERT(isMainThread());
ASSERT_UNUSED(context, context->isDocument());
ASSERT(peer);
-
- RefPtr<Blob> blob = Blob::create(url, type, size);
- peer->send(*blob);
+ peer->send(data);
}
WebSocketChannel::SendResult WorkerThreadableWebSocketChannel::Bridge::send(const String& message)
@@ -540,12 +538,12 @@ WebSocketChannel::SendResult WorkerThreadableWebSocketChannel::Bridge::send(cons
return clientWrapper->sendRequestResult();
}
-WebSocketChannel::SendResult WorkerThreadableWebSocketChannel::Bridge::send(const Blob& binaryData)
+WebSocketChannel::SendResult WorkerThreadableWebSocketChannel::Bridge::send(PassRefPtr<BlobDataHandle> data)
{
if (!m_workerClientWrapper || !m_peer)
return WebSocketChannel::SendFail;
setMethodNotCompleted();
- m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadSendBlob, AllowCrossThreadAccess(m_peer), binaryData.url(), binaryData.type(), binaryData.size()));
+ m_loaderProxy.postTaskToLoader(createCallbackTask(&WorkerThreadableWebSocketChannel::mainThreadSendBlob, AllowCrossThreadAccess(m_peer), data));
RefPtr<Bridge> protect(this);
waitForMethodCompletion();
ThreadableWebSocketChannelClientWrapper* clientWrapper = m_workerClientWrapper.get();
« no previous file with comments | « Source/modules/websockets/WorkerThreadableWebSocketChannel.h ('k') | Source/web/WebBlob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698