OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 // Put Mojo definitions into their own namespace to avoid collisions with C++ | |
6 // definitions. | |
7 // TODO(amistry): Resolve the conflict between these two sets of definitions. | |
8 module net.interfaces; | |
9 | |
10 import "host_resolver_service.mojom"; | |
11 | |
12 // Partial mirror of net::LoadState. Only contains values possible by the | |
13 // proxy resolver. | |
14 enum LoadState { | |
15 RESOLVING_PROXY_FOR_URL, | |
16 RESOLVING_HOST_IN_PROXY_SCRIPT, | |
17 }; | |
18 | |
19 // Mirror of net::ProxyServer::Scheme. | |
20 enum ProxyScheme { | |
21 INVALID, | |
22 DIRECT, | |
23 HTTP, | |
24 SOCKS4, | |
25 SOCKS5, | |
26 HTTPS, | |
27 QUIC, | |
28 }; | |
29 | |
30 // Mirror of net::ProxyServer. | |
31 struct ProxyServer { | |
32 ProxyScheme scheme; | |
33 string host; | |
34 uint16 port; | |
35 }; | |
36 | |
37 interface ProxyResolverService { | |
Sam McNally
2015/02/03 23:51:30
And ProxyResolver?
Anand Mistry (off Chromium)
2015/02/04 04:05:31
Nope :P
| |
38 SetPacScript(string data) => (int32 result); | |
39 | |
40 // Use a ProxyResolverRequestClient instead of returning a result so we can | |
41 // receive load state updates and cancel in-flight requests by destroying the | |
42 // client. | |
43 // TODO(amistry): Add BoundNetLog. | |
44 GetProxyForUrl(string url, ProxyResolverRequestClient client); | |
45 }; | |
46 | |
47 interface ProxyResolverRequestClient { | |
48 ReportResult(int32 error, array<ProxyScheme>? proxy_servers); | |
Sam McNally
2015/02/03 23:51:30
ProxyServer.
eroman
2015/02/04 01:25:20
LGTM once this comment is addressed, and the LoadS
Anand Mistry (off Chromium)
2015/02/04 04:05:31
Done and removed LoadState.
| |
49 UpdateLoadState(LoadState load_state); | |
50 }; | |
51 | |
52 interface ProxyResolverErrorObserver { | |
53 OnPacScriptError(int32 line_number, string error); | |
54 }; | |
55 | |
56 interface ProxyResolverFactory { | |
57 // TODO(amistry): Add NetLog. | |
58 CreateResolver(ProxyResolverService& resolver, | |
59 HostResolverService host_resolver, | |
60 ProxyResolverErrorObserver error_observer); | |
eroman
2015/02/04 01:25:20
For simplicity you might also want to leave off Er
Anand Mistry (off Chromium)
2015/02/04 04:05:31
Removed error observer and updated TODO.
| |
61 }; | |
OLD | NEW |