| Index: Source/modules/geolocation/Geolocation.cpp
|
| diff --git a/Source/modules/geolocation/Geolocation.cpp b/Source/modules/geolocation/Geolocation.cpp
|
| index 2cb8a1bd0e5e4f4ffeb6abf25fb133386b6f0b06..f666a382664c5872ec0ac3eeb5af61e3aed1c8f4 100644
|
| --- a/Source/modules/geolocation/Geolocation.cpp
|
| +++ b/Source/modules/geolocation/Geolocation.cpp
|
| @@ -154,27 +154,27 @@ void Geolocation::recordOriginTypeAccess() const
|
| UseCounter::count(document, counter);
|
| }
|
|
|
| -void Geolocation::getCurrentPosition(PositionCallback* successCallback, PositionErrorCallback* errorCallback, const Dictionary& options)
|
| +void Geolocation::getCurrentPosition(PositionCallback* successCallback, PositionErrorCallback* errorCallback, const PositionOptions& options)
|
| {
|
| if (!frame())
|
| return;
|
|
|
| recordOriginTypeAccess();
|
|
|
| - GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCallback, PositionOptions::create(options));
|
| + GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCallback, options);
|
| startRequest(notifier);
|
|
|
| m_oneShots.add(notifier);
|
| }
|
|
|
| -int Geolocation::watchPosition(PositionCallback* successCallback, PositionErrorCallback* errorCallback, const Dictionary& options)
|
| +int Geolocation::watchPosition(PositionCallback* successCallback, PositionErrorCallback* errorCallback, const PositionOptions& options)
|
| {
|
| if (!frame())
|
| return 0;
|
|
|
| recordOriginTypeAccess();
|
|
|
| - GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCallback, PositionOptions::create(options));
|
| + GeoNotifier* notifier = GeoNotifier::create(this, successCallback, errorCallback, options);
|
| startRequest(notifier);
|
|
|
| int watchID;
|
| @@ -193,7 +193,7 @@ void Geolocation::startRequest(GeoNotifier *notifier)
|
| notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
|
| else if (haveSuitableCachedPosition(notifier->options()))
|
| notifier->setUseCachedPosition();
|
| - else if (!notifier->options()->timeout())
|
| + else if (!notifier->options().timeout())
|
| notifier->startTimer();
|
| else if (!isAllowed()) {
|
| // if we don't yet have permission, request for permission before calling startUpdating()
|
| @@ -249,7 +249,7 @@ void Geolocation::makeCachedPositionCallbacks()
|
| if (m_oneShots.contains(notifier))
|
| m_oneShots.remove(notifier);
|
| else if (m_watchers.contains(notifier)) {
|
| - if (!notifier->options()->timeout() || startUpdating(notifier))
|
| + if (!notifier->options().timeout() || startUpdating(notifier))
|
| notifier->startTimer();
|
| else
|
| notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, failedToStartServiceErrorMessage));
|
| @@ -271,15 +271,15 @@ void Geolocation::requestTimedOut(GeoNotifier* notifier)
|
| stopUpdating();
|
| }
|
|
|
| -bool Geolocation::haveSuitableCachedPosition(PositionOptions* options)
|
| +bool Geolocation::haveSuitableCachedPosition(const PositionOptions& options)
|
| {
|
| Geoposition* cachedPosition = lastPosition();
|
| if (!cachedPosition)
|
| return false;
|
| - if (!options->maximumAge())
|
| + if (!options.maximumAge())
|
| return false;
|
| DOMTimeStamp currentTimeMillis = convertSecondsToDOMTimeStamp(currentTime());
|
| - return cachedPosition->timestamp() > currentTimeMillis - options->maximumAge();
|
| + return cachedPosition->timestamp() > currentTimeMillis - options.maximumAge();
|
| }
|
|
|
| void Geolocation::clearWatch(int watchID)
|
| @@ -498,7 +498,7 @@ bool Geolocation::startUpdating(GeoNotifier* notifier)
|
| if (!frame)
|
| return false;
|
|
|
| - GeolocationController::from(frame)->addObserver(this, notifier->options()->enableHighAccuracy());
|
| + GeolocationController::from(frame)->addObserver(this, notifier->options().enableHighAccuracy());
|
| return true;
|
| }
|
|
|
|
|