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"; |
(...skipping 13 matching lines...) Expand all Loading... |
24 struct ProxyServer { | 24 struct ProxyServer { |
25 ProxyScheme scheme; | 25 ProxyScheme scheme; |
26 | 26 |
27 // |host| and |port| are only valid if |scheme| is not INVALID or DIRECT. | 27 // |host| and |port| are only valid if |scheme| is not INVALID or DIRECT. |
28 string? host; | 28 string? host; |
29 uint16 port; | 29 uint16 port; |
30 }; | 30 }; |
31 | 31 |
32 interface ProxyResolver { | 32 interface ProxyResolver { |
33 // Use a ProxyResolverRequestClient instead of returning a result so we can | 33 // Use a ProxyResolverRequestClient instead of returning a result so we can |
34 // receive load state updates and cancel in-flight requests by destroying the | 34 // cancel in-flight requests by destroying the client. |
35 // client. | |
36 // TODO(amistry): Add BoundNetLog. | 35 // TODO(amistry): Add BoundNetLog. |
37 GetProxyForUrl(string url, ProxyResolverRequestClient client); | 36 GetProxyForUrl(string url, ProxyResolverRequestClient client); |
38 }; | 37 }; |
39 | 38 |
40 interface ProxyResolverRequestClient { | 39 interface ProxyResolverRequestClient { |
41 ReportResult(int32 error, array<ProxyServer>? proxy_servers); | 40 ReportResult(int32 error, array<ProxyServer>? proxy_servers); |
42 LoadStateChanged(int32 load_state); | |
43 }; | 41 }; |
44 | 42 |
45 interface ProxyResolverErrorObserver { | 43 interface ProxyResolverErrorObserver { |
46 OnPacScriptError(int32 line_number, string error); | 44 OnPacScriptError(int32 line_number, string error); |
47 }; | 45 }; |
48 | 46 |
49 interface ProxyResolverFactory { | 47 interface ProxyResolverFactory { |
50 // TODO(amistry): Add NetLog. | 48 // TODO(amistry): Add NetLog. |
51 CreateResolver(string pac_script, | 49 CreateResolver(string pac_script, |
52 ProxyResolver& resolver, | 50 ProxyResolver& resolver, |
53 HostResolver host_resolver, | 51 HostResolver host_resolver, |
54 ProxyResolverErrorObserver? error_observer, | 52 ProxyResolverErrorObserver? error_observer, |
55 ProxyResolverFactoryRequestClient client); | 53 ProxyResolverFactoryRequestClient client); |
56 }; | 54 }; |
57 | 55 |
58 interface ProxyResolverFactoryRequestClient { | 56 interface ProxyResolverFactoryRequestClient { |
59 ReportResult(int32 error); | 57 ReportResult(int32 error); |
60 }; | 58 }; |
OLD | NEW |