Changeset 139005 in webkit


Ignore:
Timestamp:
Jan 7, 2013 3:57:30 PM (11 years ago)
Author:
Joseph Pecoraro
Message:

String improvements in geolocation and notifications modules
https://bugs.webkit.org/show_bug.cgi?id=105352

Reviewed by Sam Weinig.

  • Modules/geolocation/Geolocation.cpp:

(WebCore::Geolocation::GeoNotifier::timerFired):
(WebCore::Geolocation::startRequest):
(WebCore::Geolocation::requestUsesCachedPosition):
(WebCore::Geolocation::makeCachedPositionCallbacks):
(WebCore::Geolocation::setIsAllowed):
(WebCore::Geolocation::cancelRequests):
(WebCore::Geolocation::handlePendingPermissionNotifiers):

  • Modules/geolocation/GeolocationController.cpp:

(WebCore::GeolocationController::positionChanged):

  • Modules/notifications/WorkerContextNotifications.cpp:

Use ASCIILiteral for constant strings becoming WTFStrings.

(WebCore::WorkerContextNotifications::from):
Use AtomicString::ConstructFromLiteral for the static local.

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r139002 r139005  
     12013-01-07  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        String improvements in geolocation and notifications modules
     4        https://bugs.webkit.org/show_bug.cgi?id=105352
     5
     6        Reviewed by Sam Weinig.
     7
     8        * Modules/geolocation/Geolocation.cpp:
     9        (WebCore::Geolocation::GeoNotifier::timerFired):
     10        (WebCore::Geolocation::startRequest):
     11        (WebCore::Geolocation::requestUsesCachedPosition):
     12        (WebCore::Geolocation::makeCachedPositionCallbacks):
     13        (WebCore::Geolocation::setIsAllowed):
     14        (WebCore::Geolocation::cancelRequests):
     15        (WebCore::Geolocation::handlePendingPermissionNotifiers):
     16        * Modules/geolocation/GeolocationController.cpp:
     17        (WebCore::GeolocationController::positionChanged):
     18        * Modules/notifications/WorkerContextNotifications.cpp:
     19        Use ASCIILiteral for constant strings becoming WTFStrings.
     20
     21        (WebCore::WorkerContextNotifications::from):
     22        Use AtomicString::ConstructFromLiteral for the static local.
     23
    1242013-01-07  Chris Fleizach  <cfleizach@apple.com>
    225
  • trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp

    r136164 r139005  
    3131#if ENABLE(GEOLOCATION)
    3232
    33 #include "Chrome.h"
    34 #include "ChromeClient.h"
    3533#include "Document.h"
    3634#include "Frame.h"
     
    170168
    171169    if (m_errorCallback) {
    172         RefPtr<PositionError> error = PositionError::create(PositionError::TIMEOUT, "Timeout expired");
     170        RefPtr<PositionError> error = PositionError::create(PositionError::TIMEOUT, ASCIILiteral("Timeout expired"));
    173171        m_errorCallback->handleEvent(error.get());
    174172    }
     
    320318    // the permission state can not change again in the lifetime of this page.
    321319    if (isDenied())
    322         notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
     320        notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, ASCIILiteral(permissionDeniedErrorMessage)));
    323321    else if (haveSuitableCachedPosition(notifier->options()))
    324322        notifier->setUseCachedPosition();
     
    332330        notifier->startTimerIfNeeded();
    333331    else
    334         notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, failedToStartServiceErrorMessage));
     332        notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(failedToStartServiceErrorMessage)));
    335333}
    336334
     
    350348    // since we last checked in startRequest.
    351349    if (isDenied()) {
    352         notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
     350        notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, ASCIILiteral(permissionDeniedErrorMessage)));
    353351        return;
    354352    }
     
    384382                notifier->startTimerIfNeeded();
    385383            else
    386                 notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, failedToStartServiceErrorMessage));
     384                notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(failedToStartServiceErrorMessage)));
    387385        }
    388386    }
     
    446444
    447445    if (!isAllowed()) {
    448         RefPtr<PositionError> error = PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage);
     446        RefPtr<PositionError> error = PositionError::create(PositionError::PERMISSION_DENIED,  ASCIILiteral(permissionDeniedErrorMessage));
    449447        error->setIsFatal(true);
    450448        handleError(error.get());
     
    512510    GeoNotifierVector::const_iterator end = notifiers.end();
    513511    for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it)
    514         (*it)->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, framelessDocumentErrorMessage));
     512        (*it)->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(framelessDocumentErrorMessage)));
    515513}
    516514
     
    671669                notifier->startTimerIfNeeded();
    672670            else
    673                 notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, failedToStartServiceErrorMessage));
     671                notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(failedToStartServiceErrorMessage)));
    674672        } else
    675             notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
     673            notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, ASCIILiteral(permissionDeniedErrorMessage)));
    676674    }
    677675}
  • trunk/Source/WebCore/Modules/geolocation/GeolocationController.cpp

    r133976 r139005  
    104104    position = InspectorInstrumentation::overrideGeolocationPosition(m_page, position);
    105105    if (!position) {
    106         errorOccurred(GeolocationError::create(GeolocationError::PositionUnavailable, "PositionUnavailable").get());
     106        errorOccurred(GeolocationError::create(GeolocationError::PositionUnavailable, ASCIILiteral("PositionUnavailable")).get());
    107107        return;
    108108    }
  • trunk/Source/WebCore/Modules/notifications/WorkerContextNotifications.cpp

    r121882 r139005  
    4848WorkerContextNotifications* WorkerContextNotifications::from(WorkerContext* context)
    4949{
    50     AtomicString supplementName = "WorkerContextNotifications";
     50    DEFINE_STATIC_LOCAL(AtomicString, supplementName, ("WorkerContextNotifications", AtomicString::ConstructFromLiteral));
    5151    WorkerContextNotifications* supplement = static_cast<WorkerContextNotifications*>(Supplement<ScriptExecutionContext>::from(context, supplementName));
    5252    if (!supplement) {
Note: See TracChangeset for help on using the changeset viewer.