Commit 50765b46 authored by Alberto Garcia's avatar Alberto Garcia
Browse files

Imported Upstream version 2.3.92

parent 57b2e7c1
2014-03-10 Mario Sanchez Prada <mario.prada@samsung.com>
[GTK] Add support for Geoclue2
https://bugs.webkit.org/show_bug.cgi?id=120185
Reviewed by Carlos Garcia Campos.
Patch by Anton Obzhirov <a.obzhirov@samsung.com> and Mario Sanchez Prada <mario.prada@samsung.com>
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.
2014-01-30 Zan Dobersek <zdobersek@igalia.com>
[GTK] Only disable -ftree-dce optimization when compiling with GCC
https://bugs.webkit.org/show_bug.cgi?id=127911
Reviewed by Carlos Garcia Campos.
* Source/autotools/SetupAutomake.m4: Define the COMPILER_GCC and COMPILER_CLANG Automake macros.
These can be used when compiler-specific flags have to be used. The latter one is not actually needed
at the moment, but is added for the sake of completeness.
2014-03-03 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Update NEWS and Versions.m4 for 2.3.91 release.
* Source/autotools/Versions.m4: Bump version numbers.
2014-03-03 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] WebKit2WebExtension GIR can't be used in vala
......
......@@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">WebKit2GTK+ Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for WebKit2GTK+ 2.3.91</p></div>
<div><p class="releaseinfo">for WebKit2GTK+ 2.3.92</p></div>
</div>
<hr>
</div>
......
......@@ -172,7 +172,7 @@ against at application run time.</p>
<hr>
<div class="refsect2">
<a name="WEBKIT-MICRO-VERSION:CAPS"></a><h3>WEBKIT_MICRO_VERSION</h3>
<pre class="programlisting">#define WEBKIT_MICRO_VERSION (91)
<pre class="programlisting">#define WEBKIT_MICRO_VERSION (92)
</pre>
<p>Like <a class="link" href="webkit2gtk-WebKitVersion.html#webkit-get-micro-version" title="webkit_get_micro_version ()"><code class="function">webkit_get_micro_version()</code></a>, but from the headers used at
application compile time, rather than from the library linked
......
......@@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">WebKitDOMGTK+ Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for WebKitDOMGTK+ 2.3.91</p></div>
<div><p class="releaseinfo">for WebKitDOMGTK+ 2.3.92</p></div>
</div>
<hr>
</div>
......
......@@ -14,7 +14,7 @@
<div class="titlepage">
<div>
<div><table class="navigation" id="top" width="100%" cellpadding="2" cellspacing="0"><tr><th valign="middle"><p class="title">WebKitGTK+ Reference Manual</p></th></tr></table></div>
<div><p class="releaseinfo">for WebKitGTK+ 2.3.91</p></div>
<div><p class="releaseinfo">for WebKitGTK+ 2.3.92</p></div>
</div>
<hr>
</div>
......
This diff is collapsed.
=================
WebKitGTK+ 2.3.92
=================
What's new in WebKitGTK+ 2.3.92?
- Add support for Geoclue2.
- Always finalize the soup session object when the networking
process finishes.
- Make sure the web process doesn't finish if there's an ongoing
print operation.
- Fix runtime critical warnings about main loop sources not found
when trying to remove them.
- Fixed several crashes in JavaScriptCore when visiting facebook.
- Improve CSS properties performance.
- Fix web process leak when the WebView is leaked by the application.
- Fix the build when using vala bindings due to UI and web process
main headers included together.
=================
WebKitGTK+ 2.3.91
=================
......
2014-01-30 Zan Dobersek <zdobersek@igalia.com>
[GTK] Only disable -ftree-dce optimization when compiling with GCC
https://bugs.webkit.org/show_bug.cgi?id=127911
Reviewed by Carlos Garcia Campos.
* GNUmakefile.am: Only disable the -ftree-dce optimization when using the GCC compiler.
Some Clang versions/configurations don't support the flag.
2014-01-30 Zan Dobersek <zdobersek@igalia.com>
[GTK] Disable optimizations for JSC that turned out malignant after jsCStack branch merge
https://bugs.webkit.org/show_bug.cgi?id=127909
Reviewed by Carlos Garcia Campos.
* GNUmakefile.am: Disable the -fomit-frame-pointer optimization to achieve proper register usage
in operationCallEval. Disable the -ftree-dce optimization since it is causing additional failures
when using GCC 4.8, possibly due to a bug in the compiler itself.
2014-01-29 Csaba Osztrogonác <ossy@webkit.org>
 
