Changeset 165418 in webkit
- Timestamp:
- Mar 10, 2014 5:23:20 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r165386 r165418 1 2014-03-10 Mario Sanchez Prada <mario.prada@samsung.com> 2 3 [GTK] Add support for Geoclue2 4 https://bugs.webkit.org/show_bug.cgi?id=120185 5 6 Reviewed by Carlos Garcia Campos. 7 8 Patch by Anton Obzhirov <a.obzhirov@samsung.com> and Mario Sanchez Prada <mario.prada@samsung.com> 9 10 Add support for Geoclue2 using autotools. 11 12 * Source/autotools/FindDependencies.m4: Add support for handling 13 both Geoclue 1.0 and 2.0. 14 * Source/autotools/PrintBuildConfiguration.m4: Print the version 15 of geoclue that is being used. 16 * Source/autotools/SetupAutoconfHeader.m4: Define GEOCLUE_API_VERSION_2. 17 * Source/autotools/SetupAutomake.m4: Likewise, for AM_CONDITIONAL. 18 * Source/autotools/Versions.m4: Added minimum required version for Geoclue2. 19 20 Add support for Geoclue2 using CMake. 21 22 * Source/cmake/FindGeoClue2.cmake: Added. 23 * Source/cmake/OptionsGTK.cmake: Add support for handling Geoclue 1.0 and 2.0. 24 * Source/cmakeconfig.h.cmake: Define WTF_USE_GEOCLUE2. 25 1 26 2014-03-10 Martin Robinson <mrobinson@igalia.com> 2 27 -
trunk/Source/WebCore/ChangeLog
r165417 r165418 1 2014-03-10 Mario Sanchez Prada <mario.prada@samsung.com> 2 3 [GTK] Add support for Geoclue2 4 https://bugs.webkit.org/show_bug.cgi?id=120185 5 6 Reviewed by Carlos Garcia Campos. 7 8 Patch by Anton Obzhirov <a.obzhirov@samsung.com> and Mario Sanchez Prada <mario.prada@samsung.com> 9 10 Implement a new geolocation provider based on Geoclue2, which will only 11 be used if a good enough version of Geoclue2 is found at configure time. 12 13 * GNUmakefile.am: Generate C-API for accessing the D-Bus API 14 provided by Geoclue2, and place it in DerivedSources. 15 * GNUmakefile.list.am: Add GeolocationProviderGeoclue2.cpp, and 16 include the generated proxy files when using Geoclue2. 17 * PlatformGTK.cmake: Likewise, for CMake based builds. 18 * platform/geoclue/GeolocationProviderGeoclue.h: Modified to 19 accomodate the needs both for Geoclue and Geoclue2 providers. 20 * platform/geoclue/GeolocationProviderGeoclue1.cpp: Renamed from Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp. 21 (GeolocationProviderGeoclue::getPositionCallback): 22 (GeolocationProviderGeoclue::positionChangedCallback): 23 (GeolocationProviderGeoclue::createGeocluePositionCallback): 24 (GeolocationProviderGeoclue::geoclueClientSetRequirementsCallback): 25 (GeolocationProviderGeoclue::createGeoclueClientCallback): 26 (GeolocationProviderGeoclue::GeolocationProviderGeoclue): 27 (GeolocationProviderGeoclue::~GeolocationProviderGeoclue): 28 (GeolocationProviderGeoclue::startUpdating): 29 (GeolocationProviderGeoclue::stopUpdating): 30 (GeolocationProviderGeoclue::setEnableHighAccuracy): 31 (GeolocationProviderGeoclue::initializeGeoclueClient): 32 (GeolocationProviderGeoclue::initializeGeocluePosition): 33 (GeolocationProviderGeoclue::updateClientRequirements): 34 (GeolocationProviderGeoclue::positionChanged): 35 (GeolocationProviderGeoclue::errorOccurred): 36 * platform/geoclue/GeolocationProviderGeoclue2.cpp: Added. 37 (GeolocationProviderGeoclue::GeolocationProviderGeoclue): 38 (GeolocationProviderGeoclue::~GeolocationProviderGeoclue): 39 (GeolocationProviderGeoclue::startUpdating): 40 (GeolocationProviderGeoclue::stopUpdating): 41 (GeolocationProviderGeoclue::setEnableHighAccuracy): 42 (GeolocationProviderGeoclue::createGeoclueManagerProxyCallback): 43 (GeolocationProviderGeoclue::getGeoclueClientCallback): 44 (GeolocationProviderGeoclue::createGeoclueClientProxyCallback): 45 (GeolocationProviderGeoclue::startClientCallback): 46 (GeolocationProviderGeoclue::locationUpdatedCallback): 47 (GeolocationProviderGeoclue::createLocationProxyCallback): 48 (GeolocationProviderGeoclue::startGeoclueClient): 49 (GeolocationProviderGeoclue::updateLocation): 50 (GeolocationProviderGeoclue::errorOccurred): 51 (GeolocationProviderGeoclue::updateClientRequirements): 52 1 53 2014-03-10 Brent Fulgham <bfulgham@apple.com> 2 54 -
trunk/Source/WebCore/GNUmakefile.am
r165060 r165418 387 387 endif # END ENABLE_WEB_AUDIO 388 388 389 if USE_GEOCLUE2 390 DerivedSources/Platform/Geoclue2Interface.c: DerivedSources/Platform/Geoclue2Interface.h 391 DerivedSources/Platform/Geoclue2Interface.h: 392 $(AM_V_GEN)gdbus-codegen --interface-prefix org.freedesktop.GeoClue2. --c-namespace Geoclue --generate-c-code DerivedSources/Platform/Geoclue2Interface $(GEOCLUE_DBUS_INTERFACE) 393 endif 394 389 395 IDL_PATH := \ 390 396 $(WebCore)/Modules/battery \ -
trunk/Source/WebCore/GNUmakefile.list.am
r165402 r165418 875 875 DerivedSources/Platform/WebKitFontFamilyNames.cpp \ 876 876 DerivedSources/Platform/WebKitFontFamilyNames.h 877 878 if USE_GEOCLUE2 879 platform_built_sources += \ 880 DerivedSources/Platform/Geoclue2Interface.h \ 881 DerivedSources/Platform/Geoclue2Interface.c 882 endif 877 883 878 884 # These files need to be part of WebCore otherwise they cause undefined … … 5576 5582 Source/WebCore/platform/audio/ZeroPole.h \ 5577 5583 Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.h \ 5578 Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp \ 5584 Source/WebCore/platform/geoclue/GeolocationProviderGeoclue1.cpp \ 5585 Source/WebCore/platform/geoclue/GeolocationProviderGeoclue2.cpp \ 5579 5586 Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h \ 5580 5587 Source/WebCore/platform/glib/BatteryProviderUPowerClient.h \ -
trunk/Source/WebCore/PlatformGTK.cmake
r165378 r165418 41 41 platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp 42 42 43 platform/geoclue/GeolocationProviderGeoclue.cpp 43 platform/geoclue/GeolocationProviderGeoclue1.cpp 44 platform/geoclue/GeolocationProviderGeoclue2.cpp 44 45 45 46 platform/graphics/GraphicsContext3DPrivate.cpp … … 243 244 platform/gtk/WidgetRenderingContext.cpp 244 245 ) 246 247 if (WTF_USE_GEOCLUE2) 248 list(APPEND WebCore_SOURCES 249 ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c 250 ) 251 execute_process(COMMAND pkg-config --variable dbus_interface geoclue-2.0 OUTPUT_VARIABLE GEOCLUE_DBUS_INTERFACE) 252 add_custom_command( 253 OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.h 254 COMMAND gdbus-codegen --interface-prefix org.freedesktop.GeoClue2. --c-namespace Geoclue --generate-c-code ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface ${GEOCLUE_DBUS_INTERFACE} 255 ) 256 endif () 245 257 246 258 if (ENABLE_NETSCAPE_PLUGIN_API) -
trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.h
r119249 r165418 1 1 /* 2 2 * Copyright (C) 2012 Igalia S.L. 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 3 4 * 4 5 * This library is free software; you can redistribute it and/or … … 24 25 25 26 #include "GeolocationProviderGeoclueClient.h" 27 #include <wtf/gobject/GRefPtr.h> 28 29 #if USE(GEOCLUE2) 30 #include "Geoclue2Interface.h" 31 #else 26 32 #include <geoclue/geoclue-master.h> 27 33 #include <geoclue/geoclue-position.h> 28 # include <wtf/gobject/GRefPtr.h>34 #endif 29 35 30 36 namespace WebCore { … … 39 45 void setEnableHighAccuracy(bool); 40 46 41 // To be used from signal callbacks. 47 private: 48 #if USE(GEOCLUE2) 49 static void createGeoclueManagerProxyCallback(GObject*, GAsyncResult*, GeolocationProviderGeoclue*); 50 static void getGeoclueClientCallback(GObject*, GAsyncResult*, GeolocationProviderGeoclue*); 51 static void createGeoclueClientProxyCallback(GObject*, GAsyncResult*, GeolocationProviderGeoclue*); 52 static void startClientCallback(GObject*, GAsyncResult*, GeolocationProviderGeoclue*); 53 static void locationUpdatedCallback(GeoclueClient*, const gchar*, const gchar*, GeolocationProviderGeoclue*); 54 static void createLocationProxyCallback(GObject*, GAsyncResult*, GeolocationProviderGeoclue*); 55 56 void startGeoclueClient(); 57 void updateLocation(GeoclueLocation*); 58 #else 59 static void getPositionCallback(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*, GError*, GeolocationProviderGeoclue*); 60 static void positionChangedCallback(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*, GeolocationProviderGeoclue*); 61 static void createGeocluePositionCallback(GeoclueMasterClient*, GeocluePosition*, GError*, GeolocationProviderGeoclue*); 62 static void geoclueClientSetRequirementsCallback(GeoclueMasterClient*, GError*, GeolocationProviderGeoclue*); 63 static void createGeoclueClientCallback(GeoclueMaster*, GeoclueMasterClient*, char*, GError*, GeolocationProviderGeoclue*); 64 42 65 void initializeGeoclueClient(GeoclueMasterClient*); 43 66 void initializeGeocluePosition(GeocluePosition*); 67 void positionChanged(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*); 68 #endif 69 70 void errorOccurred(const char*); 44 71 void updateClientRequirements(); 45 void positionChanged(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*);46 void errorOccurred(const char*);47 72 48 private:49 73 GeolocationProviderGeoclueClient* m_client; 50 74 75 #if USE(GEOCLUE2) 76 GRefPtr<GeoclueManager> m_managerProxy; 77 GRefPtr<GeoclueClient> m_clientProxy; 78 #else 51 79 GRefPtr<GeoclueMasterClient> m_geoclueClient; 52 80 GRefPtr<GeocluePosition> m_geocluePosition; 81 #endif 53 82 54 83 double m_latitude; -
trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue1.cpp
r165417 r165418 27 27 #include "GeolocationProviderGeoclue.h" 28 28 29 #if ENABLE(GEOLOCATION) 29 #if ENABLE(GEOLOCATION) && !USE(GEOCLUE2) 30 30 31 31 using namespace WebCore; 32 32 33 static voidgetPositionCallback(GeocluePosition* position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GError* error, GeolocationProviderGeoclue* provider)33 void GeolocationProviderGeoclue::getPositionCallback(GeocluePosition* position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GError* error, GeolocationProviderGeoclue* provider) 34 34 { 35 35 if (error) { … … 41 41 } 42 42 43 static voidpositionChangedCallback(GeocluePosition* position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GeolocationProviderGeoclue* provider)43 void GeolocationProviderGeoclue::positionChangedCallback(GeocluePosition* position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GeolocationProviderGeoclue* provider) 44 44 { 45 45 provider->positionChanged(position, fields, timestamp, latitude, longitude, altitude, accuracy); 46 46 } 47 47 48 static voidcreateGeocluePositionCallback(GeoclueMasterClient*, GeocluePosition* position, GError *error, GeolocationProviderGeoclue* provider)48 void GeolocationProviderGeoclue::createGeocluePositionCallback(GeoclueMasterClient*, GeocluePosition* position, GError *error, GeolocationProviderGeoclue* provider) 49 49 { 50 50 if (error) { … … 56 56 } 57 57 58 static void geoclueClientSetRequirementsCallback(GeoclueMasterClient* client, GError* error, GeolocationProviderGeoclue* provider)58 void GeolocationProviderGeoclue::geoclueClientSetRequirementsCallback(GeoclueMasterClient*, GError* error, GeolocationProviderGeoclue* provider) 59 59 { 60 60 if (error) { … … 64 64 } 65 65 66 static voidcreateGeoclueClientCallback(GeoclueMaster*, GeoclueMasterClient* client, char*, GError* error, GeolocationProviderGeoclue* provider)66 void GeolocationProviderGeoclue::createGeoclueClientCallback(GeoclueMaster*, GeoclueMasterClient* client, char*, GError* error, GeolocationProviderGeoclue* provider) 67 67 { 68 68 if (error) { … … 76 76 GeolocationProviderGeoclue::GeolocationProviderGeoclue(GeolocationProviderGeoclueClient* client) 77 77 : m_client(client) 78 , m_geoclueClient(0)79 , m_geocluePosition(0)80 78 , m_latitude(0) 81 79 , m_longitude(0) … … 155 153 } 156 154 157 void GeolocationProviderGeoclue::positionChanged(GeocluePosition* position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy)155 void GeolocationProviderGeoclue::positionChanged(GeocluePosition*, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy) 158 156 { 159 157 if (!(fields & GEOCLUE_POSITION_FIELDS_LATITUDE && fields & GEOCLUE_POSITION_FIELDS_LONGITUDE)) { … … 177 175 } 178 176 179 #endif // ENABLE(GEOLOCATION) 177 #endif // ENABLE(GEOLOCATION) && !USE(GEOCLUE2) -
trunk/Source/autotools/FindDependencies.m4
r165337 r165418 405 405 AC_SUBST([LIBXSLT_LIBS]) 406 406 407 # Check if geoclue is available. 407 # Check if geoclue is available, with a preference over Geoclue2 if present. 408 geolocation_description="none" 408 409 if test "$enable_geolocation" = "yes"; then 409 PKG_CHECK_MODULES([GEOCLUE], [geoclue]) 410 PKG_CHECK_MODULES([GEOCLUE2], [gio-unix-2.0 geoclue-2.0 >= geoclue2_required_version], [found_geoclue2=yes], [found_geoclue2=no]) 411 if test "$found_geoclue2" = "yes"; then 412 GEOCLUE_CFLAGS="$GEOCLUE2_CFLAGS" 413 GEOCLUE_LIBS="$GEOCLUE2_LIBS" 414 GEOCLUE_DBUS_INTERFACE=`$PKG_CONFIG --variable dbus_interface geoclue-2.0` 415 AC_SUBST(GEOCLUE_DBUS_INTERFACE) 416 geolocation_description="Geoclue 2" 417 else 418 PKG_CHECK_MODULES([GEOCLUE], [geoclue]) 419 geolocation_description="Geoclue" 420 fi 410 421 AC_SUBST([GEOCLUE_CFLAGS]) 411 422 AC_SUBST([GEOCLUE_LIBS]) -
trunk/Source/autotools/PrintBuildConfiguration.m4
r163440 r165418 18 18 Optimized memory allocator : $enable_fast_malloc 19 19 Accelerated rendering backend : $acceleration_description 20 Geolocation backend : $geolocation_description 20 21 21 22 Features: -
trunk/Source/autotools/SetupAutoconfHeader.m4
r156271 r165418 26 26 AC_DEFINE([HAVE_GTK_UNIX_PRINTING], [1], [Define if GTK+ UNIX Printing is available]) 27 27 fi 28 fi 29 30 if test "$found_geoclue2" = "yes"; then 31 AC_DEFINE([WTF_USE_GEOCLUE2], [1], [ ]) 28 32 fi 29 33 -
trunk/Source/autotools/SetupAutomake.m4
r163440 r165418 34 34 AM_CONDITIONAL([TARGET_DIRECTFB], [test "$enable_directfb_target" = "yes"]) 35 35 36 # Geoclue conditionals. 37 AM_CONDITIONAL([USE_GEOCLUE2],[test "$found_geoclue2" = "yes"]) 38 36 39 # GStreamer feature conditionals. 37 40 AM_CONDITIONAL([USE_GSTREAMER], [test "$enable_video" = "yes" || test "$enable_web_audio" = "yes"]) -
trunk/Source/autotools/Versions.m4
r161870 r165418 25 25 m4_define([fontconfig_required_version], [2.5]) 26 26 m4_define([freetype2_required_version], [9.0]) 27 m4_define([geoclue2_required_version], [2.1.5]) 27 28 m4_define([glib_required_version], [2.36.0]) 28 29 m4_define([gobject_introspection_required_version], [1.32.0]) -
trunk/Source/cmake/OptionsGTK.cmake
r165378 r165418 205 205 206 206 if (ENABLE_GEOLOCATION) 207 find_package(GeoClue) 207 find_package(GeoClue2 2.1.5) 208 if (GEOCLUE2_FOUND) 209 set(WTF_USE_GEOCLUE2 1) 210 else () 211 find_package(GeoClue) 212 set(WTF_USE_GEOCLUE2 0) 213 endif () 208 214 endif () 209 215 -
trunk/Source/cmakeconfig.h.cmake
r164943 r165418 124 124 #cmakedefine01 ENABLE_XSLT 125 125 #cmakedefine01 USE_SYSTEM_MALLOC 126 #cmakedefine01 WTF_USE_GEOCLUE2 126 127 #cmakedefine01 WTF_USE_TILED_BACKING_STORE 127 128 #cmakedefine01 HAVE_LLVM
Note: See TracChangeset
for help on using the changeset viewer.