Commit 66e43703 authored by hubbe's avatar hubbe Committed by Commit bot

Cast: Enable high-resolution timers while casting.

Review URL: https://codereview.chromium.org/1126873002

Cr-Commit-Position: refs/heads/master@{#328870}
parent e9a593ef
...@@ -37,10 +37,20 @@ CastSessionDelegateBase::CastSessionDelegateBase() ...@@ -37,10 +37,20 @@ CastSessionDelegateBase::CastSessionDelegateBase()
content::RenderThread::Get()->GetIOMessageLoopProxy()), content::RenderThread::Get()->GetIOMessageLoopProxy()),
weak_factory_(this) { weak_factory_(this) {
DCHECK(io_task_runner_.get()); DCHECK(io_task_runner_.get());
#if defined(OS_WIN)
// Note that this also increases the accuracy of PostDelayTask,
// which is is very helpful to cast.
if (!base::Time::ActivateHighResolutionTimer(true)) {
LOG(WARNING) << "Failed to activate high resolution timers for cast.";
}
#endif
} }
CastSessionDelegateBase::~CastSessionDelegateBase() { CastSessionDelegateBase::~CastSessionDelegateBase() {
DCHECK(io_task_runner_->BelongsToCurrentThread()); DCHECK(io_task_runner_->BelongsToCurrentThread());
#if defined(OS_WIN)
base::Time::ActivateHighResolutionTimer(false);
#endif
} }
void CastSessionDelegateBase::StartUDP( void CastSessionDelegateBase::StartUDP(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment