diff options
author | noamsml@chromium.org <noamsml@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-02 23:26:22 +0000 |
---|---|---|
committer | noamsml@chromium.org <noamsml@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-02 23:26:22 +0000 |
commit | 9c61d25a060c01b7874dea3152c1f0333ac7f1e7 (patch) | |
tree | c646b3c44a43e63866cc93e972231a973d70a739 /net/dns/mdns_client.h | |
parent | d54e1ae44e703bb2d5f3764392a14175ae99eb82 (diff) | |
download | chromium_src-9c61d25a060c01b7874dea3152c1f0333ac7f1e7.zip chromium_src-9c61d25a060c01b7874dea3152c1f0333ac7f1e7.tar.gz chromium_src-9c61d25a060c01b7874dea3152c1f0333ac7f1e7.tar.bz2 |
Add an explicit way of forcing the MDnsClient to listen on the network
Add an object called MDnsListenRef, whose existence forces the MDnsClient to
continue listening on the network, but who has no other function.
Rationale: Since a sandboxed process using an MDnsClient may not be able
to create new sockets on demand, it makes sense to force the MDnsClient to
be awake for the lifetime of the process. Add the ability to force the
MDnsClient to stay awake.
Also useful for abstractions over MDnsClient where you know that it makes sense
not to immediately shut down the client even if we shut down all listeners and
transactions.
BUG=233821
Review URL: https://chromiumcodereview.appspot.com/17922002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209812 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/dns/mdns_client.h')
-rw-r--r-- | net/dns/mdns_client.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/dns/mdns_client.h b/net/dns/mdns_client.h index 9e3bdb7..21022c8 100644 --- a/net/dns/mdns_client.h +++ b/net/dns/mdns_client.h @@ -143,6 +143,13 @@ class NET_EXPORT MDnsClient { int flags, const MDnsTransaction::ResultCallback& callback) = 0; + virtual bool StartListening() = 0; + + // Do not call this inside callbacks from related MDnsListener and + // MDnsTransaction objects. + virtual void StopListening() = 0; + virtual bool IsListening() const = 0; + // Lazily create and return static instance for MDnsClient. static MDnsClient* GetInstance(); |