Index: net/interfaces/host_resolver_service.mojom |
diff --git a/net/interfaces/host_resolver_service.mojom b/net/interfaces/host_resolver_service.mojom |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1d9b6bad30f3bfaa061dcab6cb8a5234633639f8 |
--- /dev/null |
+++ b/net/interfaces/host_resolver_service.mojom |
@@ -0,0 +1,55 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// WARNING! Do NOT use this mojom. It is intended as a temporary interface to |
+// implement out-of-process proxy resolution. If you wish to use a Mojo DNS |
+// service, contact amistry@/sammc@ and net-dev to discuss a permanent Mojo DNS |
+// interface. |
+ |
+// Put Mojo definitions into their own namespace to avoid collisions with C++ |
+// definitions. |
+// TODO(amistry): Resolve the conflict between these two sets of definitions. |
+module net.interfaces; |
+ |
+// Mirror of net::AddressFamily. |
+enum AddressFamily { |
+ ADDRESS_FAMILY_UNSPECIFIED, |
+ ADDRESS_FAMILY_IPV4, |
+ ADDRESS_FAMILY_IPV6, |
eroman
2015/02/03 04:53:29
I doubt this is actually going to be needed. That
Anand Mistry (off Chromium)
2015/02/03 06:27:22
Acknowledged.
|
+}; |
+ |
+// Mirror of net::HostResolver::RequestInfo. |
+struct RequestInfo { |
eroman
2015/02/03 04:53:29
RequestInfo is fairly vague. How about HostResolve
Anand Mistry (off Chromium)
2015/02/03 06:27:22
done.
|
+ string host; |
+ uint16 port; |
+ AddressFamily address_family; |
+ bool is_my_ip_address; |
+}; |
+ |
+// Mirror of net::IPEndPoint. |
+struct IPEndPoint { |
+ // IP address as a numeric value from most to least significant byte. |
+ // Will be of length 4 for IPv4 addresses and 16 for IPv6. |
+ array<uint8> address; |
+ uint16 port; |
+}; |
+ |
+// Mirror of net::AddressList. |
+struct AddressList { |
+ array<IPEndPoint> addresses; |
+ string canonical_name; |
eroman
2015/02/03 04:53:29
I don't believe canonical_name is needed.
Anand Mistry (off Chromium)
2015/02/03 06:27:22
Removed.
I saw the comment about crbug.com/126134
eroman
2015/02/04 01:25:19
I was thinking more in terms of "is this needed by
Anand Mistry (off Chromium)
2015/02/04 04:05:31
Acknowledged.
|
+}; |
+ |
+interface HostResolverService { |
+ // Use a HostResolveRequestClient instead of returning a result so we can |
+ // cancel in-flight requests by destroying the client. IPC requests in Mojo |
+ // cannot be cancelled directly. |
+ // TODO(amistry): Add BoundNetLog. |
+ Resolve(RequestInfo request_info, HostResolveRequestClient client); |
+}; |
+ |
+interface HostResolveRequestClient { |
eroman
2015/02/03 04:53:29
I would epected HostResolverRequestClient rather t
Anand Mistry (off Chromium)
2015/02/03 06:27:22
Done.
|
+ // |error| is a value in net::Error. |
+ ReportResult(int32 error, AddressList? result); |
+}; |