Chromium Code Reviews| Index: net/interfaces/proxy_resolver_service.mojom |
| diff --git a/net/interfaces/proxy_resolver_service.mojom b/net/interfaces/proxy_resolver_service.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a1303dd029aed4935821c4bf32b7117aa3b6b280 |
| --- /dev/null |
| +++ b/net/interfaces/proxy_resolver_service.mojom |
| @@ -0,0 +1,61 @@ |
| +// 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. |
| + |
| +// 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; |
| + |
| +import "host_resolver_service.mojom"; |
| + |
| +// Partial mirror of net::LoadState. Only contains values possible by the |
| +// proxy resolver. |
| +enum LoadState { |
| + RESOLVING_PROXY_FOR_URL, |
| + RESOLVING_HOST_IN_PROXY_SCRIPT, |
| +}; |
| + |
| +// Mirror of net::ProxyServer::Scheme. |
| +enum ProxyScheme { |
| + INVALID, |
| + DIRECT, |
| + HTTP, |
| + SOCKS4, |
| + SOCKS5, |
| + HTTPS, |
| + QUIC, |
| +}; |
| + |
| +// Mirror of net::ProxyServer. |
| +struct ProxyServer { |
| + ProxyScheme scheme; |
| + string host; |
| + uint16 port; |
| +}; |
| + |
| +interface ProxyResolverService { |
|
Sam McNally
2015/02/03 23:51:30
And ProxyResolver?
Anand Mistry (off Chromium)
2015/02/04 04:05:31
Nope :P
|
| + SetPacScript(string data) => (int32 result); |
| + |
| + // Use a ProxyResolverRequestClient instead of returning a result so we can |
| + // receive load state updates and cancel in-flight requests by destroying the |
| + // client. |
| + // TODO(amistry): Add BoundNetLog. |
| + GetProxyForUrl(string url, ProxyResolverRequestClient client); |
| +}; |
| + |
| +interface ProxyResolverRequestClient { |
| + 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.
|
| + UpdateLoadState(LoadState load_state); |
| +}; |
| + |
| +interface ProxyResolverErrorObserver { |
| + OnPacScriptError(int32 line_number, string error); |
| +}; |
| + |
| +interface ProxyResolverFactory { |
| + // TODO(amistry): Add NetLog. |
| + CreateResolver(ProxyResolverService& resolver, |
| + HostResolverService host_resolver, |
| + 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.
|
| +}; |