| 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_test_util.h" | 5 #include "net/dns/dns_test_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/big_endian.h" | 9 #include "base/big_endian.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 public: | 164 public: |
| 165 explicit MockTransactionFactory(const MockDnsClientRuleList& rules) | 165 explicit MockTransactionFactory(const MockDnsClientRuleList& rules) |
| 166 : rules_(rules) {} | 166 : rules_(rules) {} |
| 167 | 167 |
| 168 ~MockTransactionFactory() override {} | 168 ~MockTransactionFactory() override {} |
| 169 | 169 |
| 170 std::unique_ptr<DnsTransaction> CreateTransaction( | 170 std::unique_ptr<DnsTransaction> CreateTransaction( |
| 171 const std::string& hostname, | 171 const std::string& hostname, |
| 172 uint16_t qtype, | 172 uint16_t qtype, |
| 173 const DnsTransactionFactory::CallbackType& callback, | 173 const DnsTransactionFactory::CallbackType& callback, |
| 174 const BoundNetLog&) override { | 174 const NetLogWithSource&) override { |
| 175 MockTransaction* transaction = | 175 MockTransaction* transaction = |
| 176 new MockTransaction(rules_, hostname, qtype, callback); | 176 new MockTransaction(rules_, hostname, qtype, callback); |
| 177 if (transaction->delayed()) | 177 if (transaction->delayed()) |
| 178 delayed_transactions_.push_back(transaction->AsWeakPtr()); | 178 delayed_transactions_.push_back(transaction->AsWeakPtr()); |
| 179 return std::unique_ptr<DnsTransaction>(transaction); | 179 return std::unique_ptr<DnsTransaction>(transaction); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void CompleteDelayedTransactions() { | 182 void CompleteDelayedTransactions() { |
| 183 DelayedTransactionList old_delayed_transactions; | 183 DelayedTransactionList old_delayed_transactions; |
| 184 old_delayed_transactions.swap(delayed_transactions_); | 184 old_delayed_transactions.swap(delayed_transactions_); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 std::unique_ptr<const base::Value> MockDnsClient::GetPersistentData() const { | 226 std::unique_ptr<const base::Value> MockDnsClient::GetPersistentData() const { |
| 227 return std::unique_ptr<const base::Value>(); | 227 return std::unique_ptr<const base::Value>(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 void MockDnsClient::CompleteDelayedTransactions() { | 230 void MockDnsClient::CompleteDelayedTransactions() { |
| 231 factory_->CompleteDelayedTransactions(); | 231 factory_->CompleteDelayedTransactions(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 } // namespace net | 234 } // namespace net |
| OLD | NEW |