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

Unified Diff: net/base/address_list.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « net/base/address_list.h ('k') | net/base/address_list_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/address_list.cc
diff --git a/net/base/address_list.cc b/net/base/address_list.cc
deleted file mode 100644
index 02a762bf76a4062ef6bdaeda50150b544e59e60b..0000000000000000000000000000000000000000
--- a/net/base/address_list.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (c) 2012 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 "net/base/address_list.h"
-
-#include "base/bind.h"
-#include "base/logging.h"
-#include "base/values.h"
-#include "net/base/net_util.h"
-#include "net/base/sys_addrinfo.h"
-
-namespace net {
-
-namespace {
-
-base::Value* NetLogAddressListCallback(const AddressList* address_list,
- NetLog::LogLevel log_level) {
- base::DictionaryValue* dict = new base::DictionaryValue();
- base::ListValue* list = new base::ListValue();
-
- for (AddressList::const_iterator it = address_list->begin();
- it != address_list->end(); ++it) {
- list->Append(new base::StringValue(it->ToString()));
- }
-
- dict->Set("address_list", list);
- return dict;
-}
-
-} // namespace
-
-AddressList::AddressList() {}
-
-AddressList::~AddressList() {}
-
-AddressList::AddressList(const IPEndPoint& endpoint) {
- push_back(endpoint);
-}
-
-// static
-AddressList AddressList::CreateFromIPAddress(const IPAddressNumber& address,
- uint16 port) {
- return AddressList(IPEndPoint(address, port));
-}
-
-// static
-AddressList AddressList::CreateFromIPAddressList(
- const IPAddressList& addresses,
- const std::string& canonical_name) {
- AddressList list;
- list.set_canonical_name(canonical_name);
- for (IPAddressList::const_iterator iter = addresses.begin();
- iter != addresses.end(); ++iter) {
- list.push_back(IPEndPoint(*iter, 0));
- }
- return list;
-}
-
-// static
-AddressList AddressList::CreateFromAddrinfo(const struct addrinfo* head) {
- DCHECK(head);
- AddressList list;
- if (head->ai_canonname)
- list.set_canonical_name(std::string(head->ai_canonname));
- for (const struct addrinfo* ai = head; ai; ai = ai->ai_next) {
- IPEndPoint ipe;
- // NOTE: Ignoring non-INET* families.
- if (ipe.FromSockAddr(ai->ai_addr, ai->ai_addrlen))
- list.push_back(ipe);
- else
- DLOG(WARNING) << "Unknown family found in addrinfo: " << ai->ai_family;
- }
- return list;
-}
-
-// static
-AddressList AddressList::CopyWithPort(const AddressList& list, uint16 port) {
- AddressList out;
- out.set_canonical_name(list.canonical_name());
- for (size_t i = 0; i < list.size(); ++i)
- out.push_back(IPEndPoint(list[i].address(), port));
- return out;
-}
-
-void AddressList::SetDefaultCanonicalName() {
- DCHECK(!empty());
- set_canonical_name(front().ToStringWithoutPort());
-}
-
-NetLog::ParametersCallback AddressList::CreateNetLogCallback() const {
- return base::Bind(&NetLogAddressListCallback, this);
-}
-
-} // namespace net
« no previous file with comments | « net/base/address_list.h ('k') | net/base/address_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698