summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2009-12-07 07:07:48 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-07 07:07:48 -0800
commit0f8689e3c342fdff08c07ae113e5b33393b15010 (patch)
treea830e0bded7dc19f4675b8e526c3b32b829a0de3 /WebCore
parent99c4892c4dc329dc28f1fee13e1603613b80fd86 (diff)
parent462daf4b80f6d97c9d1f2b446c7fd61a35c49a59 (diff)
downloadexternal_webkit-0f8689e3c342fdff08c07ae113e5b33393b15010.zip
external_webkit-0f8689e3c342fdff08c07ae113e5b33393b15010.tar.gz
external_webkit-0f8689e3c342fdff08c07ae113e5b33393b15010.tar.bz2
am 462daf4b: Merge change I9a5736f5 into eclair-mr2
Merge commit '462daf4b80f6d97c9d1f2b446c7fd61a35c49a59' into eclair-mr2-plus-aosp * commit '462daf4b80f6d97c9d1f2b446c7fd61a35c49a59': Fixes a Geolocation bug with cached positions.
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/page/Geolocation.cpp17
-rw-r--r--WebCore/page/Geolocation.h1
2 files changed, 13 insertions, 5 deletions
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index 978a1b0..604802f 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -136,6 +136,11 @@ void Geolocation::Watchers::remove(GeoNotifier* notifier)
m_notifierToIdMap.remove(iter);
}
+bool Geolocation::Watchers::contains(GeoNotifier* notifier) const
+{
+ return m_notifierToIdMap.contains(notifier);
+}
+
void Geolocation::Watchers::clear()
{
m_idToNotifierMap.clear();
@@ -403,11 +408,13 @@ void Geolocation::requestReturnedCachedPosition(GeoNotifier* notifier)
return;
}
- // Otherwise, start the service to get updates.
- if (m_service->startUpdating(notifier->m_options.get()))
- notifier->startTimerIfNeeded();
- else
- notifier->setFatalError(PositionError::create(PositionError::UNKNOWN_ERROR, "Failed to start Geolocation service"));
+ // Otherwise, if the watch still exists, start the service to get updates.
+ if (m_watchers.contains(notifier)) {
+ if (m_service->startUpdating(notifier->m_options.get()))
+ notifier->startTimerIfNeeded();
+ else
+ notifier->setFatalError(PositionError::create(PositionError::UNKNOWN_ERROR, "Failed to start Geolocation service"));
+ }
}
bool Geolocation::haveSuitableCachedPosition(PositionOptions* options)
diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h
index d9b23c4..fd9d560 100644
--- a/WebCore/page/Geolocation.h
+++ b/WebCore/page/Geolocation.h
@@ -105,6 +105,7 @@ private:
void set(int id, PassRefPtr<GeoNotifier>);
void remove(int id);
void remove(GeoNotifier*);
+ bool contains(GeoNotifier*) const;
void clear();
bool isEmpty() const;
void getNotifiersVector(Vector<RefPtr<GeoNotifier> >&) const;