diff options
author | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-11 16:05:18 +0000 |
---|---|---|
committer | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-11 16:05:18 +0000 |
commit | 1bf1731f302628b460be391a3c9561152dbfda04 (patch) | |
tree | 530b3a1a6bdc1bffa55c1e3cdcef486f3fce42ac /net/websockets/websocket_job.h | |
parent | d34415c17079ebf8cf8557aa0ee0e464624b7180 (diff) | |
download | chromium_src-1bf1731f302628b460be391a3c9561152dbfda04.zip chromium_src-1bf1731f302628b460be391a3c9561152dbfda04.tar.gz chromium_src-1bf1731f302628b460be391a3c9561152dbfda04.tar.bz2 |
Add WebSocket over SPDY experimental implementation.
(Re-land with memory leak fix)
- Realize WebSocketJob's internal protocol switch to SPDY using SpdyWebSocketStream
- Add simple test to verify connection over SPDY
BUG=42320
TEST=net_unittests --gtest_filter=WebSocketJobTest\*
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=91997
Review URL: http://codereview.chromium.org/7185032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92017 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets/websocket_job.h')
-rw-r--r-- | net/websockets/websocket_job.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/net/websockets/websocket_job.h b/net/websockets/websocket_job.h index 369ef56..f0e67c6 100644 --- a/net/websockets/websocket_job.h +++ b/net/websockets/websocket_job.h @@ -13,6 +13,7 @@ #include "net/base/address_list.h" #include "net/base/completion_callback.h" #include "net/socket_stream/socket_stream_job.h" +#include "net/spdy/spdy_websocket_stream.h" class GURL; @@ -31,7 +32,8 @@ class WebSocketHandshakeResponseHandler; // TODO(ukai): refactor websocket.cc to use this. class NET_API WebSocketJob : public SocketStreamJob, - public SocketStream::Delegate { + public SocketStream::Delegate, + public SpdyWebSocketStream::Delegate { public: // This is state of WebSocket, not SocketStream. enum State { @@ -70,6 +72,15 @@ class NET_API WebSocketJob SocketStream* socket, AuthChallengeInfo* auth_info); virtual void OnError(const SocketStream* socket, int error); + // SpdyWebSocketStream::Delegate methods. + virtual void OnCreatedSpdyStream(int status); + virtual void OnSentSpdyHeaders(int status); + virtual int OnReceivedSpdyResponseHeader( + const spdy::SpdyHeaderBlock& headers, int status); + virtual void OnSentSpdyData(int amount_sent); + virtual void OnReceivedSpdyData(const char* data, int length); + virtual void OnCloseSpdyStream(); + private: friend class WebSocketThrottle; friend class WebSocketJobTest; @@ -92,6 +103,7 @@ class NET_API WebSocketJob bool IsWaiting() const; void Wakeup(); void RetryPendingIO(); + void CompleteIO(int result); bool SendDataInternal(const char* data, int length); void CloseInternal(); @@ -118,6 +130,9 @@ class NET_API WebSocketJob scoped_refptr<DrainableIOBuffer> current_buffer_; scoped_ptr<WebSocketFrameHandler> receive_frame_handler_; + scoped_ptr<SpdyWebSocketStream> spdy_websocket_stream_; + std::string challenge_; + DISALLOW_COPY_AND_ASSIGN(WebSocketJob); }; |