Change the Supplementable class to not use AtomicString.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2013 06:49:45 +0000 (06:49 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2013 06:49:45 +0000 (06:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=107535.

Reviewed by Adam Barth.

Replaced the use of AtomicString keys with literal const char* keys.
This simplifies the SupplementMap and makes it slightly leaner and faster.

Source/WebCore:

No new tests.

* Modules/battery/BatteryController.cpp:
(WebCore::BatteryController::supplementName):
* Modules/battery/BatteryController.h:
(BatteryController):
* Modules/battery/NavigatorBattery.cpp:
(WebCore::NavigatorBattery::supplementName):
(WebCore):
(WebCore::NavigatorBattery::from):
* Modules/battery/NavigatorBattery.h:
(NavigatorBattery):
* Modules/filesystem/chromium/DraggedIsolatedFileSystem.cpp:
(WebCore::DraggedIsolatedFileSystem::supplementName):
* Modules/filesystem/chromium/DraggedIsolatedFileSystem.h:
(DraggedIsolatedFileSystem):
* Modules/gamepad/NavigatorGamepad.cpp:
(WebCore::NavigatorGamepad::supplementName):
(WebCore):
(WebCore::NavigatorGamepad::from):
* Modules/gamepad/NavigatorGamepad.h:
(NavigatorGamepad):
* Modules/geolocation/GeolocationController.cpp:
(WebCore::GeolocationController::supplementName):
* Modules/geolocation/GeolocationController.h:
(GeolocationController):
* Modules/geolocation/NavigatorGeolocation.cpp:
(WebCore::NavigatorGeolocation::supplementName):
(WebCore):
(WebCore::NavigatorGeolocation::from):
* Modules/geolocation/NavigatorGeolocation.h:
(NavigatorGeolocation):
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::supplementName):
(WebCore):
(WebCore::DOMWindowIndexedDatabase::from):
* Modules/indexeddb/DOMWindowIndexedDatabase.h:
(DOMWindowIndexedDatabase):
* Modules/indexeddb/PageGroupIndexedDatabase.cpp:
(WebCore::PageGroupIndexedDatabase::supplementName):
(WebCore):
(WebCore::PageGroupIndexedDatabase::from):
* Modules/indexeddb/PageGroupIndexedDatabase.h:
(PageGroupIndexedDatabase):
* Modules/indexeddb/WorkerContextIndexedDatabase.cpp:
(WebCore::WorkerContextIndexedDatabase::supplementName):
(WebCore):
(WebCore::WorkerContextIndexedDatabase::from):
* Modules/indexeddb/WorkerContextIndexedDatabase.h:
(WorkerContextIndexedDatabase):
* Modules/intents/DOMWindowIntents.cpp:
(WebCore::DOMWindowIntents::supplementName):
(WebCore):
(WebCore::DOMWindowIntents::from):
* Modules/intents/DOMWindowIntents.h:
(DOMWindowIntents):
* Modules/mediastream/UserMediaController.cpp:
(WebCore::UserMediaController::supplementName):
* Modules/mediastream/UserMediaController.h:
(UserMediaController):
* Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
(WebCore::NavigatorContentUtils::supplementName):
* Modules/navigatorcontentutils/NavigatorContentUtils.h:
(NavigatorContentUtils):
* Modules/networkinfo/NavigatorNetworkInfoConnection.cpp:
(WebCore::NavigatorNetworkInfoConnection::supplementName):
(WebCore):
(WebCore::NavigatorNetworkInfoConnection::from):
* Modules/networkinfo/NavigatorNetworkInfoConnection.h:
(NavigatorNetworkInfoConnection):
* Modules/networkinfo/NetworkInfoController.cpp:
(WebCore::NetworkInfoController::supplementName):
* Modules/networkinfo/NetworkInfoController.h:
(NetworkInfoController):
* Modules/notifications/DOMWindowNotifications.cpp:
(WebCore::DOMWindowNotifications::supplementName):
(WebCore):
(WebCore::DOMWindowNotifications::from):
* Modules/notifications/DOMWindowNotifications.h:
(DOMWindowNotifications):
* Modules/notifications/NotificationController.cpp:
(WebCore::NotificationController::supplementName):
* Modules/notifications/NotificationController.h:
(NotificationController):
* Modules/notifications/WorkerContextNotifications.cpp:
(WebCore::WorkerContextNotifications::supplementName):
(WebCore):
(WebCore::WorkerContextNotifications::from):
* Modules/notifications/WorkerContextNotifications.h:
(WorkerContextNotifications):
* Modules/quota/DOMWindowQuota.cpp:
(WebCore::DOMWindowQuota::supplementName):
(WebCore):
(WebCore::DOMWindowQuota::from):
* Modules/quota/DOMWindowQuota.h:
(DOMWindowQuota):
* Modules/speech/DOMWindowSpeechSynthesis.cpp:
(WebCore::DOMWindowSpeechSynthesis::supplementName):
(WebCore):
(WebCore::DOMWindowSpeechSynthesis::from):
* Modules/speech/DOMWindowSpeechSynthesis.h:
(DOMWindowSpeechSynthesis):
* Modules/speech/SpeechRecognitionController.cpp:
(WebCore::SpeechRecognitionController::supplementName):
* Modules/speech/SpeechRecognitionController.h:
(SpeechRecognitionController):
* Modules/vibration/Vibration.cpp:
(WebCore::Vibration::supplementName):
* Modules/vibration/Vibration.h:
(Vibration):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::supplementName):
(WebCore):
(WebCore::DatabaseContext::existingDatabaseContextFrom):
(WebCore::DatabaseContext::from):
* Modules/webdatabase/DatabaseContext.h:
(DatabaseContext):
* dom/ContextFeatures.cpp:
(WebCore::ContextFeatures::supplementName):
* dom/ContextFeatures.h:
* dom/DeviceMotionController.cpp:
(WebCore::DeviceMotionController::supplementName):
* dom/DeviceMotionController.h:
(DeviceMotionController):
* dom/DeviceOrientationController.cpp:
(WebCore::DeviceOrientationController::supplementName):
* dom/DeviceOrientationController.h:
(DeviceOrientationController):
* loader/PrerendererClient.cpp:
(WebCore::PrerendererClient::supplementName):
* loader/PrerendererClient.h:
(PrerendererClient):
* page/DOMWindowPagePopup.cpp:
(WebCore::DOMWindowPagePopup::supplementName):
* page/DOMWindowPagePopup.h:
(DOMWindowPagePopup):
* page/SpeechInput.cpp:
(WebCore::SpeechInput::supplementName):
* page/SpeechInput.h:
(SpeechInput):
* platform/RefCountedSupplement.h:
(WebCore::RefCountedSupplement::provideTo):
(WebCore::RefCountedSupplement::from):
* platform/Supplementable.h:
(WebCore):
(WebCore::Supplement::provideTo):
(WebCore::Supplement::from):
(WebCore::Supplementable::provideSupplement):
(WebCore::Supplementable::removeSupplement):
(WebCore::Supplementable::requireSupplement):
(Supplementable):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::supplementName):
(WebCore):
(WebCore::InternalSettings::from):
* testing/InternalSettings.h:
(InternalSettings):

