diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-17 09:59:38 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-17 09:59:38 +0000 |
commit | 47fb09645a42f399af3e1380db0dc911a9cd1032 (patch) | |
tree | c54eb3a438f563b4d097c040d8b289dae8db3601 /net/websockets | |
parent | 3203953f3166c4a331e60a80bcc65b4201105457 (diff) | |
download | chromium_src-47fb09645a42f399af3e1380db0dc911a9cd1032.zip chromium_src-47fb09645a42f399af3e1380db0dc911a9cd1032.tar.gz chromium_src-47fb09645a42f399af3e1380db0dc911a9cd1032.tar.bz2 |
[SPDY] Replace SpdyIOBuffer with new SpdyBuffer class
Use SpdyBuffer for both SPDY reads and writes. A future
CL will add hooks to SpdyBuffer so that we keep track of
flow control windows properly.
Replace SpdyFrameProducer with SpdyBufferProducer.
Also introduce new SpdyReadQueue class for delegates
of SpdyStream to use.
BUG=176592
Review URL: https://codereview.chromium.org/13990005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets')
-rw-r--r-- | net/websockets/websocket_job.cc | 11 | ||||
-rw-r--r-- | net/websockets/websocket_job.h | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/net/websockets/websocket_job.cc b/net/websockets/websocket_job.cc index 3aeb8aa..53e0eda 100644 --- a/net/websockets/websocket_job.cc +++ b/net/websockets/websocket_job.cc @@ -9,10 +9,10 @@ #include "base/bind.h" #include "base/lazy_instance.h" #include "googleurl/src/gurl.h" +#include "net/base/io_buffer.h" #include "net/base/net_errors.h" #include "net/base/net_log.h" #include "net/cookies/cookie_store.h" -#include "net/base/io_buffer.h" #include "net/http/http_network_session.h" #include "net/http/http_transaction_factory.h" #include "net/http/http_util.h" @@ -330,14 +330,19 @@ void WebSocketJob::OnSentSpdyData(size_t bytes_sent) { OnSentData(socket_, static_cast<int>(bytes_sent)); } -void WebSocketJob::OnReceivedSpdyData(const char* data, int length) { +void WebSocketJob::OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) { DCHECK_NE(INITIALIZED, state_); DCHECK_NE(CONNECTING, state_); if (state_ == CLOSED) return; if (!spdy_websocket_stream_.get()) return; - OnReceivedData(socket_, data, length); + if (buffer) { + OnReceivedData(socket_, buffer->GetRemainingData(), + buffer->GetRemainingSize()); + } else { + OnReceivedData(socket_, NULL, 0); + } } void WebSocketJob::OnCloseSpdyStream() { diff --git a/net/websockets/websocket_job.h b/net/websockets/websocket_job.h index 29f327c..02e4dfd 100644 --- a/net/websockets/websocket_job.h +++ b/net/websockets/websocket_job.h @@ -83,7 +83,7 @@ class NET_EXPORT WebSocketJob virtual int OnReceivedSpdyResponseHeader( const SpdyHeaderBlock& headers, int status) OVERRIDE; virtual void OnSentSpdyData(size_t bytes_sent) OVERRIDE; - virtual void OnReceivedSpdyData(const char* data, int length) OVERRIDE; + virtual void OnReceivedSpdyData(scoped_ptr<SpdyBuffer> buffer) OVERRIDE; virtual void OnCloseSpdyStream() OVERRIDE; private: |