Changeset 243409 in webkit


Ignore:
Timestamp:
Mar 23, 2019 3:37:41 AM (5 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Remove build time dependency on Geoclue2
https://bugs.webkit.org/show_bug.cgi?id=195994

Reviewed by Michael Catanzaro.

.:

Remove USE_GEOCLUE build option.

  • Source/cmake/FindGeoClue2.cmake: Removed.
  • Source/cmake/OptionsGTK.cmake:

Source/WebCore:

Remove old Geoclue implementation.

  • PlatformGTK.cmake:
  • SourcesGTK.txt:
  • platform/geoclue/GeolocationProviderGeoclue.cpp: Removed.
  • platform/geoclue/GeolocationProviderGeoclue.h: Removed.
  • platform/geoclue/GeolocationProviderGeoclueClient.h: Removed.

Source/WebCore/platform/gtk/po:

  • POTFILES.in: Add GeoclueGeolocationProvider.cpp.

Source/WebKit:

Add GeoclueGeolocationProvider class to provide geolocation position updates using Geoclue2 DBus service.

  • PlatformGTK.cmake:
  • PlatformWPE.cmake:
  • SourcesGTK.txt:
  • SourcesWPE.txt:
  • UIProcess/API/glib/WebKitGeolocationManager.cpp:

(_WebKitGeolocationPosition::_WebKitGeolocationPosition):
(webkitGeolocationManagerStop):
(webkitGeolocationManagerSetEnableHighAccuracy):
(webkitGeolocationManagerDispose):
(webkit_geolocation_manager_class_init):

  • UIProcess/geoclue/GeoclueGeolocationProvider.cpp: Added.

(WebKit::GeoclueGeolocationProvider::GeoclueGeolocationProvider):
(WebKit::GeoclueGeolocationProvider::~GeoclueGeolocationProvider):
(WebKit::GeoclueGeolocationProvider::start):
(WebKit::GeoclueGeolocationProvider::stop):
(WebKit::GeoclueGeolocationProvider::setEnableHighAccuracy):
(WebKit::GeoclueGeolocationProvider::destroyManagerLater):
(WebKit::GeoclueGeolocationProvider::destroyManager):
(WebKit::GeoclueGeolocationProvider::setupManager):
(WebKit::GeoclueGeolocationProvider::createClient):
(WebKit::GeoclueGeolocationProvider::setupClient):
(WebKit::GeoclueGeolocationProvider::startClient):
(WebKit::GeoclueGeolocationProvider::stopClient):
(WebKit::GeoclueGeolocationProvider::requestAccuracyLevel):
(WebKit::GeoclueGeolocationProvider::clientLocationUpdatedCallback):
(WebKit::GeoclueGeolocationProvider::createLocation):
(WebKit::GeoclueGeolocationProvider::locationUpdated):
(WebKit::GeoclueGeolocationProvider::didFail):

  • UIProcess/geoclue/GeoclueGeolocationProvider.h: Added.
Location:
trunk
Files:
3 added
2 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r243285 r243409  
     12019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Remove build time dependency on Geoclue2
     4        https://bugs.webkit.org/show_bug.cgi?id=195994
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Remove USE_GEOCLUE build option.
     9
     10        * Source/cmake/FindGeoClue2.cmake: Removed.
     11        * Source/cmake/OptionsGTK.cmake:
     12
    1132019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r243404 r243409  
     12019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Remove build time dependency on Geoclue2
     4        https://bugs.webkit.org/show_bug.cgi?id=195994
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Remove old Geoclue implementation.
     9
     10        * PlatformGTK.cmake:
     11        * SourcesGTK.txt:
     12        * platform/geoclue/GeolocationProviderGeoclue.cpp: Removed.
     13        * platform/geoclue/GeolocationProviderGeoclue.h: Removed.
     14        * platform/geoclue/GeolocationProviderGeoclueClient.h: Removed.
     15
    1162019-03-22  Eric Carlson  <eric.carlson@apple.com>
    217
  • trunk/Source/WebCore/PlatformGTK.cmake

    r243285 r243409  
    2222    "${WEBCORE_DIR}/page/gtk"
    2323    "${WEBCORE_DIR}/platform/generic"
    24     "${WEBCORE_DIR}/platform/geoclue"
    2524    "${WEBCORE_DIR}/platform/gtk"
    2625    "${WEBCORE_DIR}/platform/graphics/egl"
     
    7574    rendering/RenderThemeGtk.cpp
    7675)
    77 
    78 if (USE_GEOCLUE)
    79     list(APPEND WebCore_SOURCES
    80         ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c
    81     )
    82     execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable dbus_interface geoclue-2.0 OUTPUT_VARIABLE GEOCLUE_DBUS_INTERFACE)
    83     add_custom_command(
    84          OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.h
    85          COMMAND gdbus-codegen --interface-prefix org.freedesktop.GeoClue2. --c-namespace Geoclue --generate-c-code ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface ${GEOCLUE_DBUS_INTERFACE}
    86     )
    87     set_source_files_properties(${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c PROPERTIES COMPILE_FLAGS -Wno-unused-parameter)
    88 endif ()
    8976
    9077list(APPEND WebCore_USER_AGENT_STYLE_SHEETS
  • trunk/Source/WebCore/SourcesGTK.txt

    r239667 r243409  
    6262platform/generic/ScrollAnimatorGeneric.cpp
    6363
    64 platform/geoclue/GeolocationProviderGeoclue.cpp
    65 
    6664platform/graphics/GLContext.cpp @no-unify
    6765platform/graphics/GraphicsContext3DPrivate.cpp
  • trunk/Source/WebCore/platform/gtk/po/ChangeLog

    r243285 r243409  
     12019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Remove build time dependency on Geoclue2
     4        https://bugs.webkit.org/show_bug.cgi?id=195994
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        * POTFILES.in: Add GeoclueGeolocationProvider.cpp.
     9
    1102019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
    211
  • trunk/Source/WebCore/platform/gtk/po/POTFILES.in

    r243285 r243409  
    3838../../../WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
    3939../../../WebKit/UIProcess/API/gtk/WebKitWebViewGtk.cpp
     40../../../WebKit/UIProcess/geoclue/GeoclueGeolocationProvider.cpp
    4041../../../WebKit/UIProcess/gtk/WebColorPickerGtk.cpp
    4142../../../WebKit/UIProcess/gtk/WebKitInspectorWindow.cpp
  • trunk/Source/WebKit/ChangeLog

    r243407 r243409  
     12019-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Remove build time dependency on Geoclue2
     4        https://bugs.webkit.org/show_bug.cgi?id=195994
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Add GeoclueGeolocationProvider class to provide geolocation position updates using Geoclue2 DBus service.
     9
     10        * PlatformGTK.cmake:
     11        * PlatformWPE.cmake:
     12        * SourcesGTK.txt:
     13        * SourcesWPE.txt:
     14        * UIProcess/API/glib/WebKitGeolocationManager.cpp:
     15        (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
     16        (webkitGeolocationManagerStop):
     17        (webkitGeolocationManagerSetEnableHighAccuracy):
     18        (webkitGeolocationManagerDispose):
     19        (webkit_geolocation_manager_class_init):
     20        * UIProcess/geoclue/GeoclueGeolocationProvider.cpp: Added.
     21        (WebKit::GeoclueGeolocationProvider::GeoclueGeolocationProvider):
     22        (WebKit::GeoclueGeolocationProvider::~GeoclueGeolocationProvider):
     23        (WebKit::GeoclueGeolocationProvider::start):
     24        (WebKit::GeoclueGeolocationProvider::stop):
     25        (WebKit::GeoclueGeolocationProvider::setEnableHighAccuracy):
     26        (WebKit::GeoclueGeolocationProvider::destroyManagerLater):
     27        (WebKit::GeoclueGeolocationProvider::destroyManager):
     28        (WebKit::GeoclueGeolocationProvider::setupManager):
     29        (WebKit::GeoclueGeolocationProvider::createClient):
     30        (WebKit::GeoclueGeolocationProvider::setupClient):
     31        (WebKit::GeoclueGeolocationProvider::startClient):
     32        (WebKit::GeoclueGeolocationProvider::stopClient):
     33        (WebKit::GeoclueGeolocationProvider::requestAccuracyLevel):
     34        (WebKit::GeoclueGeolocationProvider::clientLocationUpdatedCallback):
     35        (WebKit::GeoclueGeolocationProvider::createLocation):
     36        (WebKit::GeoclueGeolocationProvider::locationUpdated):
     37        (WebKit::GeoclueGeolocationProvider::didFail):
     38        * UIProcess/geoclue/GeoclueGeolocationProvider.h: Added.
     39
    1402019-03-22  Simon Fraser  <simon.fraser@apple.com>
    241
  • trunk/Source/WebKit/PlatformGTK.cmake

    r243285 r243409  
    398398    "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols/soup"
    399399    "${WEBKIT_DIR}/UIProcess/Plugins/gtk"
     400    "${WEBKIT_DIR}/UIProcess/geoclue"
    400401    "${WEBKIT_DIR}/UIProcess/glib"
    401402    "${WEBKIT_DIR}/UIProcess/gstreamer"
  • trunk/Source/WebKit/PlatformWPE.cmake

    r243285 r243409  
    258258    "${WEBKIT_DIR}/UIProcess/CoordinatedGraphics"
    259259    "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols/soup"
     260    "${WEBKIT_DIR}/UIProcess/geoclue"
    260261    "${WEBKIT_DIR}/UIProcess/gstreamer"
    261262    "${WEBKIT_DIR}/UIProcess/linux"
  • trunk/Source/WebKit/SourcesGTK.txt

    r243285 r243409  
    209209
    210210UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
     211
     212UIProcess/geoclue/GeoclueGeolocationProvider.cpp
    211213
    212214UIProcess/Launcher/glib/ProcessLauncherGLib.cpp @no-unify
  • trunk/Source/WebKit/SourcesWPE.txt

    r243285 r243409  
    184184UIProcess/CoordinatedGraphics/DrawingAreaProxyCoordinatedGraphics.cpp
    185185
     186UIProcess/geoclue/GeoclueGeolocationProvider.cpp
     187
    186188UIProcess/glib/WebProcessPoolGLib.cpp
    187189UIProcess/glib/WebProcessProxyGLib.cpp
  • trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationManager.cpp

    r243285 r243409  
    2222
    2323#include "APIGeolocationProvider.h"
     24#include "GeoclueGeolocationProvider.h"
    2425#include "WebGeolocationPosition.h"
    2526#include "WebKitGeolocationManagerPrivate.h"
     
    2728#include <wtf/WallTime.h>
    2829#include <wtf/glib/WTFGType.h>
    29 
    30 #if USE(GEOCLUE)
    31 #include <WebCore/GeolocationProviderGeoclue.h>
    32 #include <WebCore/GeolocationProviderGeoclueClient.h>
    33 #endif
    3430
    3531using namespace WebKit;
     
    6763    _WebKitGeolocationPosition() = default;
    6864
    69     _WebKitGeolocationPosition(double latitude, double longitude, double accuracy, Optional<double> timestamp = WTF::nullopt)
    70     {
    71         position.timestamp = timestamp.valueOr(WallTime::now().secondsSinceEpoch().value());
     65    _WebKitGeolocationPosition(double latitude, double longitude, double accuracy)
     66    {
     67        position.timestamp = WallTime::now().secondsSinceEpoch().value();
    7268        position.latitude = latitude;
    7369        position.longitude = longitude;
    7470        position.accuracy = accuracy;
     71    }
     72
     73    explicit _WebKitGeolocationPosition(GeolocationPosition&& corePosition)
     74        : position(WTFMove(corePosition))
     75    {
    7576    }
    7677
     
    229230}
    230231
    231 #if USE(GEOCLUE)
    232 class GeoclueProviderClient final : public GeolocationProviderGeoclueClient {
    233 public:
    234     explicit GeoclueProviderClient(WebKitGeolocationManager* manager)
    235         : m_manager(manager)
    236     {
    237     }
    238 
    239 private:
    240     void notifyPositionChanged(int timestamp, double latitude, double longitude, double altitude, double accuracy, double) override
    241     {
    242         WebKitGeolocationPosition position(latitude, longitude, accuracy, static_cast<double>(timestamp));
    243         webkit_geolocation_position_set_altitude(&position, altitude);
    244         webkit_gelocation_manager_update_position(m_manager, &position);
    245     }
    246 
    247     void notifyErrorOccurred(const char* message) override
    248     {
    249         webkit_gelocation_manager_failed(m_manager, message);
    250     }
    251 
    252     WebKitGeolocationManager* m_manager;
    253 };
    254 #endif
    255 
    256232struct _WebKitGeolocationManagerPrivate {
    257233    RefPtr<WebGeolocationManagerProxy> manager;
    258234    bool highAccuracyEnabled;
    259 #if USE(GEOCLUE)
    260     std::unique_ptr<GeoclueProviderClient> providerClient;
    261     std::unique_ptr<GeolocationProviderGeoclue> provider;
    262 #endif
     235    std::unique_ptr<GeoclueGeolocationProvider> geoclueProvider;
    263236};
    264237
     
    272245    g_signal_emit(manager, signals[START], 0, &returnValue);
    273246    if (returnValue) {
    274 #if USE(GEOCLUE)
    275         manager->priv->provider = nullptr;
    276         manager->priv->providerClient = nullptr;
    277 #endif
     247        manager->priv->geoclueProvider = nullptr;
    278248        return;
    279249    }
    280250
    281 #if USE(GEOCLUE)
    282     if (!manager->priv->provider) {
    283         manager->priv->providerClient = std::make_unique<GeoclueProviderClient>(manager);
    284         manager->priv->provider = std::make_unique<GeolocationProviderGeoclue>(manager->priv->providerClient.get());
    285     }
    286     manager->priv->provider->startUpdating();
    287 #endif
     251    if (!manager->priv->geoclueProvider) {
     252        manager->priv->geoclueProvider = std::make_unique<GeoclueGeolocationProvider>();
     253        manager->priv->geoclueProvider->setEnableHighAccuracy(manager->priv->highAccuracyEnabled);
     254    }
     255    manager->priv->geoclueProvider->start([manager](GeolocationPosition&& corePosition, Optional<CString> error) {
     256        if (error) {
     257            webkit_gelocation_manager_failed(manager, error->data());
     258            return;
     259        }
     260
     261        WebKitGeolocationPosition position(WTFMove(corePosition));
     262        webkit_gelocation_manager_update_position(manager, &position);
     263    });
    288264}
    289265
     
    292268    g_signal_emit(manager, signals[STOP], 0, nullptr);
    293269
    294 #if USE(GEOCLUE)
    295     if (manager->priv->provider)
    296         manager->priv->provider->stopUpdating();
    297 #endif
     270    if (manager->priv->geoclueProvider)
     271        manager->priv->geoclueProvider->stop();
    298272}
    299273
     
    305279    manager->priv->highAccuracyEnabled = enabled;
    306280    g_object_notify(G_OBJECT(manager), "enable-high-accuracy");
    307 #if USE(GEOCLUE)
    308     if (manager->priv->provider)
    309         manager->priv->provider->setEnableHighAccuracy(enabled);
    310 #endif
     281    if (manager->priv->geoclueProvider)
     282        manager->priv->geoclueProvider->setEnableHighAccuracy(enabled);
    311283}
    312284
  • trunk/Source/cmake/OptionsGTK.cmake

    r243285 r243409  
    8181WEBKIT_OPTION_DEFINE(ENABLE_X11_TARGET "Whether to enable support for the X11 windowing target." PUBLIC ${GTK3_SUPPORTS_X11})
    8282WEBKIT_OPTION_DEFINE(ENABLE_WAYLAND_TARGET "Whether to enable support for the Wayland windowing target." PUBLIC ${GTK3_SUPPORTS_WAYLAND})
    83 WEBKIT_OPTION_DEFINE(USE_GEOCLUE "Whether to enable default geolocation implementation using GeoClue2" PUBLIC ON)
    8483WEBKIT_OPTION_DEFINE(USE_LIBNOTIFY "Whether to enable the default web notification implementation." PUBLIC ON)
    8584WEBKIT_OPTION_DEFINE(USE_LIBHYPHEN "Whether to enable the default automatic hyphenation implementation." PUBLIC ON)
     
    220219    if (NOT LIBSECRET_FOUND)
    221220        message(FATAL_ERROR "libsecret is needed for USE_LIBSECRET")
    222     endif ()
    223 endif ()
    224 
    225 if (USE_GEOCLUE)
    226     find_package(GeoClue2 2.1.5)
    227     if (NOT GEOCLUE2_FOUND)
    228         message(FATAL_ERROR "Geoclue is needed for USE_GEOCLUE.")
    229221    endif ()
    230222endif ()
Note: See TracChangeset for help on using the changeset viewer.