mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-24 14:26:09 +03:00
70 lines
1.8 KiB
Plaintext
70 lines
1.8 KiB
Plaintext
|
// 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 proxy_resolver.mojom;
|
||
|
|
||
|
import "net/interfaces/host_resolver_service.mojom";
|
||
|
import "url/mojo/url.mojom";
|
||
|
|
||
|
const string kProxyResolverServiceName = "proxy_resolver";
|
||
|
|
||
|
// Mirror of net::ProxyServer::Scheme.
|
||
|
enum ProxyScheme {
|
||
|
INVALID,
|
||
|
DIRECT,
|
||
|
HTTP,
|
||
|
SOCKS4,
|
||
|
SOCKS5,
|
||
|
HTTPS,
|
||
|
QUIC,
|
||
|
};
|
||
|
|
||
|
// Mirror of net::ProxyServer.
|
||
|
struct ProxyServer {
|
||
|
ProxyScheme scheme;
|
||
|
|
||
|
// |host| and |port| are only valid if |scheme| is not INVALID or DIRECT.
|
||
|
string host;
|
||
|
uint16 port;
|
||
|
};
|
||
|
|
||
|
struct ProxyInfo {
|
||
|
array<ProxyServer> proxy_servers;
|
||
|
};
|
||
|
|
||
|
interface ProxyResolver {
|
||
|
// Use a ProxyResolverRequestClient instead of returning a result so we can
|
||
|
// cancel in-flight requests by destroying the client.
|
||
|
GetProxyForUrl(url.mojom.Url url, ProxyResolverRequestClient client);
|
||
|
};
|
||
|
|
||
|
interface ProxyResolverRequestClient {
|
||
|
ReportResult(int32 error, ProxyInfo proxy_info);
|
||
|
|
||
|
Alert(string error);
|
||
|
OnError(int32 line_number, string error);
|
||
|
|
||
|
ResolveDns(net.interfaces.HostResolverRequestInfo request_info,
|
||
|
net.interfaces.HostResolverRequestClient client);
|
||
|
};
|
||
|
|
||
|
interface ProxyResolverFactory {
|
||
|
CreateResolver(string pac_script,
|
||
|
ProxyResolver& resolver,
|
||
|
ProxyResolverFactoryRequestClient client);
|
||
|
};
|
||
|
|
||
|
interface ProxyResolverFactoryRequestClient {
|
||
|
ReportResult(int32 error);
|
||
|
|
||
|
Alert(string error);
|
||
|
OnError(int32 line_number, string error);
|
||
|
|
||
|
ResolveDns(net.interfaces.HostResolverRequestInfo request_info,
|
||
|
net.interfaces.HostResolverRequestClient client);
|
||
|
};
|