diff options
author | Steve Block <steveblock@google.com> | 2009-09-02 16:50:51 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-09-02 16:57:47 +0100 |
commit | f7d703686fcbad876e7ce6d21a52d9a6cd71d2e8 (patch) | |
tree | f7ae44c8c7dff6c35f58a0a9a4fe084f57b5e919 /WebCore/platform | |
parent | 75310d0981eaef5dfd790e839bf23d7851b68d10 (diff) | |
download | external_webkit-f7d703686fcbad876e7ce6d21a52d9a6cd71d2e8.zip external_webkit-f7d703686fcbad876e7ce6d21a52d9a6cd71d2e8.tar.gz external_webkit-f7d703686fcbad876e7ce6d21a52d9a6cd71d2e8.tar.bz2 |
Brings Mock Geolocation service up to date with latest submission to WebKit.
See https://bugs.webkit.org/show_bug.cgi?id=28264.
Diffstat (limited to 'WebCore/platform')
-rw-r--r-- | WebCore/platform/GeolocationService.cpp | 9 | ||||
-rw-r--r-- | WebCore/platform/GeolocationService.h | 3 | ||||
-rwxr-xr-x | WebCore/platform/MockGeolocationService.cpp | 4 | ||||
-rwxr-xr-x | WebCore/platform/MockGeolocationService.h | 6 |
4 files changed, 8 insertions, 14 deletions
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<Geoposition> position) +void GeolocationService::useMock() { s_factoryFunction = &MockGeolocationService::create; - MockGeolocationService::setPosition(position); -} - -void GeolocationService::setMockError(PassRefPtr<PositionError> 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<Geoposition>); - static void setMockError(PassRefPtr<PositionError>); + 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<Geoposition> position) { initStatics(); + GeolocationService::useMock(); *s_lastPosition = position; *s_lastError = 0; makeGeolocationCallbackFromAllInstances(); @@ -68,6 +69,7 @@ void MockGeolocationService::setPosition(PassRefPtr<Geoposition> position) void MockGeolocationService::setError(PassRefPtr<PositionError> error) { initStatics(); + GeolocationService::useMock(); *s_lastError = error; *s_lastPosition = 0; makeGeolocationCallbackFromAllInstances(); @@ -81,7 +83,7 @@ bool MockGeolocationService::startUpdating(PositionOptions*) void MockGeolocationService::timerFired(Timer<MockGeolocationService>* 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<Geoposition>* s_lastPosition; - static RefPtr<PositionError>* s_lastError; - typedef HashSet<MockGeolocationService*> MockGeolocationServiceSet; static MockGeolocationServiceSet* s_instances; + static RefPtr<Geoposition>* s_lastPosition; + static RefPtr<PositionError>* s_lastError; + Timer<MockGeolocationService> m_timer; }; |