diff options
author | noamsml@chromium.org <noamsml@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-30 08:07:42 +0000 |
---|---|---|
committer | noamsml@chromium.org <noamsml@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-30 08:07:42 +0000 |
commit | bdd6c3d5e38ea165ed435002f7755ffbeed68814 (patch) | |
tree | 4e2c19ae90b12dd32439f6448e6d4925929929d5 /net/dns/mdns_client_impl.h | |
parent | 4f0fd02be3a117b7b622833ae0332442ca62b53e (diff) | |
download | chromium_src-bdd6c3d5e38ea165ed435002f7755ffbeed68814.zip chromium_src-bdd6c3d5e38ea165ed435002f7755ffbeed68814.tar.gz chromium_src-bdd6c3d5e38ea165ed435002f7755ffbeed68814.tar.bz2 |
Add the ability for MDnsListener to actively refresh records
If the MDnsListener is listening for a record we care about, actively refresh
it.
BUG=336883
R=vitalybuka@chromium.org,szym@chromium.org
Review URL: https://codereview.chromium.org/132693025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/dns/mdns_client_impl.h')
-rw-r--r-- | net/dns/mdns_client_impl.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/net/dns/mdns_client_impl.h b/net/dns/mdns_client_impl.h index f755985..7660788 100644 --- a/net/dns/mdns_client_impl.h +++ b/net/dns/mdns_client_impl.h @@ -133,7 +133,7 @@ class NET_EXPORT_PRIVATE MDnsClientImpl : public MDnsClient { ListenerMap; // Alert listeners of an update to the cache. - void AlertListeners(MDnsListener::UpdateType update_type, + void AlertListeners(MDnsCache::UpdateType update_type, const ListenerKey& key, const RecordParsed* record); // Schedule a cache cleanup to a specific time, cancelling other cleanups. @@ -156,7 +156,7 @@ class NET_EXPORT_PRIVATE MDnsClientImpl : public MDnsClient { MDnsClientImpl* client_; MDnsCache cache_; - base::CancelableCallback<void()> cleanup_callback_; + base::CancelableClosure cleanup_callback_; base::Time scheduled_cleanup_; scoped_ptr<MDnsConnection> connection_; @@ -204,6 +204,9 @@ class MDnsListenerImpl : public MDnsListener, // MDnsListener implementation: virtual bool Start() OVERRIDE; + // Actively refresh any received records. + virtual void SetActiveRefresh(bool active_refresh) OVERRIDE; + virtual const std::string& GetName() const OVERRIDE; virtual uint16 GetType() const OVERRIDE; @@ -211,19 +214,27 @@ class MDnsListenerImpl : public MDnsListener, MDnsListener::Delegate* delegate() { return delegate_; } // Alert the delegate of a record update. - void AlertDelegate(MDnsListener::UpdateType update_type, - const RecordParsed* record_parsed); + void HandleRecordUpdate(MDnsCache::UpdateType update_type, + const RecordParsed* record_parsed); // Alert the delegate of the existence of an Nsec record. void AlertNsecRecord(); private: + void ScheduleNextRefresh(); + void DoRefresh(); + uint16 rrtype_; std::string name_; MDnsClientImpl* client_; MDnsListener::Delegate* delegate_; + base::Time last_update_; + uint32 ttl_; bool started_; + bool active_refresh_; + + base::CancelableClosure next_refresh_; DISALLOW_COPY_AND_ASSIGN(MDnsListenerImpl); }; |