From f7d703686fcbad876e7ce6d21a52d9a6cd71d2e8 Mon Sep 17 00:00:00 2001 From: Steve Block Date: Wed, 2 Sep 2009 16:50:51 +0100 Subject: Brings Mock Geolocation service up to date with latest submission to WebKit. See https://bugs.webkit.org/show_bug.cgi?id=28264. --- WebCore/platform/GeolocationService.cpp | 9 +-------- WebCore/platform/GeolocationService.h | 3 +-- WebCore/platform/MockGeolocationService.cpp | 4 +++- WebCore/platform/MockGeolocationService.h | 6 +++--- 4 files changed, 8 insertions(+), 14 deletions(-) (limited to 'WebCore/platform') diff --git a/WebCore/platform/GeolocationService.cpp b/WebCore/platform/GeolocationService.cpp index 454538e..4fd678b 100644 --- a/WebCore/platform/GeolocationService.cpp +++ b/WebCore/platform/GeolocationService.cpp @@ -48,16 +48,9 @@ GeolocationService* GeolocationService::create(GeolocationServiceClient* client) return (*s_factoryFunction)(client); } -void GeolocationService::setMockPosition(PassRefPtr position) +void GeolocationService::useMock() { s_factoryFunction = &MockGeolocationService::create; - MockGeolocationService::setPosition(position); -} - -void GeolocationService::setMockError(PassRefPtr error) -{ - s_factoryFunction = &MockGeolocationService::create; - MockGeolocationService::setError(error); } GeolocationService::GeolocationService(GeolocationServiceClient* client) diff --git a/WebCore/platform/GeolocationService.h b/WebCore/platform/GeolocationService.h index 3084aad..a99523f 100644 --- a/WebCore/platform/GeolocationService.h +++ b/WebCore/platform/GeolocationService.h @@ -60,8 +60,7 @@ public: void positionChanged(); void errorOccurred(); - static void setMockPosition(PassRefPtr); - static void setMockError(PassRefPtr); + static void useMock(); protected: GeolocationService(GeolocationServiceClient*); diff --git a/WebCore/platform/MockGeolocationService.cpp b/WebCore/platform/MockGeolocationService.cpp index 515bd97..72d85ef 100755 --- a/WebCore/platform/MockGeolocationService.cpp +++ b/WebCore/platform/MockGeolocationService.cpp @@ -60,6 +60,7 @@ MockGeolocationService::~MockGeolocationService() void MockGeolocationService::setPosition(PassRefPtr position) { initStatics(); + GeolocationService::useMock(); *s_lastPosition = position; *s_lastError = 0; makeGeolocationCallbackFromAllInstances(); @@ -68,6 +69,7 @@ void MockGeolocationService::setPosition(PassRefPtr position) void MockGeolocationService::setError(PassRefPtr error) { initStatics(); + GeolocationService::useMock(); *s_lastError = error; *s_lastPosition = 0; makeGeolocationCallbackFromAllInstances(); @@ -81,7 +83,7 @@ bool MockGeolocationService::startUpdating(PositionOptions*) void MockGeolocationService::timerFired(Timer* timer) { - if (timer != &m_timer) ASSERT(0); + ASSERT_UNUSED(timer, timer == &m_timer); makeGeolocationCallback(); } diff --git a/WebCore/platform/MockGeolocationService.h b/WebCore/platform/MockGeolocationService.h index eb92cbc..2f190e6 100755 --- a/WebCore/platform/MockGeolocationService.h +++ b/WebCore/platform/MockGeolocationService.h @@ -63,12 +63,12 @@ class MockGeolocationService : public GeolocationService { static void initStatics(); static void cleanUpStatics(); - static RefPtr* s_lastPosition; - static RefPtr* s_lastError; - typedef HashSet MockGeolocationServiceSet; static MockGeolocationServiceSet* s_instances; + static RefPtr* s_lastPosition; + static RefPtr* s_lastError; + Timer m_timer; }; -- cgit v1.1