OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 library icu_data_mojom; | 5 library icu_data_mojom; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:mojo/bindings.dart' as bindings; | 9 import 'package:mojo/bindings.dart' as bindings; |
10 import 'package:mojo/core.dart' as core; | 10 import 'package:mojo/core.dart' as core; |
| 11 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 12 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
11 | 13 |
12 | 14 |
13 | 15 |
14 class _IcuDataMapParams extends bindings.Struct { | 16 class _IcuDataMapParams extends bindings.Struct { |
15 static const List<bindings.StructDataHeader> kVersions = const [ | 17 static const List<bindings.StructDataHeader> kVersions = const [ |
16 const bindings.StructDataHeader(16, 0) | 18 const bindings.StructDataHeader(16, 0) |
17 ]; | 19 ]; |
18 String sha1hash = null; | 20 String sha1hash = null; |
19 | 21 |
20 _IcuDataMapParams() : super(kVersions.last.size); | 22 _IcuDataMapParams() : super(kVersions.last.size); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 73 } |
72 | 74 |
73 Map toJson() { | 75 Map toJson() { |
74 Map map = new Map(); | 76 Map map = new Map(); |
75 map["sha1hash"] = sha1hash; | 77 map["sha1hash"] = sha1hash; |
76 return map; | 78 return map; |
77 } | 79 } |
78 } | 80 } |
79 | 81 |
80 | 82 |
| 83 |
| 84 |
81 class IcuDataMapResponseParams extends bindings.Struct { | 85 class IcuDataMapResponseParams extends bindings.Struct { |
82 static const List<bindings.StructDataHeader> kVersions = const [ | 86 static const List<bindings.StructDataHeader> kVersions = const [ |
83 const bindings.StructDataHeader(16, 0) | 87 const bindings.StructDataHeader(16, 0) |
84 ]; | 88 ]; |
85 core.MojoSharedBuffer icuData = null; | 89 core.MojoSharedBuffer icuData = null; |
86 | 90 |
87 IcuDataMapResponseParams() : super(kVersions.last.size); | 91 IcuDataMapResponseParams() : super(kVersions.last.size); |
88 | 92 |
89 static IcuDataMapResponseParams deserialize(bindings.Message message) { | 93 static IcuDataMapResponseParams deserialize(bindings.Message message) { |
90 var decoder = new bindings.Decoder(message); | 94 var decoder = new bindings.Decoder(message); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 return "IcuDataMapResponseParams(" | 140 return "IcuDataMapResponseParams(" |
137 "icuData: $icuData" ")"; | 141 "icuData: $icuData" ")"; |
138 } | 142 } |
139 | 143 |
140 Map toJson() { | 144 Map toJson() { |
141 throw new bindings.MojoCodecError( | 145 throw new bindings.MojoCodecError( |
142 'Object containing handles cannot be encoded to JSON.'); | 146 'Object containing handles cannot be encoded to JSON.'); |
143 } | 147 } |
144 } | 148 } |
145 | 149 |
| 150 |
| 151 |
| 152 |
146 const int _IcuData_mapName = 0; | 153 const int _IcuData_mapName = 0; |
147 | 154 |
| 155 |
| 156 |
| 157 class _IcuDataServiceDescription implements service_describer.ServiceDescription
{ |
| 158 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 159 |
| 160 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 161 |
| 162 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 163 } |
| 164 |
148 abstract class IcuData { | 165 abstract class IcuData { |
149 static const String serviceName = "icu_data::ICUData"; | 166 static const String serviceName = "icu_data::ICUData"; |
150 dynamic map(String sha1hash,[Function responseFactory = null]); | 167 dynamic map(String sha1hash,[Function responseFactory = null]); |
151 } | 168 } |
152 | 169 |
153 | 170 |
154 class _IcuDataProxyImpl extends bindings.Proxy { | 171 class _IcuDataProxyImpl extends bindings.Proxy { |
155 _IcuDataProxyImpl.fromEndpoint( | 172 _IcuDataProxyImpl.fromEndpoint( |
156 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 173 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
157 | 174 |
158 _IcuDataProxyImpl.fromHandle(core.MojoHandle handle) : | 175 _IcuDataProxyImpl.fromHandle(core.MojoHandle handle) : |
159 super.fromHandle(handle); | 176 super.fromHandle(handle); |
160 | 177 |
161 _IcuDataProxyImpl.unbound() : super.unbound(); | 178 _IcuDataProxyImpl.unbound() : super.unbound(); |
162 | 179 |
163 static _IcuDataProxyImpl newFromEndpoint( | 180 static _IcuDataProxyImpl newFromEndpoint( |
164 core.MojoMessagePipeEndpoint endpoint) { | 181 core.MojoMessagePipeEndpoint endpoint) { |
165 assert(endpoint.setDescription("For _IcuDataProxyImpl")); | 182 assert(endpoint.setDescription("For _IcuDataProxyImpl")); |
166 return new _IcuDataProxyImpl.fromEndpoint(endpoint); | 183 return new _IcuDataProxyImpl.fromEndpoint(endpoint); |
167 } | 184 } |
168 | 185 |
| 186 service_describer.ServiceDescription get serviceDescription => |
| 187 new _IcuDataServiceDescription(); |
| 188 |
169 void handleResponse(bindings.ServiceMessage message) { | 189 void handleResponse(bindings.ServiceMessage message) { |
170 switch (message.header.type) { | 190 switch (message.header.type) { |
171 case _IcuData_mapName: | 191 case _IcuData_mapName: |
172 var r = IcuDataMapResponseParams.deserialize( | 192 var r = IcuDataMapResponseParams.deserialize( |
173 message.payload); | 193 message.payload); |
174 if (!message.header.hasRequestId) { | 194 if (!message.header.hasRequestId) { |
175 proxyError("Expected a message with a valid request Id."); | 195 proxyError("Expected a message with a valid request Id."); |
176 return; | 196 return; |
177 } | 197 } |
178 Completer c = completerMap[message.header.requestId]; | 198 Completer c = completerMap[message.header.requestId]; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 assert(_impl == null); | 364 assert(_impl == null); |
345 _impl = d; | 365 _impl = d; |
346 } | 366 } |
347 | 367 |
348 String toString() { | 368 String toString() { |
349 var superString = super.toString(); | 369 var superString = super.toString(); |
350 return "IcuDataStub($superString)"; | 370 return "IcuDataStub($superString)"; |
351 } | 371 } |
352 | 372 |
353 int get version => 0; | 373 int get version => 0; |
| 374 |
| 375 service_describer.ServiceDescription get serviceDescription => |
| 376 new _IcuDataServiceDescription(); |
354 } | 377 } |
355 | 378 |
356 | 379 |
| 380 |
OLD | NEW |