From 6e890ae667477f934f978108a1d8d6c2413a6f05 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Fri, 2 Apr 2010 15:26:11 -0700 Subject: When we stopUpdating(), we should cancel the outstanding timer. When timer fired, we should check m_lastError before calling errorOccurred(). Fix http://b/issue?id=2560897 --- WebCore/platform/android/GeolocationServiceAndroid.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'WebCore') diff --git a/WebCore/platform/android/GeolocationServiceAndroid.cpp b/WebCore/platform/android/GeolocationServiceAndroid.cpp index 61043fb..7f7d58e 100644 --- a/WebCore/platform/android/GeolocationServiceAndroid.cpp +++ b/WebCore/platform/android/GeolocationServiceAndroid.cpp @@ -111,6 +111,9 @@ void GeolocationServiceAndroid::stopUpdating() // new position from the system service when a request is first made. m_lastPosition = 0; m_lastError = 0; + // remove the pending timer + if (m_timer.isActive()) + m_timer.stop(); } void GeolocationServiceAndroid::suspend() @@ -155,7 +158,7 @@ void GeolocationServiceAndroid::timerFired(Timer* tim ASSERT(m_lastPosition || m_lastError); if (m_lastPosition) positionChanged(); - else + else if (m_lastError) errorOccurred(); } -- cgit v1.1