Source/WebKit/chromium:

* src/ContextFeaturesClientImpl.cpp:
(ContextFeaturesCache):
(WebKit::ContextFeaturesCache::supplementName):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@140509 268f45cc-cd09-0410-ab3c-d52691b4dbfc

63 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/battery/BatteryController.cpp
Source/WebCore/Modules/battery/BatteryController.h
Source/WebCore/Modules/battery/NavigatorBattery.cpp
Source/WebCore/Modules/battery/NavigatorBattery.h
Source/WebCore/Modules/filesystem/chromium/DraggedIsolatedFileSystem.cpp
Source/WebCore/Modules/filesystem/chromium/DraggedIsolatedFileSystem.h
Source/WebCore/Modules/gamepad/NavigatorGamepad.cpp
Source/WebCore/Modules/gamepad/NavigatorGamepad.h
Source/WebCore/Modules/geolocation/GeolocationController.cpp
Source/WebCore/Modules/geolocation/GeolocationController.h
Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp
Source/WebCore/Modules/geolocation/NavigatorGeolocation.h
Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp
Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h
Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.cpp
Source/WebCore/Modules/indexeddb/PageGroupIndexedDatabase.h
Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.cpp
Source/WebCore/Modules/indexeddb/WorkerContextIndexedDatabase.h
Source/WebCore/Modules/intents/DOMWindowIntents.cpp
Source/WebCore/Modules/intents/DOMWindowIntents.h
Source/WebCore/Modules/mediastream/UserMediaController.cpp
Source/WebCore/Modules/mediastream/UserMediaController.h
Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp
Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.h
Source/WebCore/Modules/networkinfo/NavigatorNetworkInfoConnection.cpp
Source/WebCore/Modules/networkinfo/NavigatorNetworkInfoConnection.h
Source/WebCore/Modules/networkinfo/NetworkInfoController.cpp
Source/WebCore/Modules/networkinfo/NetworkInfoController.h
Source/WebCore/Modules/notifications/DOMWindowNotifications.cpp
Source/WebCore/Modules/notifications/DOMWindowNotifications.h
Source/WebCore/Modules/notifications/NotificationController.cpp
Source/WebCore/Modules/notifications/NotificationController.h
Source/WebCore/Modules/notifications/WorkerContextNotifications.cpp
Source/WebCore/Modules/notifications/WorkerContextNotifications.h
Source/WebCore/Modules/quota/DOMWindowQuota.cpp
Source/WebCore/Modules/quota/DOMWindowQuota.h
Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.cpp
Source/WebCore/Modules/speech/DOMWindowSpeechSynthesis.h
Source/WebCore/Modules/speech/SpeechRecognitionController.cpp
Source/WebCore/Modules/speech/SpeechRecognitionController.h
Source/WebCore/Modules/vibration/Vibration.cpp
Source/WebCore/Modules/vibration/Vibration.h
Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
Source/WebCore/Modules/webdatabase/DatabaseContext.h
Source/WebCore/dom/ContextFeatures.cpp
Source/WebCore/dom/ContextFeatures.h
Source/WebCore/dom/DeviceMotionController.cpp
Source/WebCore/dom/DeviceMotionController.h
Source/WebCore/dom/DeviceOrientationController.cpp
Source/WebCore/dom/DeviceOrientationController.h
Source/WebCore/loader/PrerendererClient.cpp
Source/WebCore/loader/PrerendererClient.h
Source/WebCore/page/DOMWindowPagePopup.cpp
Source/WebCore/page/DOMWindowPagePopup.h
Source/WebCore/page/SpeechInput.cpp
Source/WebCore/page/SpeechInput.h
Source/WebCore/platform/RefCountedSupplement.h
Source/WebCore/platform/Supplementable.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/ContextFeaturesClientImpl.cpp

