Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 config_.nameservers.push_back(IPEndPoint(dns_ip, | 293 config_.nameservers.push_back(IPEndPoint(dns_ip, |
| 294 dns_protocol::kDefaultPort)); | 294 dns_protocol::kDefaultPort)); |
| 295 } | 295 } |
| 296 } | 296 } |
| 297 | 297 |
| 298 // Called after fully configuring |config|. | 298 // Called after fully configuring |config|. |
| 299 void ConfigureFactory() { | 299 void ConfigureFactory() { |
| 300 socket_factory_.reset(new TestSocketFactory()); | 300 socket_factory_.reset(new TestSocketFactory()); |
| 301 session_ = new DnsSession( | 301 session_ = new DnsSession( |
| 302 config_, | 302 config_, |
| 303 socket_factory_.get(), | 303 DnsSocketPool::CreateDefault(socket_factory_.get()).Pass(), |
|
szym
2012/09/26 11:16:12
No need for Pass().
Deprecated (see juliatuttle)
2012/09/26 20:44:50
Done.
| |
| 304 base::Bind(&DnsTransactionTest::GetNextId, base::Unretained(this)), | 304 base::Bind(&DnsTransactionTest::GetNextId, base::Unretained(this)), |
| 305 NULL /* NetLog */); | 305 NULL /* NetLog */); |
| 306 transaction_factory_ = DnsTransactionFactory::CreateFactory(session_.get()); | 306 transaction_factory_ = DnsTransactionFactory::CreateFactory(session_.get()); |
| 307 } | 307 } |
| 308 | 308 |
| 309 void AddSocketData(scoped_ptr<DnsSocketData> data) { | 309 void AddSocketData(scoped_ptr<DnsSocketData> data) { |
| 310 transaction_ids_.push_back(data->query_id()); | 310 transaction_ids_.push_back(data->query_id()); |
| 311 socket_factory_->AddSocketDataProvider(data->GetProvider()); | 311 socket_factory_->AddSocketDataProvider(data->GetProvider()); |
| 312 socket_data_.push_back(data.release()); | 312 socket_data_.push_back(data.release()); |
| 313 } | 313 } |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 798 AddSyncQueryAndResponse(2 /* id */, kT2HostName, kT2Qtype, | 798 AddSyncQueryAndResponse(2 /* id */, kT2HostName, kT2Qtype, |
| 799 kT2ResponseDatagram, arraysize(kT2ResponseDatagram)); | 799 kT2ResponseDatagram, arraysize(kT2ResponseDatagram)); |
| 800 | 800 |
| 801 TransactionHelper helper0("www", kT2Qtype, kT2RecordCount); | 801 TransactionHelper helper0("www", kT2Qtype, kT2RecordCount); |
| 802 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); | 802 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); |
| 803 } | 803 } |
| 804 | 804 |
| 805 } // namespace | 805 } // namespace |
| 806 | 806 |
| 807 } // namespace net | 807 } // namespace net |
| OLD | NEW |