| 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 <deque> | 7 #include <deque> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 } | 435 } |
| 436 | 436 |
| 437 // Begins query for the current name. Makes the first attempt. | 437 // Begins query for the current name. Makes the first attempt. |
| 438 AttemptResult StartQuery() { | 438 AttemptResult StartQuery() { |
| 439 std::string dotted_qname = DNSDomainToString(qnames_.front()); | 439 std::string dotted_qname = DNSDomainToString(qnames_.front()); |
| 440 net_log_.BeginEvent(NetLog::TYPE_DNS_TRANSACTION_QUERY, | 440 net_log_.BeginEvent(NetLog::TYPE_DNS_TRANSACTION_QUERY, |
| 441 NetLog::StringCallback("qname", &dotted_qname)); | 441 NetLog::StringCallback("qname", &dotted_qname)); |
| 442 | 442 |
| 443 first_server_index_ = session_->NextFirstServerIndex(); | 443 first_server_index_ = session_->NextFirstServerIndex(); |
| 444 | 444 |
| 445 attempts_.reset(); | 445 attempts_.clear(); |
| 446 return MakeAttempt(); | 446 return MakeAttempt(); |
| 447 } | 447 } |
| 448 | 448 |
| 449 void OnAttemptComplete(unsigned attempt_number, int rv) { | 449 void OnAttemptComplete(unsigned attempt_number, int rv) { |
| 450 if (callback_.is_null()) | 450 if (callback_.is_null()) |
| 451 return; | 451 return; |
| 452 DCHECK_LT(attempt_number, attempts_.size()); | 452 DCHECK_LT(attempt_number, attempts_.size()); |
| 453 const DnsUDPAttempt* attempt = attempts_[attempt_number]; | 453 const DnsUDPAttempt* attempt = attempts_[attempt_number]; |
| 454 AttemptResult result = FinishAttempt(AttemptResult(rv, attempt)); | 454 AttemptResult result = FinishAttempt(AttemptResult(rv, attempt)); |
| 455 if (result.rv != ERR_IO_PENDING) | 455 if (result.rv != ERR_IO_PENDING) |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 } // namespace | 579 } // namespace |
| 580 | 580 |
| 581 // static | 581 // static |
| 582 scoped_ptr<DnsTransactionFactory> DnsTransactionFactory::CreateFactory( | 582 scoped_ptr<DnsTransactionFactory> DnsTransactionFactory::CreateFactory( |
| 583 DnsSession* session) { | 583 DnsSession* session) { |
| 584 return scoped_ptr<DnsTransactionFactory>( | 584 return scoped_ptr<DnsTransactionFactory>( |
| 585 new DnsTransactionFactoryImpl(session)); | 585 new DnsTransactionFactoryImpl(session)); |
| 586 } | 586 } |
| 587 | 587 |
| 588 } // namespace net | 588 } // namespace net |
| 589 | |
| OLD | NEW |