Commit 6dbc5923 authored by eric@webkit.org's avatar eric@webkit.org

2010-03-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>

        Reviewed by David Kilzer.

        Guard Geolocation files with ENABLE_GEOLOCATION
        https://bugs.webkit.org/show_bug.cgi?id=25756

        The intent is to guard the Geolocation implementation files
        and minimize the impact on on clients/call sites.

        * DerivedSources.make:
        * WebCore.Geolocation.exp: Added. Exported interfaces if GEOLOCATION
        is enabled.
        * WebCore.base.exp:
        * bindings/js/JSCustomPositionCallback.cpp:
        * bindings/js/JSCustomPositionErrorCallback.cpp:
        * bindings/js/JSGeolocationCustom.cpp:
        * page/Geolocation.cpp:
        (WebCore::Geolocation::disconnectFrame): Stub implementation if
        GEOLOCATION is turned off.
        (WebCore::Geolocation::Geolocation): Ditto.
        (WebCore::Geolocation::~Geolocation): Ditto.
        (WebCore::Geolocation::setIsAllowed): Ditto.
        * page/Geolocation.h:
        * page/Geolocation.idl:
        * page/GeolocationPositionCache.cpp:
        * page/Geoposition.idl:
        * page/PositionError.idl:
        * platform/GeolocationService.cpp:
        * platform/mock/GeolocationServiceMock.cpp:
2010-03-30  Laszlo Gombos  <laszlo.1.gombos@nokia.com>

        Reviewed by David Kilzer.

        Explicit guards for ENABLE_GEOLOCATION
        https://bugs.webkit.org/show_bug.cgi?id=25756

        * WebCoreSupport/WebGeolocationMock.mm:
        (-[WebGeolocationMock setError:code:]): Make the body conditional on
        ENABLE(GEOLOCATION)
        (-[WebGeolocationMock setPosition:]): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56781 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c79ba53e
