From ab0a50979b9eb4dfa3320eff7e187e41efedf7a9 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 8 Aug 2014 14:30:41 +0200 Subject: Update Chromium to beta version 37.0.2062.68 Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca Reviewed-by: Andras Becsi --- .../websocket_handshake_stream_create_helper.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'chromium/net/websockets/websocket_handshake_stream_create_helper.h') diff --git a/chromium/net/websockets/websocket_handshake_stream_create_helper.h b/chromium/net/websockets/websocket_handshake_stream_create_helper.h index 31be2313ff7..648f8fd23fe 100644 --- a/chromium/net/websockets/websocket_handshake_stream_create_helper.h +++ b/chromium/net/websockets/websocket_handshake_stream_create_helper.h @@ -10,6 +10,7 @@ #include "net/base/net_export.h" #include "net/websockets/websocket_handshake_stream_base.h" +#include "net/websockets/websocket_stream.h" namespace net { @@ -22,7 +23,9 @@ namespace net { class NET_EXPORT_PRIVATE WebSocketHandshakeStreamCreateHelper : public WebSocketHandshakeStreamBase::CreateHelper { public: + // |connect_delegate| must out-live this object. explicit WebSocketHandshakeStreamCreateHelper( + WebSocketStream::ConnectDelegate* connect_delegate, const std::vector& requested_subprotocols); virtual ~WebSocketHandshakeStreamCreateHelper(); @@ -42,17 +45,30 @@ class NET_EXPORT_PRIVATE WebSocketHandshakeStreamCreateHelper // Return the WebSocketHandshakeStreamBase object that we created. In the case // where CreateBasicStream() was called more than once, returns the most // recent stream, which will be the one on which the handshake succeeded. + // It is not safe to call this if the handshake failed. WebSocketHandshakeStreamBase* stream() { return stream_; } + // Set a pointer to the std::string into which to write any failure messages + // that are encountered. This method must be called before CreateBasicStream() + // or CreateSpdyStream(). The |failure_message| pointer must remain valid as + // long as this object exists. + void set_failure_message(std::string* failure_message) { + failure_message_ = failure_message; + } + private: const std::vector requested_subprotocols_; // This is owned by the caller of CreateBaseStream() or // CreateSpdyStream(). Both the stream and this object will be destroyed // during the destruction of the URLRequest object associated with the - // handshake. + // handshake. This is only guaranteed to be a valid pointer if the handshake + // succeeded. WebSocketHandshakeStreamBase* stream_; + WebSocketStream::ConnectDelegate* connect_delegate_; + std::string* failure_message_; + DISALLOW_COPY_AND_ASSIGN(WebSocketHandshakeStreamCreateHelper); }; -- cgit v1.2.3