diff options
Diffstat (limited to 'WebCore/platform/MockGeolocationService.cpp')
-rwxr-xr-x | WebCore/platform/MockGeolocationService.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/WebCore/platform/MockGeolocationService.cpp b/WebCore/platform/MockGeolocationService.cpp index 72d85ef..b147f53 100755 --- a/WebCore/platform/MockGeolocationService.cpp +++ b/WebCore/platform/MockGeolocationService.cpp @@ -45,6 +45,7 @@ GeolocationService* MockGeolocationService::create(GeolocationServiceClient* cli MockGeolocationService::MockGeolocationService(GeolocationServiceClient* client) : GeolocationService(client) , m_timer(this, &MockGeolocationService::timerFired) + , m_isActive(false) { s_instances->add(this); } @@ -77,10 +78,16 @@ void MockGeolocationService::setError(PassRefPtr<PositionError> error) bool MockGeolocationService::startUpdating(PositionOptions*) { + m_isActive = true; m_timer.startOneShot(0); return true; } +void MockGeolocationService::stopUpdating() +{ + m_isActive = false; +} + void MockGeolocationService::timerFired(Timer<MockGeolocationService>* timer) { ASSERT_UNUSED(timer, timer == &m_timer); @@ -99,6 +106,9 @@ void MockGeolocationService::makeGeolocationCallbackFromAllInstances() void MockGeolocationService::makeGeolocationCallback() { + if (!m_isActive) + return; + if (*s_lastPosition) { positionChanged(); } else if (*s_lastError) { |