Fail WebSocket channel when handshake fails.

Call WebSocketMsg_NotifyFailure instead of
WebSocketMsg_AddChannelResponse(true, ...) when the opening handshake fails.

BUG=310405
[email protected]

Review URL: https://codereview.chromium.org/105833003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243835 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/websockets/websocket_event_interface.h b/net/websockets/websocket_event_interface.h
index baba88c..9ca96f6 100644
--- a/net/websockets/websocket_event_interface.h
+++ b/net/websockets/websocket_event_interface.h
@@ -71,6 +71,16 @@
   virtual ChannelState OnDropChannel(uint16 code, const std::string& reason)
       WARN_UNUSED_RESULT = 0;
 
+  // Called when the browser fails the channel, as specified in the spec.
+  //
+  // The channel should not be used again after OnFailChannel() has been
+  // called.
+  //
+  // This method returns a ChannelState for consistency, but all implementations
+  // must delete the Channel and return CHANNEL_DELETED.
+  virtual ChannelState OnFailChannel(const std::string& message)
+      WARN_UNUSED_RESULT = 0;
+
  protected:
   WebSocketEventInterface() {}