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 net_address_mojom; | 5 library net_address_mojom; |
6 import 'package:mojo/bindings.dart' as bindings; | 6 import 'package:mojo/bindings.dart' as bindings; |
7 | 7 |
8 | 8 |
9 class NetAddressFamily extends bindings.MojoEnum { | 9 class NetAddressFamily extends bindings.MojoEnum { |
10 static const NetAddressFamily unspecified = const NetAddressFamily._(0); | 10 static const NetAddressFamily unspecified = const NetAddressFamily._(0); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 default: | 60 default: |
61 return null; | 61 return null; |
62 } | 62 } |
63 } | 63 } |
64 | 64 |
65 int toJson() => mojoEnumValue; | 65 int toJson() => mojoEnumValue; |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 | 69 |
70 | |
71 | |
72 class NetAddressIPv4 extends bindings.Struct { | 70 class NetAddressIPv4 extends bindings.Struct { |
73 static const List<bindings.StructDataHeader> kVersions = const [ | 71 static const List<bindings.StructDataHeader> kVersions = const [ |
74 const bindings.StructDataHeader(24, 0) | 72 const bindings.StructDataHeader(24, 0) |
75 ]; | 73 ]; |
76 int port = 0; | 74 int port = 0; |
77 List<int> addr = null; | 75 List<int> addr = null; |
78 | 76 |
79 NetAddressIPv4() : super(kVersions.last.size); | 77 NetAddressIPv4() : super(kVersions.last.size); |
80 | 78 |
81 static NetAddressIPv4 deserialize(bindings.Message message) { | 79 static NetAddressIPv4 deserialize(bindings.Message message) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 | 146 |
149 Map toJson() { | 147 Map toJson() { |
150 Map map = new Map(); | 148 Map map = new Map(); |
151 map["port"] = port; | 149 map["port"] = port; |
152 map["addr"] = addr; | 150 map["addr"] = addr; |
153 return map; | 151 return map; |
154 } | 152 } |
155 } | 153 } |
156 | 154 |
157 | 155 |
158 | |
159 | |
160 class NetAddressIPv6 extends bindings.Struct { | 156 class NetAddressIPv6 extends bindings.Struct { |
161 static const List<bindings.StructDataHeader> kVersions = const [ | 157 static const List<bindings.StructDataHeader> kVersions = const [ |
162 const bindings.StructDataHeader(24, 0) | 158 const bindings.StructDataHeader(24, 0) |
163 ]; | 159 ]; |
164 int port = 0; | 160 int port = 0; |
165 List<int> addr = null; | 161 List<int> addr = null; |
166 | 162 |
167 NetAddressIPv6() : super(kVersions.last.size); | 163 NetAddressIPv6() : super(kVersions.last.size); |
168 | 164 |
169 static NetAddressIPv6 deserialize(bindings.Message message) { | 165 static NetAddressIPv6 deserialize(bindings.Message message) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 232 |
237 Map toJson() { | 233 Map toJson() { |
238 Map map = new Map(); | 234 Map map = new Map(); |
239 map["port"] = port; | 235 map["port"] = port; |
240 map["addr"] = addr; | 236 map["addr"] = addr; |
241 return map; | 237 return map; |
242 } | 238 } |
243 } | 239 } |
244 | 240 |
245 | 241 |
246 | |
247 | |
248 class NetAddress extends bindings.Struct { | 242 class NetAddress extends bindings.Struct { |
249 static const List<bindings.StructDataHeader> kVersions = const [ | 243 static const List<bindings.StructDataHeader> kVersions = const [ |
250 const bindings.StructDataHeader(32, 0) | 244 const bindings.StructDataHeader(32, 0) |
251 ]; | 245 ]; |
252 NetAddressFamily family = new NetAddressFamily(0); | 246 NetAddressFamily family = new NetAddressFamily(0); |
253 NetAddressIPv4 ipv4 = null; | 247 NetAddressIPv4 ipv4 = null; |
254 NetAddressIPv6 ipv6 = null; | 248 NetAddressIPv6 ipv6 = null; |
255 | 249 |
256 NetAddress() : super(kVersions.last.size); | 250 NetAddress() : super(kVersions.last.size); |
257 | 251 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 Map map = new Map(); | 339 Map map = new Map(); |
346 map["family"] = family; | 340 map["family"] = family; |
347 map["ipv4"] = ipv4; | 341 map["ipv4"] = ipv4; |
348 map["ipv6"] = ipv6; | 342 map["ipv6"] = ipv6; |
349 return map; | 343 return map; |
350 } | 344 } |
351 } | 345 } |
352 | 346 |
353 | 347 |
354 | 348 |
355 | |
356 | |
357 | |
OLD | NEW |