Revert of Revert of Add Mojo interfaces for out-of-process proxy resolver. (patchset #1 id:1 of https://codereview.chromium.org/892373006/)
Reason for revert:
The code in this change is not linked into any binary.
Test is flaky:
http://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=device_unittests&tests=SerialConnectionTest.Cancel
The likely cause of the test failure is bc78a2320b
. The author has been informed and the test will be fixed soon.
Original issue's description:
> Revert of Add Mojo interfaces for out-of-process proxy resolver. (patchset #4 id:60001 of https://codereview.chromium.org/900433003/)
>
> Reason for revert:
> http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29%281%29/builds/38575
> Broke device_unittests device_unittests SerialConnectionTest.Cancel it seems.
>
> Original issue's description:
> > Add Mojo interfaces for out-of-process proxy resolver.
> >
> > See:
> > https://docs.google.com/a/chromium.org/document/d/1n5hr4KJhZl2A4MicTfmyiHPdiKp7kmUoWXnRBN8SrZE/edit#
> >
> > BUG=11746
> >
> > Committed: https://crrev.com/073e42bb7587b90594e5799fb6a4afe08a1e1561
> > Cr-Commit-Position: refs/heads/master@{#314509}
>
> TBR=rdsmith@chromium.org,eroman@chromium.org,sammc@chromium.org,amistry@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=11746
>
> Committed: https://crrev.com/7d4ec1aa24e79406d29e0cafbb531a3fabfe815f
> Cr-Commit-Position: refs/heads/master@{#314519}
TBR=rdsmith@chromium.org,eroman@chromium.org,sammc@chromium.org,noel@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=11746
Review URL: https://codereview.chromium.org/882173005
Cr-Commit-Position: refs/heads/master@{#314527}
This commit is contained in:
12
net/interfaces/BUILD.gn
Normal file
12
net/interfaces/BUILD.gn
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
|
||||||
|
|
||||||
|
mojom("interfaces") {
|
||||||
|
sources = [
|
||||||
|
"host_resolver_service.mojom",
|
||||||
|
"proxy_resolver_service.mojom",
|
||||||
|
]
|
||||||
|
}
|
55
net/interfaces/host_resolver_service.mojom
Normal file
55
net/interfaces/host_resolver_service.mojom
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// WARNING! Do NOT use this mojom. It is intended as a temporary interface to
|
||||||
|
// implement out-of-process proxy resolution. If you wish to use a Mojo DNS
|
||||||
|
// service, contact amistry@/sammc@ and net-dev to discuss a permanent Mojo DNS
|
||||||
|
// interface.
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
|
||||||
|
// Mirror of net::AddressFamily.
|
||||||
|
enum AddressFamily {
|
||||||
|
UNSPECIFIED,
|
||||||
|
IPV4,
|
||||||
|
IPV6,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mirror of net::HostResolver::RequestInfo.
|
||||||
|
struct HostResolverRequestInfo {
|
||||||
|
string host;
|
||||||
|
uint16 port;
|
||||||
|
AddressFamily address_family;
|
||||||
|
bool is_my_ip_address;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mirror of net::IPEndPoint.
|
||||||
|
struct IPEndPoint {
|
||||||
|
// IP address as a numeric value from most to least significant byte.
|
||||||
|
// Will be of length 4 for IPv4 addresses and 16 for IPv6.
|
||||||
|
array<uint8> address;
|
||||||
|
uint16 port;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mirror of net::AddressList.
|
||||||
|
struct AddressList {
|
||||||
|
array<IPEndPoint> addresses;
|
||||||
|
};
|
||||||
|
|
||||||
|
interface HostResolverService {
|
||||||
|
// Use a HostResolverRequestClient instead of returning a result so we can
|
||||||
|
// cancel in-flight requests by destroying the client. IPC requests in Mojo
|
||||||
|
// cannot be cancelled directly.
|
||||||
|
// TODO(amistry): Add BoundNetLog.
|
||||||
|
Resolve(HostResolverRequestInfo request_info,
|
||||||
|
HostResolverRequestClient client);
|
||||||
|
};
|
||||||
|
|
||||||
|
interface HostResolverRequestClient {
|
||||||
|
// |error| is a value in net::Error.
|
||||||
|
ReportResult(int32 error, AddressList? result);
|
||||||
|
};
|
48
net/interfaces/proxy_resolver_service.mojom
Normal file
48
net/interfaces/proxy_resolver_service.mojom
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
// 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 {
|
||||||
|
INVALID,
|
||||||
|
DIRECT,
|
||||||
|
HTTP,
|
||||||
|
SOCKS4,
|
||||||
|
SOCKS5,
|
||||||
|
HTTPS,
|
||||||
|
QUIC,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Mirror of net::ProxyServer.
|
||||||
|
struct ProxyServer {
|
||||||
|
ProxyScheme scheme;
|
||||||
|
string host;
|
||||||
|
uint16 port;
|
||||||
|
};
|
||||||
|
|
||||||
|
interface ProxyResolverService {
|
||||||
|
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);
|
||||||
|
};
|
||||||
|
|
||||||
|
interface ProxyResolverFactory {
|
||||||
|
// TODO(amistry): Add NetLog and ProxyResolverErrorObserver.
|
||||||
|
CreateResolver(ProxyResolverService& resolver,
|
||||||
|
HostResolverService host_resolver);
|
||||||
|
};
|
16
net/net.gyp
16
net/net.gyp
@@ -1203,6 +1203,22 @@
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
|
['use_v8_in_net == 1 and OS != "android"', {
|
||||||
|
'targets': [
|
||||||
|
{
|
||||||
|
# GN version: //net/interfaces
|
||||||
|
'target_name': 'net_interfaces',
|
||||||
|
'type': 'static_library',
|
||||||
|
'sources': [
|
||||||
|
'interfaces/host_resolver_service.mojom',
|
||||||
|
'interfaces/proxy_resolver_service.mojom',
|
||||||
|
],
|
||||||
|
'includes': [
|
||||||
|
'../third_party/mojo/mojom_bindings_generator.gypi',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}],
|
||||||
['OS != "ios" and OS != "android"', {
|
['OS != "ios" and OS != "android"', {
|
||||||
'targets': [
|
'targets': [
|
||||||
# iOS doesn't have the concept of simple executables, these targets
|
# iOS doesn't have the concept of simple executables, these targets
|
||||||
|
Reference in New Issue
Block a user