index 9bf4575..e7a9f13 100644 (file)
@@ -1,3 +1,171 @@
+2013-01-22  Mark Lam  <mark.lam@apple.com>
+
+        Change the Supplementable class to not use AtomicString.
+        https://bugs.webkit.org/show_bug.cgi?id=107535.
+
+        Reviewed by Adam Barth.
+
+        Replaced the use of AtomicString keys with literal const char* keys.
+        This simplifies the SupplementMap and makes it slightly leaner and faster.
+
+        No new tests.
+
+        * Modules/battery/BatteryController.cpp:
+        (WebCore::BatteryController::supplementName):
+        * Modules/battery/BatteryController.h:
+        (BatteryController):
+        * Modules/battery/NavigatorBattery.cpp:
+        (WebCore::NavigatorBattery::supplementName):
+        (WebCore):
+        (WebCore::NavigatorBattery::from):
+        * Modules/battery/NavigatorBattery.h:
+        (NavigatorBattery):
+        * Modules/filesystem/chromium/DraggedIsolatedFileSystem.cpp:
+        (WebCore::DraggedIsolatedFileSystem::supplementName):
+        * Modules/filesystem/chromium/DraggedIsolatedFileSystem.h:
+        (DraggedIsolatedFileSystem):
+        * Modules/gamepad/NavigatorGamepad.cpp:
+        (WebCore::NavigatorGamepad::supplementName):
+        (WebCore):
+        (WebCore::NavigatorGamepad::from):
+        * Modules/gamepad/NavigatorGamepad.h:
+        (NavigatorGamepad):
+        * Modules/geolocation/GeolocationController.cpp:
+        (WebCore::GeolocationController::supplementName):
+        * Modules/geolocation/GeolocationController.h:
+        (GeolocationController):
+        * Modules/geolocation/NavigatorGeolocation.cpp:
+        (WebCore::NavigatorGeolocation::supplementName):
+        (WebCore):
+        (WebCore::NavigatorGeolocation::from):
+        * Modules/geolocation/NavigatorGeolocation.h:
+        (NavigatorGeolocation):
+        * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
+        (WebCore::DOMWindowIndexedDatabase::supplementName):
+        (WebCore):
+        (WebCore::DOMWindowIndexedDatabase::from):
+        * Modules/indexeddb/DOMWindowIndexedDatabase.h:
+        (DOMWindowIndexedDatabase):
+        * Modules/indexeddb/PageGroupIndexedDatabase.cpp:
+        (WebCore::PageGroupIndexedDatabase::supplementName):
+        (WebCore):
+        (WebCore::PageGroupIndexedDatabase::from):
+        * Modules/indexeddb/PageGroupIndexedDatabase.h:
+        (PageGroupIndexedDatabase):
+        * Modules/indexeddb/WorkerContextIndexedDatabase.cpp:
+        (WebCore::WorkerContextIndexedDatabase::supplementName):
+        (WebCore):
+        (WebCore::WorkerContextIndexedDatabase::from):
+        * Modules/indexeddb/WorkerContextIndexedDatabase.h:
+        (WorkerContextIndexedDatabase):
+        * Modules/intents/DOMWindowIntents.cpp:
+        (WebCore::DOMWindowIntents::supplementName):
+        (WebCore):
+        (WebCore::DOMWindowIntents::from):
+        * Modules/intents/DOMWindowIntents.h:
+        (DOMWindowIntents):
+        * Modules/mediastream/UserMediaController.cpp:
+        (WebCore::UserMediaController::supplementName):
+        * Modules/mediastream/UserMediaController.h:
+        (UserMediaController):
+        * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
+        (WebCore::NavigatorContentUtils::supplementName):
+        * Modules/navigatorcontentutils/NavigatorContentUtils.h:
+        (NavigatorContentUtils):
+        * Modules/networkinfo/NavigatorNetworkInfoConnection.cpp:
+        (WebCore::NavigatorNetworkInfoConnection::supplementName):
+        (WebCore):
+        (WebCore::NavigatorNetworkInfoConnection::from):
+        * Modules/networkinfo/NavigatorNetworkInfoConnection.h:
+        (NavigatorNetworkInfoConnection):
+        * Modules/networkinfo/NetworkInfoController.cpp:
+        (WebCore::NetworkInfoController::supplementName):
+        * Modules/networkinfo/NetworkInfoController.h:
+        (NetworkInfoController):
+        * Modules/notifications/DOMWindowNotifications.cpp:
+        (WebCore::DOMWindowNotifications::supplementName):
+        (WebCore):
+        (WebCore::DOMWindowNotifications::from):
+        * Modules/notifications/DOMWindowNotifications.h:
+        (DOMWindowNotifications):
+        * Modules/notifications/NotificationController.cpp:
+        (WebCore::NotificationController::supplementName):
+        * Modules/notifications/NotificationController.h:
+        (NotificationController):
+        * Modules/notifications/WorkerContextNotifications.cpp:
+        (WebCore::WorkerContextNotifications::supplementName):
+        (WebCore):
+        (WebCore::WorkerContextNotifications::from):
+        * Modules/notifications/WorkerContextNotifications.h:
+        (WorkerContextNotifications):
+        * Modules/quota/DOMWindowQuota.cpp:
+        (WebCore::DOMWindowQuota::supplementName):
+        (WebCore):
+        (WebCore::DOMWindowQuota::from):
+        * Modules/quota/DOMWindowQuota.h:
+        (DOMWindowQuota):
+        * Modules/speech/DOMWindowSpeechSynthesis.cpp:
+        (WebCore::DOMWindowSpeechSynthesis::supplementName):
+        (WebCore):
+        (WebCore::DOMWindowSpeechSynthesis::from):
+        * Modules/speech/DOMWindowSpeechSynthesis.h:
+        (DOMWindowSpeechSynthesis):
+        * Modules/speech/SpeechRecognitionController.cpp:
+        (WebCore::SpeechRecognitionController::supplementName):
+        * Modules/speech/SpeechRecognitionController.h:
+        (SpeechRecognitionController):
+        * Modules/vibration/Vibration.cpp:
+        (WebCore::Vibration::supplementName):
+        * Modules/vibration/Vibration.h:
+        (Vibration):
+        * Modules/webdatabase/DatabaseContext.cpp:
+        (WebCore::DatabaseContext::supplementName):
+        (WebCore):
+        (WebCore::DatabaseContext::existingDatabaseContextFrom):
+        (WebCore::DatabaseContext::from):
+        * Modules/webdatabase/DatabaseContext.h:
+        (DatabaseContext):
+        * dom/ContextFeatures.cpp:
+        (WebCore::ContextFeatures::supplementName):
+        * dom/ContextFeatures.h:
+        * dom/DeviceMotionController.cpp:
+        (WebCore::DeviceMotionController::supplementName):
+        * dom/DeviceMotionController.h:
+        (DeviceMotionController):
+        * dom/DeviceOrientationController.cpp:
+        (WebCore::DeviceOrientationController::supplementName):
+        * dom/DeviceOrientationController.h:
+        (DeviceOrientationController):
+        * loader/PrerendererClient.cpp:
+        (WebCore::PrerendererClient::supplementName):
+        * loader/PrerendererClient.h:
+        (PrerendererClient):
+        * page/DOMWindowPagePopup.cpp:
+        (WebCore::DOMWindowPagePopup::supplementName):
+        * page/DOMWindowPagePopup.h:
+        (DOMWindowPagePopup):
+        * page/SpeechInput.cpp:
+        (WebCore::SpeechInput::supplementName):
+        * page/SpeechInput.h:
+        (SpeechInput):
+        * platform/RefCountedSupplement.h:
+        (WebCore::RefCountedSupplement::provideTo):
+        (WebCore::RefCountedSupplement::from):
+        * platform/Supplementable.h:
+        (WebCore):
+        (WebCore::Supplement::provideTo):
+        (WebCore::Supplement::from):
+        (WebCore::Supplementable::provideSupplement):
+        (WebCore::Supplementable::removeSupplement):
+        (WebCore::Supplementable::requireSupplement):
+        (Supplementable):
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::supplementName):
+        (WebCore):
+        (WebCore::InternalSettings::from):
+        * testing/InternalSettings.h:
+        (InternalSettings):
+
 2013-01-22  Hajime Morrita  <morrita@google.com>
 
         non-ENABLE(DETAILS_ELEMENT) build fails.
index 390f248..4e2cc2a 100644 (file)
@@ -89,10 +89,9 @@ void BatteryController::didChangeBatteryStatus(const AtomicString& eventType, Pa
         (*it)->didChangeBatteryStatus(event, battery);
 }
 
-const AtomicString& BatteryController::supplementName()
+const char* BatteryController::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("BatteryController", AtomicString::ConstructFromLiteral));
-    return name;
+    return "BatteryController";
 }
 
 bool BatteryController::isActive(Page* page)
index 4f1c922..e43a092 100644 (file)
@@ -43,7 +43,7 @@ public:
 
     BatteryClient* client() const { return m_client; }
 
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static BatteryController* from(Page* page) { return static_cast<BatteryController*>(Supplement<Page>::from(page, supplementName())); }
     static bool isActive(Page*);
 
index 73d892e..6ae0c9d 100644 (file)
@@ -48,13 +48,17 @@ BatteryManager* NavigatorBattery::webkitBattery(Navigator* navigator)
     return navigatorBattery->m_batteryManager.get();
 }
 
+const char* NavigatorBattery::supplementName()
+{
+    return "NavigatorBattery";
+}
+
 NavigatorBattery* NavigatorBattery::from(Navigator* navigator)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorBattery", AtomicString::ConstructFromLiteral));