Remove ENABLE(JAVASCRIPT_DEBUGGER) leftovers
......
......@@ -72,6 +72,18 @@ javascriptcore_cppflags += \
-I$(srcdir)/Source/WTF \
$(LLVM_CFLAGS)
# FIXME: the -fomit-frame-pointer and -ftree-dce optimizations are disabled after they've been causing
# trouble with the merged jsCStack code. The former is required due to otherwise incorrectly compiled
# operationCallEval function, while the latter is required when using GCC 4.8. See bugs #127777 and
# #127909 for more information.
javascriptcore_cppflags += \
-fno-omit-frame-pointer
if COMPILER_GCC
javascriptcore_cppflags += \
-fno-tree-dce
endif
javascriptcore_cflags += \
$(global_cflags) \
$(GLIB_CFLAGS) \
......
2014-03-12 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] [Stable] deadlock in gobject introspection
https://bugs.webkit.org/show_bug.cgi?id=125651
Reviewed by Sergio Villar Senin.
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:
2014-03-10 Mario Sanchez Prada <mario.prada@samsung.com>
[GTK] Add support for Geoclue2
https://bugs.webkit.org/show_bug.cgi?id=120185
Reviewed by Carlos Garcia Campos.
Patch by Anton Obzhirov <a.obzhirov@samsung.com> and Mario Sanchez Prada <mario.prada@samsung.com>
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):
2014-03-07 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Timeout sources not correctly removed
https://bugs.webkit.org/show_bug.cgi?id=129877
Reviewed by Philippe Normand.
Set source ID variables to 0 after removing the sources from the
context. Also give a name to the sources.
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::disconnect):
(WebCore::TrackPrivateBaseGStreamer::activeChanged):
(WebCore::TrackPrivateBaseGStreamer::tagsChanged):
(WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
2014-03-03 Lorenzo Tilve <ltilve@igalia.com>
Optimize StylePropertiesSet::findPropertyIndex() to improve CSS properties performance
https://bugs.webkit.org/show_bug.cgi?id=129605
Reviewed by Andreas Kling.
Merged from Blink (patch by Mikhail Pozdnyakov):
https://src.chromium.org/viewvc/blink?view=revision&revision=167325
Avoid checking whether 'StylePropertiesSet' is mutable and accesing directly to its
data members to achieve performance improvements
Before the optimization applied:
mean: 3064.8337171934063 runs/s
median: 3097.5899379343855 runs/s
stdev: 66.89274074044187 runs/s
min: 2891.7479324362585 runs/s
max: 3113.288683440125 runs/s
After the optimization applied:
mean: 3343.8356114138105 runs/s
median: 3356.25682957446 runs/s
stdev: 36.297533087489036 runs/s
min: 3238.5468032264243 runs/s
max: 3368.664837531425 runs/s
Performance gain for the average value is approx. 9.1%, in the
range of the 10% - 8.2% for the min and max measured
values (Linux desktop x64).
* css/StyleProperties.cpp:
(WebCore::ImmutableStyleProperties::findPropertyIndex):
(WebCore::MutableStyleProperties::findPropertyIndex):
* css/StyleProperties.h:
(WebCore::toMutableStyleProperties):
(WebCore::toImmutableStyleProperties):
(WebCore::StyleProperties::findPropertyIndex):
2014-03-03 Tomas Popela <tpopela@redhat.com>
 
[GTK] webkit_dom_range_compare_boundary_points fails when 0 is passed as how parameter
......@@ -396,6 +396,12 @@ DerivedSources/ANGLE/glslang_tab.cpp: Source/ThirdParty/ANGLE/src/compiler/glsla
$(AM_V_GEN)$(BISON) --no-lines --defines="DerivedSources/ANGLE/glslang_tab.h" --skeleton=yacc.c --output="$@" $<
DerivedSources/ANGLE/glslang_tab.h: DerivedSources/ANGLE/glslang_tab.cpp
if USE_GEOCLUE2
DerivedSources/Platform/Geoclue2Interface.c: DerivedSources/Platform/Geoclue2Interface.h
DerivedSources/Platform/Geoclue2Interface.h:
$(AM_V_GEN)gdbus-codegen --interface-prefix org.freedesktop.GeoClue2. --c-namespace Geoclue --generate-c-code DerivedSources/Platform/Geoclue2Interface $(GEOCLUE_DBUS_INTERFACE)
endif
IDL_PATH := \
$(WebCore)/Modules/battery \
$(WebCore)/Modules/gamepad \
......
......@@ -869,6 +869,12 @@ platform_built_sources += \
DerivedSources/Platform/WebKitFontFamilyNames.cpp \
DerivedSources/Platform/WebKitFontFamilyNames.h
if USE_GEOCLUE2
platform_built_sources += \
DerivedSources/Platform/Geoclue2Interface.h \
DerivedSources/Platform/Geoclue2Interface.c
endif
# These files need to be part of WebCore otherwise they cause undefined
# symbols havoc
webcore_built_sources += \
......@@ -5583,7 +5589,8 @@ platform_sources += \
Source/WebCore/platform/audio/ZeroPole.cpp \
Source/WebCore/platform/audio/ZeroPole.h \
Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.h \
Source/WebCore/platform/geoclue/GeolocationProviderGeoclue.cpp \
Source/WebCore/platform/geoclue/GeolocationProviderGeoclue1.cpp \
Source/WebCore/platform/geoclue/GeolocationProviderGeoclue2.cpp \
Source/WebCore/platform/geoclue/GeolocationProviderGeoclueClient.h \
Source/WebCore/platform/glib/BatteryProviderUPowerClient.h \
Source/WebCore/platform/glib/BatteryProviderUPower.cpp \
......
......@@ -1129,15 +1129,29 @@ bool MutableStyleProperties::removePropertiesInSet(const CSSPropertyID* set, uns
return changed;
}
int StyleProperties::findPropertyIndex(CSSPropertyID propertyID) const
int ImmutableStyleProperties::findPropertyIndex(CSSPropertyID propertyID) const
{
// Convert here propertyID into an uint16_t to compare it with the metadata's m_propertyID to avoid
// the compiler converting it to an int multiple times in the loop.
uint16_t id = static_cast<uint16_t>(propertyID);
for (int n = propertyCount() - 1 ; n >= 0; --n) {
if (id == propertyAt(n).propertyMetadata().m_propertyID)
for (int n = m_arraySize - 1 ; n >= 0; --n) {
if (metadataArray()[n].m_propertyID == id)
return n;
}
return -1;
}
int MutableStyleProperties::findPropertyIndex(CSSPropertyID propertyID) const
{
// Convert here propertyID into an uint16_t to compare it with the metadata's m_propertyID to avoid
// the compiler converting it to an int multiple times in the loop.
uint16_t id = static_cast<uint16_t>(propertyID);
for (int n = m_propertyVector.size() - 1 ; n >= 0; --n) {
if (m_propertyVector.at(n).metadata().m_propertyID == id)
return n;
}
return -1;
}
......
......@@ -163,6 +163,7 @@ public:
const CSSValue** valueArray() const;
const StylePropertyMetadata* metadataArray() const;
int findPropertyIndex(CSSPropertyID) const;
void* m_storage;
......@@ -222,6 +223,8 @@ public:
CSSStyleDeclaration* ensureCSSStyleDeclaration();
CSSStyleDeclaration* ensureInlineCSSStyleDeclaration(StyledElement* parentElement);
int findPropertyIndex(CSSPropertyID) const;
Vector<CSSProperty, 4> m_propertyVector;
private:
......@@ -236,6 +239,20 @@ private:
friend class StyleProperties;
};
TYPE_CASTS_BASE(MutableStyleProperties, StyleProperties, set, set->isMutable(), set.isMutable());
inline MutableStyleProperties* toMutableStyleProperties(const RefPtr<StyleProperties>& set)
{
return toMutableStyleProperties(set.get());
}
TYPE_CASTS_BASE(ImmutableStyleProperties, StyleProperties, set, !set->isMutable(), !set.isMutable());
inline ImmutableStyleProperties* toImmutableStyleProperties(const RefPtr<StyleProperties>& set)
{
return toImmutableStyleProperties(set.get());
}
inline const StylePropertyMetadata& StyleProperties::PropertyReference::propertyMetadata() const
{
if (m_propertySet.isMutable())
......@@ -273,6 +290,13 @@ inline void StyleProperties::deref()
delete static_cast<ImmutableStyleProperties*>(this);
}
inline int StyleProperties::findPropertyIndex(CSSPropertyID propertyID) const
{
if (m_isMutable)
return toMutableStyleProperties(this)->findPropertyIndex(propertyID);
return toImmutableStyleProperties(this)->findPropertyIndex(propertyID);
}
} // namespace WebCore
#endif // StyleProperties_h
/*
* Copyright (C) 2012 Igalia S.L.
* Copyright (C) 2014 Samsung Electronics. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
......@@ -23,9 +24,14 @@
#if ENABLE(GEOLOCATION)
#include "GeolocationProviderGeoclueClient.h"
#include <wtf/gobject/GRefPtr.h>
#if USE(GEOCLUE2)
#include "Geoclue2Interface.h"
#else
#include <geoclue/geoclue-master.h>
#include <geoclue/geoclue-position.h>
#include <wtf/gobject/GRefPtr.h>
#endif
namespace WebCore {
......@@ -38,18 +44,41 @@ public:
void stopUpdating();
void setEnableHighAccuracy(bool);
// To be used from signal callbacks.
private:
#if USE(GEOCLUE2)
static void createGeoclueManagerProxyCallback(GObject*, GAsyncResult*, GeolocationProviderGeoclue*);
static void getGeoclueClientCallback(GObject*, GAsyncResult*, GeolocationProviderGeoclue*);
static void createGeoclueClientProxyCallback(GObject*, GAsyncResult*, GeolocationProviderGeoclue*);
static void startClientCallback(GObject*, GAsyncResult*, GeolocationProviderGeoclue*);
static void locationUpdatedCallback(GeoclueClient*, const gchar*, const gchar*, GeolocationProviderGeoclue*);
static void createLocationProxyCallback(GObject*, GAsyncResult*, GeolocationProviderGeoclue*);
void startGeoclueClient();
void updateLocation(GeoclueLocation*);
#else
static void getPositionCallback(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*, GError*, GeolocationProviderGeoclue*);
static void positionChangedCallback(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*, GeolocationProviderGeoclue*);
static void createGeocluePositionCallback(GeoclueMasterClient*, GeocluePosition*, GError*, GeolocationProviderGeoclue*);
static void geoclueClientSetRequirementsCallback(GeoclueMasterClient*, GError*, GeolocationProviderGeoclue*);
static void createGeoclueClientCallback(GeoclueMaster*, GeoclueMasterClient*, char*, GError*, GeolocationProviderGeoclue*);
void initializeGeoclueClient(GeoclueMasterClient*);
void initializeGeocluePosition(GeocluePosition*);
void updateClientRequirements();
void positionChanged(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*);
#endif
void errorOccurred(const char*);
void updateClientRequirements();
private:
GeolocationProviderGeoclueClient* m_client;
#if USE(GEOCLUE2)
GRefPtr<GeoclueManager> m_managerProxy;
GRefPtr<GeoclueClient> m_clientProxy;
#else
GRefPtr<GeoclueMasterClient> m_geoclueClient;
GRefPtr<GeocluePosition> m_geocluePosition;
#endif
double m_latitude;
double m_longitude;
......
......@@ -26,11 +26,11 @@
#include "config.h"
#include "GeolocationProviderGeoclue.h"
#if ENABLE(GEOLOCATION)
#if ENABLE(GEOLOCATION) && !USE(GEOCLUE2)
using namespace WebCore;
static void getPositionCallback(GeocluePosition* position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GError* error, GeolocationProviderGeoclue* provider)
void GeolocationProviderGeoclue::getPositionCallback(GeocluePosition* position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GError* error, GeolocationProviderGeoclue* provider)
{
if (error) {
provider->errorOccurred(error->message);
......@@ -40,12 +40,12 @@ static void getPositionCallback(GeocluePosition* position, GeocluePositionFields
provider->positionChanged(position, fields, timestamp, latitude, longitude, altitude, accuracy);
}
static void positionChangedCallback(GeocluePosition* position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GeolocationProviderGeoclue* provider)
void GeolocationProviderGeoclue::positionChangedCallback(GeocluePosition* position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy, GeolocationProviderGeoclue* provider)
{
provider->positionChanged(position, fields, timestamp, latitude, longitude, altitude, accuracy);
}
static void createGeocluePositionCallback(GeoclueMasterClient*, GeocluePosition* position, GError *error, GeolocationProviderGeoclue* provider)
void GeolocationProviderGeoclue::createGeocluePositionCallback(GeoclueMasterClient*, GeocluePosition* position, GError *error, GeolocationProviderGeoclue* provider)
{
if (error) {
provider->errorOccurred(error->message);
......@@ -55,7 +55,7 @@ static void createGeocluePositionCallback(GeoclueMasterClient*, GeocluePosition*
provider->initializeGeocluePosition(position);
}
static void geoclueClientSetRequirementsCallback(GeoclueMasterClient* client, GError* error, GeolocationProviderGeoclue* provider)
void GeolocationProviderGeoclue::geoclueClientSetRequirementsCallback(GeoclueMasterClient*, GError* error, GeolocationProviderGeoclue* provider)
{
if (error) {
provider->errorOccurred(error->message);
......@@ -63,7 +63,7 @@ static void geoclueClientSetRequirementsCallback(GeoclueMasterClient* client, GE
}
}
static void createGeoclueClientCallback(GeoclueMaster*, GeoclueMasterClient* client, char*, GError* error, GeolocationProviderGeoclue* provider)
void GeolocationProviderGeoclue::createGeoclueClientCallback(GeoclueMaster*, GeoclueMasterClient* client, char*, GError* error, GeolocationProviderGeoclue* provider)
{
if (error) {
provider->errorOccurred(error->message);
......@@ -75,8 +75,6 @@ static void createGeoclueClientCallback(GeoclueMaster*, GeoclueMasterClient* cli
GeolocationProviderGeoclue::GeolocationProviderGeoclue(GeolocationProviderGeoclueClient* client)
: m_client(client)
, m_geoclueClient(0)
, m_geocluePosition(0)
, m_latitude(0)
, m_longitude(0)
, m_altitude(0)
......@@ -154,7 +152,7 @@ void GeolocationProviderGeoclue::updateClientRequirements()
geoclue_master_client_set_requirements_async(m_geoclueClient.get(), accuracyLevel, 0, false, GEOCLUE_RESOURCE_ALL, reinterpret_cast<GeoclueSetRequirementsCallback>(geoclueClientSetRequirementsCallback), this);
}
void GeolocationProviderGeoclue::positionChanged(GeocluePosition* position, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy)
void GeolocationProviderGeoclue::positionChanged(GeocluePosition*, GeocluePositionFields fields, int timestamp, double latitude, double longitude, double altitude, GeoclueAccuracy* accuracy)
{
if (!(fields & GEOCLUE_POSITION_FIELDS_LATITUDE && fields & GEOCLUE_POSITION_FIELDS_LONGITUDE)) {
errorOccurred("Position could not be determined.");
......@@ -176,4 +174,4 @@ void GeolocationProviderGeoclue::errorOccurred(const char* message)
m_client->notifyErrorOccurred(message);
}
#endif // ENABLE(GEOLOCATION)
#endif // ENABLE(GEOLOCATION) && !USE(GEOCLUE2)
/*
* Copyright (C) 2014 Samsung Electronics. All rights reserved.
*
* 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 "GeolocationProviderGeoclue.h"
#if ENABLE(GEOLOCATION) && USE(GEOCLUE2)
#include <wtf/gobject/GUniquePtr.h>
#include <wtf/gobject/GlibUtilities.h>
#include <wtf/text/CString.h>
const char* gGeoclueBusName = "org.freedesktop.GeoClue2";
const char* gGeoclueManagerPath = "/org/freedesktop/GeoClue2/Manager";
using namespace WebCore;
typedef enum {
GeoclueAccuracyLevelCountry = 1,
GeoclueAccuracyLevelCity = 4,
GeoclueAccuracyLevelStreet = 6,
GeoclueAccuracyLevelExact = 8,
} GeoclueAccuracyLevel;
GeolocationProviderGeoclue::GeolocationProviderGeoclue(GeolocationProviderGeoclueClient* client)
: m_client(client)
, m_latitude(0)
, m_longitude(0)
, m_altitude(0)
, m_accuracy(0)
, m_altitudeAccuracy(0)
, m_timestamp(0)
, m_enableHighAccuracy(false)
, m_isUpdating(false)
{
ASSERT(m_client);
}
GeolocationProviderGeoclue::~GeolocationProviderGeoclue()
{
stopUpdating();
}
void GeolocationProviderGeoclue::startUpdating()
{
m_isUpdating = true;
if (!m_managerProxy) {