summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhubbe <hubbe@chromium.org>2015-05-07 16:05:51 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-07 23:06:21 +0000
commit66e437031fab7d461eca47dec31e561d42768711 (patch)
treeb2e50ef99d62f2db9dfb5b1f16202a7924f2c02f
parente9a593ef53f82a9cae5fa4ab68b427daa47bda1c (diff)
downloadchromium_src-66e437031fab7d461eca47dec31e561d42768711.zip
chromium_src-66e437031fab7d461eca47dec31e561d42768711.tar.gz
chromium_src-66e437031fab7d461eca47dec31e561d42768711.tar.bz2
Cast: Enable high-resolution timers while casting.
Review URL: https://codereview.chromium.org/1126873002 Cr-Commit-Position: refs/heads/master@{#328870}
-rw-r--r--chrome/renderer/media/cast_session_delegate.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/renderer/media/cast_session_delegate.cc b/chrome/renderer/media/cast_session_delegate.cc
index 2bd4316..4544016 100644
--- a/chrome/renderer/media/cast_session_delegate.cc
+++ b/chrome/renderer/media/cast_session_delegate.cc
@@ -37,10 +37,20 @@ CastSessionDelegateBase::CastSessionDelegateBase()
content::RenderThread::Get()->GetIOMessageLoopProxy()),
weak_factory_(this) {
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() {
DCHECK(io_task_runner_->BelongsToCurrentThread());
+#if defined(OS_WIN)
+ base::Time::ActivateHighResolutionTimer(false);
+#endif
}
void CastSessionDelegateBase::StartUDP(