2010-03-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by David Kilzer.
Guard Geolocation files with ENABLE_GEOLOCATION
https://bugs.webkit.org/show_bug.cgi?id=25756
The intent is to guard the Geolocation implementation files
and minimize the impact on on clients/call sites.
* DerivedSources.make:
* WebCore.Geolocation.exp: Added. Exported interfaces if GEOLOCATION
is enabled.
* WebCore.base.exp:
* bindings/js/JSCustomPositionCallback.cpp:
* bindings/js/JSCustomPositionErrorCallback.cpp:
* bindings/js/JSGeolocationCustom.cpp:
* page/Geolocation.cpp:
(WebCore::Geolocation::disconnectFrame): Stub implementation if
GEOLOCATION is turned off.
(WebCore::Geolocation::Geolocation): Ditto.
(WebCore::Geolocation::~Geolocation): Ditto.
(WebCore::Geolocation::setIsAllowed): Ditto.
* page/Geolocation.h:
* page/Geolocation.idl:
* page/GeolocationPositionCache.cpp:
* page/Geoposition.idl:
* page/PositionError.idl:
* platform/GeolocationService.cpp:
* platform/mock/GeolocationServiceMock.cpp:
2010-03-30 Andrey Kosyakov <caseq@chromium.org>
Reviewed by Pavel Feldman.
......@@ -872,6 +872,10 @@ ifeq ($(findstring ENABLE_CLIENT_BASED_GEOLOCATION,$(FEATURE_DEFINES)), ENABLE_C
WEBCORE_EXPORT_DEPENDENCIES := $(WEBCORE_EXPORT_DEPENDENCIES) WebCore.ClientBasedGeolocation.exp
endif
ifeq ($(findstring ENABLE_GEOLOCATION,$(FEATURE_DEFINES)), ENABLE_GEOLOCATION)
WEBCORE_EXPORT_DEPENDENCIES := $(WEBCORE_EXPORT_DEPENDENCIES) WebCore.Geolocation.exp
endif
WebCore.exp : WebCore.base.exp $(WEBCORE_EXPORT_DEPENDENCIES)
cat $^ > $@
......
__ZN7WebCore22GeolocationServiceMock11setPositionEN3WTF10PassRefPtrINS_11GeopositionEEE
__ZN7WebCore22GeolocationServiceMock8setErrorEN3WTF10PassRefPtrINS_13PositionErrorEEE
......@@ -446,8 +446,6 @@ __ZN7WebCore21findEventWithKeyStateEPNS_5EventE
__ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
__ZN7WebCore21mainThreadNormalWorldEv
__ZN7WebCore21reportThreadViolationEPKcNS_20ThreadViolationRoundE
__ZN7WebCore22GeolocationServiceMock11setPositionEN3WTF10PassRefPtrINS_11GeopositionEEE
__ZN7WebCore22GeolocationServiceMock8setErrorEN3WTF10PassRefPtrINS_13PositionErrorEEE
__ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv
__ZN7WebCore22applicationIsAppleMailEv
__ZN7WebCore22counterValueForElementEPNS_7ElementE
......
......@@ -26,6 +26,8 @@
#include "config.h"
#include "JSCustomPositionCallback.h"
#if ENABLE(GEOLOCATION)
#include "Frame.h"
#include "JSGeoposition.h"
#include "ScriptController.h"
......@@ -52,3 +54,5 @@ void JSCustomPositionCallback::handleEvent(Geoposition* geoposition)
}
} // namespace WebCore
#endif // ENABLE(GEOLOCATION)
......@@ -26,6 +26,8 @@
#include "config.h"
#include "JSCustomPositionErrorCallback.h"
#if ENABLE(GEOLOCATION)
#include "Frame.h"
#include "JSPositionError.h"
#include "ScriptController.h"
......@@ -53,3 +55,5 @@ void JSCustomPositionErrorCallback::handleEvent(PositionError* positionError)
}
} // namespace WebCore
#endif // ENABLE(GEOLOCATION)
......@@ -26,6 +26,8 @@
#include "config.h"
#include "JSGeolocation.h"
#if ENABLE(GEOLOCATION)
#include "DOMWindow.h"
#include "ExceptionCode.h"
#include "Geolocation.h"
......@@ -178,3 +180,5 @@ JSValue JSGeolocation::watchPosition(ExecState* exec, const ArgList& args)
}
} // namespace WebCore
#endif // ENABLE(GEOLOCATION)
......@@ -28,6 +28,8 @@
#include "config.h"
#include "Geolocation.h"
#if ENABLE(GEOLOCATION)
#include "Chrome.h"
#include "Frame.h"
#include "Page.h"
......@@ -639,3 +641,19 @@ void Geolocation::stopUpdating()
}
} // namespace WebCore
#else
namespace WebCore {
void Geolocation::disconnectFrame() {}
Geolocation::Geolocation(Frame*) {}
Geolocation::~Geolocation() {}
void Geolocation::setIsAllowed(bool) {}
}
#endif // ENABLE(GEOLOCATION)
......@@ -46,7 +46,7 @@ class GeolocationError;
#endif
class Geolocation : public RefCounted<Geolocation>
#if !ENABLE(CLIENT_BASED_GEOLOCATION)
#if !ENABLE(CLIENT_BASED_GEOLOCATION) && ENABLE(GEOLOCATION)
, public GeolocationServiceClient
#endif
{
......@@ -137,7 +137,7 @@ private:
bool startUpdating(GeoNotifier*);
void stopUpdating();
#if !ENABLE(CLIENT_BASED_GEOLOCATION)
#if !ENABLE(CLIENT_BASED_GEOLOCATION) && ENABLE(GEOLOCATION)
// GeolocationServiceClient
virtual void geolocationServicePositionChanged(GeolocationService*);
virtual void geolocationServiceErrorOccurred(GeolocationService*);
......@@ -171,7 +171,9 @@ private:
} m_allowGeolocation;
bool m_shouldClearCache;
#if ENABLE(GEOLOCATION)
OwnPtr<GeolocationPositionCache> m_positionCache;
#endif
GeoNotifierSet m_requestsAwaitingCachedPosition;
};
......
......@@ -25,7 +25,7 @@
module core {
interface [OmitConstructor] Geolocation {
interface [Conditional=GEOLOCATION, OmitConstructor] Geolocation {
[Custom] void getCurrentPosition(in PositionCallback successCallback, in PositionErrorCallback errorCallback, in PositionOptions options);
[Custom] long watchPosition(in PositionCallback successCallback, in PositionErrorCallback errorCallback, in PositionOptions options);
......
......@@ -26,6 +26,8 @@
#include "config.h"
#include "GeolocationPositionCache.h"
#if ENABLE(GEOLOCATION)
#include "Geoposition.h"
#include "SQLValue.h"
#include "SQLiteDatabase.h"
......@@ -172,3 +174,5 @@ void GeolocationPositionCache::writeToDB(const Geoposition* position)
}
} // namespace WebCore
#endif // ENABLE(GEOLOCATION)
......@@ -25,7 +25,7 @@
module core {
interface [OmitConstructor] Geoposition {
interface [Conditional=GEOLOCATION, OmitConstructor] Geoposition {
readonly attribute Coordinates coords;
readonly attribute DOMTimeStamp timestamp;
};
......
......@@ -25,7 +25,7 @@
module core {
interface PositionError {
interface [Conditional=GEOLOCATION] PositionError {
readonly attribute unsigned short code;
readonly attribute DOMString message;
......
......@@ -49,6 +49,7 @@ GeolocationService* GeolocationService::create(GeolocationServiceClient* client)
return (*s_factoryFunction)(client);
}
#if ENABLE(GEOLOCATION)
void GeolocationService::useMock()
{
s_factoryFunction = &GeolocationServiceMock::create;
......@@ -70,4 +71,6 @@ void GeolocationService::errorOccurred()
m_geolocationServiceClient->geolocationServiceErrorOccurred(this);
}
#endif
} // namespace WebCore
......@@ -26,6 +26,8 @@
#include "config.h"
#include "GeolocationServiceMock.h"
#if ENABLE(GEOLOCATION)
#include "Logging.h"
#include "Geolocation.h"
#include "Geoposition.h"
......@@ -134,3 +136,5 @@ void GeolocationServiceMock::cleanUpStatics()
}
} // namespace WebCore
#endif
2010-03-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by David Kilzer.
Explicit guards for ENABLE_GEOLOCATION
https://bugs.webkit.org/show_bug.cgi?id=25756
* WebCoreSupport/WebGeolocationMock.mm:
(-[WebGeolocationMock setError:code:]): Make the body conditional on
ENABLE(GEOLOCATION)
(-[WebGeolocationMock setPosition:]): Ditto.
2010-03-26 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Antti Koivisto.
......
......@@ -38,6 +38,7 @@ using namespace WTF;
+ (void)setPosition:(double)latitude:(double)longitude:(double)accuracy
{
#if ENABLE(GEOLOCATION)
RefPtr<Coordinates> coordinates = Coordinates::create(latitude,
longitude,
false, 0.0, // altitude
......@@ -47,13 +48,16 @@ using namespace WTF;
false, 0.0); // speed
RefPtr<Geoposition> position = Geoposition::create(coordinates.release(), currentTime() * 1000.0);
GeolocationServiceMock::setPosition(position.release());
#endif
}
+ (void)setError:(int)code:(NSString *)message
{
#if ENABLE(GEOLOCATION)
PositionError::ErrorCode codeEnum = static_cast<PositionError::ErrorCode>(code);
RefPtr<PositionError> error = PositionError::create(codeEnum, message);
GeolocationServiceMock::setError(error.release());
#endif
}
@end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment