OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 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 WEBKIT_CHILD_WEBSOCKET_HANDLE_BRIDGE_H_ |
| 6 #define WEBKIT_CHILD_WEBSOCKET_HANDLE_BRIDGE_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" |
| 13 |
| 14 class GURL; |
| 15 |
| 16 namespace webkit_glue { |
| 17 class WebSocketHandleDelegate; |
| 18 |
| 19 class WebSocketHandleBridge |
| 20 : public base::RefCountedThreadSafe<WebSocketHandleBridge> { |
| 21 public: |
| 22 enum MessageType { |
| 23 MESSAGE_TYPE_CONTINUATION, |
| 24 MESSAGE_TYPE_TEXT, |
| 25 MESSAGE_TYPE_BINARY, |
| 26 }; |
| 27 |
| 28 virtual void Connect(const GURL& url, |
| 29 const std::vector<std::string>& protocols, |
| 30 const GURL& origin, |
| 31 WebSocketHandleDelegate* delegate) = 0; |
| 32 virtual void Send(bool fin, |
| 33 MessageType type, |
| 34 const char* data, |
| 35 size_t size) = 0; |
| 36 virtual void FlowControl(int64_t quota) = 0; |
| 37 virtual void Close(unsigned short code, const std::string& reason) = 0; |
| 38 virtual void Disconnect() = 0; |
| 39 |
| 40 protected: |
| 41 friend class base::RefCountedThreadSafe<WebSocketHandleBridge>; |
| 42 WebSocketHandleBridge() {} |
| 43 virtual ~WebSocketHandleBridge() {} |
| 44 |
| 45 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(WebSocketHandleBridge); |
| 47 }; |
| 48 |
| 49 } // namespace webkit_glue |
| 50 |
| 51 #endif // WEBKIT_CHILD_WEBSOCKET_HANDLE_BRIDGE_H_ |
OLD | NEW |