OLD | NEW |
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 Loading... |
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_ |
OLD | NEW |