Roll src/third_party/WebKit a3b4a2e:7441784 (svn 202551:202552)
[chromium-blink-merge.git] / net / interfaces / proxy_resolver_service.mojom
blobf6656fa1da08b7f0887cc32ffff788a56d5e5643
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.
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;
10 import "host_resolver_service.mojom";
12 // Mirror of net::ProxyServer::Scheme.
13 enum ProxyScheme {
14   INVALID,
15   DIRECT,
16   HTTP,
17   SOCKS4,
18   SOCKS5,
19   HTTPS,
20   QUIC,
23 // Mirror of net::ProxyServer.
24 struct ProxyServer {
25   ProxyScheme scheme;
27   // |host| and |port| are only valid if |scheme| is not INVALID or DIRECT.
28   string? host;
29   uint16 port;
32 interface ProxyResolver {
33   // Use a ProxyResolverRequestClient instead of returning a result so we can
34   // cancel in-flight requests by destroying the client.
35   GetProxyForUrl(string url, ProxyResolverRequestClient client);
38 interface ProxyResolverRequestClient {
39   ReportResult(int32 error, array<ProxyServer>? proxy_servers);
41   Alert(string error);
42   OnError(int32 line_number, string error);
44   ResolveDns(HostResolverRequestInfo request_info,
45              HostResolverRequestClient client);
48 interface ProxyResolverFactory {
49   CreateResolver(string pac_script,
50                  ProxyResolver& resolver,
51                  ProxyResolverFactoryRequestClient client);
54 interface ProxyResolverFactoryRequestClient {
55   ReportResult(int32 error);
57   Alert(string error);
58   OnError(int32 line_number, string error);
60   ResolveDns(HostResolverRequestInfo request_info,
61              HostResolverRequestClient client);