Index: mojo/dart/packages/mojo_services/lib/mojo/web_socket.mojom.dart |
diff --git a/mojo/dart/packages/mojo_services/lib/mojo/web_socket.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/web_socket.mojom.dart |
index 53ddcaa3b69077024d1e6b30c814553e6ed2b587..69870b0ed077db4f7962ce4c1c941026c1d05138 100644 |
--- a/mojo/dart/packages/mojo_services/lib/mojo/web_socket.mojom.dart |
+++ b/mojo/dart/packages/mojo_services/lib/mojo/web_socket.mojom.dart |
@@ -8,6 +8,8 @@ import 'dart:async'; |
import 'package:mojo/bindings.dart' as bindings; |
import 'package:mojo/core.dart' as core; |
+import 'package:mojo/mojo/mojom_types.mojom.dart' as mojom_types; |
+import 'package:mojo/mojo/service_describer.mojom.dart' as service_describer; |
import 'package:mojo/mojo/network_error.mojom.dart' as network_error_mojom; |
@@ -125,6 +127,44 @@ class WebSocketConnectParams extends bindings.Struct { |
} |
} |
+mojom_types.MojomStruct _web_socket_WebSocket_Connect_Params__() { |
+ return new mojom_types.MojomStruct() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'WebSocketConnectParams') |
+ ..fields = <mojom_types.StructField>[ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Url') |
+ ..type = (new mojom_types.Type() |
+..stringType = (new mojom_types.StringType()..nullable = false)), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Protocols') |
+ ..type = (new mojom_types.Type()..arrayType = (new mojom_types.ArrayType() |
+ ..elementType = (new mojom_types.Type() |
+..stringType = (new mojom_types.StringType()..nullable = false)))), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Origin') |
+ ..type = (new mojom_types.Type() |
+..stringType = (new mojom_types.StringType()..nullable = false)), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'SendStream') |
+ ..type = (new mojom_types.Type() |
+..handleType = (new mojom_types.HandleType() |
+..kind = mojom_types.HandleTypeKind.DATA_PIPE_CONSUMER |
+..nullable = false)), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Client') |
+ ..type = (new mojom_types.Type() |
+ ..typeReference = (new mojom_types.TypeReference() |
+ |
+ ..identifier = '_web_socket_WebSocketClient__' |
+ ..typeKey = '_web_socket_WebSocketClient__' |
+ )), |
+ ]; |
+} |
+ |
class WebSocketSendParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
@@ -214,6 +254,29 @@ class WebSocketSendParams extends bindings.Struct { |
} |
} |
+mojom_types.MojomStruct _web_socket_WebSocket_Send_Params__() { |
+ return new mojom_types.MojomStruct() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'WebSocketSendParams') |
+ ..fields = <mojom_types.StructField>[ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Fin') |
+ ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.BOOL), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Type') |
+ ..type = (new mojom_types.Type() |
+ ..typeReference = (new mojom_types.TypeReference() |
+ |
+ ..identifier = '_web_socket_MessageType__' |
+ ..typeKey = '_web_socket_MessageType__' |
+ )), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'NumBytes') |
+ ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.UINT32), |
+ ]; |
+} |
+ |
class WebSocketFlowControlParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
@@ -281,6 +344,16 @@ class WebSocketFlowControlParams extends bindings.Struct { |
} |
} |
+mojom_types.MojomStruct _web_socket_WebSocket_FlowControl_Params__() { |
+ return new mojom_types.MojomStruct() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'WebSocketFlowControlParams') |
+ ..fields = <mojom_types.StructField>[ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Quota') |
+ ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.INT64), |
+ ]; |
+} |
+ |
class WebSocketCloseParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
@@ -357,6 +430,21 @@ class WebSocketCloseParams extends bindings.Struct { |
} |
} |
+mojom_types.MojomStruct _web_socket_WebSocket_Close_Params__() { |
+ return new mojom_types.MojomStruct() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'WebSocketCloseParams') |
+ ..fields = <mojom_types.StructField>[ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Code') |
+ ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.UINT16), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Reason') |
+ ..type = (new mojom_types.Type() |
+..stringType = (new mojom_types.StringType()..nullable = false)), |
+ ]; |
+} |
+ |
class WebSocketClientDidConnectParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
@@ -439,6 +527,29 @@ class WebSocketClientDidConnectParams extends bindings.Struct { |
} |
} |
+mojom_types.MojomStruct _web_socket_WebSocketClient_DidConnect_Params__() { |
+ return new mojom_types.MojomStruct() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'WebSocketClientDidConnectParams') |
+ ..fields = <mojom_types.StructField>[ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'SelectedSubprotocol') |
+ ..type = (new mojom_types.Type() |
+..stringType = (new mojom_types.StringType()..nullable = false)), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Extensions') |
+ ..type = (new mojom_types.Type() |
+..stringType = (new mojom_types.StringType()..nullable = false)), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'ReceiveStream') |
+ ..type = (new mojom_types.Type() |
+..handleType = (new mojom_types.HandleType() |
+..kind = mojom_types.HandleTypeKind.DATA_PIPE_CONSUMER |
+..nullable = false)), |
+ ]; |
+} |
+ |
class WebSocketClientDidReceiveDataParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
@@ -528,6 +639,29 @@ class WebSocketClientDidReceiveDataParams extends bindings.Struct { |
} |
} |
+mojom_types.MojomStruct _web_socket_WebSocketClient_DidReceiveData_Params__() { |
+ return new mojom_types.MojomStruct() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'WebSocketClientDidReceiveDataParams') |
+ ..fields = <mojom_types.StructField>[ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Fin') |
+ ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.BOOL), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Type') |
+ ..type = (new mojom_types.Type() |
+ ..typeReference = (new mojom_types.TypeReference() |
+ |
+ ..identifier = '_web_socket_MessageType__' |
+ ..typeKey = '_web_socket_MessageType__' |
+ )), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'NumBytes') |
+ ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.UINT32), |
+ ]; |
+} |
+ |
class WebSocketClientDidReceiveFlowControlParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
@@ -595,6 +729,16 @@ class WebSocketClientDidReceiveFlowControlParams extends bindings.Struct { |
} |
} |
+mojom_types.MojomStruct _web_socket_WebSocketClient_DidReceiveFlowControl_Params__() { |
+ return new mojom_types.MojomStruct() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'WebSocketClientDidReceiveFlowControlParams') |
+ ..fields = <mojom_types.StructField>[ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Quota') |
+ ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.INT64), |
+ ]; |
+} |
+ |
class WebSocketClientDidFailParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
@@ -662,6 +806,17 @@ class WebSocketClientDidFailParams extends bindings.Struct { |
} |
} |
+mojom_types.MojomStruct _web_socket_WebSocketClient_DidFail_Params__() { |
+ return new mojom_types.MojomStruct() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'WebSocketClientDidFailParams') |
+ ..fields = <mojom_types.StructField>[ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Message') |
+ ..type = (new mojom_types.Type() |
+..stringType = (new mojom_types.StringType()..nullable = false)), |
+ ]; |
+} |
+ |
class WebSocketClientDidCloseParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
@@ -747,6 +902,26 @@ class WebSocketClientDidCloseParams extends bindings.Struct { |
} |
} |
+mojom_types.MojomStruct _web_socket_WebSocketClient_DidClose_Params__() { |
+ return new mojom_types.MojomStruct() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'WebSocketClientDidCloseParams') |
+ ..fields = <mojom_types.StructField>[ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'WasClean') |
+ ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.BOOL), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Code') |
+ ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.UINT16), |
+ |
+ new mojom_types.StructField() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'Reason') |
+ ..type = (new mojom_types.Type() |
+..stringType = (new mojom_types.StringType()..nullable = false)), |
+ ]; |
+} |
+ |
+ |
const int kWebSocket_connect_name = 0; |
const int kWebSocket_send_name = 1; |
const int kWebSocket_flowControl_name = 2; |
@@ -805,12 +980,60 @@ const String WebSocketName = |
return 'WebSocketMessageType.TEXT'; |
case BINARY: |
return 'WebSocketMessageType.BINARY'; |
+ default: |
+ return null; |
} |
} |
int toJson() => value; |
} |
+mojom_types.MojomEnum _web_socket_MessageType__() { |
+ return new mojom_types.MojomEnum() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "WebSocketMessageType") |
+ ..values = <mojom_types.EnumValue>[new mojom_types.EnumValue() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "CONTINUATION") |
+ ..enumTypeKey = '_web_socket_MessageType__' |
+ ..intValue = 0,new mojom_types.EnumValue() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "TEXT") |
+ ..enumTypeKey = '_web_socket_MessageType__' |
+ ..intValue = 1,new mojom_types.EnumValue() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "BINARY") |
+ ..enumTypeKey = '_web_socket_MessageType__' |
+ ..intValue = 2,]; |
+} |
+ |
+mojom_types.MojomInterface _web_socket_WebSocket__() { |
+ return new mojom_types.MojomInterface() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "WebSocket") |
+ ..interfaceName = "WebSocket" |
+ ..methods = <int, mojom_types.MojomMethod>{ |
+kWebSocket_connect_name: new mojom_types.MojomMethod() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "Connect") |
+ ..ordinal = kWebSocket_connect_name..parameters = _web_socket_WebSocket_Connect_Params__(),kWebSocket_send_name: new mojom_types.MojomMethod() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "Send") |
+ ..ordinal = kWebSocket_send_name..parameters = _web_socket_WebSocket_Send_Params__(),kWebSocket_flowControl_name: new mojom_types.MojomMethod() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "FlowControl") |
+ ..ordinal = kWebSocket_flowControl_name..parameters = _web_socket_WebSocket_FlowControl_Params__(),kWebSocket_close_name: new mojom_types.MojomMethod() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "Close") |
+ ..ordinal = kWebSocket_close_name..parameters = _web_socket_WebSocket_Close_Params__(), |
+ }; |
+} |
+ |
+class _WebSocketServiceDescription extends service_describer.ServiceDescription { |
+ // Avoid infinite loop by overriding serviceDescription field. |
+ final service_describer.ServiceDescription serviceDescription = null; |
+dynamic getTopLevelInterface([Function responseFactory = null]) { |
+ return _web_socket_WebSocket__(); |
+ } |
+ dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
+ return getAllMojomTypeDefinitions()[typeKey]; |
+ } |
+ dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
+ return getAllMojomTypeDefinitions(); |
+ } |
+} |
+ |
abstract class WebSocket { |
void connect(String url, List<String> protocols, String origin, core.MojoDataPipeConsumer sendStream, Object client); |
void send(bool fin, WebSocketMessageType type, int numBytes); |
@@ -838,6 +1061,9 @@ class WebSocketProxyImpl extends bindings.Proxy { |
String get name => WebSocketName; |
+ service_describer.ServiceDescription get serviceDescription => |
+ new _WebSocketServiceDescription(); |
+ |
void handleResponse(bindings.ServiceMessage message) { |
switch (message.header.type) { |
default: |
@@ -1035,6 +1261,9 @@ class WebSocketStub extends bindings.Stub { |
} |
int get version => 0; |
+ |
+ service_describer.ServiceDescription get serviceDescription => |
+ new _WebSocketServiceDescription(); |
} |
const int kWebSocketClient_didConnect_name = 0; |
@@ -1046,6 +1275,39 @@ const int kWebSocketClient_didClose_name = 4; |
const String WebSocketClientName = |
'mojo::WebSocketClient'; |
+mojom_types.MojomInterface _web_socket_WebSocketClient__() { |
+ return new mojom_types.MojomInterface() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "WebSocketClient") |
+ ..interfaceName = "WebSocketClient" |
+ ..methods = <int, mojom_types.MojomMethod>{ |
+kWebSocketClient_didConnect_name: new mojom_types.MojomMethod() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "DidConnect") |
+ ..ordinal = kWebSocketClient_didConnect_name..parameters = _web_socket_WebSocketClient_DidConnect_Params__(),kWebSocketClient_didReceiveData_name: new mojom_types.MojomMethod() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "DidReceiveData") |
+ ..ordinal = kWebSocketClient_didReceiveData_name..parameters = _web_socket_WebSocketClient_DidReceiveData_Params__(),kWebSocketClient_didReceiveFlowControl_name: new mojom_types.MojomMethod() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "DidReceiveFlowControl") |
+ ..ordinal = kWebSocketClient_didReceiveFlowControl_name..parameters = _web_socket_WebSocketClient_DidReceiveFlowControl_Params__(),kWebSocketClient_didFail_name: new mojom_types.MojomMethod() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "DidFail") |
+ ..ordinal = kWebSocketClient_didFail_name..parameters = _web_socket_WebSocketClient_DidFail_Params__(),kWebSocketClient_didClose_name: new mojom_types.MojomMethod() |
+ ..declData = (new mojom_types.DeclarationData()..shortName = "DidClose") |
+ ..ordinal = kWebSocketClient_didClose_name..parameters = _web_socket_WebSocketClient_DidClose_Params__(), |
+ }; |
+} |
+ |
+class _WebSocketClientServiceDescription extends service_describer.ServiceDescription { |
+ // Avoid infinite loop by overriding serviceDescription field. |
+ final service_describer.ServiceDescription serviceDescription = null; |
+dynamic getTopLevelInterface([Function responseFactory = null]) { |
+ return _web_socket_WebSocketClient__(); |
+ } |
+ dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
+ return getAllMojomTypeDefinitions()[typeKey]; |
+ } |
+ dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
+ return getAllMojomTypeDefinitions(); |
+ } |
+} |
+ |
abstract class WebSocketClient { |
void didConnect(String selectedSubprotocol, String extensions, core.MojoDataPipeConsumer receiveStream); |
void didReceiveData(bool fin, WebSocketMessageType type, int numBytes); |
@@ -1073,6 +1335,9 @@ class WebSocketClientProxyImpl extends bindings.Proxy { |
String get name => WebSocketClientName; |
+ service_describer.ServiceDescription get serviceDescription => |
+ new _WebSocketClientServiceDescription(); |
+ |
void handleResponse(bindings.ServiceMessage message) { |
switch (message.header.type) { |
default: |
@@ -1284,6 +1549,143 @@ class WebSocketClientStub extends bindings.Stub { |
} |
int get version => 0; |
+ |
+ service_describer.ServiceDescription get serviceDescription => |
+ new _WebSocketClientServiceDescription(); |
+} |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+var _MojomDesc__ = _initDescriptions(); |
+ |
+Map<String, mojom_types.UserDefinedType> _initDescriptions() { |
+ var map = new Map<String, mojom_types.UserDefinedType>(); |
+ |
+ map["_web_socket_WebSocket_Connect_Params__"] = |
+ new mojom_types.UserDefinedType() |
+ ..structType = _web_socket_WebSocket_Connect_Params__(); |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ map["_web_socket_WebSocketClient__"] = |
+ new mojom_types.UserDefinedType() |
+ ..interfaceType = _web_socket_WebSocketClient__(); |
+ |
+ |
+ |
+ |
+ map["_web_socket_WebSocket_Send_Params__"] = |
+ new mojom_types.UserDefinedType() |
+ ..structType = _web_socket_WebSocket_Send_Params__(); |
+ |
+ |
+ |
+ |
+ map["_web_socket_MessageType__"] = |
+ new mojom_types.UserDefinedType() |
+ ..enumType = _web_socket_MessageType__(); |
+ |
+ |
+ |
+ |
+ |
+ |
+ map["_web_socket_WebSocket_FlowControl_Params__"] = |
+ new mojom_types.UserDefinedType() |
+ ..structType = _web_socket_WebSocket_FlowControl_Params__(); |
+ |
+ |
+ |
+ |
+ |
+ map["_web_socket_WebSocket_Close_Params__"] = |
+ new mojom_types.UserDefinedType() |
+ ..structType = _web_socket_WebSocket_Close_Params__(); |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ map["_web_socket_WebSocketClient_DidConnect_Params__"] = |
+ new mojom_types.UserDefinedType() |
+ ..structType = _web_socket_WebSocketClient_DidConnect_Params__(); |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ map["_web_socket_WebSocketClient_DidReceiveData_Params__"] = |
+ new mojom_types.UserDefinedType() |
+ ..structType = _web_socket_WebSocketClient_DidReceiveData_Params__(); |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ map["_web_socket_WebSocketClient_DidReceiveFlowControl_Params__"] = |
+ new mojom_types.UserDefinedType() |
+ ..structType = _web_socket_WebSocketClient_DidReceiveFlowControl_Params__(); |
+ |
+ |
+ |
+ |
+ |
+ map["_web_socket_WebSocketClient_DidFail_Params__"] = |
+ new mojom_types.UserDefinedType() |
+ ..structType = _web_socket_WebSocketClient_DidFail_Params__(); |
+ |
+ |
+ |
+ |
+ |
+ map["_web_socket_WebSocketClient_DidClose_Params__"] = |
+ new mojom_types.UserDefinedType() |
+ ..structType = _web_socket_WebSocketClient_DidClose_Params__(); |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ map["_web_socket_WebSocket__"] = |
+ new mojom_types.UserDefinedType() |
+ ..interfaceType = _web_socket_WebSocket__(); |
+ |
+ |
+ |
+network_error_mojom.getAllMojomTypeDefinitions().forEach((String s, mojom_types.UserDefinedType udt) { |
+ map[s] = udt; |
+}); |
+ return map; |
+} |
+ |
+Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
+ return _MojomDesc__; |
} |