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

Unified Diff: mojo/services/network/web_socket_impl.h

Issue 515923003: Mojo: Add a WebSocket/Client interface and hook it up to the HTML viewer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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
« no previous file with comments | « mojo/services/network/network_service_impl.cc ('k') | mojo/services/network/web_socket_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/web_socket_impl.h
diff --git a/mojo/services/network/web_socket_impl.h b/mojo/services/network/web_socket_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..403203ef2fee2a22c6f59a2e6fb97d0453917c10
--- /dev/null
+++ b/mojo/services/network/web_socket_impl.h
@@ -0,0 +1,49 @@
+// Copyright 2014 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 MOJO_SERVICES_NETWORK_WEB_SOCKET_IMPL_H_
+#define MOJO_SERVICES_NETWORK_WEB_SOCKET_IMPL_H_
+
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "mojo/public/cpp/bindings/interface_impl.h"
+#include "mojo/services/public/interfaces/network/web_socket.mojom.h"
+
+namespace net {
+class WebSocketChannel;
+} // namespace net
+
+namespace mojo {
+class NetworkContext;
+
+// Forms a bridge between the WebSocket mojo interface and the net::WebSocket
+// implementation.
+class WebSocketImpl : public InterfaceImpl<WebSocket> {
+ public:
+ explicit WebSocketImpl(NetworkContext* context);
+ virtual ~WebSocketImpl();
+
+ private:
+ class PendingWriteToDataPipe;
+ class DependentIOBuffer;
+
+ // WebSocket methods:
+ virtual void Connect(const String& url,
+ Array<String> protocols,
+ const String& origin,
+ WebSocketClientPtr client) OVERRIDE;
+ virtual void Send(bool fin,
+ WebSocket::MessageType type,
+ ScopedDataPipeConsumerHandle data) OVERRIDE;
+ virtual void FlowControl(int64_t quota) OVERRIDE;
+ virtual void Close(int16_t code, const String& reason) OVERRIDE;
+
+ // The channel we use to send events to the network.
+ scoped_ptr<net::WebSocketChannel> channel_;
+ NetworkContext* context_;
+};
+
+} // namespace mojo
+
+#endif // MOJO_SERVICES_NETWORK_WEB_SOCKET_IMPL_H_
« no previous file with comments | « mojo/services/network/network_service_impl.cc ('k') | mojo/services/network/web_socket_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698