summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/page/Geolocation.cpp8
-rw-r--r--WebCore/platform/GeolocationService.h5
-rw-r--r--WebCore/platform/android/GeolocationServiceAndroid.cpp9
-rw-r--r--WebCore/platform/android/GeolocationServiceAndroid.h4
-rw-r--r--WebCore/platform/android/PlatformBridge.h4
-rw-r--r--WebCore/platform/mock/GeolocationServiceMock.cpp5
-rwxr-xr-xWebCore/platform/mock/GeolocationServiceMock.h5
7 files changed, 35 insertions, 5 deletions
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index e55d2b1..9ca844c 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -34,6 +34,7 @@
#include "EventNames.h"
#include "Frame.h"
#include "Page.h"
+#include "PlatformBridge.h"
#include <wtf/CurrentTime.h>
#if ENABLE(CLIENT_BASED_GEOLOCATION)
@@ -648,8 +649,15 @@ bool Geolocation::startUpdating(GeoNotifier* notifier)
page->geolocationController()->addObserver(this);
return true;
#else
+#if PLATFORM(ANDROID)
+ // TODO: Upstream to webkit.org. See https://bugs.webkit.org/show_bug.cgi?id=34082
+ // Note that the correct fix is to use a 'paused' flag in WebCore, rather
+ // than calling into PlatformBridge.
+ return m_service->startUpdating(notifier->m_options.get(), PlatformBridge::isWebViewPaused(m_frame->view()));
+#else
return m_service->startUpdating(notifier->m_options.get());
#endif
+#endif
}
void Geolocation::stopUpdating()
diff --git a/WebCore/platform/GeolocationService.h b/WebCore/platform/GeolocationService.h
index cebf313..f991f67 100644
--- a/WebCore/platform/GeolocationService.h
+++ b/WebCore/platform/GeolocationService.h
@@ -47,7 +47,12 @@ public:
static GeolocationService* create(GeolocationServiceClient*);
virtual ~GeolocationService() { }
+#if PLATFORM(ANDROID)
+ // TODO: Upstream to webkit.org. See https://bugs.webkit.org/show_bug.cgi?id=34082
+ virtual bool startUpdating(PositionOptions*, bool suspend) { return false; }
+#else
virtual bool startUpdating(PositionOptions*) { return false; }
+#endif
virtual void stopUpdating() { }
virtual void suspend() { }
diff --git a/WebCore/platform/android/GeolocationServiceAndroid.cpp b/WebCore/platform/android/GeolocationServiceAndroid.cpp
index 3d45e75..aaa7af7 100644
--- a/WebCore/platform/android/GeolocationServiceAndroid.cpp
+++ b/WebCore/platform/android/GeolocationServiceAndroid.cpp
@@ -28,7 +28,6 @@
#include "GeolocationServiceBridge.h"
#include "Geoposition.h"
-#include "PlatformBridge.h"
#include "PositionError.h"
#include "PositionOptions.h"
@@ -66,7 +65,9 @@ GeolocationServiceAndroid::GeolocationServiceAndroid(GeolocationServiceClient* c
{
}
-bool GeolocationServiceAndroid::startUpdating(PositionOptions* options)
+// ANDROID
+// TODO: Upstream to webkit.org. See https://bugs.webkit.org/show_bug.cgi?id=34082
+bool GeolocationServiceAndroid::startUpdating(PositionOptions* options, bool suspend)
{
// This method is called every time a new watch or one-shot position request
// is started. If we already have a position or an error, call back
@@ -92,7 +93,9 @@ bool GeolocationServiceAndroid::startUpdating(PositionOptions* options)
if (!haveJavaBridge) {
// If the browser is paused, don't start the service. It will be started
// when we get the call to resume.
- if (!PlatformBridge::isWebViewPaused())
+ // ANDROID
+ // TODO: Upstream to webkit.org. See https://bugs.webkit.org/show_bug.cgi?id=34082
+ if (!suspend)
m_javaBridge->start();
}
diff --git a/WebCore/platform/android/GeolocationServiceAndroid.h b/WebCore/platform/android/GeolocationServiceAndroid.h
index b2be750..72532f6 100644
--- a/WebCore/platform/android/GeolocationServiceAndroid.h
+++ b/WebCore/platform/android/GeolocationServiceAndroid.h
@@ -45,7 +45,9 @@ public:
virtual ~GeolocationServiceAndroid() { };
- virtual bool startUpdating(PositionOptions*);
+ // ANDROID
+ // TODO: Upstream to webkit.org. See https://bugs.webkit.org/show_bug.cgi?id=34082
+ virtual bool startUpdating(PositionOptions*, bool suspend);
virtual void stopUpdating();
virtual Geoposition* lastPosition() const { return m_lastPosition.get(); }
diff --git a/WebCore/platform/android/PlatformBridge.h b/WebCore/platform/android/PlatformBridge.h
index 5eb127f..0918fe9 100644
--- a/WebCore/platform/android/PlatformBridge.h
+++ b/WebCore/platform/android/PlatformBridge.h
@@ -126,7 +126,9 @@ public:
#endif // USE(ACCELERATED_COMPOSITING)
// Whether the WebView is paused.
- static bool isWebViewPaused();
+ // ANDROID
+ // TODO: Upstream to webkit.org. See https://bugs.webkit.org/show_bug.cgi?id=34082
+ static bool isWebViewPaused(const FrameView*);
};
}
diff --git a/WebCore/platform/mock/GeolocationServiceMock.cpp b/WebCore/platform/mock/GeolocationServiceMock.cpp
index f187104..0104747 100644
--- a/WebCore/platform/mock/GeolocationServiceMock.cpp
+++ b/WebCore/platform/mock/GeolocationServiceMock.cpp
@@ -78,7 +78,12 @@ void GeolocationServiceMock::setError(PassRefPtr<PositionError> error)
makeGeolocationCallbackFromAllInstances();
}
+#if PLATFORM(ANDROID)
+// TODO: Upstream to webkit.org. See https://bugs.webkit.org/show_bug.cgi?id=34082
+bool GeolocationServiceMock::startUpdating(PositionOptions*, bool /* suspend */)
+#else
bool GeolocationServiceMock::startUpdating(PositionOptions*)
+#endif
{
m_isActive = true;
m_timer.startOneShot(0);
diff --git a/WebCore/platform/mock/GeolocationServiceMock.h b/WebCore/platform/mock/GeolocationServiceMock.h
index 7d02797..1b4db93 100755
--- a/WebCore/platform/mock/GeolocationServiceMock.h
+++ b/WebCore/platform/mock/GeolocationServiceMock.h
@@ -46,7 +46,12 @@ class GeolocationServiceMock : public GeolocationService {
GeolocationServiceMock(GeolocationServiceClient*);
virtual ~GeolocationServiceMock();
+#if PLATFORM(ANDROID)
+ // TODO: Upstream to webkit.org. See https://bugs.webkit.org/show_bug.cgi?id=34082
+ virtual bool startUpdating(PositionOptions*, bool suspend);
+#else
virtual bool startUpdating(PositionOptions*);
+#endif
virtual void stopUpdating();
static void setPosition(PassRefPtr<Geoposition> position);