diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index e561015a9dd1237fd6cca140d0ed89904420d14c..921bd94ed66b3b7c167eeb00e17b0a1e308cef07 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,34 @@ +2010-03-30 Laszlo Gombos + + 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 Reviewed by Pavel Feldman. diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make index f828a6d3b990b16d480e9428ad4d158c9ddbec60..3694270cec0d65f8c50b3417a3d7b71efb2ef678 100644 --- a/WebCore/DerivedSources.make +++ b/WebCore/DerivedSources.make @@ -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 $^ > $@ diff --git a/WebCore/WebCore.Geolocation.exp b/WebCore/WebCore.Geolocation.exp new file mode 100644 index 0000000000000000000000000000000000000000..296c8aa3b5010b2d52662c2684474fca3ccfb809 --- /dev/null +++ b/WebCore/WebCore.Geolocation.exp @@ -0,0 +1,2 @@ +__ZN7WebCore22GeolocationServiceMock11setPositionEN3WTF10PassRefPtrINS_11GeopositionEEE +__ZN7WebCore22GeolocationServiceMock8setErrorEN3WTF10PassRefPtrINS_13PositionErrorEEE diff --git a/WebCore/WebCore.base.exp b/WebCore/WebCore.base.exp index 8b6eb99f3b5b41d52e1bb8f4f6e4d15e9d665f10..034d511bbd40c232e76b392c178fac16f1b715e0 100644 --- a/WebCore/WebCore.base.exp +++ b/WebCore/WebCore.base.exp @@ -446,8 +446,6 @@ __ZN7WebCore21findEventWithKeyStateEPNS_5EventE __ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE __ZN7WebCore21mainThreadNormalWorldEv __ZN7WebCore21reportThreadViolationEPKcNS_20ThreadViolationRoundE -__ZN7WebCore22GeolocationServiceMock11setPositionEN3WTF10PassRefPtrINS_11GeopositionEEE -__ZN7WebCore22GeolocationServiceMock8setErrorEN3WTF10PassRefPtrINS_13PositionErrorEEE __ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv __ZN7WebCore22applicationIsAppleMailEv __ZN7WebCore22counterValueForElementEPNS_7ElementE diff --git a/WebCore/bindings/js/JSCustomPositionCallback.cpp b/WebCore/bindings/js/JSCustomPositionCallback.cpp index e5f83aa10d4a88f41db4b25d2313384ca3eb1017..cc6d45cd261efadb8a77dcedbc75cc1aca9d0495 100644 --- a/WebCore/bindings/js/JSCustomPositionCallback.cpp +++ b/WebCore/bindings/js/JSCustomPositionCallback.cpp @@ -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) diff --git a/WebCore/bindings/js/JSCustomPositionErrorCallback.cpp b/WebCore/bindings/js/JSCustomPositionErrorCallback.cpp index bd64deb48db15daf0242944e3445ac10a19f6253..c94ae9aaa622f826a41aae2fe26e5506051ed2ea 100644 --- a/WebCore/bindings/js/JSCustomPositionErrorCallback.cpp +++ b/WebCore/bindings/js/JSCustomPositionErrorCallback.cpp @@ -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) diff --git a/WebCore/bindings/js/JSGeolocationCustom.cpp b/WebCore/bindings/js/JSGeolocationCustom.cpp index 530b89bc6859bd8dab47a5cae488f06b01b4fbca..8bc348ce00d61d7e4e74f519a75a73b4f2db3554 100644 --- a/WebCore/bindings/js/JSGeolocationCustom.cpp +++ b/WebCore/bindings/js/JSGeolocationCustom.cpp @@ -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) diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp index 395da0aa9af2064ce5ebc5fd8f2d6b850d38991f..7dd47bb449778e855fcdefec79a94a834ba29c69 100644 --- a/WebCore/page/Geolocation.cpp +++ b/WebCore/page/Geolocation.cpp @@ -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) diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h index c7b0bbdc2b494aaa8fc91ffd79c9d2a938382f66..2b67facecef7fbe74c66df3b06320478cda268de 100644 --- a/WebCore/page/Geolocation.h +++ b/WebCore/page/Geolocation.h @@ -46,7 +46,7 @@ class GeolocationError; #endif class Geolocation : public RefCounted -#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 m_positionCache; +#endif GeoNotifierSet m_requestsAwaitingCachedPosition; }; diff --git a/WebCore/page/Geolocation.idl b/WebCore/page/Geolocation.idl index 58b219cfcfaa66403afc19c723611ddf7894b901..aa5b59f63d84866c027dae9b172b8f58064b76f0 100644 --- a/WebCore/page/Geolocation.idl +++ b/WebCore/page/Geolocation.idl @@ -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); diff --git a/WebCore/page/GeolocationPositionCache.cpp b/WebCore/page/GeolocationPositionCache.cpp index 8567152ed96cdcfa1d4bdbfa579fc39be5e8aa2d..06159f472df15eff0175b04a60530a627bb87484 100644 --- a/WebCore/page/GeolocationPositionCache.cpp +++ b/WebCore/page/GeolocationPositionCache.cpp @@ -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) diff --git a/WebCore/page/Geoposition.idl b/WebCore/page/Geoposition.idl index 6fa12ffd43233565033ad416ef0cd34d502868d8..41a226285c355cd71747691f84f16c94e96a1745 100644 --- a/WebCore/page/Geoposition.idl +++ b/WebCore/page/Geoposition.idl @@ -25,7 +25,7 @@ module core { - interface [OmitConstructor] Geoposition { + interface [Conditional=GEOLOCATION, OmitConstructor] Geoposition { readonly attribute Coordinates coords; readonly attribute DOMTimeStamp timestamp; }; diff --git a/WebCore/page/PositionError.idl b/WebCore/page/PositionError.idl index 1f28d95e297df4aed46e7140e727f797c000094b..5870e0d32ba8896fce40d12c28860aebbdec2f93 100644 --- a/WebCore/page/PositionError.idl +++ b/WebCore/page/PositionError.idl @@ -25,7 +25,7 @@ module core { - interface PositionError { + interface [Conditional=GEOLOCATION] PositionError { readonly attribute unsigned short code; readonly attribute DOMString message; diff --git a/WebCore/platform/GeolocationService.cpp b/WebCore/platform/GeolocationService.cpp index 7e1f755790a97c4e4c030d09b42823d7052dcd09..467600681f1a5063960773c594b44a7aeb1cfd21 100644 --- a/WebCore/platform/GeolocationService.cpp +++ b/WebCore/platform/GeolocationService.cpp @@ -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 diff --git a/WebCore/platform/mock/GeolocationServiceMock.cpp b/WebCore/platform/mock/GeolocationServiceMock.cpp index f1871047c59220e15907ad2f08288054c48c8a76..b254cb8127695ad05d9ed8a7955e12fd456dc3a4 100644 --- a/WebCore/platform/mock/GeolocationServiceMock.cpp +++ b/WebCore/platform/mock/GeolocationServiceMock.cpp @@ -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 diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog index e7bf585fd4d17c51688c87fcdea4d926471fa8f3..658e923f59972a66ccd190cfcbe205891214357f 100644 --- a/WebKit/mac/ChangeLog +++ b/WebKit/mac/ChangeLog @@ -1,3 +1,15 @@ +2010-03-30 Laszlo Gombos + + 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 Reviewed by Antti Koivisto. diff --git a/WebKit/mac/WebCoreSupport/WebGeolocationMock.mm b/WebKit/mac/WebCoreSupport/WebGeolocationMock.mm index 32e8d0d53621173feb43beb3a40d1eeaeb939341..1bdb616da86fd80e897a84fc31b40f17ec859178 100644 --- a/WebKit/mac/WebCoreSupport/WebGeolocationMock.mm +++ b/WebKit/mac/WebCoreSupport/WebGeolocationMock.mm @@ -38,6 +38,7 @@ using namespace WTF; + (void)setPosition:(double)latitude:(double)longitude:(double)accuracy { +#if ENABLE(GEOLOCATION) RefPtr coordinates = Coordinates::create(latitude, longitude, false, 0.0, // altitude @@ -47,13 +48,16 @@ using namespace WTF; false, 0.0); // speed RefPtr 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(code); RefPtr error = PositionError::create(codeEnum, message); GeolocationServiceMock::setError(error.release()); +#endif } @end