| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_ |
| 6 #define NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 |
| 13 namespace net { |
| 14 |
| 15 class NET_EXPORT WebSocketEventInterface { |
| 16 public: |
| 17 typedef int WebSocketMessageType; |
| 18 virtual ~WebSocketEventInterface() {} |
| 19 virtual void OnAddChannelResponse(bool fail, |
| 20 const std::string& selected_protocol) = 0; |
| 21 virtual void OnSendFrame(bool fin, |
| 22 WebSocketMessageType type, |
| 23 const std::vector<char>& data) = 0; |
| 24 virtual void OnFlowControl(int64 quota) = 0; |
| 25 // Both the "reason" and "reason_text" are passed through to Javascript, so |
| 26 // care must be taken not to provide details that could be useful to attackers |
| 27 // attempting to use WebSockets to probe networks. |
| 28 virtual void OnDropChannel(unsigned short reason, |
| 29 const std::string& reason_text) = 0; |
| 30 |
| 31 protected: |
| 32 WebSocketEventInterface() {} |
| 33 |
| 34 private: |
| 35 DISALLOW_COPY_AND_ASSIGN(WebSocketEventInterface); |
| 36 }; |
| 37 |
| 38 } // namespace net |
| 39 |
| 40 #endif // NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_ |
| OLD | NEW |