summaryrefslogtreecommitdiffstats
path: root/chromium/net/websockets/websocket_stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/websockets/websocket_stream.h')
-rw-r--r--chromium/net/websockets/websocket_stream.h37
1 files changed, 32 insertions, 5 deletions
diff --git a/chromium/net/websockets/websocket_stream.h b/chromium/net/websockets/websocket_stream.h
index c08f8dc39b7..09f11b22f1a 100644
--- a/chromium/net/websockets/websocket_stream.h
+++ b/chromium/net/websockets/websocket_stream.h
@@ -14,9 +14,16 @@
#include "base/memory/scoped_vector.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
+#include "net/websockets/websocket_event_interface.h"
+#include "net/websockets/websocket_handshake_request_info.h"
+#include "net/websockets/websocket_handshake_response_info.h"
class GURL;
+namespace url {
+class Origin;
+} // namespace url
+
namespace net {
class BoundNetLog;
@@ -57,10 +64,26 @@ class NET_EXPORT_PRIVATE WebSocketStream {
// WebSocketStream.
virtual void OnSuccess(scoped_ptr<WebSocketStream> stream) = 0;
- // Called on failure to connect. The parameter is either one of the values
- // defined in net::WebSocketError, or an error defined by some WebSocket
- // extension protocol that we implement.
- virtual void OnFailure(unsigned short websocket_error) = 0;
+ // Called on failure to connect.
+ // |message| contains defails of the failure.
+ virtual void OnFailure(const std::string& message) = 0;
+
+ // Called when the WebSocket Opening Handshake starts.
+ virtual void OnStartOpeningHandshake(
+ scoped_ptr<WebSocketHandshakeRequestInfo> request) = 0;
+
+ // Called when the WebSocket Opening Handshake ends.
+ virtual void OnFinishOpeningHandshake(
+ scoped_ptr<WebSocketHandshakeResponseInfo> response) = 0;
+
+ // Called when there is an SSL certificate error. Should call
+ // ssl_error_callbacks->ContinueSSLRequest() or
+ // ssl_error_callbacks->CancelSSLRequest().
+ virtual void OnSSLCertificateError(
+ scoped_ptr<WebSocketEventInterface::SSLErrorCallbacks>
+ ssl_error_callbacks,
+ const SSLInfo& ssl_info,
+ bool fatal) = 0;
};
// Create and connect a WebSocketStream of an appropriate type. The actual
@@ -78,7 +101,7 @@ class NET_EXPORT_PRIVATE WebSocketStream {
static scoped_ptr<WebSocketStreamRequest> CreateAndConnectStream(
const GURL& socket_url,
const std::vector<std::string>& requested_subprotocols,
- const GURL& origin,
+ const url::Origin& origin,
URLRequestContext* url_request_context,
const BoundNetLog& net_log,
scoped_ptr<ConnectDelegate> connect_delegate);
@@ -125,6 +148,10 @@ class NET_EXPORT_PRIVATE WebSocketStream {
// calling callback.Run() (and any calling methods in the same object) must
// return immediately without any further method calls or access to member
// variables. Implementors should write test(s) for this case.
+ //
+ // Extensions which use reserved header bits should clear them when they are
+ // set correctly. If the reserved header bits are set incorrectly, it is okay
+ // to leave it to the caller to report the error.
virtual int ReadFrames(ScopedVector<WebSocketFrame>* frames,
const CompletionCallback& callback) = 0;