[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 18:27:56 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 958bb629dc99bbe91c30943dc6d45001f3b587e3
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Dec 11 06:50:13 2010 +0000
2010-12-10 John Knottenbelt <jknotten at chromium.org>
Reviewed by Eric Seidel.
Remove WebCore/platform/mac/GeolocationService.{h,mm}
https://bugs.webkit.org/show_bug.cgi?id=50074
Remove unused non-client-based geolocation code.
* platform/mac/GeolocationServiceMac.h: Removed.
* platform/mac/GeolocationServiceMac.mm: Removed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73839 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8aca6ee..7a89928 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-12-10 John Knottenbelt <jknotten at chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove WebCore/platform/mac/GeolocationService.{h,mm}
+ https://bugs.webkit.org/show_bug.cgi?id=50074
+
+ Remove unused non-client-based geolocation code.
+
+ * platform/mac/GeolocationServiceMac.h: Removed.
+ * platform/mac/GeolocationServiceMac.mm: Removed.
+
2010-12-10 Alexey Proskuryakov <ap at apple.com>
Reviewed by Darin Adler.
diff --git a/WebCore/platform/mac/GeolocationServiceMac.h b/WebCore/platform/mac/GeolocationServiceMac.h
deleted file mode 100644
index 4beefca..0000000
--- a/WebCore/platform/mac/GeolocationServiceMac.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. 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. ``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
- * 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.
- */
-
-#ifndef GeolocationServiceMac_h
-#define GeolocationServiceMac_h
-
-#if ENABLE(GEOLOCATION)
-
-#include "GeolocationService.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-#include <wtf/RetainPtr.h>
-
-#ifdef __OBJC__
- at class CLLocationManager;
- at class WebCoreCoreLocationObserver;
-#else
-class CLLocationManager;
-class WebCoreCoreLocationObserver;
-#endif
-
-namespace WebCore {
-
-class GeolocationServiceMac : public GeolocationService {
-public:
- static GeolocationService* create(GeolocationServiceClient*);
- virtual ~GeolocationServiceMac();
-
- virtual bool startUpdating(PositionOptions*);
- virtual void stopUpdating();
-
- virtual void suspend();
- virtual void resume();
-
- virtual Geoposition* lastPosition() const { return m_lastPosition.get(); }
- virtual PositionError* lastError() const { return m_lastError.get(); }
-
- void positionChanged(PassRefPtr<Geoposition>);
- void errorOccurred(PassRefPtr<PositionError>);
-
-private:
- GeolocationServiceMac(GeolocationServiceClient*);
-
- RetainPtr<CLLocationManager> m_locationManager;
- RetainPtr<WebCoreCoreLocationObserver> m_objcObserver;
-
- RefPtr<Geoposition> m_lastPosition;
- RefPtr<PositionError> m_lastError;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(GEOLOCATION)
-
-#endif // GeolocationServiceMac_h
diff --git a/WebCore/platform/mac/GeolocationServiceMac.mm b/WebCore/platform/mac/GeolocationServiceMac.mm
deleted file mode 100644
index 9c781ad..0000000
--- a/WebCore/platform/mac/GeolocationServiceMac.mm
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. 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. ``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
- * 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.
- */
-
-#import "config.h"
-
-#if ENABLE(GEOLOCATION) && !ENABLE(CLIENT_BASED_GEOLOCATION)
-
-#import "GeolocationServiceMac.h"
-
-#import "Geoposition.h"
-#import "PositionError.h"
-#import "PositionOptions.h"
-#import "SoftLinking.h"
-#import <CoreLocation/CoreLocation.h>
-#import <objc/objc-runtime.h>
-#import <wtf/RefPtr.h>
-#import <wtf/UnusedParam.h>
-
-SOFT_LINK_FRAMEWORK(CoreLocation)
-
-SOFT_LINK_CLASS(CoreLocation, CLLocationManager)
-SOFT_LINK_CLASS(CoreLocation, CLLocation)
-
-SOFT_LINK_CONSTANT(CoreLocation, kCLLocationAccuracyBest, double)
-SOFT_LINK_CONSTANT(CoreLocation, kCLLocationAccuracyHundredMeters, double)
-
-#define kCLLocationAccuracyBest getkCLLocationAccuracyBest()
-#define kCLLocationAccuracyHundredMeters getkCLLocationAccuracyHundredMeters()
-
-using namespace WebCore;
-
- at interface WebCoreCoreLocationObserver : NSObject<CLLocationManagerDelegate>
-{
- GeolocationServiceMac* m_callback;
-}
-
-- (id)initWithCallback:(GeolocationServiceMac*)callback;
-
-- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation;
-- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error;
-
- at end
-
-namespace WebCore {
-
-GeolocationService* GeolocationServiceMac::create(GeolocationServiceClient* client)
-{
- return new GeolocationServiceMac(client);
-}
-
-GeolocationService::FactoryFunction* GeolocationService::s_factoryFunction = &GeolocationServiceMac::create;
-
-GeolocationServiceMac::GeolocationServiceMac(GeolocationServiceClient* client)
- : GeolocationService(client)
- , m_objcObserver(AdoptNS, [[WebCoreCoreLocationObserver alloc] initWithCallback:this])
-{
-}
-
-GeolocationServiceMac::~GeolocationServiceMac()
-{
- [m_locationManager.get() stopUpdatingLocation];
- m_locationManager.get().delegate = nil;
-}
-
-bool GeolocationServiceMac::startUpdating(PositionOptions* options)
-{
- #define CLLocationManager getCLLocationManagerClass()
- if (!m_locationManager.get()) {
- m_locationManager.adoptNS([[CLLocationManager alloc] init]);
- m_locationManager.get().delegate = m_objcObserver.get();
- }
-
- if (!m_locationManager.get().locationServicesEnabled)
- return false;
-
- if (options) {
- // CLLocationAccuracy values suggested by Ron Huang.
- CLLocationAccuracy accuracy = options->enableHighAccuracy() ? kCLLocationAccuracyBest : kCLLocationAccuracyHundredMeters;
- m_locationManager.get().desiredAccuracy = accuracy;
- }
-
- // This can safely be called multiple times.
- [m_locationManager.get() startUpdatingLocation];
-
- return true;
- #undef CLLocationManager
-}
-
-void GeolocationServiceMac::stopUpdating()
-{
- [m_locationManager.get() stopUpdatingLocation];
-}
-
-void GeolocationServiceMac::suspend()
-{
- [m_locationManager.get() stopUpdatingLocation];
-}
-
-void GeolocationServiceMac::resume()
-{
- [m_locationManager.get() startUpdatingLocation];
-}
-
-void GeolocationServiceMac::positionChanged(PassRefPtr<Geoposition> position)
-{
- m_lastPosition = position;
- GeolocationService::positionChanged();
-}
-
-void GeolocationServiceMac::errorOccurred(PassRefPtr<PositionError> error)
-{
- m_lastError = error;
- GeolocationService::errorOccurred();
-}
-
-} // namespace WebCore
-
- at implementation WebCoreCoreLocationObserver
-
-- (id)initWithCallback:(GeolocationServiceMac *)callback
-{
- self = [super init];
- if (self)
- m_callback = callback;
- return self;
-}
-
-- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
-{
- ASSERT(m_callback);
- ASSERT(newLocation);
- UNUSED_PARAM(manager);
- UNUSED_PARAM(oldLocation);
-
- // Normalize
- bool canProvideAltitude = true;
- bool canProvideAltitudeAccuracy = true;
- double altitude = newLocation.altitude;
- double altitudeAccuracy = newLocation.verticalAccuracy;
- if (altitudeAccuracy < 0.0) {
- canProvideAltitude = false;
- canProvideAltitudeAccuracy = false;
- }
-
- bool canProvideSpeed = true;
- double speed = newLocation.speed;
- if (speed < 0.0)
- canProvideSpeed = false;
-
- bool canProvideHeading = true;
- double heading = newLocation.course;
- if (heading < 0.0)
- canProvideHeading = false;
-
- WTF::RefPtr<WebCore::Coordinates> newCoordinates = WebCore::Coordinates::create(
- newLocation.coordinate.latitude,
- newLocation.coordinate.longitude,
- canProvideAltitude,
- altitude,
- newLocation.horizontalAccuracy,
- canProvideAltitudeAccuracy,
- altitudeAccuracy,
- canProvideHeading,
- heading,
- canProvideSpeed,
- speed);
- WTF::RefPtr<WebCore::Geoposition> newPosition = WebCore::Geoposition::create(
- newCoordinates.release(),
- [newLocation.timestamp timeIntervalSince1970] * 1000.0); // seconds -> milliseconds
-
- m_callback->positionChanged(newPosition.release());
-}
-
-- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
-{
- ASSERT(m_callback);
- ASSERT(error);
-
- UNUSED_PARAM(manager);
-
- PositionError::ErrorCode code;
- switch ([error code]) {
- case kCLErrorDenied:
- code = PositionError::PERMISSION_DENIED;
- break;
- case kCLErrorLocationUnknown:
- code = PositionError::POSITION_UNAVAILABLE;
- break;
- default:
- code = PositionError::POSITION_UNAVAILABLE;
- break;
- }
-
- m_callback->errorOccurred(PositionError::create(code, [error localizedDescription]));
-}
-
- at end
-
-#endif // ENABLE(GEOLOCATION)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list