Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: mojo/services/network/net_address_type_converters.cc

Issue 1873463003: Remove mojo network service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/network/net_address_type_converters.h ('k') | mojo/services/network/network_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/network/net_address_type_converters.cc
diff --git a/mojo/services/network/net_address_type_converters.cc b/mojo/services/network/net_address_type_converters.cc
deleted file mode 100644
index dcd7d73b146d1ae1035dd902db9464aa8e6d8477..0000000000000000000000000000000000000000
--- a/mojo/services/network/net_address_type_converters.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2014 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.
-
-#include <stdint.h>
-
-#include "mojo/services/network/net_address_type_converters.h"
-
-namespace mojo {
-
-// static
-net::IPEndPoint TypeConverter<net::IPEndPoint, NetAddressPtr>::Convert(
- const NetAddressPtr& obj) {
- if (!obj)
- return net::IPEndPoint();
-
- switch (obj->family) {
- case NetAddressFamily::IPV4:
- if (!obj->ipv4)
- break;
- return net::IPEndPoint(obj->ipv4->addr.storage(), obj->ipv4->port);
-
- case NetAddressFamily::IPV6:
- if (!obj->ipv6)
- break;
- return net::IPEndPoint(obj->ipv6->addr.storage(), obj->ipv6->port);
-
- default:
- break;
- }
-
- return net::IPEndPoint();
-}
-
-// static
-NetAddressPtr TypeConverter<NetAddressPtr, net::IPEndPoint>::Convert(
- const net::IPEndPoint& obj) {
- NetAddressPtr net_address(NetAddress::New());
-
- switch (obj.GetFamily()) {
- case net::ADDRESS_FAMILY_IPV4:
- net_address->family = NetAddressFamily::IPV4;
- net_address->ipv4 = NetAddressIPv4::New();
- net_address->ipv4->port = static_cast<uint16_t>(obj.port());
- net_address->ipv4->addr = Array<uint8_t>::From(obj.address().bytes());
- break;
- case net::ADDRESS_FAMILY_IPV6:
- net_address->ipv6 = NetAddressIPv6::New();
- net_address->family = NetAddressFamily::IPV6;
- net_address->ipv6->port = static_cast<uint16_t>(obj.port());
- net_address->ipv6->addr = Array<uint8_t>::From(obj.address().bytes());
- break;
- default:
- break;
- }
-
- return net_address;
-}
-
-} // namespace mojo
« no previous file with comments | « mojo/services/network/net_address_type_converters.h ('k') | mojo/services/network/network_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698