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

Unified Diff: net/dns/address_sorter_posix.cc

Issue 1520493002: Remove ScopedVector from address_sorter_posix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/address_sorter_posix.cc
diff --git a/net/dns/address_sorter_posix.cc b/net/dns/address_sorter_posix.cc
index 9bbe835ebc806fc0d2a9a513e8102566f9f6e935..692dd8cc53a3e264db324e2201decaafb5284003 100644
--- a/net/dns/address_sorter_posix.cc
+++ b/net/dns/address_sorter_posix.cc
@@ -6,6 +6,10 @@
#include <netinet/in.h>
+#include <vector>
mmenke 2015/12/11 14:32:49 I think this should go down with <algorithm> (Inc
+
+#include "base/memory/scoped_ptr.h"
mmenke 2015/12/11 14:32:49 I think these should go just above logging.h
+
#if defined(OS_MACOSX) || defined(OS_BSD)
#include <sys/socket.h> // Must be included before ifaddrs.h.
#include <ifaddrs.h>
@@ -18,7 +22,6 @@
#include <algorithm>
#include "base/logging.h"
-#include "base/memory/scoped_vector.h"
#include "net/base/net_errors.h"
#include "net/socket/client_socket_factory.h"
#include "net/udp/datagram_client_socket.h"
@@ -186,8 +189,8 @@ struct DestinationInfo {
// Returns true iff |dst_a| should precede |dst_b| in the address list.
// RFC 3484, section 6.
-bool CompareDestinations(const DestinationInfo* dst_a,
- const DestinationInfo* dst_b) {
+bool CompareDestinations(const scoped_ptr<DestinationInfo>& dst_a,
+ const scoped_ptr<DestinationInfo>& dst_b) {
// Rule 1: Avoid unusable destinations.
// Unusable destinations are already filtered out.
DCHECK(dst_a->src);
@@ -257,7 +260,7 @@ AddressSorterPosix::~AddressSorterPosix() {
void AddressSorterPosix::Sort(const AddressList& list,
const CallbackType& callback) const {
DCHECK(CalledOnValidThread());
- ScopedVector<DestinationInfo> sort_list;
+ std::vector<scoped_ptr<DestinationInfo>> sort_list;
for (size_t i = 0; i < list.size(); ++i) {
scoped_ptr<DestinationInfo> info(new DestinationInfo());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698