OLD | NEW |
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 // Put Mojo definitions into their own namespace to avoid collisions with C++ | 5 // Put Mojo definitions into their own namespace to avoid collisions with C++ |
6 // definitions. | 6 // definitions. |
7 // TODO(amistry): Resolve the conflict between these two sets of definitions. | 7 // TODO(amistry): Resolve the conflict between these two sets of definitions. |
8 module net.interfaces; | 8 module net.interfaces; |
9 | 9 |
10 import "host_resolver_service.mojom"; | 10 import "host_resolver_service.mojom"; |
| 11 import "url/mojo/url.mojom"; |
11 | 12 |
12 // Mirror of net::ProxyServer::Scheme. | 13 // Mirror of net::ProxyServer::Scheme. |
13 enum ProxyScheme { | 14 enum ProxyScheme { |
14 INVALID, | 15 INVALID, |
15 DIRECT, | 16 DIRECT, |
16 HTTP, | 17 HTTP, |
17 SOCKS4, | 18 SOCKS4, |
18 SOCKS5, | 19 SOCKS5, |
19 HTTPS, | 20 HTTPS, |
20 QUIC, | 21 QUIC, |
21 }; | 22 }; |
22 | 23 |
23 // Mirror of net::ProxyServer. | 24 // Mirror of net::ProxyServer. |
24 struct ProxyServer { | 25 struct ProxyServer { |
25 ProxyScheme scheme; | 26 ProxyScheme scheme; |
26 | 27 |
27 // |host| and |port| are only valid if |scheme| is not INVALID or DIRECT. | 28 // |host| and |port| are only valid if |scheme| is not INVALID or DIRECT. |
28 string? host; | 29 string? host; |
29 uint16 port; | 30 uint16 port; |
30 }; | 31 }; |
31 | 32 |
32 interface ProxyResolver { | 33 interface ProxyResolver { |
33 // Use a ProxyResolverRequestClient instead of returning a result so we can | 34 // Use a ProxyResolverRequestClient instead of returning a result so we can |
34 // cancel in-flight requests by destroying the client. | 35 // cancel in-flight requests by destroying the client. |
35 GetProxyForUrl(string url, ProxyResolverRequestClient client); | 36 GetProxyForUrl(url.mojom.Url url, ProxyResolverRequestClient client); |
36 }; | 37 }; |
37 | 38 |
38 interface ProxyResolverRequestClient { | 39 interface ProxyResolverRequestClient { |
39 ReportResult(int32 error, array<ProxyServer>? proxy_servers); | 40 ReportResult(int32 error, array<ProxyServer>? proxy_servers); |
40 | 41 |
41 Alert(string error); | 42 Alert(string error); |
42 OnError(int32 line_number, string error); | 43 OnError(int32 line_number, string error); |
43 | 44 |
44 ResolveDns(HostResolverRequestInfo request_info, | 45 ResolveDns(HostResolverRequestInfo request_info, |
45 HostResolverRequestClient client); | 46 HostResolverRequestClient client); |
46 }; | 47 }; |
47 | 48 |
48 interface ProxyResolverFactory { | 49 interface ProxyResolverFactory { |
49 CreateResolver(string pac_script, | 50 CreateResolver(string pac_script, |
50 ProxyResolver& resolver, | 51 ProxyResolver& resolver, |
51 ProxyResolverFactoryRequestClient client); | 52 ProxyResolverFactoryRequestClient client); |
52 }; | 53 }; |
53 | 54 |
54 interface ProxyResolverFactoryRequestClient { | 55 interface ProxyResolverFactoryRequestClient { |
55 ReportResult(int32 error); | 56 ReportResult(int32 error); |
56 | 57 |
57 Alert(string error); | 58 Alert(string error); |
58 OnError(int32 line_number, string error); | 59 OnError(int32 line_number, string error); |
59 | 60 |
60 ResolveDns(HostResolverRequestInfo request_info, | 61 ResolveDns(HostResolverRequestInfo request_info, |
61 HostResolverRequestClient client); | 62 HostResolverRequestClient client); |
62 }; | 63 }; |
OLD | NEW |