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

Side by Side Diff: net/websockets/websocket_event_interface.h

Issue 105833003: Fail WebSocket channel when handshake fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_ 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_
6 #define NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_ 6 #define NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // attackers attempting to use WebSockets to probe networks. 64 // attackers attempting to use WebSockets to probe networks.
65 // 65 //
66 // The channel should not be used again after OnDropChannel() has been 66 // The channel should not be used again after OnDropChannel() has been
67 // called. 67 // called.
68 // 68 //
69 // This method returns a ChannelState for consistency, but all implementations 69 // This method returns a ChannelState for consistency, but all implementations
70 // must delete the Channel and return CHANNEL_DELETED. 70 // must delete the Channel and return CHANNEL_DELETED.
71 virtual ChannelState OnDropChannel(uint16 code, const std::string& reason) 71 virtual ChannelState OnDropChannel(uint16 code, const std::string& reason)
72 WARN_UNUSED_RESULT = 0; 72 WARN_UNUSED_RESULT = 0;
73 73
74 // Called when the browser fails the channel, as specified in the spec.
75 //
76 // The channel should not be used again after OnFailChannel() has been
77 // called.
78 //
79 // This method returns a ChannelState for consistency, but all implementations
80 // must delete the Channel and return CHANNEL_DELETED.
81 virtual ChannelState OnFailChannel(const std::string& message)
82 WARN_UNUSED_RESULT = 0;
83
74 protected: 84 protected:
75 WebSocketEventInterface() {} 85 WebSocketEventInterface() {}
76 86
77 private: 87 private:
78 DISALLOW_COPY_AND_ASSIGN(WebSocketEventInterface); 88 DISALLOW_COPY_AND_ASSIGN(WebSocketEventInterface);
79 }; 89 };
80 90
81 } // namespace net 91 } // namespace net
82 92
83 #endif // NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_ 93 #endif // NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_
OLDNEW
« no previous file with comments | « net/websockets/websocket_channel_test.cc ('k') | net/websockets/websocket_handshake_stream_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698