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

Unified Diff: Source/modules/websockets/NewWebSocketChannelImpl.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/NewWebSocketChannelImpl.h ('k') | Source/modules/websockets/WebSocket.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/NewWebSocketChannelImpl.cpp
diff --git a/Source/modules/websockets/NewWebSocketChannelImpl.cpp b/Source/modules/websockets/NewWebSocketChannelImpl.cpp
index 2faf184c213c7d63651fe451e7c0a5fae067a98e..7e415eb628edab13964eea37037e8ae45b0d3cc8 100644
--- a/Source/modules/websockets/NewWebSocketChannelImpl.cpp
+++ b/Source/modules/websockets/NewWebSocketChannelImpl.cpp
@@ -139,7 +139,7 @@ bool isClean(int code)
class NewWebSocketChannelImpl::BlobLoader : public FileReaderLoaderClient {
public:
- BlobLoader(const Blob&, NewWebSocketChannelImpl*);
+ BlobLoader(PassRefPtr<BlobDataHandle>, NewWebSocketChannelImpl*);
virtual ~BlobLoader() { }
void cancel();
@@ -155,11 +155,11 @@ private:
FileReaderLoader m_loader;
};
-NewWebSocketChannelImpl::BlobLoader::BlobLoader(const Blob& blob, NewWebSocketChannelImpl* channel)
+NewWebSocketChannelImpl::BlobLoader::BlobLoader(PassRefPtr<BlobDataHandle> blobDataHandle, NewWebSocketChannelImpl* channel)
: m_channel(channel)
, m_loader(FileReaderLoader::ReadAsArrayBuffer, this)
{
- m_loader.start(channel->executionContext(), blob);
+ m_loader.start(channel->executionContext(), blobDataHandle);
}
void NewWebSocketChannelImpl::BlobLoader::cancel()
@@ -311,10 +311,10 @@ WebSocketChannel::SendResult NewWebSocketChannelImpl::send(const String& message
return SendSuccess;
}
-WebSocketChannel::SendResult NewWebSocketChannelImpl::send(const Blob& blob)
+WebSocketChannel::SendResult NewWebSocketChannelImpl::send(PassRefPtr<BlobDataHandle> blobDataHandle)
{
- LOG(Network, "NewWebSocketChannelImpl %p sendBlob(%s, %s, %llu)", this, blob.url().string().utf8().data(), blob.type().utf8().data(), blob.size());
- m_messages.append(Message(blob));
+ LOG(Network, "NewWebSocketChannelImpl %p sendBlob(%s, %s, %llu)", this, blobDataHandle->uuid().utf8().data(), blobDataHandle->type().utf8().data(), blobDataHandle->size());
+ m_messages.append(Message(blobDataHandle));
sendInternal();
return SendSuccess;
}
@@ -438,9 +438,9 @@ NewWebSocketChannelImpl::Message::Message(const String& text)
: type(MessageTypeText)
, text(text.utf8(String::StrictConversionReplacingUnpairedSurrogatesWithFFFD)) { }
-NewWebSocketChannelImpl::Message::Message(const Blob& blob)
+NewWebSocketChannelImpl::Message::Message(PassRefPtr<BlobDataHandle> blobDataHandle)
: type(MessageTypeBlob)
- , blob(Blob::create(blob.url(), blob.type(), blob.size())) { }
+ , blobDataHandle(blobDataHandle) { }
NewWebSocketChannelImpl::Message::Message(PassRefPtr<ArrayBuffer> arrayBuffer)
: type(MessageTypeArrayBuffer)
@@ -466,7 +466,7 @@ void NewWebSocketChannelImpl::sendInternal()
}
case MessageTypeBlob:
ASSERT(!m_blobLoader);
- m_blobLoader = adoptPtr(new BlobLoader(*message.blob, this));
+ m_blobLoader = adoptPtr(new BlobLoader(message.blobDataHandle, this));
break;
case MessageTypeArrayBuffer: {
WebSocketHandle::MessageType type =
« no previous file with comments | « Source/modules/websockets/NewWebSocketChannelImpl.h ('k') | Source/modules/websockets/WebSocket.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698