-    NavigatorBattery* supplement = static_cast<NavigatorBattery*>(Supplement<Navigator>::from(navigator, name));
+    NavigatorBattery* supplement = static_cast<NavigatorBattery*>(Supplement<Navigator>::from(navigator, supplementName()));
     if (!supplement) {
         supplement = new NavigatorBattery();
-        provideTo(navigator, name, adoptPtr(supplement));
+        provideTo(navigator, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index 238f354..af7114f 100644 (file)
@@ -41,6 +41,7 @@ public:
 
  private:
     NavigatorBattery();
+    static const char* supplementName();
 
     RefPtr<BatteryManager> m_batteryManager;
 };
index 91bea3e..4372615 100644 (file)
@@ -56,11 +56,10 @@ DOMFileSystem* DraggedIsolatedFileSystem::getDOMFileSystem(ScriptExecutionContex
 }
 
 // static
-const AtomicString& DraggedIsolatedFileSystem::supplementName()
+const char* DraggedIsolatedFileSystem::supplementName()
 {
     ASSERT(isMainThread());
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("DraggedIsolatedFileSystem", AtomicString::ConstructFromLiteral));
-    return name;
+    return "DraggedIsolatedFileSystem";
 }
 
 DraggedIsolatedFileSystem::DraggedIsolatedFileSystem(const String& filesystemId)
index 87896e5..2d87d98 100644 (file)
@@ -35,7 +35,6 @@
 
 #include "ChromiumDataObject.h"
 #include <wtf/Forward.h>
-#include <wtf/text/AtomicString.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -54,7 +53,7 @@ public:
     const String& filesystemId() const { return m_filesystemId; }
     DOMFileSystem* getDOMFileSystem(ScriptExecutionContext*);
 
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static DraggedIsolatedFileSystem* from(ChromiumDataObject* dataObject) { return static_cast<DraggedIsolatedFileSystem*>(Supplement<ChromiumDataObject>::from(dataObject, supplementName())); }
 
 private:
index 8648f0b..2079e78 100644 (file)
@@ -43,13 +43,17 @@ NavigatorGamepad::~NavigatorGamepad()
 {
 }
 
+const char* NavigatorGamepad::supplementName()
+{
+    return "NavigatorGamepad";
+}
+
 NavigatorGamepad* NavigatorGamepad::from(Navigator* navigator)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorGamepad", AtomicString::ConstructFromLiteral));
-    NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Navigator>::from(navigator, name));
+    NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Navigator>::from(navigator, supplementName()));
     if (!supplement) {
         supplement = new NavigatorGamepad();
-        provideTo(navigator, name, adoptPtr(supplement));
+        provideTo(navigator, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index d4d400a..3ee8ba9 100644 (file)
@@ -46,6 +46,7 @@ public:
 
 private:
     NavigatorGamepad();
+    static const char* supplementName();
 
     RefPtr<GamepadList> m_gamepads;
 };
index 4e6f58e..fca4563 100644 (file)
@@ -132,10 +132,9 @@ GeolocationPosition* GeolocationController::lastPosition()
     return m_client->lastPosition();
 }
 
-const AtomicString& GeolocationController::supplementName()
+const char* GeolocationController::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("GeolocationController", AtomicString::ConstructFromLiteral));
-    return name;
+    return "GeolocationController";
 }
 
 void provideGeolocationTo(Page* page, GeolocationClient* client)
index bc61b9e..c4689ac 100644 (file)
@@ -61,7 +61,7 @@ public:
 
     GeolocationClient* client() { return m_client; }
 
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static GeolocationController* from(Page* page) { return static_cast<GeolocationController*>(Supplement<Page>::from(page, supplementName())); }
 
 private:
index b7c24bb..88bd4b9 100644 (file)
@@ -42,13 +42,17 @@ NavigatorGeolocation::~NavigatorGeolocation()
 {
 }
 
+const char* NavigatorGeolocation::supplementName()
+{
+    return "NavigatorGeolocation";
+}
+
 NavigatorGeolocation* NavigatorGeolocation::from(Navigator* navigator)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorGeolocation", AtomicString::ConstructFromLiteral));
-    NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(navigator, name));
+    NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(navigator, supplementName()));
     if (!supplement) {
         supplement = new NavigatorGeolocation(navigator->frame());
-        provideTo(navigator, name, adoptPtr(supplement));
+        provideTo(navigator, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index 6f9d805..0130a2c 100644 (file)
@@ -41,6 +41,7 @@ public:
 
 private:
     NavigatorGeolocation(Frame*);
+    static const char* supplementName();
 
     mutable RefPtr<Geolocation> m_geolocation;
 };
index 8db5e9d..a616913 100644 (file)
@@ -47,13 +47,17 @@ DOMWindowIndexedDatabase::~DOMWindowIndexedDatabase()
 {
 }
 
+const char* DOMWindowIndexedDatabase::supplementName()
+{
+    return "DOMWindowIndexedDatabase";
+}
+
 DOMWindowIndexedDatabase* DOMWindowIndexedDatabase::from(DOMWindow* window)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("DOMWindowIndexedDatabase", AtomicString::ConstructFromLiteral));
