| Index: net/websockets/websocket_job.h
|
| diff --git a/net/websockets/websocket_job.h b/net/websockets/websocket_job.h
|
| index f19653d29ae4874032b22208467c550dc8445e84..bc45a66d7cbb1dcd964fc886d5fcab1ecd16899d 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;
|
|
|
| @@ -29,7 +30,9 @@ class WebSocketHandshakeResponseHandler;
|
| // see HttpOnly cookies, so it injects cookie header in handshake request and
|
| // strips set-cookie headers in handshake response.
|
| // TODO(ukai): refactor websocket.cc to use this.
|
| -class WebSocketJob : public SocketStreamJob, public SocketStream::Delegate {
|
| +class WebSocketJob : public SocketStreamJob,
|
| + public SocketStream::Delegate,
|
| + public SpdyWebSocketStreamDelegate {
|
| public:
|
| // This is state of WebSocket, not SocketStream.
|
| enum State {
|
| @@ -67,6 +70,22 @@ class WebSocketJob : public SocketStreamJob, public SocketStream::Delegate {
|
| virtual void OnError(
|
| const SocketStream* socket, int error);
|
|
|
| + // SpdyWebSocketStreamDelegate methods.
|
| + virtual void OnCreatedSpdyStream(
|
| + SpdyWebSocketStream* spdy_websocket_stream, int status);
|
| + virtual void OnSentSpdyHeaders(
|
| + SpdyWebSocketStream* spdy_websocket_stream);
|
| + virtual int OnReceivedSpdyResponseHeader(
|
| + SpdyWebSocketStream* spdy_websocket_stream,
|
| + const spdy::SpdyHeaderBlock& headers,
|
| + int status);
|
| + virtual void OnSentSpdyData(
|
| + SpdyWebSocketStream* spdy_websocket_stream, int amount_sent);
|
| + virtual void OnReceivedSpdyData(
|
| + SpdyWebSocketStream* spdy_websocket_stream, const char* data, int length);
|
| + virtual void OnCloseSpdyStream(
|
| + SpdyWebSocketStream* spdy_websocket_stream);
|
| +
|
| private:
|
| friend class WebSocketThrottle;
|
| friend class WebSocketJobTest;
|
| @@ -86,11 +105,14 @@ class WebSocketJob : public SocketStreamJob, public SocketStream::Delegate {
|
| GURL GetURLForCookies() const;
|
|
|
| const AddressList& address_list() const;
|
| + int TrySpdyStream();
|
| void SetWaiting();
|
| bool IsWaiting() const;
|
| void Wakeup();
|
| - void DoCallback();
|
| + void DoCallback(int result);
|
|
|
| + void SendDataInternal(const char* data, int length);
|
| + void CloseInternal();
|
| void SendPending();
|
|
|
| SocketStream::Delegate* delegate_;
|
| @@ -114,6 +136,9 @@ class WebSocketJob : public SocketStreamJob, public SocketStream::Delegate {
|
| 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);
|
| };
|
|
|
|
|