Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1815)

Unified Diff: net/websockets/websocket_event_interface.h

Issue 304093003: Support recovery from SSL errors for new WebSocket implementation (Closed) Base URL: http://git.chromium.org/chromium/src.git@master-for-pool-throttling
Patch Set: clang compile fix. Also lint & format cleanups. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/websockets/websocket_event_interface.h
diff --git a/net/websockets/websocket_event_interface.h b/net/websockets/websocket_event_interface.h
index 923581a43a63297d59c11b8890049cf6dd8859df..d32a7c131cfec0adc38c523ad27b8cbfabc6c815 100644
--- a/net/websockets/websocket_event_interface.h
+++ b/net/websockets/websocket_event_interface.h
@@ -12,8 +12,11 @@
#include "base/compiler_specific.h" // for WARN_UNUSED_RESULT
#include "net/base/net_export.h"
+class GURL;
+
namespace net {
+class SSLInfo;
struct WebSocketHandshakeRequestInfo;
struct WebSocketHandshakeResponseInfo;
@@ -99,6 +102,32 @@ class NET_EXPORT WebSocketEventInterface {
scoped_ptr<WebSocketHandshakeResponseInfo> response)
WARN_UNUSED_RESULT = 0;
+ // Callbacks to be used in response to a call to OnSSLCertificateError. Very
+ // similar to content::SSLErrorHandler::Delegate (which we can't use directly
+ // due to layering constraints).
+ class NET_EXPORT SSLErrorCallbacks {
+ public:
+ virtual ~SSLErrorCallbacks() {}
+
+ // Cancels the SSL response in response to the error.
+ virtual void CancelSSLRequest(int error, const SSLInfo* ssl_info) = 0;
+
+ // Continue with the SSL connection despite the error.
+ virtual void ContinueSSLRequest() = 0;
+ };
+
+ // Called on SSL Certificate Error during the SSL handshake. Should result in
+ // a call to either ssl_error_callbacks->ContinueSSLRequest() or
+ // ssl_error_callbacks->CancelSSLRequest(). Normally the implementation of
+ // this method will delegate to content::SSLManager::OnSSLCertificateError to
+ // make the actual decision. The callbacks must not be called after the
+ // WebSocketChannel has been destroyed.
+ virtual ChannelState OnSSLCertificateError(
+ scoped_ptr<SSLErrorCallbacks> ssl_error_callbacks,
+ const GURL& url,
+ const SSLInfo& ssl_info,
+ bool fatal) WARN_UNUSED_RESULT = 0;
+
protected:
WebSocketEventInterface() {}

Powered by Google App Engine
This is Rietveld 408576698