-    DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*>(Supplement<DOMWindow>::from(window, name));
+    DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*>(Supplement<DOMWindow>::from(window, supplementName()));
     if (!supplement) {
         supplement = new DOMWindowIndexedDatabase(window);
-        provideTo(window, name, adoptPtr(supplement));
+        provideTo(window, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index c8c6303..108a5a2 100644 (file)
@@ -53,6 +53,7 @@ private:
     explicit DOMWindowIndexedDatabase(DOMWindow*);
 
     IDBFactory* indexedDB();
+    static const char* supplementName();
 
     DOMWindow* m_window;
     RefPtr<IDBFactory> m_idbFactory;
index ad3d596..840ef08 100644 (file)
@@ -41,13 +41,17 @@ PageGroupIndexedDatabase::~PageGroupIndexedDatabase()
 {
 }
 
+const char* PageGroupIndexedDatabase::supplementName()
+{
+    return "PageGroupIndexedDatabase";
+}
+
 PageGroupIndexedDatabase* PageGroupIndexedDatabase::from(PageGroup& group)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("PageGroupIndexedDatabase", AtomicString::ConstructFromLiteral));
-    PageGroupIndexedDatabase* supplement = static_cast<PageGroupIndexedDatabase*>(Supplement<PageGroup>::from(&group, name));
+    PageGroupIndexedDatabase* supplement = static_cast<PageGroupIndexedDatabase*>(Supplement<PageGroup>::from(&group, supplementName()));
     if (!supplement) {
         supplement = new PageGroupIndexedDatabase();
-        provideTo(&group, name, adoptPtr(supplement));
+        provideTo(&group, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index 187c78a..ff78a65 100644 (file)
@@ -44,6 +44,7 @@ public:
 
 private:
     PageGroupIndexedDatabase();
+    static const char* supplementName();
 
     RefPtr<IDBFactoryBackendInterface> m_factoryBackend;
 };
index 0a25ea7..4048a79 100644 (file)
@@ -47,13 +47,17 @@ WorkerContextIndexedDatabase::~WorkerContextIndexedDatabase()
 {
 }
 
+const char* WorkerContextIndexedDatabase::supplementName()
+{
+    return "WorkerContextIndexedDatabase";
+}
+
 WorkerContextIndexedDatabase* WorkerContextIndexedDatabase::from(ScriptExecutionContext* context)
 {
-    AtomicString name = "WorkderContextIndexedDatabase";
-    WorkerContextIndexedDatabase* supplement = static_cast<WorkerContextIndexedDatabase*>(Supplement<ScriptExecutionContext>::from(context, name));
+    WorkerContextIndexedDatabase* supplement = static_cast<WorkerContextIndexedDatabase*>(Supplement<ScriptExecutionContext>::from(context, supplementName()));
     if (!supplement) {
         supplement = new WorkerContextIndexedDatabase(context);
-        provideTo(context, name, adoptPtr(supplement));
+        provideTo(context, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index 9a84f17..30bbe0a 100644 (file)
@@ -48,6 +48,7 @@ private:
     explicit WorkerContextIndexedDatabase(ScriptExecutionContext*);
 
     IDBFactory* indexedDB();
+    static const char* supplementName();
 
     ScriptExecutionContext* m_context;
     RefPtr<IDBFactoryBackendInterface> m_factoryBackend;
index 7addb06..efba591 100644 (file)
@@ -43,14 +43,18 @@ DOMWindowIntents::~DOMWindowIntents()
 {
 }
 
+const char* DOMWindowIntents::supplementName()
+{
+    return "DOMWindowIntents";
+}
+
 DOMWindowIntents* DOMWindowIntents::from(DOMWindow* window)
 {
     ASSERT(window);
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("DOMWindowIntents", AtomicString::ConstructFromLiteral));
-    DOMWindowIntents* supplement = static_cast<DOMWindowIntents*>(Supplement<DOMWindow>::from(window, name));
+    DOMWindowIntents* supplement = static_cast<DOMWindowIntents*>(Supplement<DOMWindow>::from(window, supplementName()));
     if (!supplement) {
         supplement = new DOMWindowIntents(window);
-        provideTo(window, name, adoptPtr(supplement));
+        provideTo(window, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index 9f5be8b..a095fe5 100644 (file)
@@ -50,6 +50,7 @@ private:
     explicit DOMWindowIntents(DOMWindow*);
 
     DeliveredIntent* webkitIntent();
+    static const char* supplementName();
 
     RefPtr<DeliveredIntent> m_intent;
 };
index 69bf014..d46d4bc 100644 (file)
 
 namespace WebCore {
 
-const AtomicString& UserMediaController::supplementName()
+const char* UserMediaController::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("UserMediaController", AtomicString::ConstructFromLiteral));
-    return name;
+    return "UserMediaController";
 }
 
 UserMediaController::UserMediaController(UserMediaClient* client)
index e595338..67fc49f 100644 (file)
@@ -42,7 +42,7 @@ public:
     void cancelUserMediaRequest(UserMediaRequest*);
 
     static PassOwnPtr<UserMediaController> create(UserMediaClient*);
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static UserMediaController* from(Page* page) { return static_cast<UserMediaController*>(Supplement<Page>::from(page, supplementName())); }
 
 protected:
index e8dd493..0e93c3f 100644 (file)
@@ -201,10 +201,9 @@ void NavigatorContentUtils::unregisterProtocolHandler(Navigator* navigator, cons
 }
 #endif
 
-const AtomicString& NavigatorContentUtils::supplementName()
+const char* NavigatorContentUtils::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorContentUtils", AtomicString::ConstructFromLiteral));
-    return name;
+    return "NavigatorContentUtils";
 }
 
 void provideNavigatorContentUtilsTo(Page* page, NavigatorContentUtilsClient* client)
index f4d6ea2..99151c2 100644 (file)
@@ -45,7 +45,7 @@ class NavigatorContentUtils : public RefCountedSupplement<Page, NavigatorContent
 public:
     virtual ~NavigatorContentUtils();
 
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static NavigatorContentUtils* from(Page*);
 
     static void registerProtocolHandler(Navigator*, const String& scheme, const String& url, const String& title, ExceptionCode&);
index fd76971..a75327c 100644 (file)
@@ -43,13 +43,17 @@ NavigatorNetworkInfoConnection::~NavigatorNetworkInfoConnection()
 {
 }
 
+const char* NavigatorNetworkInfoConnection::supplementName()
+{
+    return "NavigatorNetworkInfoConnection";
+}
+
 NavigatorNetworkInfoConnection* NavigatorNetworkInfoConnection::from(Navigator* navigator)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorNetworkInfoConnection", AtomicString::ConstructFromLiteral));
-    NavigatorNetworkInfoConnection* supplement = static_cast<NavigatorNetworkInfoConnection*>(Supplement<Navigator>::from(navigator, name));
+    NavigatorNetworkInfoConnection* supplement = static_cast<NavigatorNetworkInfoConnection*>(Supplement<Navigator>::from(navigator, supplementName()));
     if (!supplement) {
         supplement = new NavigatorNetworkInfoConnection();
-        provideTo(navigator, name, adoptPtr(supplement));
+        provideTo(navigator, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index 8f227ce..9091a58 100644 (file)
@@ -44,6 +44,7 @@ public:
 
 private:
     NavigatorNetworkInfoConnection();
+    static const char* supplementName();
 
     RefPtr<NetworkInfoConnection> m_connection;
 };
index f714b30..e3ec420 100644 (file)
@@ -79,10 +79,9 @@ void NetworkInfoController::didChangeNetworkInformation(const AtomicString& even
          (*it)->didChangeNetworkInformation(event, networkInformation);
 }
 
-const AtomicString& NetworkInfoController::supplementName()
+const char* NetworkInfoController::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("NetworkInfoController", AtomicString::ConstructFromLiteral));
-    return name;
+    return "NetworkInfoController";
 }
 
 void provideNetworkInfoTo(Page* page, NetworkInfoClient* client)
index 4e6283b..5681ec8 100644 (file)
@@ -44,7 +44,7 @@ public:
 
     static PassOwnPtr<NetworkInfoController> create(Page*, NetworkInfoClient*);
 
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static NetworkInfoController* from(Page* page) { return static_cast<NetworkInfoController*>(Supplement<Page>::from(page, supplementName())); }
    
     void addListener(NetworkInfoConnection*);
index 4c556de..21a6b93 100644 (file)
@@ -47,13 +47,17 @@ DOMWindowNotifications::~DOMWindowNotifications()
 {
 }
 
+const char* DOMWindowNotifications::supplementName()
+{
+    return "DOMWindowNotifications";
+}
+
 DOMWindowNotifications* DOMWindowNotifications::from(DOMWindow* window)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, supplementName, ("DOMWindowNotifications", AtomicString::ConstructFromLiteral));
-    DOMWindowNotifications* supplement = static_cast<DOMWindowNotifications*>(Supplement<DOMWindow>::from(window, supplementName));
+    DOMWindowNotifications* supplement = static_cast<DOMWindowNotifications*>(Supplement<DOMWindow>::from(window, supplementName()));
     if (!supplement) {
         supplement = new DOMWindowNotifications(window);
-        Supplement<DOMWindow>::provideTo(window, supplementName, adoptPtr(supplement));
+        Supplement<DOMWindow>::provideTo(window, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index c06d7de..93a78e6 100644 (file)
@@ -55,6 +55,7 @@ private:
     explicit DOMWindowNotifications(DOMWindow*);
 
     NotificationCenter* webkitNotifications();
+    static const char* supplementName();
 
     DOMWindow* m_window;
     RefPtr<NotificationCenter> m_notificationCenter;
index 0dc1973..0a90889 100644 (file)
@@ -56,10 +56,9 @@ NotificationClient* NotificationController::clientFrom(Page* page)
     return 0;
 }
 
-const AtomicString& NotificationController::supplementName()
+const char* NotificationController::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("NotificationController", AtomicString::ConstructFromLiteral));
-    return name;
+    return "NotificationController";
 }
 
 void provideNotification(Page* page, NotificationClient* client)
index 73dc8ad..751d477 100644 (file)
@@ -42,7 +42,7 @@ public:
     ~NotificationController();
 
     static PassOwnPtr<NotificationController> create(NotificationClient*);
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static NotificationController* from(Page* page) { return static_cast<NotificationController*>(Supplement<Page>::from(page, supplementName())); }
     static NotificationClient* clientFrom(Page*);
 
index 218fe1d..9b1a4c0 100644 (file)
@@ -45,13 +45,17 @@ WorkerContextNotifications::~WorkerContextNotifications()
 {
 }
 
+const char* WorkerContextNotifications::supplementName()
+{
+    return "WorkerContextNotifications";
+}
+
 WorkerContextNotifications* WorkerContextNotifications::from(WorkerContext* context)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, supplementName, ("WorkerContextNotifications", AtomicString::ConstructFromLiteral));
