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

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

Issue 2837863004: Use base::OneShotTimer instead of base::Timer(false, false)
Patch Set: rebase Created 3 years, 7 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/base/network_throttle_manager_impl.cc ('k') | net/http/bidirectional_stream.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 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
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
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
OLDNEW
« no previous file with comments | « net/base/network_throttle_manager_impl.cc ('k') | net/http/bidirectional_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698