blob: d8fd5994be5eed3527b3ca90ef96f93c0ee21d03 [file] [log] [blame]
// 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";
// Mirror of net::ProxyServer::Scheme.
enum ProxyScheme {
// 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;
interface ProxyResolver {
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<ProxyServer>? proxy_servers);
LoadStateChanged(int32 load_state);
interface ProxyResolverFactory {
// TODO(amistry): Add NetLog and ProxyResolverErrorObserver.
CreateResolver(ProxyResolver& resolver,
HostResolver host_resolver);