Modified: trunk/Source/WebCore/ChangeLog (139004 => 139005)
--- trunk/Source/WebCore/ChangeLog 2013-01-07 23:49:29 UTC (rev 139004)
+++ trunk/Source/WebCore/ChangeLog 2013-01-07 23:57:30 UTC (rev 139005)
@@ -1,3 +1,26 @@
+2013-01-07 Joseph Pecoraro <[email protected]>
+
+ 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.
+
2013-01-07 Chris Fleizach <[email protected]>
AX: the text of render counters are not exposed to Accessibility
Modified: trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp (139004 => 139005)
--- trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp 2013-01-07 23:49:29 UTC (rev 139004)
+++ trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp 2013-01-07 23:57:30 UTC (rev 139005)
@@ -30,8 +30,6 @@
#if ENABLE(GEOLOCATION)
-#include "Chrome.h"
-#include "ChromeClient.h"
#include "Document.h"
#include "Frame.h"
#include "Geoposition.h"
@@ -169,7 +167,7 @@
}
if (m_errorCallback) {
- RefPtr<PositionError> error = PositionError::create(PositionError::TIMEOUT, "Timeout expired");
+ RefPtr<PositionError> error = PositionError::create(PositionError::TIMEOUT, ASCIILiteral("Timeout expired"));
m_errorCallback->handleEvent(error.get());
}
m_geolocation->requestTimedOut(this);
@@ -319,7 +317,7 @@
// 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, permissionDeniedErrorMessage));
+ notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, ASCIILiteral(permissionDeniedErrorMessage)));
else if (haveSuitableCachedPosition(notifier->options()))
notifier->setUseCachedPosition();
else if (notifier->hasZeroTimeout())
@@ -331,7 +329,7 @@
} else if (startUpdating(notifier))
notifier->startTimerIfNeeded();
else
- notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, failedToStartServiceErrorMessage));
+ notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(failedToStartServiceErrorMessage)));
}
void Geolocation::fatalErrorOccurred(Geolocation::GeoNotifier* notifier)
@@ -349,7 +347,7 @@
// 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, permissionDeniedErrorMessage));
+ notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, ASCIILiteral(permissionDeniedErrorMessage)));
return;
}
@@ -383,7 +381,7 @@
if (notifier->hasZeroTimeout() || startUpdating(notifier))
notifier->startTimerIfNeeded();
else
- notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, failedToStartServiceErrorMessage));
+ notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(failedToStartServiceErrorMessage)));
}
}
@@ -445,7 +443,7 @@
}
if (!isAllowed()) {
- RefPtr<PositionError> error = PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage);
+ RefPtr<PositionError> error = PositionError::create(PositionError::PERMISSION_DENIED, ASCIILiteral(permissionDeniedErrorMessage));
error->setIsFatal(true);
handleError(error.get());
m_requestsAwaitingCachedPosition.clear();
@@ -511,7 +509,7 @@
{
GeoNotifierVector::const_iterator end = notifiers.end();
for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it)
- (*it)->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, framelessDocumentErrorMessage));
+ (*it)->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(framelessDocumentErrorMessage)));
}
void Geolocation::cancelAllRequests()
@@ -670,9 +668,9 @@
if (startUpdating(notifier))
notifier->startTimerIfNeeded();
else
- notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, failedToStartServiceErrorMessage));
+ notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(failedToStartServiceErrorMessage)));
} else
- notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
+ notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, ASCIILiteral(permissionDeniedErrorMessage)));
}
}
Modified: trunk/Source/WebCore/Modules/geolocation/GeolocationController.cpp (139004 => 139005)
--- trunk/Source/WebCore/Modules/geolocation/GeolocationController.cpp 2013-01-07 23:49:29 UTC (rev 139004)
+++ trunk/Source/WebCore/Modules/geolocation/GeolocationController.cpp 2013-01-07 23:57:30 UTC (rev 139005)
@@ -103,7 +103,7 @@
{
position = InspectorInstrumentation::overrideGeolocationPosition(m_page, position);
if (!position) {
- errorOccurred(GeolocationError::create(GeolocationError::PositionUnavailable, "PositionUnavailable").get());
+ errorOccurred(GeolocationError::create(GeolocationError::PositionUnavailable, ASCIILiteral("PositionUnavailable")).get());
return;
}
m_lastPosition = position;
Modified: trunk/Source/WebCore/Modules/notifications/WorkerContextNotifications.cpp (139004 => 139005)
--- trunk/Source/WebCore/Modules/notifications/WorkerContextNotifications.cpp 2013-01-07 23:49:29 UTC (rev 139004)
+++ trunk/Source/WebCore/Modules/notifications/WorkerContextNotifications.cpp 2013-01-07 23:57:30 UTC (rev 139005)
@@ -47,7 +47,7 @@
WorkerContextNotifications* WorkerContextNotifications::from(WorkerContext* context)
{
- AtomicString supplementName = "WorkerContextNotifications";
+ DEFINE_STATIC_LOCAL(AtomicString, supplementName, ("WorkerContextNotifications", AtomicString::ConstructFromLiteral));
WorkerContextNotifications* supplement = static_cast<WorkerContextNotifications*>(Supplement<ScriptExecutionContext>::from(context, supplementName));
if (!supplement) {
supplement = new WorkerContextNotifications(context);