diff options
author | Jordan Bayles <jophba@chromium.org> | 2020-05-15 17:08:11 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-18 17:39:18 +0000 |
commit | ca609c305ed10d10cc2f8c07e772f17d5f94f474 (patch) | |
tree | 4e36a1ce3c9877237f4dab4d4bba58d5919fb1c8 /cast/common | |
parent | 4a4a818a80ec7af2e03592818a624553f23eb9ef (diff) | |
download | openscreen-ca609c305ed10d10cc2f8c07e772f17d5f94f474.tar.gz |
Time and clock::duration cleanups
This patch contains a few minor time-related cleanups:
1. Instead of having using statements literally everywhere, moved to
using statements for common std::chrono types in the trivial clock
traits header.
2. Removed some Clock::duration types in favor of
std::chrono::milliseconds, because Clock::duration is frequently used
incorrectly--it's microseconds, not milliseconds, so typical
instantiation values of 50 are essentially 0 seconds.
Change-Id: If2b30ca7605bf40165dfb6e76f8386ffa1c0eb87
Reviewed-on: https://chromium-review.googlesource.com/c/openscreen/+/2204429
Reviewed-by: Ryan Keane <rwkeane@google.com>
Commit-Queue: Jordan Bayles <jophba@chromium.org>
Diffstat (limited to 'cast/common')
-rw-r--r-- | cast/common/discovery/e2e_test/tests.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cast/common/discovery/e2e_test/tests.cc b/cast/common/discovery/e2e_test/tests.cc index 80216f26..97f4baf8 100644 --- a/cast/common/discovery/e2e_test/tests.cc +++ b/cast/common/discovery/e2e_test/tests.cc @@ -41,7 +41,7 @@ constexpr int kMaxCheckLoopIterations = 25; // Publishes new service instances. class Publisher : public discovery::DnsSdServicePublisher<ServiceInfo> { public: - Publisher(discovery::DnsSdService* service) + explicit Publisher(discovery::DnsSdService* service) : DnsSdServicePublisher<ServiceInfo>(service, kCastV2ServiceId, ServiceInfoToDnsSdInstance) { @@ -68,7 +68,7 @@ class Publisher : public discovery::DnsSdServicePublisher<ServiceInfo> { // Receives incoming services and outputs their results to stdout. class Receiver : public discovery::DnsSdServiceWatcher<ServiceInfo> { public: - Receiver(discovery::DnsSdService* service) + explicit Receiver(discovery::DnsSdService* service) : discovery::DnsSdServiceWatcher<ServiceInfo>( service, kCastV2ServiceId, @@ -135,7 +135,7 @@ class DiscoveryE2ETest : public testing::Test { // Sleep to let any packets clear off the network before further tests. std::this_thread::sleep_for(std::chrono::milliseconds(500)); - PlatformClientPosix::Create(Clock::duration{50}, Clock::duration{50}); + PlatformClientPosix::Create(milliseconds{50}, milliseconds{50}); task_runner_ = PlatformClientPosix::GetInstance()->GetTaskRunner(); } |