Title: [221352] releases/WebKitGTK/webkit-2.18/Source
Revision
221352
Author
carlo...@webkit.org
Date
2017-08-30 02:00:12 -0700 (Wed, 30 Aug 2017)

Log Message

Merge r221132 - Geoclue2 based backend should provide the right desktop ID
https://bugs.webkit.org/show_bug.cgi?id=129879

Reviewed by Michael Catanzaro.

* platform/geoclue/GeolocationProviderGeoclue.cpp:
(GeolocationProviderGeoclue::createGeoclueClientProxyCallback): Try first obtaining the application
identifier using GApplication first, keeping a fallback to the value returned by g_get_prgname().

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog (221351 => 221352)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog	2017-08-30 08:59:10 UTC (rev 221351)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/ChangeLog	2017-08-30 09:00:12 UTC (rev 221352)
@@ -1,3 +1,14 @@
+2017-08-23  Adrian Perez de Castro  <ape...@igalia.com>
+
+        Geoclue2 based backend should provide the right desktop ID
+        https://bugs.webkit.org/show_bug.cgi?id=129879
+
+        Reviewed by Michael Catanzaro.
+
+        * platform/geoclue/GeolocationProviderGeoclue.cpp:
+        (GeolocationProviderGeoclue::createGeoclueClientProxyCallback): Try first obtaining the application
+        identifier using GApplication first, keeping a fallback to the value returned by g_get_prgname().
+
 2017-08-23  Wenson Hsieh  <wenson_hs...@apple.com>
 
         DeleteSelectionCommand should be robust when starting and ending editable positions cannot be found

Modified: releases/WebKitGTK/webkit-2.18/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue2.cpp (221351 => 221352)


--- releases/WebKitGTK/webkit-2.18/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue2.cpp	2017-08-30 08:59:10 UTC (rev 221351)
+++ releases/WebKitGTK/webkit-2.18/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue2.cpp	2017-08-30 09:00:12 UTC (rev 221352)
@@ -137,11 +137,17 @@
 
     // Geoclue2 requires the client to provide a desktop ID for security
     // reasons, which should identify the application requesting the location.
-    // FIXME: We provide the program name as the desktop ID for now but, in an ideal world,
-    // we should provide a proper "application ID" (normally the name of a .desktop file).
-    // https://bugs.webkit.org/show_bug.cgi?id=129879
-    geoclue_client_set_desktop_id(provider->m_clientProxy.get(), g_get_prgname());
+    // We use the application ID configured for the default GApplication, and
+    // also fallback to our old behavior of using g_get_prgname().
+    const char* appId = nullptr;
+    GApplication* defaultApp = g_application_get_default();
+    if (defaultApp)
+        appId = g_application_get_application_id(defaultApp);
+    if (!appId)
+        appId = g_get_prgname();
 
+    geoclue_client_set_desktop_id(provider->m_clientProxy.get(), appId);
+
     provider->startGeoclueClient();
 }
 

Modified: releases/WebKitGTK/webkit-2.18/Source/WebKit/UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp (221351 => 221352)


--- releases/WebKitGTK/webkit-2.18/Source/WebKit/UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp	2017-08-30 08:59:10 UTC (rev 221351)
+++ releases/WebKitGTK/webkit-2.18/Source/WebKit/UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp	2017-08-30 09:00:12 UTC (rev 221352)
@@ -39,6 +39,22 @@
  *
  * When a WebKitGeolocationPermissionRequest is not handled by the user,
  * it is denied by default.
+ *
+ * When embedding web views in your application, you *must* configure an
+ * application identifier to allow web content to use geolocation services.
+ * The identifier *must* match the name of the `.desktop` file which describes
+ * the application, sans the suffix.
+ *
+ * If your application uses #GApplication (or any subclass like
+ * #GtkApplication), WebKit will automatically use the identifier returned by
+ * g_application_get_application_id(). This is the recommended approach for
+ * enabling geolocation in applications.
+ *
+ * If an identifier cannot be obtained through #GApplication, the value
+ * returned by g_get_prgname() will be used instead as a fallback. For
+ * programs which cannot use #GApplication, calling g_set_prgname() early
+ * during initialization is needed when the name of the executable on disk
+ * does not match the name of a valid `.desktop` file.
  */
 
 static void webkit_permission_request_interface_init(WebKitPermissionRequestIface*);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to