Commit e69ee170 authored by mark.lam@apple.com's avatar 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.

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: http://svn.webkit.org/repository/webkit/trunk@140509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7bd559c9
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> 2013-01-22 Hajime Morrita <morrita@google.com>
non-ENABLE(DETAILS_ELEMENT) build fails. non-ENABLE(DETAILS_ELEMENT) build fails.
...@@ -89,10 +89,9 @@ void BatteryController::didChangeBatteryStatus(const AtomicString& eventType, Pa ...@@ -89,10 +89,9 @@ void BatteryController::didChangeBatteryStatus(const AtomicString& eventType, Pa
(*it)->didChangeBatteryStatus(event, battery); (*it)->didChangeBatteryStatus(event, battery);
} }
const AtomicString& BatteryController::supplementName() const char* BatteryController::supplementName()
{ {
DEFINE_STATIC_LOCAL(AtomicString, name, ("BatteryController", AtomicString::ConstructFromLiteral)); return "BatteryController";
return name;
} }
bool BatteryController::isActive(Page* page) bool BatteryController::isActive(Page* page)
......
...@@ -43,7 +43,7 @@ public: ...@@ -43,7 +43,7 @@ public:
BatteryClient* client() const { return m_client; } 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 BatteryController* from(Page* page) { return static_cast<BatteryController*>(Supplement<Page>::from(page, supplementName())); }
static bool isActive(Page*); static bool isActive(Page*);
......
...@@ -48,13 +48,17 @@ BatteryManager* NavigatorBattery::webkitBattery(Navigator* navigator) ...@@ -48,13 +48,17 @@ BatteryManager* NavigatorBattery::webkitBattery(Navigator* navigator)
return navigatorBattery->m_batteryManager.get(); return navigatorBattery->m_batteryManager.get();
} }
const char* NavigatorBattery::supplementName()
{
return "NavigatorBattery";
}
NavigatorBattery* NavigatorBattery::from(Navigator* navigator) NavigatorBattery* NavigatorBattery::from(Navigator* navigator)
{ {
DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorBattery", AtomicString::ConstructFromLiteral)); NavigatorBattery* supplement = static_cast<NavigatorBattery*>(Supplement<Navigator>::from(navigator, supplementName()));
NavigatorBattery* supplement = static_cast<NavigatorBattery*>(Supplement<Navigator>::from(navigator, name));
if (!supplement) { if (!supplement) {
supplement = new NavigatorBattery(); supplement = new NavigatorBattery();
provideTo(navigator, name, adoptPtr(supplement)); provideTo(navigator, supplementName(), adoptPtr(supplement));
} }
return supplement; return supplement;
} }
......
...@@ -41,6 +41,7 @@ public: ...@@ -41,6 +41,7 @@ public:
private: private:
NavigatorBattery(); NavigatorBattery();
static const char* supplementName();
RefPtr<BatteryManager> m_batteryManager; RefPtr<BatteryManager> m_batteryManager;
}; };
......
...@@ -56,11 +56,10 @@ DOMFileSystem* DraggedIsolatedFileSystem::getDOMFileSystem(ScriptExecutionContex ...@@ -56,11 +56,10 @@ DOMFileSystem* DraggedIsolatedFileSystem::getDOMFileSystem(ScriptExecutionContex
} }
// static // static
const AtomicString& DraggedIsolatedFileSystem::supplementName() const char* DraggedIsolatedFileSystem::supplementName()
{ {
ASSERT(isMainThread()); ASSERT(isMainThread());
DEFINE_STATIC_LOCAL(AtomicString, name, ("DraggedIsolatedFileSystem", AtomicString::ConstructFromLiteral)); return "DraggedIsolatedFileSystem";
return name;
} }
DraggedIsolatedFileSystem::DraggedIsolatedFileSystem(const String& filesystemId) DraggedIsolatedFileSystem::DraggedIsolatedFileSystem(const String& filesystemId)
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include "ChromiumDataObject.h" #include "ChromiumDataObject.h"
#include <wtf/Forward.h> #include <wtf/Forward.h>
#include <wtf/text/AtomicString.h>
#include <wtf/text/WTFString.h> #include <wtf/text/WTFString.h>
namespace WebCore { namespace WebCore {
...@@ -54,7 +53,7 @@ public: ...@@ -54,7 +53,7 @@ public:
const String& filesystemId() const { return m_filesystemId; } const String& filesystemId() const { return m_filesystemId; }
DOMFileSystem* getDOMFileSystem(ScriptExecutionContext*); 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())); } static DraggedIsolatedFileSystem* from(ChromiumDataObject* dataObject) { return static_cast<DraggedIsolatedFileSystem*>(Supplement<ChromiumDataObject>::from(dataObject, supplementName())); }
private: private:
......
...@@ -43,13 +43,17 @@ NavigatorGamepad::~NavigatorGamepad() ...@@ -43,13 +43,17 @@ NavigatorGamepad::~NavigatorGamepad()
{ {
} }
const char* NavigatorGamepad::supplementName()
{
return "NavigatorGamepad";
}
NavigatorGamepad* NavigatorGamepad::from(Navigator* navigator) NavigatorGamepad* NavigatorGamepad::from(Navigator* navigator)
{ {
DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorGamepad", AtomicString::ConstructFromLiteral)); NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Navigator>::from(navigator, supplementName()));
NavigatorGamepad* supplement = static_cast<NavigatorGamepad*>(Supplement<Navigator>::from(navigator, name));
if (!supplement) { if (!supplement) {
supplement = new NavigatorGamepad(); supplement = new NavigatorGamepad();
provideTo(navigator, name, adoptPtr(supplement)); provideTo(navigator, supplementName(), adoptPtr(supplement));
} }
return supplement; return supplement;
} }
......
...@@ -46,6 +46,7 @@ public: ...@@ -46,6 +46,7 @@ public:
private: private:
NavigatorGamepad(); NavigatorGamepad();
static const char* supplementName();
RefPtr<GamepadList> m_gamepads; RefPtr<GamepadList> m_gamepads;
}; };
......
...@@ -132,10 +132,9 @@ GeolocationPosition* GeolocationController::lastPosition() ...@@ -132,10 +132,9 @@ GeolocationPosition* GeolocationController::lastPosition()
return m_client->lastPosition(); return m_client->lastPosition();
} }
const AtomicString& GeolocationController::supplementName() const char* GeolocationController::supplementName()
{ {
DEFINE_STATIC_LOCAL(AtomicString, name, ("GeolocationController", AtomicString::ConstructFromLiteral)); return "GeolocationController";
return name;
} }
void provideGeolocationTo(Page* page, GeolocationClient* client) void provideGeolocationTo(Page* page, GeolocationClient* client)
......
...@@ -61,7 +61,7 @@ public: ...@@ -61,7 +61,7 @@ public:
GeolocationClient* client() { return m_client; } 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())); } static GeolocationController* from(Page* page) { return static_cast<GeolocationController*>(Supplement<Page>::from(page, supplementName())); }
private: private:
......
...@@ -42,13 +42,17 @@ NavigatorGeolocation::~NavigatorGeolocation() ...@@ -42,13 +42,17 @@ NavigatorGeolocation::~NavigatorGeolocation()
{ {
} }
const char* NavigatorGeolocation::supplementName()
{
return "NavigatorGeolocation";
}
NavigatorGeolocation* NavigatorGeolocation::from(Navigator* navigator) NavigatorGeolocation* NavigatorGeolocation::from(Navigator* navigator)
{ {
DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorGeolocation", AtomicString::ConstructFromLiteral)); NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(navigator, supplementName()));
NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(navigator, name));
if (!supplement) { if (!supplement) {
supplement = new NavigatorGeolocation(navigator->frame()); supplement = new NavigatorGeolocation(navigator->frame());
provideTo(navigator, name, adoptPtr(supplement)); provideTo(navigator, supplementName(), adoptPtr(supplement));
} }
return supplement; return supplement;
} }
......
...@@ -41,6 +41,7 @@ public: ...@@ -41,6 +41,7 @@ public:
private: private:
NavigatorGeolocation(Frame*); NavigatorGeolocation(Frame*);
static const char* supplementName();
mutable RefPtr<Geolocation> m_geolocation; mutable RefPtr<Geolocation> m_geolocation;
}; };
......
...@@ -47,13 +47,17 @@ DOMWindowIndexedDatabase::~DOMWindowIndexedDatabase() ...@@ -47,13 +47,17 @@ DOMWindowIndexedDatabase::~DOMWindowIndexedDatabase()
{ {
} }
const char* DOMWindowIndexedDatabase::supplementName()
{
return "DOMWindowIndexedDatabase";
}
DOMWindowIndexedDatabase* DOMWindowIndexedDatabase::from(DOMWindow* window) DOMWindowIndexedDatabase* DOMWindowIndexedDatabase::from(DOMWindow* window)
{ {
DEFINE_STATIC_LOCAL(AtomicString, name, ("DOMWindowIndexedDatabase", AtomicString::ConstructFromLiteral)); DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*>(Supplement<DOMWindow>::from(window, supplementName()));
DOMWindowIndexedDatabase* supplement = static_cast<DOMWindowIndexedDatabase*>(Supplement<DOMWindow>::from(window, name));
if (!supplement) { if (!supplement) {
supplement = new DOMWindowIndexedDatabase(window); supplement = new DOMWindowIndexedDatabase(window);
provideTo(window, name, adoptPtr(supplement)); provideTo(window, supplementName(), adoptPtr(supplement));
} }
return supplement; return supplement;
} }
......
...@@ -53,6 +53,7 @@ private: ...@@ -53,6 +53,7 @@ private:
explicit DOMWindowIndexedDatabase(DOMWindow*); explicit DOMWindowIndexedDatabase(DOMWindow*);
IDBFactory* indexedDB(); IDBFactory* indexedDB();
static const char* supplementName();
DOMWindow* m_window; DOMWindow* m_window;
RefPtr<IDBFactory> m_idbFactory; RefPtr<IDBFactory> m_idbFactory;
......
...@@ -41,13 +41,17 @@ PageGroupIndexedDatabase::~PageGroupIndexedDatabase() ...@@ -41,13 +41,17 @@ PageGroupIndexedDatabase::~PageGroupIndexedDatabase()
{ {
} }
const char* PageGroupIndexedDatabase::supplementName()
{
return "PageGroupIndexedDatabase";
}
PageGroupIndexedDatabase* PageGroupIndexedDatabase::from(PageGroup& group) PageGroupIndexedDatabase* PageGroupIndexedDatabase::from(PageGroup& group)
{ {
DEFINE_STATIC_LOCAL(AtomicString, name, ("PageGroupIndexedDatabase", AtomicString::ConstructFromLiteral)); PageGroupIndexedDatabase* supplement = static_cast<PageGroupIndexedDatabase*>(Supplement<PageGroup>::from(&group, supplementName()));
PageGroupIndexedDatabase* supplement = static_cast<PageGroupIndexedDatabase*>(Supplement<PageGroup>::from(&group, name));
if (!supplement) { if (!supplement) {
supplement = new PageGroupIndexedDatabase(); supplement = new PageGroupIndexedDatabase();
provideTo(&group, name, adoptPtr(supplement)); provideTo(&group, supplementName(), adoptPtr(supplement));
} }
return supplement; return supplement;
} }
......
...@@ -44,6 +44,7 @@ public: ...@@ -44,6 +44,7 @@ public:
private: private:
PageGroupIndexedDatabase(); PageGroupIndexedDatabase();
static const char* supplementName();
RefPtr<IDBFactoryBackendInterface> m_factoryBackend; RefPtr<IDBFactoryBackendInterface> m_factoryBackend;
}; };
......
...@@ -47,13 +47,17 @@ WorkerContextIndexedDatabase::~WorkerContextIndexedDatabase() ...@@ -47,13 +47,17 @@ WorkerContextIndexedDatabase::~WorkerContextIndexedDatabase()
{ {
} }
const char* WorkerContextIndexedDatabase::supplementName()
{
return "WorkerContextIndexedDatabase";
}
WorkerContextIndexedDatabase* WorkerContextIndexedDatabase::from(ScriptExecutionContext* context) WorkerContextIndexedDatabase* WorkerContextIndexedDatabase::from(ScriptExecutionContext* context)
{ {
AtomicString name = "WorkderContextIndexedDatabase"; WorkerContextIndexedDatabase* supplement = static_cast<WorkerContextIndexedDatabase*>(Supplement<ScriptExecutionContext>::from(context, supplementName()));
WorkerContextIndexedDatabase* supplement = static_cast<WorkerContextIndexedDatabase*>(Supplement<ScriptExecutionContext>::from(context, name));
if (!supplement) { if (!supplement) {
supplement = new WorkerContextIndexedDatabase(context); supplement = new WorkerContextIndexedDatabase(context);
provideTo(context, name, adoptPtr(supplement)); provideTo(context, supplementName(), adoptPtr(supplement));
} }
return supplement; return supplement;
} }
......
...@@ -48,6 +48,7 @@ private: ...@@ -48,6 +48,7 @@ private:
explicit WorkerContextIndexedDatabase(ScriptExecutionContext*); explicit WorkerContextIndexedDatabase(ScriptExecutionContext*);
IDBFactory* indexedDB(); IDBFactory* indexedDB();
static const char* supplementName();
ScriptExecutionContext* m_context; ScriptExecutionContext* m_context;
RefPtr<IDBFactoryBackendInterface> m_factoryBackend; RefPtr<IDBFactoryBackendInterface> m_factoryBackend;
......
...@@ -43,14 +43,18 @@ DOMWindowIntents::~DOMWindowIntents() ...@@ -43,14 +43,18 @@ DOMWindowIntents::~DOMWindowIntents()
{ {
} }
const char* DOMWindowIntents::supplementName()
{
return "DOMWindowIntents";
}
DOMWindowIntents* DOMWindowIntents::from(DOMWindow* window) DOMWindowIntents* DOMWindowIntents::from(DOMWindow* window)
{ {
ASSERT(window); ASSERT(window);
DEFINE_STATIC_LOCAL(AtomicString, name, ("DOMWindowIntents", AtomicString::ConstructFromLiteral)); DOMWindowIntents* supplement = static_cast<DOMWindowIntents*>(Supplement<DOMWindow>::from(window, supplementName()));
DOMWindowIntents* supplement = static_cast<DOMWindowIntents*>(Supplement<DOMWindow>::from(window, name));
if (!supplement) { if (!supplement) {
supplement = new DOMWindowIntents(window); supplement = new DOMWindowIntents(window);
provideTo(window, name, adoptPtr(supplement)); provideTo(window, supplementName(), adoptPtr(supplement));
} }
return supplement; return supplement;
} }
......
...@@ -50,6 +50,7 @@ private: ...@@ -50,6 +50,7 @@ private:
explicit DOMWindowIntents(DOMWindow*); explicit DOMWindowIntents(DOMWindow*);
DeliveredIntent* webkitIntent(); DeliveredIntent* webkitIntent();
static const char* supplementName();
RefPtr<DeliveredIntent> m_intent; RefPtr<DeliveredIntent> m_intent;
}; };
......
...@@ -29,10 +29,9 @@ ...@@ -29,10 +29,9 @@
namespace WebCore { namespace WebCore {
const AtomicString& UserMediaController::supplementName() const char* UserMediaController::supplementName()
{