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

Unified Diff: net/dns/mdns_client_impl.cc

Issue 578703003: use base::Time constants in net module instead of using static constants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed as per review comment Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/mdns_client_impl.cc
diff --git a/net/dns/mdns_client_impl.cc b/net/dns/mdns_client_impl.cc
index 68cee7a87ec1572b395a964ec6b4de588fedb4b1..1745385784a8ec4ba1f6e1b420fa877f7b190d7f 100644
--- a/net/dns/mdns_client_impl.cc
+++ b/net/dns/mdns_client_impl.cc
@@ -8,6 +8,7 @@
#include "base/message_loop/message_loop_proxy.h"
#include "base/stl_util.h"
#include "base/time/default_clock.h"
+#include "base/time/time.h"
#include "net/base/dns_util.h"
#include "net/base/net_errors.h"
#include "net/base/net_log.h"
@@ -32,7 +33,6 @@ const unsigned MDnsTransactionTimeoutSeconds = 3;
// the original TTL.
const double kListenerRefreshRatio1 = 0.85;
const double kListenerRefreshRatio2 = 0.95;
-const unsigned kMillisecondsPerSecond = 1000;
} // namespace
@@ -538,11 +538,11 @@ void MDnsListenerImpl::ScheduleNextRefresh() {
// be canceled and rescheduled if the record's TTL is updated due to a
// response being received.
base::Time next_refresh1 = last_update_ + base::TimeDelta::FromMilliseconds(
- static_cast<int>(kMillisecondsPerSecond *
+ static_cast<int>(base::Time::kMillisecondsPerSecond *
kListenerRefreshRatio1 * ttl_));
base::Time next_refresh2 = last_update_ + base::TimeDelta::FromMilliseconds(
- static_cast<int>(kMillisecondsPerSecond *
+ static_cast<int>(base::Time::kMillisecondsPerSecond *
kListenerRefreshRatio2 * ttl_));
base::MessageLoop::current()->PostDelayedTask(
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698