-    WorkerContextNotifications* supplement = static_cast<WorkerContextNotifications*>(Supplement<ScriptExecutionContext>::from(context, supplementName));
+    WorkerContextNotifications* supplement = static_cast<WorkerContextNotifications*>(Supplement<ScriptExecutionContext>::from(context, supplementName()));
     if (!supplement) {
         supplement = new WorkerContextNotifications(context);
-        Supplement<ScriptExecutionContext>::provideTo(context, supplementName, adoptPtr(supplement));
+        Supplement<ScriptExecutionContext>::provideTo(context, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index 6354fca..a45e044 100644 (file)
@@ -48,6 +48,7 @@ private:
     explicit WorkerContextNotifications(WorkerContext*);
 
     NotificationCenter* webkitNotifications();
+    static const char* supplementName();
 
     WorkerContext* m_context;
     RefPtr<NotificationCenter> m_notificationCenter;
index f6e2892..b51ac6a 100644 (file)
@@ -48,14 +48,18 @@ DOMWindowQuota::~DOMWindowQuota()
 {
 }
 
+const char* DOMWindowQuota::supplementName()
+{
+    return "DOMWindowQuota";
+}
+
 // static
 DOMWindowQuota* DOMWindowQuota::from(DOMWindow* window)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("DOMWindowQuota", AtomicString::ConstructFromLiteral));
-    DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(Supplement<DOMWindow>::from(window, name));
+    DOMWindowQuota* supplement = static_cast<DOMWindowQuota*>(Supplement<DOMWindow>::from(window, supplementName()));
     if (!supplement) {
         supplement = new DOMWindowQuota(window);
-        provideTo(window, name, adoptPtr(supplement));
+        provideTo(window, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index 69a7419..ccd434a 100644 (file)
@@ -50,6 +50,8 @@ public:
 
 private:
     explicit DOMWindowQuota(DOMWindow*);
+    static const char* supplementName();
+
     mutable RefPtr<StorageInfo> m_storageInfo;
 };
 
index 9d336bb..57f2253 100644 (file)
@@ -47,14 +47,18 @@ DOMWindowSpeechSynthesis::~DOMWindowSpeechSynthesis()
 {
 }
 
+const char* DOMWindowSpeechSynthesis::supplementName()
+{
+    return "DOMWindowSpeechSynthesis";
+}
+
 // static
 DOMWindowSpeechSynthesis* DOMWindowSpeechSynthesis::from(DOMWindow* window)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("DOMWindowSpeechSynthesis", AtomicString::ConstructFromLiteral));
-    DOMWindowSpeechSynthesis* supplement = static_cast<DOMWindowSpeechSynthesis*>(Supplement<DOMWindow>::from(window, name));
+    DOMWindowSpeechSynthesis* supplement = static_cast<DOMWindowSpeechSynthesis*>(Supplement<DOMWindow>::from(window, upplementName()));
     if (!supplement) {
         supplement = new DOMWindowSpeechSynthesis(window);
-        provideTo(window, name, adoptPtr(supplement));
+        provideTo(window, supplementName(), adoptPtr(supplement));
     }
     return supplement;
 }
index 0c94e1a..c51d1f4 100644 (file)
@@ -47,6 +47,7 @@ private:
     explicit DOMWindowSpeechSynthesis(DOMWindow*);
     
     SpeechSynthesis* speechSynthesis();
+    static const char* supplementName();
     
     RefPtr<SpeechSynthesis> m_speechSynthesis;
 };
index 5148110..26d4baa 100644 (file)
 
 namespace WebCore {
 
-const AtomicString& SpeechRecognitionController::supplementName()
+const char* SpeechRecognitionController::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("SpeechRecognitionController", AtomicString::ConstructFromLiteral));
-    return name;
+    return "SpeechRecognitionController";
 }
 
 SpeechRecognitionController::SpeechRecognitionController(SpeechRecognitionClient* client)
index b34d0fe..efb3c39 100644 (file)
@@ -47,7 +47,7 @@ public:
     void abort(SpeechRecognition* recognition) { m_client->abort(recognition); }
 
     static PassOwnPtr<SpeechRecognitionController> create(SpeechRecognitionClient*);
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static SpeechRecognitionController* from(Page* page) { return static_cast<SpeechRecognitionController*>(Supplement<Page>::from(page, supplementName())); }
 
 private:
index 3c7d7ca..ae9dbe2 100644 (file)
@@ -126,10 +126,9 @@ void Vibration::timerStopFired(Timer<Vibration>* timer)
     }
 }
 
-const AtomicString& Vibration::supplementName()
+const char* Vibration::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("Vibration", AtomicString::ConstructFromLiteral));
-    return name;
+    return "Vibration";
 }
 
 bool Vibration::isActive(Page* page)
