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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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 MOJO_SERVICES_NETWORK_WEB_SOCKET_IMPL_H_
6 #define MOJO_SERVICES_NETWORK_WEB_SOCKET_IMPL_H_
7
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "mojo/public/cpp/bindings/interface_impl.h"
11 #include "mojo/services/public/interfaces/network/web_socket.mojom.h"
12
13 namespace net {
14 class WebSocketChannel;
15 } // namespace net
16
17 namespace mojo {
18 class NetworkContext;
19
20 // Forms a bridge between the WebSocket mojo interface and the net::WebSocket
21 // implementation.
22 class WebSocketImpl : public InterfaceImpl<WebSocket> {
23 public:
24 explicit WebSocketImpl(NetworkContext* context);
25 virtual ~WebSocketImpl();
26
27 private:
28 class PendingWriteToDataPipe;
29 class DependentIOBuffer;
30
31 // WebSocket methods:
32 virtual void Connect(const String& url,
33 Array<String> protocols,
34 const String& origin,
35 WebSocketClientPtr client) OVERRIDE;
36 virtual void Send(bool fin,
37 WebSocket::MessageType type,
38 ScopedDataPipeConsumerHandle data) OVERRIDE;
39 virtual void FlowControl(int64_t quota) OVERRIDE;
40 virtual void Close(int16_t code, const String& reason) OVERRIDE;
41
42 // The channel we use to send events to the network.
43 scoped_ptr<net::WebSocketChannel> channel_;
44 NetworkContext* context_;
45 };
46
47 } // namespace mojo
48
49 #endif // MOJO_SERVICES_NETWORK_WEB_SOCKET_IMPL_H_
OLDNEW
« 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