Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: webkit/child/websocket_handle_bridge.h

Issue 22815034: Introduce webkit_glue bridges for the new WebSocket Implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698