| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/mdns_client_impl.h" | 5 #include "net/dns/mdns_client_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 415 } |
| 416 | 416 |
| 417 void MDnsClientImpl::Core::QueryCache( | 417 void MDnsClientImpl::Core::QueryCache( |
| 418 uint16_t rrtype, | 418 uint16_t rrtype, |
| 419 const std::string& name, | 419 const std::string& name, |
| 420 std::vector<const RecordParsed*>* records) const { | 420 std::vector<const RecordParsed*>* records) const { |
| 421 cache_.FindDnsRecords(rrtype, name, records, clock_->Now()); | 421 cache_.FindDnsRecords(rrtype, name, records, clock_->Now()); |
| 422 } | 422 } |
| 423 | 423 |
| 424 MDnsClientImpl::MDnsClientImpl() | 424 MDnsClientImpl::MDnsClientImpl() |
| 425 : clock_(new base::DefaultClock), | 425 : clock_(new base::DefaultClock), cleanup_timer_(new base::OneShotTimer) {} |
| 426 cleanup_timer_(new base::Timer(false, false)) { | |
| 427 } | |
| 428 | 426 |
| 429 MDnsClientImpl::MDnsClientImpl(std::unique_ptr<base::Clock> clock, | 427 MDnsClientImpl::MDnsClientImpl(std::unique_ptr<base::Clock> clock, |
| 430 std::unique_ptr<base::Timer> timer) | 428 std::unique_ptr<base::Timer> timer) |
| 431 : clock_(std::move(clock)), cleanup_timer_(std::move(timer)) {} | 429 : clock_(std::move(clock)), cleanup_timer_(std::move(timer)) {} |
| 432 | 430 |
| 433 MDnsClientImpl::~MDnsClientImpl() { | 431 MDnsClientImpl::~MDnsClientImpl() { |
| 434 } | 432 } |
| 435 | 433 |
| 436 bool MDnsClientImpl::StartListening(MDnsSocketFactory* socket_factory) { | 434 bool MDnsClientImpl::StartListening(MDnsSocketFactory* socket_factory) { |
| 437 DCHECK(!core_.get()); | 435 DCHECK(!core_.get()); |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 | 739 |
| 742 void MDnsTransactionImpl::OnNsecRecord(const std::string& name, unsigned type) { | 740 void MDnsTransactionImpl::OnNsecRecord(const std::string& name, unsigned type) { |
| 743 TriggerCallback(RESULT_NSEC, NULL); | 741 TriggerCallback(RESULT_NSEC, NULL); |
| 744 } | 742 } |
| 745 | 743 |
| 746 void MDnsTransactionImpl::OnCachePurged() { | 744 void MDnsTransactionImpl::OnCachePurged() { |
| 747 // TODO(noamsml): Cache purge situations not yet implemented | 745 // TODO(noamsml): Cache purge situations not yet implemented |
| 748 } | 746 } |
| 749 | 747 |
| 750 } // namespace net | 748 } // namespace net |
| OLD | NEW |