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

Unified Diff: chrome/renderer/media/cast_session_delegate.cc

Issue 1126873002: Cast: Enable high-resolution timers while casting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment added Created 5 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/media/cast_session_delegate.cc
diff --git a/chrome/renderer/media/cast_session_delegate.cc b/chrome/renderer/media/cast_session_delegate.cc
index 2bd43161d9ad70b6d057c5e522b735c1cd1c79a4..4544016890bfe3c071434f9e88f9a6ecd03ed27c 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(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698