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

Unified Diff: mojo/services/public/interfaces/network/web_socket.mojom

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/public/interfaces/network/network_service.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/public/interfaces/network/web_socket.mojom
diff --git a/mojo/services/public/interfaces/network/web_socket.mojom b/mojo/services/public/interfaces/network/web_socket.mojom
new file mode 100644
index 0000000000000000000000000000000000000000..0e3b42ad5d7c0e9fcb07adf9c706027227219918
--- /dev/null
+++ b/mojo/services/public/interfaces/network/web_socket.mojom
@@ -0,0 +1,46 @@
+// 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.
+
+import "mojo/services/public/interfaces/network/network_error.mojom"
+
+module mojo {
+
+interface WebSocket {
+ enum MessageType {
+ CONTINUATION,
+ TEXT,
+ BINARY
+ };
+ const int16 kAbnormalCloseCode = 1006; // stolen from websocket_bridge
+
+ Connect(
+ string url, string[] protocols, string origin, WebSocketClient client);
+ Send(bool fin, MessageType type, handle<data_pipe_consumer> data);
+ FlowControl(int64 quota);
+ Close(int16 code, string reason);
+};
+
+interface WebSocketClient {
+ DidConnect(bool fail, string selected_subprotocol, string extensions);
+ DidReceiveData(
+ bool fin, WebSocket.MessageType type, handle<data_pipe_consumer> data);
+ DidReceiveFlowControl(int64 quota);
+
+ // TODO(mpcomplete): add these methods from blink:
+ // void didStartOpeningHandshake(WebSocketHandle*, const
+ // WebSocketHandshakeRequestInfo&) = 0;
+ //
+ // void didFinishOpeningHandshake(WebSocketHandle*, const
+ // WebSocketHandshakeResponseInfo&) = 0;
+ //
+ // void didFail(WebSocketHandle* /* handle */, const WebString&
+ // message) = 0;
+ //
+ // void didClose(WebSocketHandle* /* handle */, bool wasClean,
+ // unsigned short code, const WebString& reason) = 0;
+ //
+ // void didStartClosingHandshake(WebSocketHandle*) = 0;
+};
+
+}
« no previous file with comments | « mojo/services/public/interfaces/network/network_service.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698