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

Side by Side Diff: mojo/dart/embedder/io/internet_address_patch.dart

Issue 1529423002: Dart: Fix conversion of identifiers to lowerCamelCase. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Comments Created 5 years 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 | « examples/dart/netcat/lib/main.dart ('k') | mojo/dart/embedder/io/mojo_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 // 5 //
6 // Implementation of InternetAddress for Mojo. 6 // Implementation of InternetAddress for Mojo.
7 // 7 //
8 8
9 patch class InternetAddress { 9 patch class InternetAddress {
10 /* patch */ static InternetAddress get LOOPBACK_IP_V4 { 10 /* patch */ static InternetAddress get LOOPBACK_IP_V4 {
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 // TODO(johnmccutchan): This should be implemented in Dart. 182 // TODO(johnmccutchan): This should be implemented in Dart.
183 static Uint8List _parse(String address) native "InternetAddress_Parse"; 183 static Uint8List _parse(String address) native "InternetAddress_Parse";
184 } 184 }
185 185
186 NetAddressFamily _internetAddressTypeToAddressFamily(InternetAddressType type) { 186 NetAddressFamily _internetAddressTypeToAddressFamily(InternetAddressType type) {
187 if (type == null) { 187 if (type == null) {
188 return NetAddressFamily.unspecified; 188 return NetAddressFamily.unspecified;
189 } 189 }
190 if (type == InternetAddressType.IP_V4) { 190 if (type == InternetAddressType.IP_V4) {
191 return NetAddressFamily.ipV4; 191 return NetAddressFamily.ipv4;
192 } else if (type == InternetAddressType.IP_V6) { 192 } else if (type == InternetAddressType.IP_V6) {
193 return NetAddressFamily.ipV6; 193 return NetAddressFamily.ipv6;
194 } 194 }
195 return NetAddressFamily.unspecified; 195 return NetAddressFamily.unspecified;
196 } 196 }
197 197
198 class _MojoInternetAddress { 198 class _MojoInternetAddress {
199 static Future _lookup(String host, InternetAddressType type) async { 199 static Future _lookup(String host, InternetAddressType type) async {
200 HostResolverProxy hostResolver = _getHostResolver(); 200 HostResolverProxy hostResolver = _getHostResolver();
201 var family = _internetAddressTypeToAddressFamily(type); 201 var family = _internetAddressTypeToAddressFamily(type);
202 var response = await hostResolver.ptr.getHostAddresses(host, family); 202 var response = await hostResolver.ptr.getHostAddresses(host, family);
203 _NetworkService._throwOnError(response.result); 203 _NetworkService._throwOnError(response.result);
204 var numAddresses = response.addresses.length; 204 var numAddresses = response.addresses.length;
205 var r = new List(numAddresses); 205 var r = new List(numAddresses);
206 for (var i = 0; i < numAddresses; i++) { 206 for (var i = 0; i < numAddresses; i++) {
207 r[i] = _NetworkServiceCodec._fromNetAddress(response.addresses[i]); 207 r[i] = _NetworkServiceCodec._fromNetAddress(response.addresses[i]);
208 } 208 }
209 return r; 209 return r;
210 } 210 }
211 } 211 }
OLDNEW
« no previous file with comments | « examples/dart/netcat/lib/main.dart ('k') | mojo/dart/embedder/io/mojo_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698