index 08f8c0c..9e2bc43 100644 (file)
@@ -49,7 +49,7 @@ public:
     void timerStartFired(Timer<Vibration>*);
     void timerStopFired(Timer<Vibration>*);
 
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static Vibration* from(Page* page) { return static_cast<Vibration*>(Supplement<Page>::from(page, supplementName())); }
     static bool isActive(Page*);
 
index 6835b5d..7d94d37 100644 (file)
 
 namespace WebCore {
 
-static DatabaseContext* existingDatabaseContextFrom(ScriptExecutionContext* context)
+const char* DatabaseContext::supplementName()
 {
-    return static_cast<DatabaseContext*>(Supplement<ScriptExecutionContext>::from(context, "DatabaseContext"));
+    return "DatabaseContext";
+}
+
+DatabaseContext* DatabaseContext::existingDatabaseContextFrom(ScriptExecutionContext* context)
+{
+    return static_cast<DatabaseContext*>(Supplement<ScriptExecutionContext>::from(context, supplementName()));
 }
 
 DatabaseContext::DatabaseContext(ScriptExecutionContext* context)
@@ -68,7 +73,7 @@ DatabaseContext* DatabaseContext::from(ScriptExecutionContext* context)
     DatabaseContext* supplement = existingDatabaseContextFrom(context);
     if (!supplement) {
         supplement = new DatabaseContext(context);
-        provideTo(context, "DatabaseContext", adoptPtr(supplement));
+        provideTo(context, supplementName(), adoptPtr(supplement));
         ASSERT(supplement == existingDatabaseContextFrom(context));
     }
     return supplement;
index b513ebf..e5d4257 100644 (file)
@@ -59,6 +59,8 @@ public:
 
 private:
     explicit DatabaseContext(ScriptExecutionContext*);
+    static const char* supplementName();
+    static DatabaseContext* existingDatabaseContextFrom(ScriptExecutionContext*);
 
     ScriptExecutionContext* m_scriptExecutionContext;
     RefPtr<DatabaseThread> m_databaseThread;
index 71ce8ac..65992e5 100644 (file)
@@ -39,10 +39,9 @@ ContextFeaturesClient* ContextFeaturesClient::empty()
     return &empty;
 }
 
-const AtomicString& ContextFeatures::supplementName()
+const char* ContextFeatures::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("ContextFeatures", AtomicString::ConstructFromLiteral));
-    return name;
+    return "ContextFeatures";
 }
 
 ContextFeatures* ContextFeatures::defaultSwitch()
index b799285..2dcf011 100644 (file)
@@ -48,7 +48,7 @@ public:
         FeatureTypeSize // Should be the last entry.
     };
 
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static ContextFeatures* defaultSwitch();
     static PassRefPtr<ContextFeatures> create(ContextFeaturesClient*);
 
index 6661edc..b573701 100644 (file)
@@ -66,10 +66,9 @@ PassRefPtr<Event> DeviceMotionController::getLastEvent()
     return DeviceMotionEvent::create(eventNames().devicemotionEvent, deviceMotionClient()->lastMotion());
 }
 
-const AtomicString& DeviceMotionController::supplementName()
+const char* DeviceMotionController::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("DeviceMotionController", AtomicString::ConstructFromLiteral));
-    return name;
+    return "DeviceMotionController";
 }
 
 DeviceMotionController* DeviceMotionController::from(Page* page)
index e3d72a9..29bf913 100644 (file)
@@ -46,7 +46,7 @@ public:
     virtual bool hasLastData() OVERRIDE;
     virtual PassRefPtr<Event> getLastEvent() OVERRIDE;
 
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static DeviceMotionController* from(Page*);
     static bool isActiveAt(Page*);
 
index ff1c219..9526766 100644 (file)
@@ -68,10 +68,9 @@ PassRefPtr<Event> DeviceOrientationController::getLastEvent()
     return DeviceOrientationEvent::create(eventNames().deviceorientationEvent, deviceOrientationClient()->lastOrientation());
 }
 
-const AtomicString& DeviceOrientationController::supplementName()
+const char* DeviceOrientationController::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("DeviceOrientationController", AtomicString::ConstructFromLiteral));
-    return name;
+    return "DeviceOrientationController";
 }
 
 DeviceOrientationController* DeviceOrientationController::from(Page* page)
index 0021195..19c0284 100644 (file)
@@ -47,7 +47,7 @@ public:
     virtual bool hasLastData() OVERRIDE;
     virtual PassRefPtr<Event> getLastEvent() OVERRIDE;
 
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static DeviceOrientationController* from(Page*);
     static bool isActiveAt(Page*);
 
index dad289c..8670113 100644 (file)
 
 #include "Page.h"
 #include "Supplementable.h"
-#include <wtf/text/AtomicString.h>
 
 #if ENABLE(LINK_PRERENDER)
 
 namespace WebCore {
 
 // static
-const AtomicString& PrerendererClient::supplementName()
+const char* PrerendererClient::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("PrerendererClient", AtomicString::ConstructFromLiteral));
-    return name;
+    return "PrerendererClient";
 }
 
 // static
index 5a4ce94..335158d 100644 (file)
@@ -49,7 +49,7 @@ public:
 
     virtual void willAddPrerender(PrerenderHandle*) = 0;
 
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static PrerendererClient* from(Page*);
 
 protected:
index b9fc7ca..1e16a47 100644 (file)
@@ -48,10 +48,9 @@ DOMWindowPagePopup::~DOMWindowPagePopup()
     m_controller->clearPagePopupClient();
 }
 
-const AtomicString& DOMWindowPagePopup::supplementName()
+const char* DOMWindowPagePopup::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("DOMWindowPagePopup", AtomicString::ConstructFromLiteral));
-    return name;
+    return "DOMWindowPagePopup";
 }
 
 PagePopupController* DOMWindowPagePopup::pagePopupController(DOMWindow* window)
index 8559974..87949bc 100644 (file)
@@ -49,7 +49,7 @@ public:
 
 private:
     explicit DOMWindowPagePopup(PagePopupClient*);
-    static const AtomicString& supplementName();
+    static const char* supplementName();
 
     RefPtr<PagePopupController> m_controller;
 };
index cb4a21f..228d3fc 100644 (file)
@@ -117,10 +117,9 @@ void SpeechInput::cancelRecognition(int listenerId)
     m_client->cancelRecognition(listenerId);
 }
 
-const AtomicString& SpeechInput::supplementName()
+const char* SpeechInput::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("SpeechInput", AtomicString::ConstructFromLiteral));
-    return name;
+    return "SpeechInput";
 }
 
 void provideSpeechInputTo(Page* page, SpeechInputClient* client)
