diff options
author | ricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-28 09:35:41 +0000 |
---|---|---|
committer | ricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-28 09:35:41 +0000 |
commit | f4533ba8c4dbce9f5bc35a0da3fe08c5f4ed0501 (patch) | |
tree | 33903cd7e19e38204faa3c7f56fe1050bd6fe57f /net/websockets/websocket_handshake_stream_base.h | |
parent | 91cd4febe4c959d8256341e25a59a4d9dca9ca69 (diff) | |
download | chromium_src-f4533ba8c4dbce9f5bc35a0da3fe08c5f4ed0501.zip chromium_src-f4533ba8c4dbce9f5bc35a0da3fe08c5f4ed0501.tar.gz chromium_src-f4533ba8c4dbce9f5bc35a0da3fe08c5f4ed0501.tar.bz2 |
Add WebSocket handshake support to UrlRequestHttpJob, by supporting ws: and wss: protocols and passing the WebSocketStreamFactory through to HttpNetworkTransaction.
BUG=315027
TEST=net_unittests --gtest_filter=URLRequestHttpJob*
Review URL: https://codereview.chromium.org/23500007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/websockets/websocket_handshake_stream_base.h')
-rw-r--r-- | net/websockets/websocket_handshake_stream_base.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/websockets/websocket_handshake_stream_base.h b/net/websockets/websocket_handshake_stream_base.h index 60e55bd..a003bfe 100644 --- a/net/websockets/websocket_handshake_stream_base.h +++ b/net/websockets/websocket_handshake_stream_base.h @@ -12,7 +12,9 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" +#include "base/supports_user_data.h" #include "net/http/http_stream_base.h" +#include "net/url_request/websocket_handshake_userdata_key.h" #include "net/websockets/websocket_stream.h" namespace net { @@ -26,8 +28,13 @@ class SpdySession; // HttpStreamBase. class NET_EXPORT WebSocketHandshakeStreamBase : public HttpStreamBase { public: - class CreateHelper { + class CreateHelper : public base::SupportsUserData::Data { public: + // Returns a key to use to lookup this object in a URLRequest object. It is + // different from any other key that is supplied to + // URLRequest::SetUserData(). + static const void* DataKey() { return kWebSocketHandshakeUserDataKey; } + virtual ~CreateHelper() {} // Create a WebSocketBasicHandshakeStream. This is called after the @@ -43,6 +50,8 @@ class NET_EXPORT WebSocketHandshakeStreamBase : public HttpStreamBase { bool use_relative_url) = 0; }; + // This has to have an inline implementation so that the net/url_request/ + // tests do not fail on iOS. virtual ~WebSocketHandshakeStreamBase() {} // After the handshake has completed, this method creates a WebSocketStream @@ -52,6 +61,7 @@ class NET_EXPORT WebSocketHandshakeStreamBase : public HttpStreamBase { virtual scoped_ptr<WebSocketStream> Upgrade() = 0; protected: + // As with the destructor, this must be inline. WebSocketHandshakeStreamBase() {} private: |