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

Unified Diff: net/websockets/websocket_stream_base.h

Issue 14813024: Introduce RequestWebSocketStream into HttpStreamFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 7 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
« net/socket/socket_test_util.cc ('K') | « net/socket/socket_test_util.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_stream_base.h
diff --git a/net/websockets/websocket_stream_base.h b/net/websockets/websocket_stream_base.h
new file mode 100644
index 0000000000000000000000000000000000000000..2dbb6cca53b5d3fb72e44d61bba28dce5c63a99e
--- /dev/null
+++ b/net/websockets/websocket_stream_base.h
@@ -0,0 +1,55 @@
+// 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 NET_WEBSOCKETS_WEBSOCKET_STREAM_BASE_H_
+#define NET_WEBSOCKETS_WEBSOCKET_STREAM_BASE_H_
+
+// This file is included from net/http files.
+// Since net/http can be built without linking net/websockets code,
+// you should not introduce dependency to net/websockets in this file.
mmenke 2013/06/03 21:10:18 nit: Don't use "you" in comments. Can use passiv
yhirano 2013/06/04 02:20:13 Done.
+
+#include <base/basictypes.h>
+
+namespace net {
+
+class ClientSocketHandle;
+class SpdySession;
+class WebSocketStream;
+
+// WebSocketStreamBase is the base class of WebSocketStream.
+// net/http code uses this interface to handle WebSocketStream.
+class WebSocketStreamBase {
+ public:
+ class Factory {
+ public:
+ virtual ~Factory() {}
+
+ // Create a WebSocketBasicStream.
+ // This function (or the returned object) takes the ownership
+ // of |connection|.
+ virtual WebSocketStreamBase* CreateBasicStream(
+ ClientSocketHandle* connection,
+ bool using_proxy) = 0;
+
+ // Create a WebSocketSpdyStream.
+ virtual WebSocketStreamBase* CreateSpdyStream(
+ SpdySession* session,
+ bool use_relative_url) = 0;
+ };
+
+ virtual ~WebSocketStreamBase() {}
+
+ // Return this object as WebSocketStream.
+ virtual WebSocketStream* AsWebSocketStream() = 0;
+
+ protected:
+ WebSocketStreamBase() {}
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(WebSocketStreamBase);
+};
+
+} // namespace net
+
+#endif // NET_WEBSOCKETS_WEBSOCKET_STREAM_BASE_H_
« net/socket/socket_test_util.cc ('K') | « net/socket/socket_test_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698