Commit db3a3094 authored by Kinuko Yasuda's avatar Kinuko Yasuda Committed by Commit Bot

Merge blink-specific typemaps into the other ones

Having 'for_blink' typemap that is mostly same as the original one
feels a bit awkward (also services/network directory talking
specifically about 'blink' seems a bit of layering violation).

Bug: 787254

Change-Id: I16a6164f52a6c4c4defd00e4107d7d741d838463
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2016524Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735735}
parent 49e3cd09
......@@ -10,7 +10,10 @@ source_set("cpp") {
"cros_network_config_util.h",
]
deps = [ "//chromeos/services/network_config/public/mojom" ]
deps = [
"//chromeos/services/network_config/public/mojom",
"//services/network/public/cpp:ip_address_mojom_support",
]
}
source_set("test_support") {
......
......@@ -112,6 +112,24 @@ jumbo_component("cpp") {
defines = [ "IS_NETWORK_CPP_IMPL" ]
}
# These interfaces are put in their own target so that modules that only
# need to depend on mojom_ip_address does not depend on the entire cpp_base.
component("ip_address_mojom_support") {
sources = [
"address_list_mojom_traits.cc",
"address_list_mojom_traits.h",
"ip_address_mojom_traits.cc",
"ip_address_mojom_traits.h",
"ip_endpoint_mojom_traits.cc",
"ip_endpoint_mojom_traits.h",
]
deps = [
"//net",
"//services/network/public/mojom:mojom_ip_address_shared",
]
defines = [ "IS_NETWORK_CPP_BASE_IMPL" ]
}
jumbo_component("cpp_base") {
output_name = "network_cpp_base"
......@@ -130,6 +148,8 @@ jumbo_component("cpp_base") {
"mutable_partial_network_traffic_annotation_tag_mojom_traits.h",
"net_ipc_param_traits.cc",
"net_ipc_param_traits.h",
"network_interface_mojom_traits.cc",
"network_interface_mojom_traits.h",
"network_ipc_param_traits.cc",
"network_ipc_param_traits.h",
"network_isolation_key_mojom_traits.cc",
......@@ -167,6 +187,7 @@ jumbo_component("cpp_base") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]
public_deps = [
":ip_address_mojom_support",
"//services/network/public/mojom:data_pipe_interfaces",
"//services/network/public/mojom:mutable_network_traffic_annotation_interface",
"//url/ipc:url_ipc",
......
......@@ -5,10 +5,5 @@
mojom = "//services/network/public/mojom/address_list.mojom"
public_headers = [ "//net/base/address_list.h" ]
traits_headers = [ "//services/network/public/cpp/address_list_mojom_traits.h" ]
sources = [
"//services/network/public/cpp/address_list_mojom_traits.cc",
]
type_mappings = [ "network.mojom.AddressList=::net::AddressList" ]
public_deps = [
"//net",
]
public_deps = [ "//net" ]
......@@ -9,12 +9,14 @@
#include <vector>
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "services/network/public/mojom/address_list.mojom.h"
#include "net/base/address_list.h"
#include "services/network/public/mojom/address_list.mojom-shared.h"
namespace mojo {
template <>
struct StructTraits<network::mojom::AddressListDataView, net::AddressList> {
struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
StructTraits<network::mojom::AddressListDataView, net::AddressList> {
static const std::vector<net::IPEndPoint>& addresses(
const net::AddressList& obj) {
return obj.endpoints();
......
......@@ -5,10 +5,5 @@
mojom = "//services/network/public/mojom/ip_address.mojom"
public_headers = [ "//net/base/ip_address.h" ]
traits_headers = [ "//services/network/public/cpp/ip_address_mojom_traits.h" ]
sources = [
"//services/network/public/cpp/ip_address_mojom_traits.cc",
]
type_mappings = [ "network.mojom.IPAddress=::net::IPAddress" ]
public_deps = [
"//net",
]
public_deps = [ "//net" ]
# Copyright 2019 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.
mojom = "//services/network/public/mojom/ip_address.mojom"
public_headers = [ "//net/base/ip_address.h" ]
traits_headers = [ "//services/network/public/cpp/ip_address_mojom_traits.h" ]
type_mappings = [ "network.mojom.IPAddress=::net::IPAddress" ]
public_deps = [
"//net",
]
......@@ -8,11 +8,12 @@
#include "base/containers/span.h"
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "net/base/ip_address.h"
#include "services/network/public/mojom/ip_address.mojom.h"
#include "services/network/public/mojom/ip_address.mojom-shared.h"
namespace mojo {
template <>
struct StructTraits<network::mojom::IPAddressDataView, net::IPAddress> {
struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
StructTraits<network::mojom::IPAddressDataView, net::IPAddress> {
static base::span<const uint8_t> address_bytes(
const net::IPAddress& ip_address) {
return ip_address.bytes();
......
......@@ -5,6 +5,7 @@
#include "services/network/public/cpp/ip_address_mojom_traits.h"
#include "mojo/public/cpp/test_support/test_utils.h"
#include "services/network/public/mojom/ip_address.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace net {
......
......@@ -5,10 +5,5 @@
mojom = "//services/network/public/mojom/ip_endpoint.mojom"
public_headers = [ "//net/base/ip_endpoint.h" ]
traits_headers = [ "//services/network/public/cpp/ip_endpoint_mojom_traits.h" ]
sources = [
"//services/network/public/cpp/ip_endpoint_mojom_traits.cc",
]
type_mappings = [ "network.mojom.IPEndPoint=::net::IPEndPoint" ]
public_deps = [
"//net",
]
public_deps = [ "//net" ]
# Copyright 2019 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.
mojom = "//services/network/public/mojom/ip_endpoint.mojom"
public_headers = [ "//net/base/ip_endpoint.h" ]
traits_headers = [ "//services/network/public/cpp/ip_endpoint_mojom_traits.h" ]
type_mappings = [ "network.mojom.IPEndPoint=::net::IPEndPoint" ]
public_deps = [
"//net",
]
......@@ -7,11 +7,12 @@
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "net/base/ip_endpoint.h"
#include "services/network/public/mojom/ip_endpoint.mojom.h"
#include "services/network/public/mojom/ip_endpoint.mojom-shared.h"
namespace mojo {
template <>
struct StructTraits<network::mojom::IPEndPointDataView, net::IPEndPoint> {
struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
StructTraits<network::mojom::IPEndPointDataView, net::IPEndPoint> {
static const net::IPAddress& address(const net::IPEndPoint& obj) {
return obj.address();
}
......
......@@ -6,10 +6,5 @@ mojom = "//services/network/public/mojom/network_interface.mojom"
public_headers = [ "//net/base/network_interfaces.h" ]
traits_headers =
[ "//services/network/public/cpp/network_interface_mojom_traits.h" ]
sources = [
"//services/network/public/cpp/network_interface_mojom_traits.cc",
]
public_deps = [
"//net",
]
public_deps = [ "//net" ]
type_mappings = [ "network.mojom.NetworkInterface=::net::NetworkInterface" ]
# Copyright 2019 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.
mojom = "//services/network/public/mojom/network_interface.mojom"
public_headers = [ "//net/base/network_interfaces.h" ]
traits_headers =
[ "//services/network/public/cpp/network_interface_mojom_traits.h" ]
public_deps = [
"//net",
]
type_mappings = [ "network.mojom.NetworkInterface=::net::NetworkInterface" ]
......@@ -10,13 +10,14 @@
#include "mojo/public/cpp/bindings/struct_traits.h"
#include "net/base/network_change_notifier.h"
#include "net/base/network_interfaces.h"
#include "services/network/public/mojom/network_interface.mojom.h"
#include "services/network/public/mojom/network_interface.mojom-shared.h"
namespace mojo {
template <>
class StructTraits<network::mojom::NetworkInterfaceDataView,
net::NetworkInterface> {
class COMPONENT_EXPORT(NETWORK_CPP_BASE)
StructTraits<network::mojom::NetworkInterfaceDataView,
net::NetworkInterface> {
public:
static const std::string& name(const net::NetworkInterface& network) {
return network.name;
......@@ -47,8 +48,9 @@ class StructTraits<network::mojom::NetworkInterfaceDataView,
};
template <>
struct EnumTraits<network::mojom::ConnectionType,
net::NetworkChangeNotifier::ConnectionType> {
struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
EnumTraits<network::mojom::ConnectionType,
net::NetworkChangeNotifier::ConnectionType> {
static network::mojom::ConnectionType ToMojom(
net::NetworkChangeNotifier::ConnectionType input);
static bool FromMojom(network::mojom::ConnectionType input,
......
......@@ -7,9 +7,9 @@ typemaps = [
"//media/mojo/mojom/audio_parameters.typemap",
"//mojo/public/cpp/base/values.typemap",
"//services/network/public/cpp/http_request_headers.typemap",
"//services/network/public/cpp/ip_address_for_blink.typemap",
"//services/network/public/cpp/ip_endpoint_for_blink.typemap",
"//services/network/public/cpp/network_interface_for_blink.typemap",
"//services/network/public/cpp/ip_address.typemap",
"//services/network/public/cpp/ip_endpoint.typemap",
"//services/network/public/cpp/network_interface.typemap",
"//services/network/public/cpp/mutable_network_traffic_annotation_tag.typemap",
"//services/network/public/cpp/site_for_cookies.typemap",
"//services/network/public/cpp/p2p.typemap",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment