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

Unified Diff: net/dns/mdns_client_unittest.cc

Issue 1475553002: Remove ScopedVector from CreateSockets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove {} 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 | « net/dns/mdns_client_impl.cc ('k') | net/dns/mock_mdns_socket_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/mdns_client_unittest.cc
diff --git a/net/dns/mdns_client_unittest.cc b/net/dns/mdns_client_unittest.cc
index 6e735e5d44ca20d3b6194ca87d93824739c2a1d0..e002bbe796a40bdfb6d5954626c668fa174c351f 100644
--- a/net/dns/mdns_client_unittest.cc
+++ b/net/dns/mdns_client_unittest.cc
@@ -3,9 +3,11 @@
// found in the LICENSE file.
#include <queue>
+#include <vector>
#include "base/location.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
@@ -1157,17 +1159,18 @@ TEST_F(MDnsTest, RefreshQuery) {
// This is a simplifying assumption based on the way the code works now.
class SimpleMockSocketFactory : public MDnsSocketFactory {
public:
- void CreateSockets(ScopedVector<DatagramServerSocket>* sockets) override {
+ void CreateSockets(
+ std::vector<scoped_ptr<DatagramServerSocket>>* sockets) override {
sockets->clear();
sockets->swap(sockets_);
}
- void PushSocket(DatagramServerSocket* socket) {
- sockets_.push_back(socket);
+ void PushSocket(scoped_ptr<DatagramServerSocket> socket) {
+ sockets_.push_back(std::move(socket));
}
private:
- ScopedVector<DatagramServerSocket> sockets_;
+ std::vector<scoped_ptr<DatagramServerSocket>> sockets_;
};
class MockMDnsConnectionDelegate : public MDnsConnection::Delegate {
@@ -1191,8 +1194,8 @@ class MDnsConnectionTest : public ::testing::Test {
void SetUp() override {
socket_ipv4_ = new MockMDnsDatagramServerSocket(ADDRESS_FAMILY_IPV4);
socket_ipv6_ = new MockMDnsDatagramServerSocket(ADDRESS_FAMILY_IPV6);
- factory_.PushSocket(socket_ipv6_);
- factory_.PushSocket(socket_ipv4_);
+ factory_.PushSocket(make_scoped_ptr(socket_ipv6_));
+ factory_.PushSocket(make_scoped_ptr(socket_ipv4_));
sample_packet_ = MakeString(kSamplePacket1, sizeof(kSamplePacket1));
sample_buffer_ = new StringIOBuffer(sample_packet_);
}
« no previous file with comments | « net/dns/mdns_client_impl.cc ('k') | net/dns/mock_mdns_socket_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698