summaryrefslogtreecommitdiffstats
path: root/cloud_print/gcp20/prototype/dns_sd_server.cc
diff options
context:
space:
mode:
authormaksymb@chromium.org <maksymb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-23 15:39:15 +0000
committermaksymb@chromium.org <maksymb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-23 15:39:15 +0000
commita20b019ab8ee1eeba45257d9c8774e88b1a665e4 (patch)
tree8b62906129a1a89134c3a9447026fcdf885da71b /cloud_print/gcp20/prototype/dns_sd_server.cc
parent73f6d0a7200a072972d4c8dd774f6f5cd341ff47 (diff)
downloadchromium_src-a20b019ab8ee1eeba45257d9c8774e88b1a665e4.zip
chromium_src-a20b019ab8ee1eeba45257d9c8774e88b1a665e4.tar.gz
chromium_src-a20b019ab8ee1eeba45257d9c8774e88b1a665e4.tar.bz2
XPrivetToken, saving to file, little extend for /privet/info.
Review URL: https://chromiumcodereview.appspot.com/18703004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213129 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print/gcp20/prototype/dns_sd_server.cc')
-rw-r--r--cloud_print/gcp20/prototype/dns_sd_server.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/cloud_print/gcp20/prototype/dns_sd_server.cc b/cloud_print/gcp20/prototype/dns_sd_server.cc
index cecb8d5..38dfb35 100644
--- a/cloud_print/gcp20/prototype/dns_sd_server.cc
+++ b/cloud_print/gcp20/prototype/dns_sd_server.cc
@@ -66,7 +66,7 @@ bool DnsSdServer::Start(const ServiceParameters& serv_params, uint32 full_ttl,
SendAnnouncement(full_ttl_);
base::MessageLoop::current()->PostTask(
FROM_HERE,
- base::Bind(&DnsSdServer::OnDatagramReceived, base::Unretained(this)));
+ base::Bind(&DnsSdServer::OnDatagramReceived, AsWeakPtr()));
return true;
}
@@ -242,11 +242,8 @@ void DnsSdServer::DoLoop(int rv) {
do {
if (rv > 0)
ProcessMessage(rv, recv_buf_.get());
- rv = socket_->RecvFrom(
- recv_buf_.get(),
- recv_buf_->size(),
- &recv_address_,
- base::Bind(&DnsSdServer::DoLoop, base::Unretained(this)));
+ rv = socket_->RecvFrom(recv_buf_.get(), recv_buf_->size(), &recv_address_,
+ base::Bind(&DnsSdServer::DoLoop, AsWeakPtr()));
} while (rv > 0);
// TODO(maksymb): Add handler for errors
@@ -285,7 +282,7 @@ void DnsSdServer::SendAnnouncement(uint32 ttl) {
// Schedule next announcement.
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE,
- base::Bind(&DnsSdServer::Update, base::Unretained(this)),
+ base::Bind(&DnsSdServer::Update, AsWeakPtr()),
base::TimeDelta::FromSeconds(static_cast<int64>(
kTimeToNextAnnouncement*full_ttl_)));
}