Merge r165418 - [GTK] Add support for Geoclue2
https://bugs.webkit.org/show_bug.cgi?id=120185

Reviewed by Carlos Garcia Campos.

.:

Add support for Geoclue2 using autotools.

* Source/autotools/FindDependencies.m4: Add support for handling
both Geoclue 1.0 and 2.0.
* Source/autotools/PrintBuildConfiguration.m4: Print the version
of geoclue that is being used.
* Source/autotools/SetupAutoconfHeader.m4: Define GEOCLUE_API_VERSION_2.
* Source/autotools/SetupAutomake.m4: Likewise, for AM_CONDITIONAL.
* Source/autotools/Versions.m4: Added minimum required version for Geoclue2.

Add support for Geoclue2 using CMake.

* Source/cmake/FindGeoClue2.cmake: Added.
* Source/cmake/OptionsGTK.cmake:  Add support for handling Geoclue 1.0 and 2.0.
* Source/cmakeconfig.h.cmake: Define WTF_USE_GEOCLUE2.

Source/WebCore:

Implement a new geolocation provider based on Geoclue2, which will only
be used if a good enough version of Geoclue2 is found  at configure time.

* GNUmakefile.am: Generate C-API for accessing the D-Bus API
provided by Geoclue2, and place it in DerivedSources.
* GNUmakefile.list.am: Add GeolocationProviderGeoclue2.cpp, and
include the generated proxy files when using Geoclue2.
* PlatformGTK.cmake: Likewise, for CMake based builds.
* platform/geoclue/GeolocationProviderGeoclue.h: Modified to
accomodate the needs both for Geoclue and Geoclue2 providers.
* platform/geoclue/GeolocationProviderGeoclue1.cpp: Renamed from Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp.
(GeolocationProviderGeoclue::getPositionCallback):
(GeolocationProviderGeoclue::positionChangedCallback):
(GeolocationProviderGeoclue::createGeocluePositionCallback):
(GeolocationProviderGeoclue::geoclueClientSetRequirementsCallback):
(GeolocationProviderGeoclue::createGeoclueClientCallback):
(GeolocationProviderGeoclue::GeolocationProviderGeoclue):
(GeolocationProviderGeoclue::~GeolocationProviderGeoclue):
(GeolocationProviderGeoclue::startUpdating):
(GeolocationProviderGeoclue::stopUpdating):
(GeolocationProviderGeoclue::setEnableHighAccuracy):
(GeolocationProviderGeoclue::initializeGeoclueClient):
(GeolocationProviderGeoclue::initializeGeocluePosition):
(GeolocationProviderGeoclue::updateClientRequirements):
(GeolocationProviderGeoclue::positionChanged):
(GeolocationProviderGeoclue::errorOccurred):
* platform/geoclue/GeolocationProviderGeoclue2.cpp: Added.
(GeolocationProviderGeoclue::GeolocationProviderGeoclue):
(GeolocationProviderGeoclue::~GeolocationProviderGeoclue):
(GeolocationProviderGeoclue::startUpdating):
(GeolocationProviderGeoclue::stopUpdating):
(GeolocationProviderGeoclue::setEnableHighAccuracy):
(GeolocationProviderGeoclue::createGeoclueManagerProxyCallback):
(GeolocationProviderGeoclue::getGeoclueClientCallback):
(GeolocationProviderGeoclue::createGeoclueClientProxyCallback):
(GeolocationProviderGeoclue::startClientCallback):
(GeolocationProviderGeoclue::locationUpdatedCallback):
(GeolocationProviderGeoclue::createLocationProxyCallback):
(GeolocationProviderGeoclue::startGeoclueClient):
(GeolocationProviderGeoclue::updateLocation):
(GeolocationProviderGeoclue::errorOccurred):
(GeolocationProviderGeoclue::updateClientRequirements):

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@165462 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r165467 - [GTK] [Stable] deadlock in gobject introspection
https://bugs.webkit.org/show_bug.cgi?id=125651

Reviewed by Sergio Villar Senin.

Source/WebCore:

Make the default SoupNetworkSession a destroyable object to ensure
the wrapped SoupSession is finalized when the process finishes. This
is important because soup cancels any ongoing connection when finalized.

* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::defaultSession): Do not use NeverDestroyed.
* platform/network/soup/SoupNetworkSession.h:

Source/WebKit/gtk:

* webkit/webkitglobals.cpp:
(webkitExit): Dot not try to unref the default network session, it
will be finalized automatically when the process finishes.

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@165468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge r165489 - [GTK] Runtime error when page is closed while print operation is in progress
https://bugs.webkit.org/show_bug.cgi?id=129869

Reviewed by Anders Carlsson.

Sometimes when the page is closed right after printing the web
process aborts with the runtime message "pure virtual method
called terminate called without an active exception".
This happens because the page is closed when the pages have been
printed, but print job is still ongoing sending the data to the
printer. When print job finishes, we try to notify the UI process
sending the print callback message using WebPage::send(), but the
web page object has been destroyed. The virtual method it complains
about is probably MessageSender::messageSenderDestinationID() used
by send(). Since our print operation is always asynchronous, we
need a way to notify the web page when the print operation has
actually finished to clean it up, but also notify the print
operation when the page has been closed to not try to notify the
UI process in that case.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close): Call disconnectFromPage to notify the
print operation in case there's an ongoing print job.
(WebKit::WebPage::endPrinting): Do not cleanup the print operation
here, since the print opertation might not have finished yet.
(WebKit::WebPage::didFinishPrintOperation): Send
PrintFinishedCallback message to the Ui process and cleanup the
print operation.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
(WebKit::WebPrintOperationGtk::disconnectFromPage): Set m_webPage
to nullptr.
(WebKit::WebPrintOperationGtk::printDone): Call
didFinishPrintOperation() is the web page hasn't been closed.
* WebProcess/WebPage/gtk/WebPrintOperationGtk.h:

git-svn-id: http://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.4@165495 268f45cc-cd09-0410-ab3c-d52691b4dbfc