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

Unified Diff: Source/platform/Timer.cpp

Issue 1221973002: Check the return value of Platform::current()->currentThread() for media_blink_unittests. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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: Source/platform/Timer.cpp
diff --git a/Source/platform/Timer.cpp b/Source/platform/Timer.cpp
index 33f33481e0e166583ae9c0817637767e09da58e0..25ac67ec8bee57bb9e7b888d0ab245a5999861bb 100644
--- a/Source/platform/Timer.cpp
+++ b/Source/platform/Timer.cpp
@@ -46,7 +46,7 @@ TimerBase::TimerBase()
, m_unalignedNextFireTime(0)
, m_repeatInterval(0)
, m_cancellableTimerTask(nullptr)
- , m_webScheduler(Platform::current()->currentThread()->scheduler())
+ , m_webScheduler(Platform::current()->currentThread() ? Platform::current()->currentThread()->scheduler() : nullptr)
#if ENABLE(ASSERT)
, m_thread(currentThread())
#endif
@@ -104,7 +104,8 @@ void TimerBase::setNextFireTime(double now, double delay)
if (m_cancellableTimerTask)
m_cancellableTimerTask->cancel();
m_cancellableTimerTask = new CancellableTimerTask(this);
- m_webScheduler->postTimerTask(m_location, m_cancellableTimerTask, delayMs);
+ if (m_webScheduler)
+ m_webScheduler->postTimerTask(m_location, m_cancellableTimerTask, delayMs);
}
}
« 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