<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[243285] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/243285">243285</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2019-03-21 03:10:35 -0700 (Thu, 21 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK][WPE] Add API to provide geolocation information
https://bugs.webkit.org/show_bug.cgi?id=195940

Reviewed by Michael Catanzaro.

.:

Build with geolocation enabled by default in both GTK and WPE. In GTK add a specific USE_GEOCLUE build option
instead of using ENABLE_GEOLOCATION.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

Replace ENABLE(GEOLOCATION) with USE(GEOCLUE).

* PlatformGTK.cmake:
* platform/geoclue/GeolocationProviderGeoclue.cpp:
* platform/geoclue/GeolocationProviderGeoclue.h:
* platform/geoclue/GeolocationProviderGeoclueClient.h:

Source/WebCore/platform/gtk/po:

* POTFILES.in: Add WebKitGeolocationManager.cpp.

Source/WebKit:

Add WebKitGeolocationManager public class to handle geolocation position updates. WebKitGeolocationProvider has
been removed and the default implementation based on GeoClue is done by WebKitGeolocationManager.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/glib/WebKitGeolocationManager.cpp: Added.
(_WebKitGeolocationPosition::_WebKitGeolocationPosition):
(webkit_geolocation_position_new):
(webkit_geolocation_position_copy):
(webkit_geolocation_position_free):
(webkit_geolocation_position_set_timestamp):
(webkit_geolocation_position_set_altitude):
(webkit_geolocation_position_set_altitude_accuracy):
(webkit_geolocation_position_set_heading):
(webkit_geolocation_position_set_speed):
(webkitGeolocationManagerStop):
(webkitGeolocationManagerSetEnableHighAccuracy):
(webkitGeolocationManagerCreate):
(webkitGeolocationManagerGetProperty):
(webkit_geolocation_manager_class_init):
(webkit_gelocation_manager_update_position):
(webkit_gelocation_manager_failed):
(webkit_geolocation_manager_get_enable_high_accuracy):
* UIProcess/API/glib/WebKitGeolocationManagerPrivate.h: Copied from Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h.
* UIProcess/API/glib/WebKitGeolocationProvider.cpp: Removed.
* UIProcess/API/glib/WebKitGeolocationProvider.h: Removed.
* UIProcess/API/glib/WebKitWebContext.cpp:
(webkitWebContextConstructed): Create a WebKitGeolocationManager instead of a WebKitGeolocationProvider.
(webkit_web_context_get_geolocation_manager): Get the WebKitGeolocationManager.
* UIProcess/API/gtk/WebKitGeolocationManager.h: Added.
* UIProcess/API/gtk/WebKitWebContext.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
* UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
* UIProcess/API/gtk/webkit2.h:
* UIProcess/API/wpe/WebKitGeolocationManager.h: Added.
* UIProcess/API/wpe/WebKitWebContext.h:
* UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
* UIProcess/API/wpe/docs/wpe-docs.sgml:
* UIProcess/API/wpe/webkit.h:

Tools:

Add a new test to check the new API.