index 38113a0..447f632 100644 (file)
@@ -55,7 +55,7 @@ public:
     virtual ~SpeechInput();
 
     static PassOwnPtr<SpeechInput> create(SpeechInputClient*);
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static SpeechInput* from(Page* page) { return static_cast<SpeechInput*>(Supplement<Page>::from(page, supplementName())); }
 
     // Generates a unique ID for the given listener to be used for speech requests.
index cfbeb5a..4bdc56f 100644 (file)
@@ -53,12 +53,12 @@ public:
         RefPtr<ThisType> m_wrapped;
     };
 
-    static void provideTo(Supplementable<T>* host, const AtomicString& key, PassRefPtr<ThisType> supplement)
+    static void provideTo(Supplementable<T>* host, const char* key, PassRefPtr<ThisType> supplement)
     {
         host->provideSupplement(key, adoptPtr(new Wrapper(supplement)));
     }
 
-    static ThisType* from(Supplementable<T>* host, const AtomicString& key)
+    static ThisType* from(Supplementable<T>* host, const char* key)
     {
         Supplement<T>* found = host->requireSupplement(key);
         if (!found)
index 0a278fc..1b81cf7 100644 (file)
 #define Supplementable_h
 
 #include <wtf/HashMap.h>
+#include <wtf/OwnPtr.h>
 #include <wtf/PassOwnPtr.h>
-#include <wtf/text/AtomicString.h>
-#include <wtf/text/AtomicStringHash.h>
 
 namespace WebCore {
 
+// What you should know about the Supplement keys
+// ==============================================
+// The Supplement is expected to use the same const char* string instance
+// as its key. The Supplementable's SupplementMap will use the address of the
+// string as the key and not the characters themselves. Hence, 2 strings with
+// the same characters will be treated as 2 different keys.
+//
+// In practice, it is recommended that Supplements implements a static method
+// for returning its key to use. For example:
+//
+//     class MyClass : public Supplement<MySupplementable> {
+//         ...
+//         static const char* supplementName();
+//     }
+//
+//     const char* MyClass::supplementName()
+//     {
+//         return "MyClass";
+//     }
+//
+// An example of the using the key:
+//
+//     MyClass* MyClass::from(MySupplementable* host)
+//     {
+//         return reinterpret_cast<MyClass*>(Supplement<MySupplementable>::from(host, supplementName()));
+//     }
+
 template<typename T>
 class Supplementable;
 
@@ -44,12 +70,12 @@ public:
     virtual bool isRefCountedWrapper() const { return false; }
 #endif
 
-    static void provideTo(Supplementable<T>* host, const AtomicString& key, PassOwnPtr<Supplement<T> > supplement)
+    static void provideTo(Supplementable<T>* host, const char* key, PassOwnPtr<Supplement<T> > supplement)
     {
         host->provideSupplement(key, supplement);
     }
 
-    static Supplement<T>* from(Supplementable<T>* host, const AtomicString& key)
+    static Supplement<T>* from(Supplementable<T>* host, const char* key)
     {
         return host ? host->requireSupplement(key) : 0;
     }
@@ -58,24 +84,24 @@ public:
 template<typename T>
 class Supplementable {
 public:
-    void provideSupplement(const AtomicString& key, PassOwnPtr<Supplement<T> > supplement)
+    void provideSupplement(const char* key, PassOwnPtr<Supplement<T> > supplement)
     {
-        ASSERT(!m_supplements.get(key.impl()));
+        ASSERT(!m_supplements.get(key));
         m_supplements.set(key, supplement);
     }
 
-    void removeSupplement(const AtomicString& key)
+    void removeSupplement(const char* key)
     {
         m_supplements.remove(key);
     }
 
-    Supplement<T>* requireSupplement(const AtomicString& key)
+    Supplement<T>* requireSupplement(const char* key)
     {
         return m_supplements.get(key);
     }
 
 private:
-    typedef HashMap<AtomicString, OwnPtr<Supplement<T> > > SupplementMap;
+    typedef HashMap<const char*, OwnPtr<Supplement<T> >, PtrHash<const char*> > SupplementMap;
     SupplementMap m_supplements;
 };
 
index bf33a14..82e8f44 100644 (file)
@@ -145,12 +145,16 @@ private:
     RefPtr<InternalSettings> m_internalSettings;
 };
 
+const char* InternalSettings::supplementName()
+{
+    return "InternalSettings";
+}
+
 InternalSettings* InternalSettings::from(Page* page)
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("InternalSettings", AtomicString::ConstructFromLiteral));
-    if (!Supplement<Page>::from(page, name))
-        Supplement<Page>::provideTo(page, name, adoptPtr(new InternalSettingsWrapper(page)));
-    return static_cast<InternalSettingsWrapper*>(Supplement<Page>::from(page, name))->internalSettings();
+    if (!Supplement<Page>::from(page, supplementName()))
+        Supplement<Page>::provideTo(page, supplementName(), adoptPtr(new InternalSettingsWrapper(page)));
+    return static_cast<InternalSettingsWrapper*>(Supplement<Page>::from(page, supplementName()))->internalSettings();
 }
 
 InternalSettings::~InternalSettings()
index ee7439b..50d7a77 100644 (file)
@@ -129,6 +129,7 @@ private:
 
     Settings* settings() const;
     Page* page() const { return m_page; }
+    static const char* supplementName();
 
     Page* m_page;
     Backup m_backup;
index 020cb70..7d80ea4 100644 (file)
@@ -1,3 +1,17 @@
+2013-01-22  Mark Lam  <mark.lam@apple.com>
+
+        Change the Supplementable class to not use AtomicString.
+        https://bugs.webkit.org/show_bug.cgi?id=107535.
+
+        Reviewed by Adam Barth.
+
+        Replaced the use of AtomicString keys with literal const char* keys.
+        This simplifies the SupplementMap and makes it slightly leaner and faster.
+
+        * src/ContextFeaturesClientImpl.cpp:
+        (ContextFeaturesCache):
+        (WebKit::ContextFeaturesCache::supplementName):
+
 2013-01-22  Leandro Gracia Gil  <leandrogracia@chromium.org>
 
         [Chromium] Expose didCommitCompositorFrame in WebWidgetClient.
index 41fd054..7c768dc 100644 (file)
@@ -77,7 +77,7 @@ public:
         bool m_defaultValue; // Needs to be traked as a part of the signature since it can be changed dynamically.
     };
 
-    static const AtomicString& supplementName();
+    static const char* supplementName();
     static ContextFeaturesCache* from(Document*);
 
     Entry& entryFor(ContextFeatures::FeatureType type)
@@ -94,10 +94,9 @@ private:
     Entry m_entries[ContextFeatures::FeatureTypeSize];
 };
 
-const AtomicString& ContextFeaturesCache::supplementName()
+const char* ContextFeaturesCache::supplementName()
 {
-    DEFINE_STATIC_LOCAL(AtomicString, name, ("ContextFeaturesCache"));
-    return name;
+    return "ContextFeaturesCache";
 }
 
 ContextFeaturesCache* ContextFeaturesCache::from(Document* document)