Title: [221132] trunk/Source
- Revision
- 221132
- Author
- ape...@igalia.com
- Date
- 2017-08-24 01:45:07 -0700 (Thu, 24 Aug 2017)
Log Message
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: trunk/Source/WebCore/ChangeLog (221131 => 221132)
--- trunk/Source/WebCore/ChangeLog 2017-08-24 08:07:38 UTC (rev 221131)
+++ trunk/Source/WebCore/ChangeLog 2017-08-24 08:45:07 UTC (rev 221132)
@@ -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-24 Zan Dobersek <zdober...@igalia.com>
[EME] Implement HTMLMediaElement dispatch of the onencrypted event
Modified: trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp (221131 => 221132)
--- trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp 2017-08-24 08:07:38 UTC (rev 221131)
+++ trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp 2017-08-24 08:45:07 UTC (rev 221132)
@@ -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: trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp (221131 => 221132)
--- trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp 2017-08-24 08:07:38 UTC (rev 221131)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp 2017-08-24 08:45:07 UTC (rev 221132)
@@ -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