* TestWebKitAPI/Tests/WebKitGLib/TestGeolocationManager.cpp: Added.
(testGeolocationManagerCurrentPosition):
(testGeolocationManagerWatchPosition):
(beforeAll):
(afterAll):
* TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
(testWebViewGeolocationPermissionRequests): Stop using ENABLE(GEOLOCATION) conditionals for geolocation tests.
(beforeAll): Ditto.
* TestWebKitAPI/glib/CMakeLists.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCoreplatformgeoclueGeolocationProviderGeocluecpp">trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgeoclueGeolocationProviderGeoclueh">trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgeoclueGeolocationProviderGeoclueClienth">trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkpoChangeLog">trunk/Source/WebCore/platform/gtk/po/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkpoPOTFILESin">trunk/Source/WebCore/platform/gtk/po/POTFILES.in</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitPlatformGTKcmake">trunk/Source/WebKit/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKitPlatformWPEcmake">trunk/Source/WebKit/PlatformWPE.cmake</a></li>
<li><a href="#trunkSourceWebKitSourcesGTKtxt">trunk/Source/WebKit/SourcesGTK.txt</a></li>
<li><a href="#trunkSourceWebKitSourcesWPEtxt">trunk/Source/WebKit/SourcesWPE.txt</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIglibWebKitWebContextcpp">trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkWebKitWebContexth">trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkdocswebkit2gtk40sectionstxt">trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkdocswebkit2gtk40types">trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0.types</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkdocswebkit2gtkdocssgml">trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkwebkit2h">trunk/Source/WebKit/UIProcess/API/gtk/webkit2.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIwpeWebKitWebContexth">trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIwpedocswpe10sectionstxt">trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-1.0-sections.txt</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIwpedocswpedocssgml">trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-docs.sgml</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIwpewebkith">trunk/Source/WebKit/UIProcess/API/wpe/webkit.h</a></li>
<li><a href="#trunkSourcecmakeOptionsGTKcmake">trunk/Source/cmake/OptionsGTK.cmake</a></li>
<li><a href="#trunkSourcecmakeOptionsWPEcmake">trunk/Source/cmake/OptionsWPE.cmake</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitGLibTestUIClientcpp">trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPIglibCMakeListstxt">trunk/Tools/TestWebKitAPI/glib/CMakeLists.txt</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitUIProcessAPIglibWebKitGeolocationManagercpp">trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationManager.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIglibWebKitGeolocationManagerPrivateh">trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationManagerPrivate.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIgtkWebKitGeolocationManagerh">trunk/Source/WebKit/UIProcess/API/gtk/WebKitGeolocationManager.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIwpeWebKitGeolocationManagerh">trunk/Source/WebKit/UIProcess/API/wpe/WebKitGeolocationManager.h</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKitGLibTestGeolocationManagercpp">trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestGeolocationManager.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitUIProcessAPIglibWebKitGeolocationProvidercpp">trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPIglibWebKitGeolocationProviderh">trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog  2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/ChangeLog     2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK][WPE] Add API to provide geolocation information
+        https://bugs.webkit.org/show_bug.cgi?id=195940
+
+        Reviewed by Michael Catanzaro.
+
+        Build with geolocation enabled by default in both GTK and WPE. In GTK add a specific USE_GEOCLUE build option
+        instead of using ENABLE_GEOLOCATION.
+
+        * Source/cmake/OptionsGTK.cmake:
+        * Source/cmake/OptionsWPE.cmake:
+
</ins><span class="cx"> 2019-03-20  Simon Fraser  <simon.fraser@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebCore/ChangeLog      2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
</span><span class="cx"> 
</span><ins>+        [GTK][WPE] Add API to provide geolocation information
+        https://bugs.webkit.org/show_bug.cgi?id=195940
+
+        Reviewed by Michael Catanzaro.
+
+        Replace ENABLE(GEOLOCATION) with USE(GEOCLUE).
+
+        * PlatformGTK.cmake:
+        * platform/geoclue/GeolocationProviderGeoclue.cpp:
+        * platform/geoclue/GeolocationProviderGeoclue.h:
+        * platform/geoclue/GeolocationProviderGeoclueClient.h:
+
+2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
+
</ins><span class="cx">         [WPE] Confusing messages in stderr when surfaceless context is not supported
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=195742
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake   2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebCore/PlatformGTK.cmake      2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     rendering/RenderThemeGtk.cpp
</span><span class="cx"> )
</span><span class="cx"> 
</span><del>-if (ENABLE_GEOLOCATION)
</del><ins>+if (USE_GEOCLUE)
</ins><span class="cx">     list(APPEND WebCore_SOURCES
</span><span class="cx">         ${DERIVED_SOURCES_WEBCORE_DIR}/Geoclue2Interface.c
</span><span class="cx">     )
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgeoclueGeolocationProviderGeocluecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp     2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp        2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "GeolocationProviderGeoclue.h"
</span><span class="cx"> 
</span><del>-#if ENABLE(GEOLOCATION)
</del><ins>+#if USE(GEOCLUE)
</ins><span class="cx"> 
</span><span class="cx"> #include <wtf/glib/GLibUtilities.h>
</span><span class="cx"> #include <wtf/glib/GUniquePtr.h>
</span><span class="lines">@@ -212,4 +212,4 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><del>-#endif // ENABLE(GEOLOCATION)
</del><ins>+#endif // USE(GEOCLUE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgeoclueGeolocationProviderGeoclueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.h (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.h       2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.h  2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -18,10 +18,9 @@
</span><span class="cx">  * Boston, MA 02110-1301, USA.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef GeolocationProviderGeoclue_h
-#define GeolocationProviderGeoclue_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><del>-#if ENABLE(GEOLOCATION)
</del><ins>+#if USE(GEOCLUE)
</ins><span class="cx"> 
</span><span class="cx"> #include "GeolocationProviderGeoclueClient.h"
</span><span class="cx"> #include <wtf/glib/GRefPtr.h>
</span><span class="lines">@@ -71,6 +70,4 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><del>-#endif // ENABLE(GEOLOCATION)
-
-#endif // GeolocationProviderGeoclue_h
</del><ins>+#endif // USE(GEOCLUE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgeoclueGeolocationProviderGeoclueClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h 2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h    2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -17,10 +17,9 @@
</span><span class="cx">  * Boston, MA 02110-1301, USA.
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef GeolocationProviderGeoclueClient_h
-#define GeolocationProviderGeoclueClient_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><del>-#if ENABLE(GEOLOCATION)
</del><ins>+#if USE(GEOCLUE)
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -32,6 +31,4 @@
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><del>-#endif // ENABLE(GEOLOCATION)
-
-#endif // GeolocationProviderGeoclueClient_h
</del><ins>+#endif // USE(GEOCLUE)
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkpoChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/po/ChangeLog (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/po/ChangeLog   2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebCore/platform/gtk/po/ChangeLog      2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK][WPE] Add API to provide geolocation information
+        https://bugs.webkit.org/show_bug.cgi?id=195940
+
+        Reviewed by Michael Catanzaro.
+
+        * POTFILES.in: Add WebKitGeolocationManager.cpp.
+
</ins><span class="cx"> 2019-03-13  Milo Casagrande <milo@milo.name>
</span><span class="cx"> 
</span><span class="cx">         [l10n] Updated Italian translation of WebKitGTK+
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkpoPOTFILESin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/po/POTFILES.in (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/po/POTFILES.in 2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebCore/platform/gtk/po/POTFILES.in    2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -16,6 +16,7 @@
</span><span class="cx"> ../../../WebKit/UIProcess/API/glib/WebKitFaviconDatabase.cpp
</span><span class="cx"> ../../../WebKit/UIProcess/API/glib/WebKitFileChooserRequest.cpp
</span><span class="cx"> ../../../WebKit/UIProcess/API/glib/WebKitFindController.cpp
</span><ins>+../../../WebKit/UIProcess/API/glib/WebKitGeolocationManager.cpp
</ins><span class="cx"> ../../../WebKit/UIProcess/API/glib/WebKitNavigationPolicyDecision.cpp
</span><span class="cx"> ../../../WebKit/UIProcess/API/glib/WebKitNotification.cpp
</span><span class="cx"> ../../../WebKit/UIProcess/API/glib/WebKitResponsePolicyDecision.cpp
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/ChangeLog       2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK][WPE] Add API to provide geolocation information
+        https://bugs.webkit.org/show_bug.cgi?id=195940
+
+        Reviewed by Michael Catanzaro.
+
+        Add WebKitGeolocationManager public class to handle geolocation position updates. WebKitGeolocationProvider has
+        been removed and the default implementation based on GeoClue is done by WebKitGeolocationManager.
+
+        * PlatformGTK.cmake:
+        * PlatformWPE.cmake:
+        * SourcesGTK.txt:
+        * SourcesWPE.txt:
+        * UIProcess/API/glib/WebKitGeolocationManager.cpp: Added.
+        (_WebKitGeolocationPosition::_WebKitGeolocationPosition):
+        (webkit_geolocation_position_new):
+        (webkit_geolocation_position_copy):
+        (webkit_geolocation_position_free):
+        (webkit_geolocation_position_set_timestamp):
+        (webkit_geolocation_position_set_altitude):
+        (webkit_geolocation_position_set_altitude_accuracy):
+        (webkit_geolocation_position_set_heading):
+        (webkit_geolocation_position_set_speed):
+        (webkitGeolocationManagerStop):
+        (webkitGeolocationManagerSetEnableHighAccuracy):
+        (webkitGeolocationManagerCreate):
+        (webkitGeolocationManagerGetProperty):
+        (webkit_geolocation_manager_class_init):
+        (webkit_gelocation_manager_update_position):
+        (webkit_gelocation_manager_failed):
+        (webkit_geolocation_manager_get_enable_high_accuracy):
+        * UIProcess/API/glib/WebKitGeolocationManagerPrivate.h: Copied from Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h.
+        * UIProcess/API/glib/WebKitGeolocationProvider.cpp: Removed.
+        * UIProcess/API/glib/WebKitGeolocationProvider.h: Removed.
+        * UIProcess/API/glib/WebKitWebContext.cpp:
+        (webkitWebContextConstructed): Create a WebKitGeolocationManager instead of a WebKitGeolocationProvider.
+        (webkit_web_context_get_geolocation_manager): Get the WebKitGeolocationManager.
+        * UIProcess/API/gtk/WebKitGeolocationManager.h: Added.
+        * UIProcess/API/gtk/WebKitWebContext.h:
+        * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
+        * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
+        * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
+        * UIProcess/API/gtk/webkit2.h:
+        * UIProcess/API/wpe/WebKitGeolocationManager.h: Added.
+        * UIProcess/API/wpe/WebKitWebContext.h:
+        * UIProcess/API/wpe/docs/wpe-0.1-sections.txt:
+        * UIProcess/API/wpe/docs/wpe-docs.sgml:
+        * UIProcess/API/wpe/webkit.h:
+
</ins><span class="cx"> 2019-03-20  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Compute quota after network process restart based on default quota and space used
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/PlatformGTK.cmake (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/PlatformGTK.cmake    2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/PlatformGTK.cmake       2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -82,6 +82,7 @@
</span><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitFindController.h
</span><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitFormSubmissionRequest.h
</span><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitForwardDeclarations.h
</span><ins>+    ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitGeolocationManager.h
</ins><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitGeolocationPermissionRequest.h
</span><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitHitTestResult.h
</span><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.h
</span></span></pre></div>
<a id="trunkSourceWebKitPlatformWPEcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/PlatformWPE.cmake (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/PlatformWPE.cmake    2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/PlatformWPE.cmake       2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -113,6 +113,7 @@
</span><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/wpe/WebKitFileChooserRequest.h
</span><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/wpe/WebKitFindController.h
</span><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/wpe/WebKitFormSubmissionRequest.h
</span><ins>+    ${WEBKIT_DIR}/UIProcess/API/wpe/WebKitGeolocationManager.h
</ins><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/wpe/WebKitGeolocationPermissionRequest.h
</span><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/wpe/WebKitHitTestResult.h
</span><span class="cx">     ${WEBKIT_DIR}/UIProcess/API/wpe/WebKitInstallMissingMediaPluginsPermissionRequest.h
</span></span></pre></div>
<a id="trunkSourceWebKitSourcesGTKtxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/SourcesGTK.txt (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/SourcesGTK.txt       2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/SourcesGTK.txt  2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -146,8 +146,8 @@
</span><span class="cx"> UIProcess/API/glib/WebKitFindController.cpp @no-unify
</span><span class="cx"> UIProcess/API/glib/WebKitFormClient.cpp @no-unify
</span><span class="cx"> UIProcess/API/glib/WebKitFormSubmissionRequest.cpp @no-unify
</span><ins>+UIProcess/API/glib/WebKitGeolocationManager.cpp @no-unify
</ins><span class="cx"> UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp @no-unify
</span><del>-UIProcess/API/glib/WebKitGeolocationProvider.cpp @no-unify
</del><span class="cx"> UIProcess/API/glib/WebKitIconLoadingClient.cpp @no-unify
</span><span class="cx"> UIProcess/API/glib/WebKitInjectedBundleClient.cpp @no-unify
</span><span class="cx"> UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp @no-unify
</span></span></pre></div>
<a id="trunkSourceWebKitSourcesWPEtxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/SourcesWPE.txt (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/SourcesWPE.txt       2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/SourcesWPE.txt  2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -131,8 +131,8 @@
</span><span class="cx"> UIProcess/API/glib/WebKitFindController.cpp @no-unify
</span><span class="cx"> UIProcess/API/glib/WebKitFormClient.cpp @no-unify
</span><span class="cx"> UIProcess/API/glib/WebKitFormSubmissionRequest.cpp @no-unify
</span><ins>+UIProcess/API/glib/WebKitGeolocationManager.cpp @no-unify
</ins><span class="cx"> UIProcess/API/glib/WebKitGeolocationPermissionRequest.cpp @no-unify
</span><del>-UIProcess/API/glib/WebKitGeolocationProvider.cpp @no-unify
</del><span class="cx"> UIProcess/API/glib/WebKitInjectedBundleClient.cpp @no-unify
</span><span class="cx"> UIProcess/API/glib/WebKitInstallMissingMediaPluginsPermissionRequest.cpp @no-unify
</span><span class="cx"> UIProcess/API/glib/WebKitJavascriptResult.cpp @no-unify
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIglibWebKitGeolocationManagercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationManager.cpp (0 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationManager.cpp                              (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationManager.cpp 2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -0,0 +1,478 @@
</span><ins>+/*
+ * Copyright (C) 2019 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebKitGeolocationManager.h"
+
+#include "APIGeolocationProvider.h"
+#include "WebGeolocationPosition.h"
+#include "WebKitGeolocationManagerPrivate.h"
+#include <glib/gi18n-lib.h>
+#include <wtf/WallTime.h>
+#include <wtf/glib/WTFGType.h>
+
+#if USE(GEOCLUE)
+#include <WebCore/GeolocationProviderGeoclue.h>
+#include <WebCore/GeolocationProviderGeoclueClient.h>
+#endif
+
+using namespace WebKit;
+using namespace WebCore;
+
+/**
+ * SECTION:WebKitGeolocationManager
+ * @short_description: WebKitGeolocationManager
+ * @title: Geolocation manager
+ * @see_also: #WebKitGeolocationPermissionRequest, #WebKitWebContext
+ *
+ * WebKitGeolocationManager provides API to get the geographical position of the user.
+ * Once a #WebKitGeolocationPermissionRequest is allowed, when WebKit needs to know the
+ * user location #WebKitGeolocationManager::start signal is emitted. If the signal is handled
+ * and returns %TRUE, the application is responsible for providing the position every time it's
+ * updated by calling webkit_gelocation_manager_update_position(). The signal #WebKitGeolocationManager::stop
+ * will be emitted when location updates are no longer needed.
+ *
+ * Since: 2.26
+ */
+
+enum {
+    PROP_0,
+
+    PROP_ENABLE_HIGH_ACCURACY
+};
+
+enum {
+    START,
+    STOP,
+    LAST_SIGNAL
+};
+
+struct _WebKitGeolocationPosition {
+    _WebKitGeolocationPosition() = default;
+
+    _WebKitGeolocationPosition(double latitude, double longitude, double accuracy, Optional<double> timestamp = WTF::nullopt)
+    {
+        position.timestamp = timestamp.valueOr(WallTime::now().secondsSinceEpoch().value());
+        position.latitude = latitude;
+        position.longitude = longitude;
+        position.accuracy = accuracy;
+    }
+
+    explicit _WebKitGeolocationPosition(const GeolocationPosition& other)
+    {
+        position = other;
+    }
+
+    GeolocationPosition position;
+};
+
+/**
+ * WebKitGeolocationPosition:
+ *
+ * WebKitGeolocationPosition is an opaque struct used to provide position updates to a
+ * #WebKitGeolocationManager using webkit_gelocation_manager_update_position().
+ *
+ * Since: 2.26
+ */
+
+G_DEFINE_BOXED_TYPE(WebKitGeolocationPosition, webkit_geolocation_position, webkit_geolocation_position_copy, webkit_geolocation_position_free)
+
+/**
+ * webkit_geolocation_position_new:
+ * @latitude: a valid latitude in degrees
+ * @longitude: a valid longitude in degrees
+ * @accuracy: accuracy of location in meters
+ *
+ * Create a new #WebKitGeolocationPosition
+ *
+ * Returns: (transfer full): a newly created #WebKitGeolocationPosition
+ *
+ * Since: 2.26
+ */
+WebKitGeolocationPosition* webkit_geolocation_position_new(double latitude, double longitude, double accuracy)
+{
+    auto* position = static_cast<WebKitGeolocationPosition*>(fastMalloc(sizeof(WebKitGeolocationPosition)));
+    new (position) WebKitGeolocationPosition(latitude, longitude, accuracy);
+    return position;
+}
+
+/**
+ * webkit_geolocation_position_copy:
+ * @position: a #WebKitGeolocationPosition
+ *
+ * Make a copy of the #WebKitGeolocationPosition
+ *
+ * Returns: (transfer full): a copy of @position
+ *
+ * Since: 2.26
+ */
+WebKitGeolocationPosition* webkit_geolocation_position_copy(WebKitGeolocationPosition* position)
+{
+    g_return_val_if_fail(position, nullptr);
+
+    auto* copy = static_cast<WebKitGeolocationPosition*>(fastMalloc(sizeof(WebKitGeolocationPosition)));
+    new (copy) WebKitGeolocationPosition(position->position);
+    return copy;
+}
+
+/**
+ * webkit_geolocation_position_free:
+ * @position: a #WebKitGeolocationPosition
+ *
+ * Free the #WebKitGeolocationPosition
+ *
+ * Since: 2.26
+ */
+void webkit_geolocation_position_free(WebKitGeolocationPosition* position)
+{
+    g_return_if_fail(position);
+
+    position->~WebKitGeolocationPosition();
+    fastFree(position);
+}
+
+/**
+ * webkit_geolocation_position_set_timestamp:
+ * @position: a #WebKitGeolocationPosition
+ * @timestamp: timestamp in seconds since the epoch, or 0 to use current time
+ *
+ * Set the @position timestamp. By default it's the time when the @position was created.
+ *
+ * Since: 2.26
+ */
+void webkit_geolocation_position_set_timestamp(WebKitGeolocationPosition* position, guint64 timestamp)
+{
+    g_return_if_fail(position);
+
+    position->position.timestamp = timestamp ? static_cast<double>(timestamp) : WallTime::now().secondsSinceEpoch().value();
+}
+
+/**
+ * webkit_geolocation_position_set_altitude:
+ * @position: a #WebKitGeolocationPosition
+ * @altitude: altitude in meters
+ *
+ * Set the @position altitude
+ *
+ * Since: 2.26
+ */
+void webkit_geolocation_position_set_altitude(WebKitGeolocationPosition* position, double altitude)
+{
+    g_return_if_fail(position);
+
+    position->position.altitude = altitude;
+}
+
+/**
+ * webkit_geolocation_position_set_altitude_accuracy:
+ * @position: a #WebKitGeolocationPosition
+ * @altitude_accuracy: accuracy of position altitude in meters
+ *
+ * Set the accuracy of @position altitude
+ *
+ * Since: 2.26
+ */
+void webkit_geolocation_position_set_altitude_accuracy(WebKitGeolocationPosition* position, double altitudeAccuracy)
+{
+    g_return_if_fail(position);
+
+    position->position.altitudeAccuracy = altitudeAccuracy;
+}
+
+/**
+ * webkit_geolocation_position_set_heading:
+ * @position: a #WebKitGeolocationPosition
+ * @heading: heading in degrees
+ *
+ * Set the @position heading, as a positive angle between the direction of movement and the North
+ * direction, in clockwise direction.
+ *
+ * Since: 2.26
+ */
+void webkit_geolocation_position_set_heading(WebKitGeolocationPosition* position, double heading)
+{
+    g_return_if_fail(position);
+
+    position->position.heading = heading;
+}
+
+/**
+ * webkit_geolocation_position_set_speed:
+ * @position: a #WebKitGeolocationPosition
+ * @speed: speed in meters per second
+ *
+ * Set the @position speed
+ *
+ * Since: 2.26
+ */
+void webkit_geolocation_position_set_speed(WebKitGeolocationPosition* position, double speed)
+{
+    g_return_if_fail(position);
+
+    position->position.speed = speed;
+}
+
+#if USE(GEOCLUE)
+class GeoclueProviderClient final : public GeolocationProviderGeoclueClient {
+public:
+    explicit GeoclueProviderClient(WebKitGeolocationManager* manager)
+        : m_manager(manager)
+    {
+    }
+
+private:
+    void notifyPositionChanged(int timestamp, double latitude, double longitude, double altitude, double accuracy, double) override
+    {
+        WebKitGeolocationPosition position(latitude, longitude, accuracy, static_cast<double>(timestamp));
+        webkit_geolocation_position_set_altitude(&position, altitude);
+        webkit_gelocation_manager_update_position(m_manager, &position);
+    }
+
+    void notifyErrorOccurred(const char* message) override
+    {
+        webkit_gelocation_manager_failed(m_manager, message);
+    }
+
+    WebKitGeolocationManager* m_manager;
+};
+#endif
+
+struct _WebKitGeolocationManagerPrivate {
+    RefPtr<WebGeolocationManagerProxy> manager;
+    bool highAccuracyEnabled;
+#if USE(GEOCLUE)
+    std::unique_ptr<GeoclueProviderClient> providerClient;
+    std::unique_ptr<GeolocationProviderGeoclue> provider;
+#endif
+};
+
+static guint signals[LAST_SIGNAL] = { 0, };
+
+WEBKIT_DEFINE_TYPE(WebKitGeolocationManager, webkit_geolocation_manager, G_TYPE_OBJECT)
+
+static void webkitGeolocationManagerStart(WebKitGeolocationManager* manager)
+{
+    gboolean returnValue;
+    g_signal_emit(manager, signals[START], 0, &returnValue);
+    if (returnValue) {
+#if USE(GEOCLUE)
+        manager->priv->provider = nullptr;
+        manager->priv->providerClient = nullptr;
+#endif
+        return;
+    }
+
+#if USE(GEOCLUE)
+    if (!manager->priv->provider) {
+        manager->priv->providerClient = std::make_unique<GeoclueProviderClient>(manager);
+        manager->priv->provider = std::make_unique<GeolocationProviderGeoclue>(manager->priv->providerClient.get());
+    }
+    manager->priv->provider->startUpdating();
+#endif
+}
+
+static void webkitGeolocationManagerStop(WebKitGeolocationManager* manager)
+{
+    g_signal_emit(manager, signals[STOP], 0, nullptr);
+
+#if USE(GEOCLUE)
+    if (manager->priv->provider)
+        manager->priv->provider->stopUpdating();
+#endif
+}
+
+static void webkitGeolocationManagerSetEnableHighAccuracy(WebKitGeolocationManager* manager, bool enabled)
+{
+    if (manager->priv->highAccuracyEnabled == enabled)
+        return;
+
+    manager->priv->highAccuracyEnabled = enabled;
+    g_object_notify(G_OBJECT(manager), "enable-high-accuracy");
+#if USE(GEOCLUE)
+    if (manager->priv->provider)
+        manager->priv->provider->setEnableHighAccuracy(enabled);
+#endif
+}
+
+class GeolocationProvider final : public API::GeolocationProvider {
+public:
+    explicit GeolocationProvider(WebKitGeolocationManager* manager)
+        : m_manager(manager)
+    {
+    }
+
+private:
+    void startUpdating(WebGeolocationManagerProxy&) override
+    {
+        webkitGeolocationManagerStart(m_manager);
+    }
+
+    void stopUpdating(WebGeolocationManagerProxy&) override
+    {
+        webkitGeolocationManagerStop(m_manager);
+    }
+
+    void setEnableHighAccuracy(WebGeolocationManagerProxy&, bool enabled) override
+    {
+        webkitGeolocationManagerSetEnableHighAccuracy(m_manager, enabled);
+    }
+
+    WebKitGeolocationManager* m_manager;
+};
+
+WebKitGeolocationManager* webkitGeolocationManagerCreate(WebGeolocationManagerProxy* proxy)
+{
+    auto* manager = WEBKIT_GEOLOCATION_MANAGER(g_object_new(WEBKIT_TYPE_GEOLOCATION_MANAGER, nullptr));
+    manager->priv->manager = proxy;
+    proxy->setProvider(std::make_unique<GeolocationProvider>(manager));
+    return manager;
+}
+
+static void webkitGeolocationManagerGetProperty(GObject* object, guint propId, GValue* value, GParamSpec* paramSpec)
+{
+    WebKitGeolocationManager* manager = WEBKIT_GEOLOCATION_MANAGER(object);
+
+    switch (propId) {
+    case PROP_ENABLE_HIGH_ACCURACY:
+        g_value_set_boolean(value, webkit_geolocation_manager_get_enable_high_accuracy(manager));
+        break;
+    default:
+        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propId, paramSpec);
+    }
+}
+
+static void webkit_geolocation_manager_class_init(WebKitGeolocationManagerClass* geolocationManagerClass)
+{
+    GObjectClass* gObjectClass = G_OBJECT_CLASS(geolocationManagerClass);
+    gObjectClass->get_property = webkitGeolocationManagerGetProperty;
+
+    /**
+     * WebKitGeolocationManager:enable-high-accuracy:
+     *
+     * Whether high accuracy is enabled. This is a read-only property that will be
+     * set to %TRUE when a #WebKitGeolocationManager needs to get accurate position updates.
+     * You can connect to notify::enable-high-accuracy signal to monitor it.
+     *
+     * Since: 2.26
+     */
+    g_object_class_install_property(
+        gObjectClass,
+        PROP_ENABLE_HIGH_ACCURACY,
+        g_param_spec_boolean(
+            "enable-high-accuracy",
+            _("Enable high accuracy"),
+            _("Whether high accuracy is enabled"),
+            FALSE,
+            WEBKIT_PARAM_READABLE));
+
+    /**
+     * WebKitGeolocationManager::start:
+     * @manager: the #WebKitGeolocationManager on which the signal is emitted
+     *
+     * The signal is emitted to notify that @manager needs to start receiving
+     * position updates. After this signal is emitted the user should provide
+     * the updates using webkit_gelocation_manager_update_position() every time
+     * the position changes, or use webkit_gelocation_manager_failed() in case
+     * it isn't possible to determine the current position.
+     *
+     * If the signal is not handled, WebKit will try to determine the position
+     * using GeoClue if available.
+     *
+     * Returns: %TRUE to stop other handlers from being invoked for the event.
+     *    %FALSE to propagate the event further.
+     *
+     * Since: 2.26
+     */
+    signals[START] = g_signal_new(
+        "start",
+        G_TYPE_FROM_CLASS(geolocationManagerClass),
+        G_SIGNAL_RUN_LAST,
+        0,
+        g_signal_accumulator_true_handled, nullptr,
+        g_cclosure_marshal_generic,
+        G_TYPE_BOOLEAN, 0);
+
+    /**
+     * WebKitGeolocationManager::stop:
+     * @manager: the #WebKitGeolocationManager on which the signal is emitted
+     *
+     * The signal is emitted to notify that @manager doesn't need to receive
+     * position updates anymore.
+     *
+     * Since: 2.26
+     */
+    signals[STOP] = g_signal_new(
+        "stop",
+        G_TYPE_FROM_CLASS(geolocationManagerClass),
+        G_SIGNAL_RUN_LAST,
+        0,
+        nullptr, nullptr,
+        g_cclosure_marshal_generic,
+        G_TYPE_NONE, 0);
+}
+
+/**
+ * webkit_gelocation_manager_update_position:
+ * @manager: a #WebKitGeolocationManager
+ * @position: a #WebKitGeolocationPosition
+ *
+ * Notify @manager that position has been updated to @position.
+ *
+ * Since: 2.26
+ */
+void webkit_gelocation_manager_update_position(WebKitGeolocationManager* manager, WebKitGeolocationPosition* position)
+{
+    g_return_if_fail(WEBKIT_IS_GEOLOCATION_MANAGER(manager));
+    g_return_if_fail(position);
+
+    GeolocationPosition corePosition = position->position;
+    auto wkPosition = WebGeolocationPosition::create(WTFMove(corePosition));
+    manager->priv->manager->providerDidChangePosition(wkPosition.ptr());
+}
+
+/**
+ * webkit_gelocation_manager_failed:
+ * @manager: a #WebKitGeolocationManager
+ * @error_message: the error message
+ *
+ * Notify @manager that determining the position failed.
+ *
+ * Since: 2.26
+ */
+void webkit_gelocation_manager_failed(WebKitGeolocationManager* manager, const char* errorMessage)
+{
+    g_return_if_fail(WEBKIT_IS_GEOLOCATION_MANAGER(manager));
+
+    manager->priv->manager->providerDidFailToDeterminePosition(String::fromUTF8(errorMessage));
+}
+
+/**
+ * webkit_geolocation_manager_get_enable_high_accuracy:
+ * @manager: a #WebKitGeolocationManager
+ *
+ * Get whether high accuracy is enabled.
+ *
+ * Since: 2.26
+ */
+gboolean webkit_geolocation_manager_get_enable_high_accuracy(WebKitGeolocationManager* manager)
+{
+    g_return_val_if_fail(WEBKIT_IS_GEOLOCATION_MANAGER(manager), FALSE);
+
+    return manager->priv->highAccuracyEnabled;
+}
</ins></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIglibWebKitGeolocationManagerPrivatehfromrev243284trunkSourceWebCoreplatformgeoclueGeolocationProviderGeoclueClienth"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationManagerPrivate.h (from rev 243284, trunk/Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h) (0 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationManagerPrivate.h                         (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationManagerPrivate.h    2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -0,0 +1,25 @@
</span><ins>+/*
+ * Copyright (C) 2019 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#pragma once
+
+#include "WebGeolocationManagerProxy.h"
+#include "WebKitGeolocationManager.h"
+
+WebKitGeolocationManager* webkitGeolocationManagerCreate(WebKit::WebGeolocationManagerProxy*);
</ins></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIglibWebKitGeolocationProvidercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.cpp (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.cpp     2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.cpp        2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -1,98 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WebKitGeolocationProvider.h"
-
-#if ENABLE(GEOLOCATION)
-
-#include "APIGeolocationProvider.h"
-#include "WebGeolocationManagerProxy.h"
-#include "WebGeolocationPosition.h"
-
-namespace WebKit {
-
-class GeolocationProvider : public API::GeolocationProvider {
-public:
-    explicit GeolocationProvider(WebKitGeolocationProvider& provider)
-        : m_provider(provider)
-    {
-    }
-
-private:
-    void startUpdating(WebGeolocationManagerProxy&) override
-    {
-        m_provider.startUpdating();
-    }
-
-    void stopUpdating(WebGeolocationManagerProxy&) override
-    {
-        m_provider.stopUpdating();
-    }
-
-    WebKitGeolocationProvider& m_provider;
-};
-
-WebKitGeolocationProvider::~WebKitGeolocationProvider()
-{
-    m_provider.stopUpdating();
-    m_geolocationManager->setProvider(nullptr);
-}
-
-WebKitGeolocationProvider::WebKitGeolocationProvider(WebGeolocationManagerProxy* geolocationManager)
-    : m_geolocationManager(geolocationManager)
-    , m_provider(this)
-{
-    ASSERT(geolocationManager);
-    geolocationManager->setProvider(std::make_unique<GeolocationProvider>(*this));
-}
-
-void WebKitGeolocationProvider::startUpdating()
-{
-    m_provider.startUpdating();
-}
-
-void WebKitGeolocationProvider::stopUpdating()
-{
-    m_provider.stopUpdating();
-}
-
-void WebKitGeolocationProvider::notifyPositionChanged(int timestamp, double latitude, double longitude, double altitude, double accuracy, double altitudeAccuracy)
-{
-    WebCore::GeolocationPosition corePosition { static_cast<double>(timestamp), latitude, longitude, accuracy };
-    corePosition.altitude = altitude;
-    corePosition.altitudeAccuracy = altitudeAccuracy;
-    auto position = WebGeolocationPosition::create(WTFMove(corePosition));
-    m_geolocationManager->providerDidChangePosition(position.ptr());
-}
-
-void WebKitGeolocationProvider::notifyErrorOccurred(const char* /* message */)
-{
-    m_geolocationManager->providerDidFailToDeterminePosition();
-}
-
-} // namespace WebKit
-
-#endif // ENABLE(GEOLOCATION)
</del></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIglibWebKitGeolocationProviderh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.h (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.h       2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitGeolocationProvider.h  2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -1,50 +0,0 @@
</span><del>-/*
- * Copyright (C) 2012 Igalia S.L.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#pragma once
-
-#if ENABLE(GEOLOCATION)
-
-#include <WebCore/GeolocationProviderGeoclue.h>
-#include <WebCore/GeolocationProviderGeoclueClient.h>
-
-namespace WebKit {
-class WebGeolocationManagerProxy;
-
-class WebKitGeolocationProvider final : public WebCore::GeolocationProviderGeoclueClient {
-public:
-    explicit WebKitGeolocationProvider(WebGeolocationManagerProxy*);
-    ~WebKitGeolocationProvider();
-
-    void startUpdating();
-    void stopUpdating();
-
-private:
-    // GeolocationProviderGeoclueClient interface.
-    void notifyPositionChanged(int, double, double, double, double, double) override;
-    void notifyErrorOccurred(const char*) override;
-
-    RefPtr<WebGeolocationManagerProxy> m_geolocationManager;
-    WebCore::GeolocationProviderGeoclue m_provider;
-};
-
-} // namespace WebKit
-
-#endif // ENABLE(GEOLOCATION)
-
</del></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIglibWebKitWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp      2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp 2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -31,13 +31,12 @@
</span><span class="cx"> #include "TextCheckerState.h"
</span><span class="cx"> #include "WebAutomationSession.h"
</span><span class="cx"> #include "WebCertificateInfo.h"
</span><del>-#include "WebGeolocationManagerProxy.h"
</del><span class="cx"> #include "WebKitAutomationSessionPrivate.h"
</span><span class="cx"> #include "WebKitCustomProtocolManagerClient.h"
</span><span class="cx"> #include "WebKitDownloadClient.h"
</span><span class="cx"> #include "WebKitDownloadPrivate.h"
</span><span class="cx"> #include "WebKitFaviconDatabasePrivate.h"
</span><del>-#include "WebKitGeolocationProvider.h"
</del><ins>+#include "WebKitGeolocationManagerPrivate.h"
</ins><span class="cx"> #include "WebKitInjectedBundleClient.h"
</span><span class="cx"> #include "WebKitNetworkProxySettingsPrivate.h"
</span><span class="cx"> #include "WebKitNotificationProvider.h"
</span><span class="lines">@@ -170,9 +169,7 @@
</span><span class="cx">     GRefPtr<WebKitSecurityManager> securityManager;
</span><span class="cx">     URISchemeHandlerMap uriSchemeHandlers;
</span><span class="cx">     URISchemeRequestMap uriSchemeRequests;
</span><del>-#if ENABLE(GEOLOCATION)
-    std::unique_ptr<WebKitGeolocationProvider> geolocationProvider;
-#endif
</del><ins>+    GRefPtr<WebKitGeolocationManager> geolocationManager;
</ins><span class="cx">     std::unique_ptr<WebKitNotificationProvider> notificationProvider;
</span><span class="cx">     GRefPtr<WebKitWebsiteDataManager> websiteDataManager;
</span><span class="cx"> 
</span><span class="lines">@@ -367,9 +364,7 @@
</span><span class="cx">     attachDownloadClientToContext(webContext);
</span><span class="cx">     attachCustomProtocolManagerClientToContext(webContext);
</span><span class="cx"> 
</span><del>-#if ENABLE(GEOLOCATION)
-    priv->geolocationProvider = std::make_unique<WebKitGeolocationProvider>(priv->processPool->supplement<WebGeolocationManagerProxy>());
-#endif
</del><ins>+    priv->geolocationManager = adoptGRef(webkitGeolocationManagerCreate(priv->processPool->supplement<WebGeolocationManagerProxy>()));
</ins><span class="cx">     priv->notificationProvider = std::make_unique<WebKitNotificationProvider>(priv->processPool->supplement<WebNotificationManagerProxy>(), webContext);
</span><span class="cx"> #if PLATFORM(GTK) && ENABLE(REMOTE_INSPECTOR)
</span><span class="cx">     priv->remoteInspectorProtocolHandler = std::make_unique<RemoteInspectorProtocolHandler>(webContext);
</span><span class="lines">@@ -867,6 +862,23 @@
</span><span class="cx">     return webkit_website_data_manager_get_cookie_manager(context->priv->websiteDataManager.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+/**
+ * webkit_web_context_get_geolocation_manager:
+ * @context: a #WebKitWebContext
+ *
+ * Get the #WebKitGeolocationManager of @context.
+ *
+ * Returns: (transfer none): the #WebKitGeolocationManager of @context.
+ *
+ * Since: 2.26
+ */
+WebKitGeolocationManager* webkit_web_context_get_geolocation_manager(WebKitWebContext* context)
+{
+    g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), nullptr);
+
+    return context->priv->geolocationManager.get();
+}
+
</ins><span class="cx"> static void ensureFaviconDatabase(WebKitWebContext* context)
</span><span class="cx"> {
</span><span class="cx">     WebKitWebContextPrivate* priv = context->priv;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkWebKitGeolocationManagerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/UIProcess/API/gtk/WebKitGeolocationManager.h (0 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitGeolocationManager.h                         (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitGeolocationManager.h    2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+/*
+ * Copyright (C) 2019 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
+#error "Only <webkit2/webkit2.h> can be included directly."
+#endif
+
+#ifndef WebKitGeolocationManager_h
+#define WebKitGeolocationManager_h
+
+#include <glib-object.h>
+#include <webkit2/WebKitDefines.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_GEOLOCATION_MANAGER            (webkit_geolocation_manager_get_type())
+#define WEBKIT_GEOLOCATION_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_GEOLOCATION_MANAGER, WebKitGeolocationManager))
+#define WEBKIT_IS_GEOLOCATION_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_GEOLOCATION_MANAGER))
+#define WEBKIT_GEOLOCATION_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_GEOLOCATION_MANAGER, WebKitGeolocationManagerClass))
+#define WEBKIT_IS_GEOLOCATION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_GEOLOCATION_MANAGER))
+#define WEBKIT_GEOLOCATION_MANAGER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_GEOLOCATION_MANAGER, WebKitGeolocationManagerClass))
+
+#define WEBKIT_TYPE_GEOLOCATION_POSITION           (webkit_geolocation_position_get_type())
+
+typedef struct _WebKitGeolocationManager        WebKitGeolocationManager;
+typedef struct _WebKitGeolocationManagerClass   WebKitGeolocationManagerClass;
+typedef struct _WebKitGeolocationManagerPrivate WebKitGeolocationManagerPrivate;
+typedef struct _WebKitGeolocationPosition       WebKitGeolocationPosition;
+
+struct _WebKitGeolocationManager {
+    GObject parent;
+
+    /*< private >*/
+    WebKitGeolocationManagerPrivate *priv;
+};
+
+struct _WebKitGeolocationManagerClass {
+    GObjectClass parent_class;
+
+    void (*_webkit_reserved0) (void);
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
+};
+
+WEBKIT_API GType
+webkit_geolocation_manager_get_type                 (void);
+
+WEBKIT_API void
+webkit_gelocation_manager_update_position           (WebKitGeolocationManager  *manager,
+                                                     WebKitGeolocationPosition *position);
+
+WEBKIT_API void
+webkit_gelocation_manager_failed                    (WebKitGeolocationManager  *manager,
+                                                     const char                *error_message);
+
+WEBKIT_API gboolean
+webkit_geolocation_manager_get_enable_high_accuracy (WebKitGeolocationManager  *manager);
+
+
+WEBKIT_API GType
+webkit_geolocation_position_get_type                (void);
+
+WEBKIT_API WebKitGeolocationPosition *
+webkit_geolocation_position_new                     (double                     latitude,
+                                                     double                     longitude,
+                                                     double                     accuracy);
+
+WEBKIT_API WebKitGeolocationPosition *
+webkit_geolocation_position_copy                    (WebKitGeolocationPosition *position);
+
+WEBKIT_API void
+webkit_geolocation_position_free                    (WebKitGeolocationPosition *position);
+
+WEBKIT_API void
+webkit_geolocation_position_set_timestamp           (WebKitGeolocationPosition *position,
+                                                     guint64                    timestamp);
+
+WEBKIT_API void
+webkit_geolocation_position_set_altitude            (WebKitGeolocationPosition *position,
+                                                     double                     altitude);
+
+WEBKIT_API void
+webkit_geolocation_position_set_altitude_accuracy   (WebKitGeolocationPosition *position,
+                                                     double                     altitude_accuracy);
+
+WEBKIT_API void
+webkit_geolocation_position_set_heading             (WebKitGeolocationPosition *position,
+                                                     double                     heading);
+
+WEBKIT_API void
+webkit_geolocation_position_set_speed               (WebKitGeolocationPosition *position,
+                                                     double                     speed);
+
+G_END_DECLS
+
+#endif /* WebKitGeolocationManager_h */
</ins></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkWebKitWebContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h 2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/gtk/WebKitWebContext.h    2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include <webkit2/WebKitDefines.h>
</span><span class="cx"> #include <webkit2/WebKitDownload.h>
</span><span class="cx"> #include <webkit2/WebKitFaviconDatabase.h>
</span><ins>+#include <webkit2/WebKitGeolocationManager.h>
</ins><span class="cx"> #include <webkit2/WebKitNetworkProxySettings.h>
</span><span class="cx"> #include <webkit2/WebKitSecurityManager.h>
</span><span class="cx"> #include <webkit2/WebKitURISchemeRequest.h>
</span><span class="lines">@@ -214,6 +215,9 @@
</span><span class="cx"> WEBKIT_API WebKitCookieManager *
</span><span class="cx"> webkit_web_context_get_cookie_manager               (WebKitWebContext              *context);
</span><span class="cx"> 
</span><ins>+WEBKIT_API WebKitGeolocationManager *
+webkit_web_context_get_geolocation_manager          (WebKitWebContext              *context);
+
</ins><span class="cx"> WEBKIT_API WebKitFaviconDatabase *
</span><span class="cx"> webkit_web_context_get_favicon_database             (WebKitWebContext              *context);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkdocswebkit2gtk40sectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt   2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt      2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> webkit_web_context_set_network_proxy_settings
</span><span class="cx"> webkit_web_context_download_uri
</span><span class="cx"> webkit_web_context_get_cookie_manager
</span><ins>+webkit_web_context_get_geolocation_manager
</ins><span class="cx"> webkit_web_context_get_favicon_database
</span><span class="cx"> webkit_web_context_set_favicon_database_directory
</span><span class="cx"> webkit_web_context_get_favicon_database_directory
</span><span class="lines">@@ -1494,6 +1495,40 @@
</span><span class="cx"> </SECTION>
</span><span class="cx"> 
</span><span class="cx"> <SECTION>
</span><ins>+<FILE>WebKitGeolocationManager</FILE>
+WebKitGeolocationManager
+webkit_gelocation_manager_update_position
+webkit_gelocation_manager_failed
+webkit_geolocation_manager_get_enable_high_accuracy
+
+<SUBSECTION Position>
+WebKitGeolocationPosition
+webkit_geolocation_position_new
+webkit_geolocation_position_copy
+webkit_geolocation_position_free
+webkit_geolocation_position_set_timestamp
+webkit_geolocation_position_set_altitude
+webkit_geolocation_position_set_altitude_accuracy
+webkit_geolocation_position_set_heading
+webkit_geolocation_position_set_speed
+
+<SUBSECTION Private>
+WebKitGeolocationManagerPrivate
+webkit_geolocation_manager_get_type
+webkit_geolocation_position_get_type
+
+<SUBSECTION Standard>
+WebKitGeolocationManagerClass
+WEBKIT_TYPE_GEOLOCATION_MANAGER
+WEBKIT_GEOLOCATION_MANAGER
+WEBKIT_IS_GEOLOCATION_MANAGER
+WEBKIT_GEOLOCATION_MANAGER_CLASS
+WEBKIT_IS_GEOLOCATION_MANAGER_CLASS
+WEBKIT_GEOLOCATION_MANAGER_GET_CLASS
+WEBKIT_TYPE_GEOLOCATION_POSITION
+</SECTION>
+
+<SECTION>
</ins><span class="cx"> <FILE>WebKitWebExtension</FILE>
</span><span class="cx"> WebKitWebExtension
</span><span class="cx"> WebKitWebExtensionInitializeFunction
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkdocswebkit2gtk40types"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0.types (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0.types  2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-4.0.types     2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -40,3 +40,5 @@
</span><span class="cx"> webkit_option_menu_get_type
</span><span class="cx"> webkit_option_menu_item_get_type
</span><span class="cx"> webkit_device_info_permission_request_get_type
</span><ins>+webkit_geolocation_manager_get_type
+webkit_geolocation_position_get_type
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkdocswebkit2gtkdocssgml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml  2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml     2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -62,6 +62,7 @@
</span><span class="cx">     <xi:include href="xml/WebKitNetworkProxySettings.xml"/>
</span><span class="cx">     <xi:include href="xml/WebKitAutomationSession.xml"/>
</span><span class="cx">     <xi:include href="xml/WebKitApplicationInfo.xml"/>
</span><ins>+    <xi:include href="xml/WebKitGeolocationManager.xml"/>
</ins><span class="cx">   </chapter>
</span><span class="cx"> 
</span><span class="cx">   <chapter>
</span><span class="lines">@@ -149,5 +150,10 @@
</span><span class="cx">     <xi:include href="xml/api-index-2.24.xml"><xi:fallback /></xi:include>
</span><span class="cx">   </index>
</span><span class="cx"> 
</span><ins>+  <index id="api-index-2-26" role="2.26">
+    <title>Index of new symbols in 2.26</title>
+    <xi:include href="xml/api-index-2.26.xml"><xi:fallback /></xi:include>
+  </index>
+
</ins><span class="cx">   <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</span><span class="cx"> </book>
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIgtkwebkit2h"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/gtk/webkit2.h (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/gtk/webkit2.h  2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/gtk/webkit2.h     2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #include <webkit2/WebKitFileChooserRequest.h>
</span><span class="cx"> #include <webkit2/WebKitFindController.h>
</span><span class="cx"> #include <webkit2/WebKitFormSubmissionRequest.h>
</span><ins>+#include <webkit2/WebKitGeolocationManager.h>
</ins><span class="cx"> #include <webkit2/WebKitGeolocationPermissionRequest.h>
</span><span class="cx"> #include <webkit2/WebKitHitTestResult.h>
</span><span class="cx"> #include <webkit2/WebKitInstallMissingMediaPluginsPermissionRequest.h>
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIwpeWebKitGeolocationManagerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/UIProcess/API/wpe/WebKitGeolocationManager.h (0 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/wpe/WebKitGeolocationManager.h                         (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/wpe/WebKitGeolocationManager.h    2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+/*
+ * Copyright (C) 2019 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#if !defined(__WEBKIT_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
+#error "Only <wpe/webkit.h> can be included directly."
+#endif
+
+#ifndef WebKitGeolocationManager_h
+#define WebKitGeolocationManager_h
+
+#include <glib-object.h>
+#include <wpe/WebKitDefines.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_GEOLOCATION_MANAGER            (webkit_geolocation_manager_get_type())
+#define WEBKIT_GEOLOCATION_MANAGER(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_GEOLOCATION_MANAGER, WebKitGeolocationManager))
+#define WEBKIT_IS_GEOLOCATION_MANAGER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_GEOLOCATION_MANAGER))
+#define WEBKIT_GEOLOCATION_MANAGER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),  WEBKIT_TYPE_GEOLOCATION_MANAGER, WebKitGeolocationManagerClass))
+#define WEBKIT_IS_GEOLOCATION_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),  WEBKIT_TYPE_GEOLOCATION_MANAGER))
+#define WEBKIT_GEOLOCATION_MANAGER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),  WEBKIT_TYPE_GEOLOCATION_MANAGER, WebKitGeolocationManagerClass))
+
+#define WEBKIT_TYPE_GEOLOCATION_POSITION           (webkit_geolocation_position_get_type())
+
+typedef struct _WebKitGeolocationManager        WebKitGeolocationManager;
+typedef struct _WebKitGeolocationManagerClass   WebKitGeolocationManagerClass;
+typedef struct _WebKitGeolocationManagerPrivate WebKitGeolocationManagerPrivate;
+typedef struct _WebKitGeolocationPosition       WebKitGeolocationPosition;
+
+struct _WebKitGeolocationManager {
+    GObject parent;
+
+    /*< private >*/
+    WebKitGeolocationManagerPrivate *priv;
+};
+
+struct _WebKitGeolocationManagerClass {
+    GObjectClass parent_class;
+
+    void (*_webkit_reserved0) (void);
+    void (*_webkit_reserved1) (void);
+    void (*_webkit_reserved2) (void);
+    void (*_webkit_reserved3) (void);
+};
+
+WEBKIT_API GType
+webkit_geolocation_manager_get_type                 (void);
+
+WEBKIT_API void
+webkit_gelocation_manager_update_position           (WebKitGeolocationManager  *manager,
+                                                     WebKitGeolocationPosition *position);
+
+WEBKIT_API void
+webkit_gelocation_manager_failed                    (WebKitGeolocationManager  *manager,
+                                                     const char                *error_message);
+
+WEBKIT_API gboolean
+webkit_geolocation_manager_get_enable_high_accuracy (WebKitGeolocationManager  *manager);
+
+
+WEBKIT_API GType
+webkit_geolocation_position_get_type                (void);
+
+WEBKIT_API WebKitGeolocationPosition *
+webkit_geolocation_position_new                     (double                     latitude,
+                                                     double                     longitude,
+                                                     double                     accuracy);
+
+WEBKIT_API WebKitGeolocationPosition *
+webkit_geolocation_position_copy                    (WebKitGeolocationPosition *position);
+
+WEBKIT_API void
+webkit_geolocation_position_free                    (WebKitGeolocationPosition *position);
+
+WEBKIT_API void
+webkit_geolocation_position_set_timestamp           (WebKitGeolocationPosition *position,
+                                                     guint64                    timestamp);
+
+WEBKIT_API void
+webkit_geolocation_position_set_altitude            (WebKitGeolocationPosition *position,
+                                                     double                     altitude);
+
+WEBKIT_API void
+webkit_geolocation_position_set_altitude_accuracy   (WebKitGeolocationPosition *position,
+                                                     double                     altitude_accuracy);
+
+WEBKIT_API void
+webkit_geolocation_position_set_heading             (WebKitGeolocationPosition *position,
+                                                     double                     heading);
+
+WEBKIT_API void
+webkit_geolocation_position_set_speed               (WebKitGeolocationPosition *position,
+                                                     double                     speed);
+
+G_END_DECLS
+
+#endif /* WebKitGeolocationManager_h */
</ins></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIwpeWebKitWebContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h 2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/wpe/WebKitWebContext.h    2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #include <wpe/WebKitDefines.h>
</span><span class="cx"> #include <wpe/WebKitDownload.h>
</span><span class="cx"> #include <wpe/WebKitFaviconDatabase.h>
</span><ins>+#include <wpe/WebKitGeolocationManager.h>
</ins><span class="cx"> #include <wpe/WebKitNetworkProxySettings.h>
</span><span class="cx"> #include <wpe/WebKitSecurityManager.h>
</span><span class="cx"> #include <wpe/WebKitURISchemeRequest.h>
</span><span class="lines">@@ -214,6 +215,9 @@
</span><span class="cx"> WEBKIT_API WebKitCookieManager *
</span><span class="cx"> webkit_web_context_get_cookie_manager               (WebKitWebContext              *context);
</span><span class="cx"> 
</span><ins>+WEBKIT_API WebKitGeolocationManager *
+webkit_web_context_get_geolocation_manager          (WebKitWebContext              *context);
+
</ins><span class="cx"> WEBKIT_API WebKitFaviconDatabase *
</span><span class="cx"> webkit_web_context_get_favicon_database             (WebKitWebContext              *context);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIwpedocswpe10sectionstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-1.0-sections.txt (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-1.0-sections.txt  2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-1.0-sections.txt     2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> webkit_web_context_set_network_proxy_settings
</span><span class="cx"> webkit_web_context_download_uri
</span><span class="cx"> webkit_web_context_get_cookie_manager
</span><ins>+webkit_web_context_get_geolocation_manager
</ins><span class="cx"> webkit_web_context_get_favicon_database
</span><span class="cx"> webkit_web_context_set_favicon_database_directory
</span><span class="cx"> webkit_web_context_get_favicon_database_directory
</span><span class="lines">@@ -1368,6 +1369,40 @@
</span><span class="cx"> </SECTION>
</span><span class="cx"> 
</span><span class="cx"> <SECTION>
</span><ins>+<FILE>WebKitGeolocationManager</FILE>
+WebKitGeolocationManager
+webkit_gelocation_manager_update_position
+webkit_gelocation_manager_failed
+webkit_geolocation_manager_get_enable_high_accuracy
+
+<SUBSECTION Position>
+WebKitGeolocationPosition
+webkit_geolocation_position_new
+webkit_geolocation_position_copy
+webkit_geolocation_position_free
+webkit_geolocation_position_set_timestamp
+webkit_geolocation_position_set_altitude
+webkit_geolocation_position_set_altitude_accuracy
+webkit_geolocation_position_set_heading
+webkit_geolocation_position_set_speed
+
+<SUBSECTION Private>
+WebKitGeolocationManagerPrivate
+webkit_geolocation_manager_get_type
+webkit_geolocation_position_get_type
+
+<SUBSECTION Standard>
+WebKitGeolocationManagerClass
+WEBKIT_TYPE_GEOLOCATION_MANAGER
+WEBKIT_GEOLOCATION_MANAGER
+WEBKIT_IS_GEOLOCATION_MANAGER
+WEBKIT_GEOLOCATION_MANAGER_CLASS
+WEBKIT_IS_GEOLOCATION_MANAGER_CLASS
+WEBKIT_GEOLOCATION_MANAGER_GET_CLASS
+WEBKIT_TYPE_GEOLOCATION_POSITION
+</SECTION>
+
+<SECTION>
</ins><span class="cx"> <FILE>WebKitURIUtilities</FILE>
</span><span class="cx"> webkit_uri_for_display
</span><span class="cx"> </SECTION>
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIwpedocswpedocssgml"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-docs.sgml (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-docs.sgml 2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/wpe/docs/wpe-docs.sgml    2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx">     <xi:include href="xml/WebKitAutomationSession.xml"/>
</span><span class="cx">     <xi:include href="xml/WebKitApplicationInfo.xml"/>
</span><span class="cx">     <xi:include href="xml/WebKitColor.xml"/>
</span><ins>+    <xi:include href="xml/WebKitGeolocationManager.xml"/>
</ins><span class="cx">   </chapter>
</span><span class="cx"> 
</span><span class="cx">   <chapter>
</span><span class="lines">@@ -82,5 +83,15 @@
</span><span class="cx">     <xi:include href="xml/api-index-2.22.xml"><xi:fallback /></xi:include>
</span><span class="cx">   </index>
</span><span class="cx"> 
</span><ins>+  <index id="api-index-2-24" role="2.24">
+    <title>Index of new symbols in 2.24</title>
+    <xi:include href="xml/api-index-2.24.xml"><xi:fallback /></xi:include>
+  </index>
+
+  <index id="api-index-2-26" role="2.26">
+    <title>Index of new symbols in 2.26</title>
+    <xi:include href="xml/api-index-2.62.xml"><xi:fallback /></xi:include>
+  </index>
+
</ins><span class="cx">   <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
</span><span class="cx"> </book>
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPIwpewebkith"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/wpe/webkit.h (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/wpe/webkit.h   2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/WebKit/UIProcess/API/wpe/webkit.h      2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #include <wpe/WebKitFaviconDatabase.h>
</span><span class="cx"> #include <wpe/WebKitFindController.h>
</span><span class="cx"> #include <wpe/WebKitFormSubmissionRequest.h>
</span><ins>+#include <wpe/WebKitGeolocationManager.h>
</ins><span class="cx"> #include <wpe/WebKitGeolocationPermissionRequest.h>
</span><span class="cx"> #include <wpe/WebKitHitTestResult.h>
</span><span class="cx"> #include <wpe/WebKitInstallMissingMediaPluginsPermissionRequest.h>
</span></span></pre></div>
<a id="trunkSourcecmakeOptionsGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsGTK.cmake (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsGTK.cmake      2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/cmake/OptionsGTK.cmake 2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -80,6 +80,7 @@
</span><span class="cx"> WEBKIT_OPTION_DEFINE(ENABLE_QUARTZ_TARGET "Whether to enable support for the Quartz windowing target." PUBLIC ${GTK3_SUPPORTS_QUARTZ})
</span><span class="cx"> WEBKIT_OPTION_DEFINE(ENABLE_X11_TARGET "Whether to enable support for the X11 windowing target." PUBLIC ${GTK3_SUPPORTS_X11})
</span><span class="cx"> WEBKIT_OPTION_DEFINE(ENABLE_WAYLAND_TARGET "Whether to enable support for the Wayland windowing target." PUBLIC ${GTK3_SUPPORTS_WAYLAND})
</span><ins>+WEBKIT_OPTION_DEFINE(USE_GEOCLUE "Whether to enable default geolocation implementation using GeoClue2" PUBLIC ON)
</ins><span class="cx"> WEBKIT_OPTION_DEFINE(USE_LIBNOTIFY "Whether to enable the default web notification implementation." PUBLIC ON)
</span><span class="cx"> WEBKIT_OPTION_DEFINE(USE_LIBHYPHEN "Whether to enable the default automatic hyphenation implementation." PUBLIC ON)
</span><span class="cx"> WEBKIT_OPTION_DEFINE(USE_LIBSECRET "Whether to enable the persistent credential storage using libsecret." PUBLIC ON)
</span><span class="lines">@@ -140,7 +141,6 @@
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ACCELERATED_2D_CANVAS PUBLIC OFF)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ASYNC_SCROLLING PRIVATE ON)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_DRAG_SUPPORT PUBLIC ON)
</span><del>-WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PUBLIC ON)
</del><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ICONDATABASE PUBLIC ON)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPELLCHECK PUBLIC ON)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS PUBLIC ON)
</span><span class="lines">@@ -222,10 +222,10 @@
</span><span class="cx">     endif ()
</span><span class="cx"> endif ()
</span><span class="cx"> 
</span><del>-if (ENABLE_GEOLOCATION)
</del><ins>+if (USE_GEOCLUE)
</ins><span class="cx">     find_package(GeoClue2 2.1.5)
</span><span class="cx">     if (NOT GEOCLUE2_FOUND)
</span><del>-        message(FATAL_ERROR "Geoclue is needed for ENABLE_GEOLOCATION.")
</del><ins>+        message(FATAL_ERROR "Geoclue is needed for USE_GEOCLUE.")
</ins><span class="cx">     endif ()
</span><span class="cx"> endif ()
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourcecmakeOptionsWPEcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/cmake/OptionsWPE.cmake (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/cmake/OptionsWPE.cmake      2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Source/cmake/OptionsWPE.cmake 2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -48,7 +48,6 @@
</span><span class="cx"> # Changing these options is completely unsupported.
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ASYNC_SCROLLING PRIVATE ON)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CONTENT_EXTENSIONS PRIVATE ON)
</span><del>-WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_GEOLOCATION PRIVATE OFF)
</del><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MHTML PRIVATE ON)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API PRIVATE OFF)
</span><span class="cx"> WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NOTIFICATIONS PRIVATE OFF)
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Tools/ChangeLog       2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -1,5 +1,24 @@
</span><span class="cx"> 2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
</span><span class="cx"> 
</span><ins>+        [GTK][WPE] Add API to provide geolocation information
+        https://bugs.webkit.org/show_bug.cgi?id=195940
+
+        Reviewed by Michael Catanzaro.
+
+        Add a new test to check the new API.
+
+        * TestWebKitAPI/Tests/WebKitGLib/TestGeolocationManager.cpp: Added.
+        (testGeolocationManagerCurrentPosition):
+        (testGeolocationManagerWatchPosition):
+        (beforeAll):
+        (afterAll):
+        * TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
+        (testWebViewGeolocationPermissionRequests): Stop using ENABLE(GEOLOCATION) conditionals for geolocation tests.
+        (beforeAll): Ditto.
+        * TestWebKitAPI/glib/CMakeLists.txt:
+
+2019-03-21  Carlos Garcia Campos  <cgarcia@igalia.com>
+
</ins><span class="cx">         [GLib] Returning G_TYPE_OBJECT from a method does not work
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=195574
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitGLibTestGeolocationManagercpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestGeolocationManager.cpp (0 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestGeolocationManager.cpp                            (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestGeolocationManager.cpp       2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -0,0 +1,337 @@
</span><ins>+/*
+ * Copyright (C) 2019 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2,1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "TestMain.h"
+
+#include "WebViewTest.h"
+#include <wtf/WallTime.h>
+
+class GeolocationTest: public WebViewTest {
+public:
+    MAKE_GLIB_TEST_FIXTURE(GeolocationTest);
+
+    struct Position {
+        double timestamp { std::numeric_limits<double>::quiet_NaN() };
+        double latitude { std::numeric_limits<double>::quiet_NaN() };
+        double longitude { std::numeric_limits<double>::quiet_NaN() };
+        double accuracy { std::numeric_limits<double>::quiet_NaN() };
+
+        Optional<double> altitude;
+        Optional<double> altitudeAccuracy;
+        Optional<double> heading;
+        Optional<double> speed;
+    };
+
+    static gboolean startCallback(WebKitGeolocationManager* manager, GeolocationTest* test)
+    {
+        g_assert_true(test->m_manager == manager);
+        test->start();
+        return TRUE;
+    }
+
+    static void stopCallback(WebKitGeolocationManager* manager, GeolocationTest* test)
+    {
+        g_assert_true(test->m_manager == manager);
+        test->stop();
+    }
+
+    static gboolean permissionRequested(WebKitWebView*, WebKitPermissionRequest* request, GeolocationTest* test)
+    {
+        g_assert_true(WEBKIT_IS_PERMISSION_REQUEST(request));
+        test->assertObjectIsDeletedWhenTestFinishes(G_OBJECT(request));
+
+        if (WEBKIT_IS_GEOLOCATION_PERMISSION_REQUEST(request)) {
+            webkit_permission_request_allow(request);
+            return TRUE;
+        }
+
+        return FALSE;
+    }
+
+    GeolocationTest()
+        : m_manager(webkit_web_context_get_geolocation_manager(m_webContext.get()))
+    {
+        g_assert_true(WEBKIT_IS_GEOLOCATION_MANAGER(m_manager));
+        assertObjectIsDeletedWhenTestFinishes(G_OBJECT(m_manager));
+        g_signal_connect(m_manager, "start", G_CALLBACK(startCallback), this);
+        g_signal_connect(m_manager, "stop", G_CALLBACK(stopCallback), this);
+        g_signal_connect(m_webView, "permission-request", G_CALLBACK(permissionRequested), this);
+    }
+
+    ~GeolocationTest()
+    {
+        if (m_checkPosition)
+            webkit_geolocation_position_free(m_checkPosition);
+
+        g_signal_handlers_disconnect_matched(m_manager, G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
+        g_signal_handlers_disconnect_matched(m_webView, G_SIGNAL_MATCH_DATA, 0, 0, nullptr, nullptr, this);
+    }
+
+    void start()
+    {
+        g_assert_false(m_updating);
+        m_updating = true;
+
+        if (m_errorMessage) {
+            g_assert_false(m_checkPosition);
+            webkit_gelocation_manager_failed(m_manager, m_errorMessage.get());
+        }
+
+        if (m_checkPosition) {
+            g_assert_false(m_errorMessage.get());
+            webkit_gelocation_manager_update_position(m_manager, m_checkPosition);
+        }
+
+        g_main_loop_quit(m_mainLoop);
+    }
+
+    void stop()
+    {
+        g_assert_true(m_updating);
+        m_updating = false;
+        if (m_watching)
+            g_main_loop_quit(m_mainLoop);
+    }
+
+    Position lastPosition()
+    {
+        GUniqueOutPtr<GError> error;
+        auto* javascriptResult = runJavaScriptAndWaitUntilFinished("position", &error.outPtr());
+        g_assert_nonnull(javascriptResult);
+        g_assert_no_error(error.get());
+
+        auto* jsPosition = webkit_javascript_result_get_js_value(javascriptResult);
+        g_assert_true(jsc_value_is_object(jsPosition));
+        Position result;
+        GRefPtr<JSCValue> value = adoptGRef(jsc_value_object_get_property(jsPosition, "latitude"));
+        g_assert_true(jsc_value_is_number(value.get()));
+        result.latitude = jsc_value_to_double(value.get());
+        value = adoptGRef(jsc_value_object_get_property(jsPosition, "longitude"));
+        g_assert_true(jsc_value_is_number(value.get()));
+        result.longitude = jsc_value_to_double(value.get());
+        value = adoptGRef(jsc_value_object_get_property(jsPosition, "accuracy"));
+        g_assert_true(jsc_value_is_number(value.get()));
+        result.accuracy = jsc_value_to_double(value.get());
+        value = adoptGRef(jsc_value_object_get_property(jsPosition, "altitude"));
+        if (!jsc_value_is_null(value.get())) {
+            g_assert_true(jsc_value_is_number(value.get()));
+            result.altitude = jsc_value_to_double(value.get());
+        }
+        value = adoptGRef(jsc_value_object_get_property(jsPosition, "altitudeAccuracy"));
+        if (!jsc_value_is_null(value.get())) {
+            g_assert_true(jsc_value_is_number(value.get()));
+            result.altitudeAccuracy = jsc_value_to_double(value.get());
+        }
+        value = adoptGRef(jsc_value_object_get_property(jsPosition, "heading"));
+        if (!jsc_value_is_null(value.get())) {
+            g_assert_true(jsc_value_is_number(value.get()));
+            result.heading = jsc_value_to_double(value.get());
+        }
+        value = adoptGRef(jsc_value_object_get_property(jsPosition, "speed"));
+        if (!jsc_value_is_null(value.get())) {
+            g_assert_true(jsc_value_is_number(value.get()));
+            result.speed = jsc_value_to_double(value.get());
+        }
+        value = adoptGRef(jsc_value_object_get_property(jsPosition, "timestamp"));
+        g_assert_true(jsc_value_is_number(value.get()));
+        result.timestamp = jsc_value_to_double(value.get());
+        return result;
+    }
+
+    Position checkCurrentPosition(WebKitGeolocationPosition* position, bool enableHighAccuracy = false)
+    {
+        g_clear_pointer(&m_checkPosition, webkit_geolocation_position_free);
+        m_checkPosition = position;
+
+        static const char getCurrentPosition[] =
+            "var position = null;\n"
+            "options = { enableHighAccuracy: %s }\n"
+            "navigator.geolocation.getCurrentPosition(function(p) {\n"
+            "  position = { };\n"
+            "  position.latitude = p.coords.latitude;\n"
+            "  position.longitude = p.coords.longitude;\n"
+            "  position.accuracy = p.coords.accuracy;\n"
+            "  position.altitude = p.coords.altitude;\n"
+            "  position.altitudeAccuracy = p.coords.altitudeAccuracy;\n"
+            "  position.heading = p.coords.heading;\n"
+            "  position.speed = p.coords.speed;\n"
+            "  position.timestamp = p.timestamp;\n"
+            "}, undefined, options);";
+        GUniquePtr<char> script(g_strdup_printf(getCurrentPosition, enableHighAccuracy ? "true" : "false"));
+        GUniqueOutPtr<GError> error;
+        runJavaScriptAndWaitUntilFinished(script.get(), &error.outPtr());
+        g_assert_no_error(error.get());
+        g_main_loop_run(m_mainLoop);
+        g_clear_pointer(&m_checkPosition, webkit_geolocation_position_free);
+        g_assert_true(webkit_geolocation_manager_get_enable_high_accuracy(m_manager) == enableHighAccuracy);
+
+        return lastPosition();
+    }
+
+    GUniquePtr<char> checkFailedToDeterminePosition(const char* errorMessage)
+    {
+        m_errorMessage.reset(g_strdup(errorMessage));
+        static const char getCurrentPosition[] =
+            "var error;\n"
+            "navigator.geolocation.getCurrentPosition(\n"
+            "  function(p) { error = null; },\n"
+            "  function(e) { error = e.message.toString(); }\n"
+            ");";
+        GUniqueOutPtr<GError> error;
+        auto* javascriptResult = runJavaScriptAndWaitUntilFinished(getCurrentPosition, &error.outPtr());
+        g_assert_no_error(error.get());
+        g_main_loop_run(m_mainLoop);
+        m_errorMessage = nullptr;
+
+        javascriptResult = runJavaScriptAndWaitUntilFinished("error", &error.outPtr());
+        g_assert_nonnull(javascriptResult);
+        g_assert_no_error(error.get());
+        auto* jsErrorMessage = webkit_javascript_result_get_js_value(javascriptResult);
+        g_assert_true(jsc_value_is_string(jsErrorMessage));
+        return GUniquePtr<char>(jsc_value_to_string(jsErrorMessage));
+    }
+
+    void startWatch()
+    {
+        g_clear_pointer(&m_checkPosition, webkit_geolocation_position_free);
+        m_errorMessage = nullptr;
+
+        m_watching = true;
+        static const char watchPosition[] =
+            "var position = null;\n"
+            "var watchID = navigator.geolocation.watchPosition(function(p) {\n"
+            "  position = { };\n"
+            "  position.latitude = p.coords.latitude;\n"
+            "  position.longitude = p.coords.longitude;\n"
+            "  position.accuracy = p.coords.accuracy;\n"
+            "  position.altitude = p.coords.altitude;\n"
+            "  position.altitudeAccuracy = p.coords.altitudeAccuracy;\n"
+            "  position.heading = p.coords.heading;\n"
+            "  position.speed = p.coords.speed;\n"
+            "  position.timestamp = p.timestamp;\n"
+            "});";
+        GUniqueOutPtr<GError> error;
+        auto* javascriptResult = runJavaScriptAndWaitUntilFinished(watchPosition, &error.outPtr());
+        g_assert_nonnull(javascriptResult);
+        g_assert_no_error(error.get());
+        g_main_loop_run(m_mainLoop);
+    }
+
+    void stopWatch()
+    {
+        GUniqueOutPtr<GError> error;
+        runJavaScriptAndWaitUntilFinished("navigator.geolocation.clearWatch(watchID)", &error.outPtr());
+        g_assert_no_error(error.get());
+        g_main_loop_run(m_mainLoop);
+        m_watching = false;
+    }
+
+    WebKitGeolocationManager* m_manager;
+    bool m_updating { false };
+    bool m_watching { false };
+    WebKitGeolocationPosition* m_checkPosition { nullptr };
+    GUniquePtr<char> m_errorMessage;
+};
+
+static void testGeolocationManagerCurrentPosition(GeolocationTest* test, gconstpointer)
+{
+    test->showInWindow();
+    test->loadHtml("<html><body></body></html>", "https://foo.com/bar");
+    test->waitUntilLoadFinished();
+
+    WebKitGeolocationPosition* position = webkit_geolocation_position_new(37.1760783, -3.59033, 17);
+    g_assert_false(test->m_updating);
+    auto result = test->checkCurrentPosition(position);
+    g_assert_false(test->m_updating);
+    g_assert_cmpfloat(result.latitude, ==, 37.1760783);
+    g_assert_cmpfloat(result.longitude, ==, -3.59033);
+    g_assert_cmpfloat(result.accuracy, ==, 17);
+    g_assert_false(result.altitude);
+    g_assert_false(result.altitudeAccuracy);
+    g_assert_false(result.heading);
+    g_assert_false(result.speed);
+    g_assert_cmpfloat(result.timestamp, >, 0);
+    g_assert_cmpfloat(result.timestamp / 1000., <, WallTime::now().secondsSinceEpoch().value());
+
+    position = webkit_geolocation_position_new(27.986065, 86.922623, 0);
+    auto timestamp = WallTime::now().secondsSinceEpoch();
+    webkit_geolocation_position_set_timestamp(position, timestamp.value());
+    webkit_geolocation_position_set_altitude(position, 8495);
+    webkit_geolocation_position_set_altitude_accuracy(position, 0);
+    webkit_geolocation_position_set_heading(position, 100.55);
+    webkit_geolocation_position_set_speed(position, 0.05);
+    g_assert_false(test->m_updating);
+    result = test->checkCurrentPosition(position, true);
+    g_assert_false(test->m_updating);
+    g_assert_cmpfloat(result.latitude, ==, 27.986065);
+    g_assert_cmpfloat(result.longitude, ==, 86.922623);
+    g_assert_cmpfloat(result.accuracy, ==, 0);
+    g_assert_true(result.altitude);
+    g_assert_cmpfloat(result.altitude.value(), ==, 8495);
+    g_assert_true(result.altitudeAccuracy);
+    g_assert_cmpfloat(result.altitudeAccuracy.value(), ==, 0);
+    g_assert_true(result.heading);
+    g_assert_cmpfloat(result.heading.value(), ==, 100.55);
+    g_assert_true(result.speed);
+    g_assert_cmpfloat(result.speed.value(), ==, 0.05);
+    g_assert_cmpfloat_with_epsilon(result.timestamp / 1000., timestamp.value(), 1);
+
+    auto errorMessage = test->checkFailedToDeterminePosition("GPS is not active");
+    g_assert_cmpstr(errorMessage.get(), ==, "GPS is not active");
+}
+
+static void testGeolocationManagerWatchPosition(GeolocationTest* test, gconstpointer)
+{
+    test->showInWindow();
+    test->loadHtml("<html><body></body></html>", "https://foo.com/bar");
+    test->waitUntilLoadFinished();
+
+    test->startWatch();
+    g_assert_true(test->m_updating);
+
+    WebKitGeolocationPosition* position = webkit_geolocation_position_new(37.1760783, -3.59033, 17);
+    webkit_gelocation_manager_update_position(test->m_manager, position);
+    webkit_geolocation_position_free(position);
+    auto result = test->lastPosition();
+    g_assert_cmpfloat(result.latitude, ==, 37.1760783);
+    g_assert_cmpfloat(result.longitude, ==, -3.59033);
+    g_assert_cmpfloat(result.accuracy, ==, 17);
+
+    position = webkit_geolocation_position_new(38.1770783, -3.60033, 17);
+    webkit_gelocation_manager_update_position(test->m_manager, position);
+    webkit_geolocation_position_free(position);
+    result = test->lastPosition();
+    g_assert_cmpfloat(result.latitude, ==, 38.1770783);
+    g_assert_cmpfloat(result.longitude, ==, -3.60033);
+    g_assert_cmpfloat(result.accuracy, ==, 17);
+
+    test->stopWatch();
+    g_assert_false(test->m_updating);
+}
+
+void beforeAll()
+{
+    GeolocationTest::add("WebKitGeolocationManager", "current-position", testGeolocationManagerCurrentPosition);
+    GeolocationTest::add("WebKitGeolocationManager", "watch-position", testGeolocationManagerWatchPosition);
+}
+
+void afterAll()
+{
+}
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKitGLibTestUIClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp      2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp 2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -786,7 +786,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // PLATFORM(GTK)
</span><span class="cx"> 
</span><del>-#if ENABLE(GEOLOCATION)
</del><span class="cx"> static void testWebViewGeolocationPermissionRequests(UIClientTest* test, gconstpointer)
</span><span class="cx"> {
</span><span class="cx">     // Some versions of geoclue give a runtime warning because it tries
</span><span class="lines">@@ -831,7 +830,6 @@
</span><span class="cx">     g_assert_cmpstr(result, !=, "1");
</span><span class="cx">     test->addLogFatalFlag(G_LOG_LEVEL_WARNING);
</span><span class="cx"> }
</span><del>-#endif // ENABLE(GEOLOCATION)
</del><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx"> static void testWebViewUserMediaEnumerateDevicesPermissionCheck(UIClientTest* test, gconstpointer)
</span><span class="lines">@@ -1193,9 +1191,7 @@
</span><span class="cx"> #if PLATFORM(GTK)
</span><span class="cx">     UIClientTest::add("WebKitWebView", "mouse-target", testWebViewMouseTarget);
</span><span class="cx"> #endif
</span><del>-#if ENABLE(GEOLOCATION)
</del><span class="cx">     UIClientTest::add("WebKitWebView", "geolocation-permission-requests", testWebViewGeolocationPermissionRequests);
</span><del>-#endif
</del><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="cx">     UIClientTest::add("WebKitWebView", "usermedia-enumeratedevices-permission-check", testWebViewUserMediaEnumerateDevicesPermissionCheck);
</span><span class="cx">     UIClientTest::add("WebKitWebView", "usermedia-permission-requests", testWebViewUserMediaPermissionRequests);
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIglibCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/glib/CMakeLists.txt (243284 => 243285)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/glib/CMakeLists.txt    2019-03-21 09:44:22 UTC (rev 243284)
+++ trunk/Tools/TestWebKitAPI/glib/CMakeLists.txt       2019-03-21 10:10:35 UTC (rev 243285)
</span><span class="lines">@@ -146,6 +146,7 @@
</span><span class="cx"> ADD_WK2_TEST(TestWebsiteData ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp)
</span><span class="cx"> ADD_WK2_TEST(TestConsoleMessage ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/TestConsoleMessage.cpp)
</span><span class="cx"> ADD_WK2_TEST(TestDOMElement ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/TestDOMElement.cpp)
</span><ins>+ADD_WK2_TEST(TestGeolocationManager ${TOOLS_DIR}/TestWebKitAPI/Tests/WebKitGLib/TestGeolocationManager.cpp)
</ins><span class="cx"> 
</span><span class="cx"> # FIXME: Enable for WPE
</span><span class="cx"> if (PORT STREQUAL "GTK")
</span></span></pre>
</div>
</div>

</body>
</html>