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

Side by Side Diff: net/dns/dns_transaction_unittest.cc

Issue 657013003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « net/dns/dns_session_unittest.cc ('k') | net/dns/mapped_host_resolver_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/dns/dns_transaction.h" 5 #include "net/dns/dns_transaction.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 const net::NetLog::Source& source) override { 191 const net::NetLog::Source& source) override {
192 if (fail_next_socket_) { 192 if (fail_next_socket_) {
193 fail_next_socket_ = false; 193 fail_next_socket_ = false;
194 return scoped_ptr<DatagramClientSocket>( 194 return scoped_ptr<DatagramClientSocket>(
195 new FailingUDPClientSocket(&empty_data_, net_log)); 195 new FailingUDPClientSocket(&empty_data_, net_log));
196 } 196 }
197 SocketDataProvider* data_provider = mock_data().GetNext(); 197 SocketDataProvider* data_provider = mock_data().GetNext();
198 scoped_ptr<TestUDPClientSocket> socket( 198 scoped_ptr<TestUDPClientSocket> socket(
199 new TestUDPClientSocket(this, data_provider, net_log)); 199 new TestUDPClientSocket(this, data_provider, net_log));
200 data_provider->set_socket(socket.get()); 200 data_provider->set_socket(socket.get());
201 return socket.PassAs<DatagramClientSocket>(); 201 return socket.Pass();
202 } 202 }
203 203
204 void OnConnect(const IPEndPoint& endpoint) { 204 void OnConnect(const IPEndPoint& endpoint) {
205 remote_endpoints_.push_back(endpoint); 205 remote_endpoints_.push_back(endpoint);
206 } 206 }
207 207
208 std::vector<IPEndPoint> remote_endpoints_; 208 std::vector<IPEndPoint> remote_endpoints_;
209 bool fail_next_socket_; 209 bool fail_next_socket_;
210 210
211 private: 211 private:
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 config_.timeout = TestTimeouts::tiny_timeout(); 1002 config_.timeout = TestTimeouts::tiny_timeout();
1003 ConfigureFactory(); 1003 ConfigureFactory();
1004 1004
1005 TransactionHelper helper0(".", dns_protocol::kTypeA, ERR_INVALID_ARGUMENT); 1005 TransactionHelper helper0(".", dns_protocol::kTypeA, ERR_INVALID_ARGUMENT);
1006 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); 1006 EXPECT_TRUE(helper0.Run(transaction_factory_.get()));
1007 } 1007 }
1008 1008
1009 } // namespace 1009 } // namespace
1010 1010
1011 } // namespace net 1011 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/dns_session_unittest.cc ('k') | net/dns/mapped_host_resolver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698