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 // Use the <code>chrome.dns</code> API for dns resolution. | 5 // Use the <code>chrome.dns</code> API for dns resolution. |
6 namespace dns { | 6 [use_movable_types=true] namespace dns { |
7 | 7 |
8 dictionary ResolveCallbackResolveInfo { | 8 dictionary ResolveCallbackResolveInfo { |
9 // The result code. Zero indicates success. | 9 // The result code. Zero indicates success. |
10 long resultCode; | 10 long resultCode; |
11 | 11 |
12 // A string representing the IP address literal. Supplied only if resultCode | 12 // A string representing the IP address literal. Supplied only if resultCode |
13 // indicates success. Note that we presently return only IPv4 addresses. | 13 // indicates success. Note that we presently return only IPv4 addresses. |
14 DOMString? address; | 14 DOMString? address; |
15 }; | 15 }; |
16 | 16 |
17 callback ResolveCallback = void (ResolveCallbackResolveInfo resolveInfo); | 17 callback ResolveCallback = void (ResolveCallbackResolveInfo resolveInfo); |
18 | 18 |
19 interface Functions { | 19 interface Functions { |
20 // Resolves the given hostname or IP address literal. | 20 // Resolves the given hostname or IP address literal. |
21 // |hostname| : The hostname to resolve. | 21 // |hostname| : The hostname to resolve. |
22 // |callback| : Called when the resolution operation completes. | 22 // |callback| : Called when the resolution operation completes. |
23 static void resolve(DOMString hostname, | 23 static void resolve(DOMString hostname, |
24 ResolveCallback callback); | 24 ResolveCallback callback); |
25 }; | 25 }; |
26 | 26 |
27 }; | 27 }; |
OLD | NEW |