Chromium Code Reviews| Index: Source/modules/vibration/NavigatorVibration.cpp |
| diff --git a/Source/modules/vibration/NavigatorVibration.cpp b/Source/modules/vibration/NavigatorVibration.cpp |
| index 194b2593818eb008b1ce4ac0d3818c0012944800..d2fc5807c0f83f9fdcd783cca2133e1b345d8556 100644 |
| --- a/Source/modules/vibration/NavigatorVibration.cpp |
| +++ b/Source/modules/vibration/NavigatorVibration.cpp |
| @@ -84,6 +84,7 @@ bool NavigatorVibration::vibrate(const VibrationPattern& pattern) |
| } |
| m_timerStart.startOneShot(0); |
| + m_isVibrating = true; |
|
abarth-chromium
2013/07/08 21:04:59
Is that true? Don't we need to wait until the one
kihong
2013/07/12 11:04:13
If we move this to the timerStartFired(), there is
|
| return true; |
| } |
| @@ -112,6 +113,7 @@ void NavigatorVibration::resumeVibration() |
| ASSERT(!m_timerStart.isActive()); |
| m_timerStart.startOneShot(0); |
| + m_isVibrating = true; |
| } |
| void NavigatorVibration::timerStartFired(Timer<NavigatorVibration>* timer) |
| @@ -119,7 +121,6 @@ void NavigatorVibration::timerStartFired(Timer<NavigatorVibration>* timer) |
| ASSERT_UNUSED(timer, timer == &m_timerStart); |
| if (m_pattern.size()) { |
| - m_isVibrating = true; |
| WebKit::Platform::current()->vibrate(m_pattern[0]); |
| m_timerStop.startOneShot(m_pattern[0] / 1000.0); |
| m_pattern.remove(0); |
| @@ -130,7 +131,8 @@ void NavigatorVibration::timerStopFired(Timer<NavigatorVibration>* timer) |
| { |
| ASSERT_UNUSED(timer, timer == &m_timerStop); |
| - m_isVibrating = false; |
| + if (m_pattern.isEmpty()) |
| + m_isVibrating = false; |
| if (m_pattern.size()) { |
| m_timerStart.startOneShot(m_pattern[0] / 1000.0); |