Index: webkit/child/websocket_handle_bridge.h |
diff --git a/webkit/child/websocket_handle_bridge.h b/webkit/child/websocket_handle_bridge.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8466580c051603d15335197acf03bc6e44aaf645 |
--- /dev/null |
+++ b/webkit/child/websocket_handle_bridge.h |
@@ -0,0 +1,51 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef WEBKIT_CHILD_WEBSOCKET_HANDLE_BRIDGE_H_ |
+#define WEBKIT_CHILD_WEBSOCKET_HANDLE_BRIDGE_H_ |
+ |
+#include <string> |
+#include <vector> |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/ref_counted.h" |
+ |
+class GURL; |
+ |
+namespace webkit_glue { |
+class WebSocketHandleDelegate; |
+ |
+class WebSocketHandleBridge |
+ : public base::RefCountedThreadSafe<WebSocketHandleBridge> { |
+ public: |
+ enum MessageType { |
+ MESSAGE_TYPE_CONTINUATION, |
+ MESSAGE_TYPE_TEXT, |
+ MESSAGE_TYPE_BINARY, |
+ }; |
+ |
+ virtual void Connect(const GURL& url, |
+ const std::vector<std::string>& protocols, |
+ const GURL& origin, |
+ WebSocketHandleDelegate* delegate) = 0; |
+ virtual void Send(bool fin, |
+ MessageType type, |
+ const char* data, |
+ size_t size) = 0; |
+ virtual void FlowControl(int64_t quota) = 0; |
+ virtual void Close(unsigned short code, const std::string& reason) = 0; |
+ virtual void Disconnect() = 0; |
+ |
+ protected: |
+ friend class base::RefCountedThreadSafe<WebSocketHandleBridge>; |
+ WebSocketHandleBridge() {} |
+ virtual ~WebSocketHandleBridge() {} |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(WebSocketHandleBridge); |
+}; |
+ |
+} // namespace webkit_glue |
+ |
+#endif // WEBKIT_CHILD_WEBSOCKET_HANDLE_BRIDGE_H_ |