summaryrefslogtreecommitdiffstats
path: root/chromium/net/websockets/websocket_handshake_stream_create_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/websockets/websocket_handshake_stream_create_helper.h')
-rw-r--r--chromium/net/websockets/websocket_handshake_stream_create_helper.h18
1 files changed, 17 insertions, 1 deletions
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<std::string>& 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<std::string> 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);
};