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>
non-ENABLE(DETAILS_ELEMENT) build fails.
......@@ -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)
......
......@@ -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*);
......
......@@ -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;
}
......
......@@ -41,6 +41,7 @@ public:
private:
NavigatorBattery();
static const char* supplementName();
RefPtr<BatteryManager> m_batteryManager;
};
......
......@@ -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)
......
......@@ -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:
......
......@@ -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;
}
......
......@@ -46,6 +46,7 @@ public:
private:
NavigatorGamepad();
static const char* supplementName();
RefPtr<GamepadList> m_gamepads;
};
......
......@@ -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)
......
......@@ -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:
......
......@@ -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;
}
......
......@@ -41,6 +41,7 @@ public:
private:
NavigatorGeolocation(Frame*);
static const char* supplementName();
mutable RefPtr<Geolocation> m_geolocation;
};
......
......@@ -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;
}
......
......@@ -53,6 +53,7 @@ private:
explicit DOMWindowIndexedDatabase(DOMWindow*);
IDBFactory* indexedDB();
static const char* supplementName();
DOMWindow* m_window;
RefPtr<IDBFactory> m_idbFactory;
......
......@@ -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;
}
......
......@@ -44,6 +44,7 @@ public:
private:
PageGroupIndexedDatabase();
static const char* supplementName();
RefPtr<IDBFactoryBackendInterface> m_factoryBackend;
};
......
......@@ -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;
}
......
......@@ -48,6 +48,7 @@ private:
explicit WorkerContextIndexedDatabase(ScriptExecutionContext*);
IDBFactory* indexedDB();
static const char* supplementName();
ScriptExecutionContext* m_context;
RefPtr<IDBFactoryBackendInterface> m_factoryBackend;
......
......@@ -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;
}
......
......@@ -50,6 +50,7 @@ private:
explicit DOMWindowIntents(DOMWindow*);
DeliveredIntent* webkitIntent();
static const char* supplementName();
RefPtr<DeliveredIntent> m_intent;
};
......
......@@ -29,10 +29,9 @@
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)
......
......@@ -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:
......
......@@ -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)
......
......@@ -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&);
......
......@@ -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;
}
......
......@@ -44,6 +44,7 @@ public:
private:
NavigatorNetworkInfoConnection();
static const char* supplementName();
RefPtr<NetworkInfoConnection> m_connection;
};
......
......@@ -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)
......
......@@ -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*);
......
......@@ -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;
}
......
......@@ -55,6 +55,7 @@ private:
explicit DOMWindowNotifications(DOMWindow*);
NotificationCenter* webkitNotifications();
static const char* supplementName();
DOMWindow* m_window;
RefPtr<NotificationCenter> m_notificationCenter;
......
......@@ -56,10 +56,9 @@ NotificationClient* NotificationController::clientFrom(Page* page)
return 0;
}
const AtomicString& NotificationController::supplementName()