1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
|
/*
* Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All Rights Reserved.
* Copyright (C) 2009 Torch Mobile, Inc.
* Copyright 2010, The Android Open Source Project
*
* 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.
*/
#include "config.h"
#include "Geolocation.h"
#if ENABLE(GEOLOCATION)
#include "Document.h"
#include "Frame.h"
#include "Geoposition.h"
#include "Page.h"
#include <wtf/CurrentTime.h>
#include "Coordinates.h"
#include "GeolocationController.h"
#include "GeolocationError.h"
#include "GeolocationPosition.h"
#include "PositionError.h"
namespace WebCore {
static const char permissionDeniedErrorMessage[] = "User denied Geolocation";
static const char failedToStartServiceErrorMessage[] = "Failed to start Geolocation service";
static const char framelessDocumentErrorMessage[] = "Geolocation cannot be used in frameless documents";
static PassRefPtr<Geoposition> createGeoposition(GeolocationPosition* position)
{
if (!position)
return 0;
RefPtr<Coordinates> coordinates = Coordinates::create(position->latitude(), position->longitude(), position->canProvideAltitude(), position->altitude(),
position->accuracy(), position->canProvideAltitudeAccuracy(), position->altitudeAccuracy(),
position->canProvideHeading(), position->heading(), position->canProvideSpeed(), position->speed());
return Geoposition::create(coordinates.release(), convertSecondsToDOMTimeStamp(position->timestamp()));
}
static PassRefPtr<PositionError> createPositionError(GeolocationError* error)
{
PositionError::ErrorCode code = PositionError::POSITION_UNAVAILABLE;
switch (error->code()) {
case GeolocationError::PermissionDenied:
code = PositionError::PERMISSION_DENIED;
break;
case GeolocationError::PositionUnavailable:
code = PositionError::POSITION_UNAVAILABLE;
break;
}
return PositionError::create(code, error->message());
}
Geolocation::GeoNotifier::GeoNotifier(Geolocation* geolocation, PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
: m_geolocation(geolocation)
, m_successCallback(successCallback)
, m_errorCallback(errorCallback)
, m_options(options)
, m_timer(this, &Geolocation::GeoNotifier::timerFired)
, m_useCachedPosition(false)
{
ASSERT(m_geolocation);
ASSERT(m_successCallback);
// If no options were supplied from JS, we should have created a default set
// of options in JSGeolocationCustom.cpp.
ASSERT(m_options);
}
void Geolocation::GeoNotifier::setFatalError(PassRefPtr<PositionError> error)
{
// If a fatal error has already been set, stick with it. This makes sure that
// when permission is denied, this is the error reported, as required by the
// spec.
if (m_fatalError)
return;
m_fatalError = error;
// An existing timer may not have a zero timeout.
m_timer.stop();
m_timer.startOneShot(0);
}
void Geolocation::GeoNotifier::setUseCachedPosition()
{
m_useCachedPosition = true;
m_timer.startOneShot(0);
}
bool Geolocation::GeoNotifier::hasZeroTimeout() const
{
return m_options->hasTimeout() && m_options->timeout() == 0;
}
void Geolocation::GeoNotifier::runSuccessCallback(Geoposition* position)
{
// If we are here and the Geolocation permission is not approved, something has
// gone horribly wrong.
if (!m_geolocation->isAllowed())
CRASH();
m_successCallback->handleEvent(position);
}
void Geolocation::GeoNotifier::runErrorCallback(PositionError* error)
{
if (m_errorCallback)
m_errorCallback->handleEvent(error);
}
void Geolocation::GeoNotifier::startTimerIfNeeded()
{
if (m_options->hasTimeout())
m_timer.startOneShot(m_options->timeout() / 1000.0);
}
void Geolocation::GeoNotifier::stopTimer()
{
m_timer.stop();
}
void Geolocation::GeoNotifier::timerFired(Timer<GeoNotifier>*)
{
m_timer.stop();
// Protect this GeoNotifier object, since it
// could be deleted by a call to clearWatch in a callback.
RefPtr<GeoNotifier> protect(this);
// Test for fatal error first. This is required for the case where the Frame is
// disconnected and requests are cancelled.
if (m_fatalError) {
runErrorCallback(m_fatalError.get());
// This will cause this notifier to be deleted.
m_geolocation->fatalErrorOccurred(this);
return;
}
if (m_useCachedPosition) {
// Clear the cached position flag in case this is a watch request, which
// will continue to run.
m_useCachedPosition = false;
m_geolocation->requestUsesCachedPosition(this);
return;
}
if (m_errorCallback) {
RefPtr<PositionError> error = PositionError::create(PositionError::TIMEOUT, ASCIILiteral("Timeout expired"));
m_errorCallback->handleEvent(error.get());
}
m_geolocation->requestTimedOut(this);
}
bool Geolocation::Watchers::add(int id, PassRefPtr<GeoNotifier> prpNotifier)
{
ASSERT(id > 0);
RefPtr<GeoNotifier> notifier = prpNotifier;
if (!m_idToNotifierMap.add(id, notifier.get()).isNewEntry)
return false;
m_notifierToIdMap.set(notifier.release(), id);
return true;
}
Geolocation::GeoNotifier* Geolocation::Watchers::find(int id)
{
ASSERT(id > 0);
IdToNotifierMap::iterator iter = m_idToNotifierMap.find(id);
if (iter == m_idToNotifierMap.end())
return 0;
return iter->value.get();
}
void Geolocation::Watchers::remove(int id)
{
ASSERT(id > 0);
IdToNotifierMap::iterator iter = m_idToNotifierMap.find(id);
if (iter == m_idToNotifierMap.end())
return;
m_notifierToIdMap.remove(iter->value);
m_idToNotifierMap.remove(iter);
}
void Geolocation::Watchers::remove(GeoNotifier* notifier)
{
NotifierToIdMap::iterator iter = m_notifierToIdMap.find(notifier);
if (iter == m_notifierToIdMap.end())
return;
m_idToNotifierMap.remove(iter->value);
m_notifierToIdMap.remove(iter);
}
bool Geolocation::Watchers::contains(GeoNotifier* notifier) const
{
return m_notifierToIdMap.contains(notifier);
}
void Geolocation::Watchers::clear()
{
m_idToNotifierMap.clear();
m_notifierToIdMap.clear();
}
bool Geolocation::Watchers::isEmpty() const
{
return m_idToNotifierMap.isEmpty();
}
void Geolocation::Watchers::getNotifiersVector(GeoNotifierVector& copy) const
{
copyValuesToVector(m_idToNotifierMap, copy);
}
PassRefPtr<Geolocation> Geolocation::create(ScriptExecutionContext* context)
{
RefPtr<Geolocation> geolocation = adoptRef(new Geolocation(context));
geolocation->suspendIfNeeded();
return geolocation.release();
}
Geolocation::Geolocation(ScriptExecutionContext* context)
: ActiveDOMObject(context)
, m_allowGeolocation(Unknown)
{
}
Geolocation::~Geolocation()
{
ASSERT(m_allowGeolocation != InProgress);
}
Document* Geolocation::document() const
{
return toDocument(scriptExecutionContext());
}
Frame* Geolocation::frame() const
{
return document() ? document()->frame() : 0;
}
Page* Geolocation::page() const
{
return document() ? document()->page() : 0;
}
void Geolocation::stop()
{
Page* page = this->page();
if (page && m_allowGeolocation == InProgress)
GeolocationController::from(page)->cancelPermissionRequest(this);
// The frame may be moving to a new page and we want to get the permissions from the new page's client.
m_allowGeolocation = Unknown;
cancelAllRequests();
stopUpdating();
m_pendingForPermissionNotifiers.clear();
}
Geoposition* Geolocation::lastPosition()
{
Page* page = this->page();
if (!page)
return 0;
m_lastPosition = createGeoposition(GeolocationController::from(page)->lastPosition());
return m_lastPosition.get();
}
void Geolocation::getCurrentPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
{
if (!frame())
return;
RefPtr<GeoNotifier> notifier = GeoNotifier::create(this, successCallback, errorCallback, options);
startRequest(notifier.get());
m_oneShots.add(notifier);
}
int Geolocation::watchPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options)
{
if (!frame())
return 0;
RefPtr<GeoNotifier> notifier = GeoNotifier::create(this, successCallback, errorCallback, options);
startRequest(notifier.get());
int watchID;
// Keep asking for the next id until we're given one that we don't already have.
do {
watchID = m_scriptExecutionContext->circularSequentialID();
} while (!m_watchers.add(watchID, notifier));
return watchID;
}
void Geolocation::startRequest(GeoNotifier *notifier)
{
// Check whether permissions have already been denied. Note that if this is the case,
// the permission state can not change again in the lifetime of this page.
if (isDenied())
notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, ASCIILiteral(permissionDeniedErrorMessage)));
else if (haveSuitableCachedPosition(notifier->options()))
notifier->setUseCachedPosition();
else if (notifier->hasZeroTimeout())
notifier->startTimerIfNeeded();
else if (!isAllowed()) {
// if we don't yet have permission, request for permission before calling startUpdating()
m_pendingForPermissionNotifiers.add(notifier);
requestPermission();
} else if (startUpdating(notifier))
notifier->startTimerIfNeeded();
else
notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(failedToStartServiceErrorMessage)));
}
void Geolocation::fatalErrorOccurred(Geolocation::GeoNotifier* notifier)
{
// This request has failed fatally. Remove it from our lists.
m_oneShots.remove(notifier);
m_watchers.remove(notifier);
if (!hasListeners())
stopUpdating();
}
void Geolocation::requestUsesCachedPosition(GeoNotifier* notifier)
{
// This is called asynchronously, so the permissions could have been denied
// since we last checked in startRequest.
if (isDenied()) {
notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, ASCIILiteral(permissionDeniedErrorMessage)));
return;
}
m_requestsAwaitingCachedPosition.add(notifier);
// If permissions are allowed, make the callback
if (isAllowed()) {
makeCachedPositionCallbacks();
return;
}
// Request permissions, which may be synchronous or asynchronous.
requestPermission();
}
void Geolocation::makeCachedPositionCallbacks()
{
// All modifications to m_requestsAwaitingCachedPosition are done
// asynchronously, so we don't need to worry about it being modified from
// the callbacks.
GeoNotifierSet::const_iterator end = m_requestsAwaitingCachedPosition.end();
for (GeoNotifierSet::const_iterator iter = m_requestsAwaitingCachedPosition.begin(); iter != end; ++iter) {
GeoNotifier* notifier = iter->get();
notifier->runSuccessCallback(lastPosition());
// If this is a one-shot request, stop it. Otherwise, if the watch still
// exists, start the service to get updates.
if (m_oneShots.contains(notifier))
m_oneShots.remove(notifier);
else if (m_watchers.contains(notifier)) {
if (notifier->hasZeroTimeout() || startUpdating(notifier))
notifier->startTimerIfNeeded();
else
notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(failedToStartServiceErrorMessage)));
}
}
m_requestsAwaitingCachedPosition.clear();
if (!hasListeners())
stopUpdating();
}
void Geolocation::requestTimedOut(GeoNotifier* notifier)
{
// If this is a one-shot request, stop it.
m_oneShots.remove(notifier);
if (!hasListeners())
stopUpdating();
}
bool Geolocation::haveSuitableCachedPosition(PositionOptions* options)
{
Geoposition* cachedPosition = lastPosition();
if (!cachedPosition)
return false;
if (!options->hasMaximumAge())
return true;
if (!options->maximumAge())
return false;
DOMTimeStamp currentTimeMillis = convertSecondsToDOMTimeStamp(currentTime());
return cachedPosition->timestamp() > currentTimeMillis - options->maximumAge();
}
void Geolocation::clearWatch(int watchID)
{
if (watchID <= 0)
return;
if (GeoNotifier* notifier = m_watchers.find(watchID))
m_pendingForPermissionNotifiers.remove(notifier);
m_watchers.remove(watchID);
if (!hasListeners())
stopUpdating();
}
void Geolocation::setIsAllowed(bool allowed)
{
// Protect the Geolocation object from garbage collection during a callback.
RefPtr<Geolocation> protect(this);
// This may be due to either a new position from the service, or a cached
// position.
m_allowGeolocation = allowed ? Yes : No;
// Permission request was made during the startRequest process
if (!m_pendingForPermissionNotifiers.isEmpty()) {
handlePendingPermissionNotifiers();
m_pendingForPermissionNotifiers.clear();
return;
}
if (!isAllowed()) {
RefPtr<PositionError> error = PositionError::create(PositionError::PERMISSION_DENIED, ASCIILiteral(permissionDeniedErrorMessage));
error->setIsFatal(true);
handleError(error.get());
m_requestsAwaitingCachedPosition.clear();
return;
}
// If the service has a last position, use it to call back for all requests.
// If any of the requests are waiting for permission for a cached position,
// the position from the service will be at least as fresh.
if (lastPosition())
makeSuccessCallbacks();
else
makeCachedPositionCallbacks();
}
void Geolocation::sendError(GeoNotifierVector& notifiers, PositionError* error)
{
GeoNotifierVector::const_iterator end = notifiers.end();
for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it) {
RefPtr<GeoNotifier> notifier = *it;
notifier->runErrorCallback(error);
}
}
void Geolocation::sendPosition(GeoNotifierVector& notifiers, Geoposition* position)
{
GeoNotifierVector::const_iterator end = notifiers.end();
for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it)
(*it)->runSuccessCallback(position);
}
void Geolocation::stopTimer(GeoNotifierVector& notifiers)
{
GeoNotifierVector::const_iterator end = notifiers.end();
for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it)
(*it)->stopTimer();
}
void Geolocation::stopTimersForOneShots()
{
GeoNotifierVector copy;
copyToVector(m_oneShots, copy);
stopTimer(copy);
}
void Geolocation::stopTimersForWatchers()
{
GeoNotifierVector copy;
m_watchers.getNotifiersVector(copy);
stopTimer(copy);
}
void Geolocation::stopTimers()
{
stopTimersForOneShots();
stopTimersForWatchers();
}
void Geolocation::cancelRequests(GeoNotifierVector& notifiers)
{
GeoNotifierVector::const_iterator end = notifiers.end();
for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it)
(*it)->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(framelessDocumentErrorMessage)));
}
void Geolocation::cancelAllRequests()
{
GeoNotifierVector copy;
copyToVector(m_oneShots, copy);
cancelRequests(copy);
m_watchers.getNotifiersVector(copy);
cancelRequests(copy);
}
void Geolocation::extractNotifiersWithCachedPosition(GeoNotifierVector& notifiers, GeoNotifierVector* cached)
{
GeoNotifierVector nonCached;
GeoNotifierVector::iterator end = notifiers.end();
for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it) {
GeoNotifier* notifier = it->get();
if (notifier->useCachedPosition()) {
if (cached)
cached->append(notifier);
} else
nonCached.append(notifier);
}
notifiers.swap(nonCached);
}
void Geolocation::copyToSet(const GeoNotifierVector& src, GeoNotifierSet& dest)
{
GeoNotifierVector::const_iterator end = src.end();
for (GeoNotifierVector::const_iterator it = src.begin(); it != end; ++it) {
GeoNotifier* notifier = it->get();
dest.add(notifier);
}
}
void Geolocation::handleError(PositionError* error)
{
ASSERT(error);
GeoNotifierVector oneShotsCopy;
copyToVector(m_oneShots, oneShotsCopy);
GeoNotifierVector watchersCopy;
m_watchers.getNotifiersVector(watchersCopy);
// Clear the lists before we make the callbacks, to avoid clearing notifiers
// added by calls to Geolocation methods from the callbacks, and to prevent
// further callbacks to these notifiers.
GeoNotifierVector oneShotsWithCachedPosition;
m_oneShots.clear();
if (error->isFatal())
m_watchers.clear();
else {
// Don't send non-fatal errors to notifiers due to receive a cached position.
extractNotifiersWithCachedPosition(oneShotsCopy, &oneShotsWithCachedPosition);
extractNotifiersWithCachedPosition(watchersCopy, 0);
}
sendError(oneShotsCopy, error);
sendError(watchersCopy, error);
// hasListeners() doesn't distinguish between notifiers due to receive a
// cached position and those requiring a fresh position. Perform the check
// before restoring the notifiers below.
if (!hasListeners())
stopUpdating();
// Maintain a reference to the cached notifiers until their timer fires.
copyToSet(oneShotsWithCachedPosition, m_oneShots);
}
void Geolocation::requestPermission()
{
if (m_allowGeolocation > Unknown)
return;
Page* page = this->page();
if (!page)
return;
m_allowGeolocation = InProgress;
// Ask the embedder: it maintains the geolocation challenge policy itself.
GeolocationController::from(page)->requestPermission(this);
}
void Geolocation::makeSuccessCallbacks()
{
ASSERT(lastPosition());
ASSERT(isAllowed());
GeoNotifierVector oneShotsCopy;
copyToVector(m_oneShots, oneShotsCopy);
GeoNotifierVector watchersCopy;
m_watchers.getNotifiersVector(watchersCopy);
// Clear the lists before we make the callbacks, to avoid clearing notifiers
// added by calls to Geolocation methods from the callbacks, and to prevent
// further callbacks to these notifiers.
m_oneShots.clear();
sendPosition(oneShotsCopy, lastPosition());
sendPosition(watchersCopy, lastPosition());
if (!hasListeners())
stopUpdating();
}
void Geolocation::positionChanged()
{
ASSERT(isAllowed());
// Stop all currently running timers.
stopTimers();
makeSuccessCallbacks();
}
void Geolocation::setError(GeolocationError* error)
{
RefPtr<PositionError> positionError = createPositionError(error);
handleError(positionError.get());
}
bool Geolocation::startUpdating(GeoNotifier* notifier)
{
Page* page = this->page();
if (!page)
return false;
GeolocationController::from(page)->addObserver(this, notifier->options()->enableHighAccuracy());
return true;
}
void Geolocation::stopUpdating()
{
Page* page = this->page();
if (!page)
return;
GeolocationController::from(page)->removeObserver(this);
}
void Geolocation::handlePendingPermissionNotifiers()
{
// While we iterate through the list, we need not worry about list being modified as the permission
// is already set to Yes/No and no new listeners will be added to the pending list
GeoNotifierSet::const_iterator end = m_pendingForPermissionNotifiers.end();
for (GeoNotifierSet::const_iterator iter = m_pendingForPermissionNotifiers.begin(); iter != end; ++iter) {
GeoNotifier* notifier = iter->get();
if (isAllowed()) {
// start all pending notification requests as permission granted.
// The notifier is always ref'ed by m_oneShots or m_watchers.
if (startUpdating(notifier))
notifier->startTimerIfNeeded();
else
notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(failedToStartServiceErrorMessage)));
} else
notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, ASCIILiteral(permissionDeniedErrorMessage)));
}
}
} // namespace WebCore
#endif // ENABLE(GEOLOCATION)
|