[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
eric at webkit.org
eric at webkit.org
Thu Apr 8 02:02:04 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 4aaf04022609b6e4933f2452cec140d4284b30a5
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Feb 27 01:00:00 2010 +0000
2010-02-26 Arno Renevier <arno at renevier.net>
Reviewed by Gustavo Noronha Silva.
[Gtk] use geoclue_position_get_position_async to get geolocation position.
https://bugs.webkit.org/show_bug.cgi?id=35355
No new tests, behaviour depends on system.
* platform/gtk/GeolocationServiceGtk.cpp:
(WebCore::GeolocationServiceGtk::startUpdating):
(WebCore::GeolocationServiceGtk::get_position):
* platform/gtk/GeolocationServiceGtk.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 334e25b..1c837a3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-02-26 Arno Renevier <arno at renevier.net>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [Gtk] use geoclue_position_get_position_async to get geolocation position.
+ https://bugs.webkit.org/show_bug.cgi?id=35355
+
+ No new tests, behaviour depends on system.
+
+ * platform/gtk/GeolocationServiceGtk.cpp:
+ (WebCore::GeolocationServiceGtk::startUpdating):
+ (WebCore::GeolocationServiceGtk::get_position):
+ * platform/gtk/GeolocationServiceGtk.h:
+
2010-02-26 Yaar Schnitman <yaar at chromium.org>
Chromium Win build fix.
diff --git a/WebCore/platform/gtk/GeolocationServiceGtk.cpp b/WebCore/platform/gtk/GeolocationServiceGtk.cpp
index edb8d10..f961ebb 100644
--- a/WebCore/platform/gtk/GeolocationServiceGtk.cpp
+++ b/WebCore/platform/gtk/GeolocationServiceGtk.cpp
@@ -113,12 +113,13 @@ bool GeolocationServiceGtk::startUpdating(PositionOptions* options)
return false;
}
+ m_geoclueClient = client;
+
+ geoclue_position_get_position_async(m_geocluePosition, (GeocluePositionCallback)getPositionCallback, this);
+
g_signal_connect(G_OBJECT(m_geocluePosition), "position-changed",
G_CALLBACK(position_changed), this);
- m_geoclueClient = client;
- updateLocationInformation();
-
return true;
}
@@ -156,28 +157,6 @@ PositionError* GeolocationServiceGtk::lastError() const
return m_lastError.get();
}
-void GeolocationServiceGtk::updateLocationInformation()
-{
- ASSERT(m_geocluePosition);
-
- GOwnPtr<GError> error;
- GOwnPtr<GeoclueAccuracy> accuracy;
-
- GeocluePositionFields fields = geoclue_position_get_position(m_geocluePosition, &m_timestamp,
- &m_latitude, &m_longitude,
- &m_altitude, &accuracy.outPtr(),
- &error.outPtr());
- if (error) {
- setError(PositionError::POSITION_UNAVAILABLE, error->message);
- return;
- } else if (!(fields & GEOCLUE_POSITION_FIELDS_LATITUDE && fields & GEOCLUE_POSITION_FIELDS_LONGITUDE)) {
- setError(PositionError::POSITION_UNAVAILABLE, "Position could not be determined.");
- return;
- }
-
-
-}
-
void GeolocationServiceGtk::updatePosition()
{
m_lastError = 0;
@@ -189,6 +168,24 @@ void GeolocationServiceGtk::updatePosition()
positionChanged();
}
+void GeolocationServiceGtk::getPositionCallback(GeocluePosition *position,
+ GeocluePositionFields fields,
+ int timestamp,
+ double latitude,
+ double longitude,
+ double altitude,
+ GeoclueAccuracy* accuracy,
+ GError* error,
+ GeolocationServiceGtk* that)
+{
+ if (error) {
+ that->setError(PositionError::POSITION_UNAVAILABLE, error->message);
+ g_error_free(error);
+ return;
+ }
+ position_changed(position, fields, timestamp, latitude, longitude, altitude, accuracy, that);
+}
+
void GeolocationServiceGtk::position_changed(GeocluePosition*, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GeolocationServiceGtk* that)
{
if (!(fields & GEOCLUE_POSITION_FIELDS_LATITUDE && fields & GEOCLUE_POSITION_FIELDS_LONGITUDE)) {
diff --git a/WebCore/platform/gtk/GeolocationServiceGtk.h b/WebCore/platform/gtk/GeolocationServiceGtk.h
index a198dc0..c123017 100644
--- a/WebCore/platform/gtk/GeolocationServiceGtk.h
+++ b/WebCore/platform/gtk/GeolocationServiceGtk.h
@@ -46,11 +46,11 @@ namespace WebCore {
private:
GeolocationServiceGtk(GeolocationServiceClient*);
- void updateLocationInformation();
void setError(PositionError::ErrorCode, const char* message);
void updatePosition();
static void position_changed(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*, GeolocationServiceGtk*);
+ static void getPositionCallback(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*, GError*, GeolocationServiceGtk*);
private:
RefPtr<Geoposition> m_lastPosition;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list