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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 // Called when the remote server has Started the WebSocket Closing | 44 // Called when the remote server has Started the WebSocket Closing |
45 // Handshake. The client should not attempt to send any more messages after | 45 // Handshake. The client should not attempt to send any more messages after |
46 // receiving this message. It will be followed by OnDropChannel() when the | 46 // receiving this message. It will be followed by OnDropChannel() when the |
47 // closing handshake is complete. It is not safe to delete the | 47 // closing handshake is complete. It is not safe to delete the |
48 // WebSocketChannel from within this callback. | 48 // WebSocketChannel from within this callback. |
49 virtual void OnClosingHandshake() = 0; | 49 virtual void OnClosingHandshake() = 0; |
50 | 50 |
51 // Called when the channel has been dropped, either due to a network close, a | 51 // Called when the channel has been dropped, either due to a network close, a |
52 // network error, or a protocol error. This may or may not be preceeded by a | 52 // network error, or a protocol error. This may or may not be preceeded by a |
53 // call to OnClosingHandshake(). | 53 // call to OnClosingHandshake(). |
54 // |fail| is true if the user agent is required to fail the connection. | |
Adam Rice
2013/10/23 03:18:06
I have just realised we may need more information
tyoshino (SeeGerritForStatus)
2013/10/23 05:21:34
I think yes. But basically we should focus on keep
yhirano
2013/10/23 05:42:23
You are right.
IIUC "close with prejudice" occurs
| |
54 // | 55 // |
55 // Warning: Both the |code| and |reason| are passed through to Javascript, so | 56 // Warning: Both the |code| and |reason| are passed through to Javascript, so |
56 // callers must take care not to provide details that could be useful to | 57 // callers must take care not to provide details that could be useful to |
57 // attackers attempting to use WebSockets to probe networks. | 58 // attackers attempting to use WebSockets to probe networks. |
58 // | 59 // |
59 // The channel should not be used again after OnDropChannel() has been | 60 // The channel should not be used again after OnDropChannel() has been |
60 // called. | 61 // called. |
61 // | 62 // |
62 // It is not safe to delete the WebSocketChannel from within this | 63 // It is not safe to delete the WebSocketChannel from within this |
63 // callback. It is recommended to delete the channel after returning to the | 64 // callback. It is recommended to delete the channel after returning to the |
64 // event loop. | 65 // event loop. |
65 virtual void OnDropChannel(uint16 code, const std::string& reason) = 0; | 66 virtual void OnDropChannel(bool fail, |
67 uint16 code, | |
68 const std::string& reason) = 0; | |
66 | 69 |
67 protected: | 70 protected: |
68 WebSocketEventInterface() {} | 71 WebSocketEventInterface() {} |
69 | 72 |
70 private: | 73 private: |
71 DISALLOW_COPY_AND_ASSIGN(WebSocketEventInterface); | 74 DISALLOW_COPY_AND_ASSIGN(WebSocketEventInterface); |
72 }; | 75 }; |
73 | 76 |
74 } // namespace net | 77 } // namespace net |
75 | 78 |
76 #endif // NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_ | 79 #endif // NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_ |
OLD | NEW |