Commit d2bf6499 authored by weinig@apple.com's avatar weinig@apple.com

Event and EventTarget interfaces don't need to be store as AtomicStrings

https://bugs.webkit.org/show_bug.cgi?id=121751

Reviewed by Andreas Kling.

Convert the Event and EventTarget interface identifiers from AtomicStrings to enums. They
are not extensible and not exposed as Strings anywhere.

* Files elided *



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156241 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d9b22137
2013-09-21 Sam Weinig <sam@webkit.org>
Event and EventTarget interfaces don't need to be store as AtomicStrings
https://bugs.webkit.org/show_bug.cgi?id=121751
Reviewed by Andreas Kling.
Convert the Event and EventTarget interface identifiers from AtomicStrings to enums. They
are not extensible and not exposed as Strings anywhere.
* Files elided *
2013-09-21 Darin Adler <darin@apple.com>
Add ExecState::uncheckedArgument and use where possible to shrink a bit
......@@ -38,7 +38,7 @@ public:
static PassRefPtr<BatteryManager> create(Navigator*);
// EventTarget implementation.
virtual const WTF::AtomicString& interfaceName() const { return eventNames().interfaceForBatteryManager; }
virtual EventTargetInterface eventTargetInterface() const { return BatteryManagerEventTargetInterfaceType; }
virtual ScriptExecutionContext* scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); }
bool charging();
......
......@@ -53,9 +53,9 @@ MediaKeyMessageEvent::~MediaKeyMessageEvent()
{
}
const AtomicString& MediaKeyMessageEvent::interfaceName() const
EventInterface MediaKeyMessageEvent::eventInterface() const
{
return eventNames().interfaceForMediaKeyMessageEvent;
return MediaKeyMessageEventInterfaceType;
}
} // namespace WebCore
......
......@@ -55,7 +55,7 @@ public:
return adoptRef(new MediaKeyMessageEvent(type, initializer));
}
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventInterface eventInterface() const OVERRIDE;
Uint8Array* message() const { return m_message.get(); }
String destinationURL() const { return m_destinationURL; }
......
......@@ -52,9 +52,9 @@ MediaKeyNeededEvent::~MediaKeyNeededEvent()
{
}
const AtomicString& MediaKeyNeededEvent::interfaceName() const
EventInterface MediaKeyNeededEvent::eventInterface() const
{
return eventNames().interfaceForMediaKeyNeededEvent;
return MediaKeyNeededEventInterfaceType;
}
} // namespace WebCore
......
......@@ -53,7 +53,7 @@ public:
return adoptRef(new MediaKeyNeededEvent(type, initializer));
}
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventInterface eventInterface() const OVERRIDE;
Uint8Array* initData() const { return m_initData.get(); }
......
......@@ -219,9 +219,9 @@ void MediaKeySession::addKeyTimerFired(Timer<MediaKeySession>*)
}
}
const AtomicString& MediaKeySession::interfaceName() const
EventTargetInterface MediaKeySession::eventTargetInterface() const
{
return eventNames().interfaceForMediaKeySession;
return MediaKeySessionEventTargetInterfaceType;
}
ScriptExecutionContext* MediaKeySession::scriptExecutionContext() const
......
......@@ -72,7 +72,7 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitkeyerror);
DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitkeymessage);
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventTargetInterface eventTargetInterface() const OVERRIDE;
virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
protected:
......
......@@ -75,9 +75,9 @@ FileWriter::~FileWriter()
stop();
}
const AtomicString& FileWriter::interfaceName() const
EventTargetInterface FileWriter::eventTargetInterface() const
{
return eventNames().interfaceForFileWriter;
return FileWriterEventTargetInterfaceType;
}
bool FileWriter::canSuspend() const
......
......@@ -69,7 +69,7 @@ public:
void didFail(FileError::ErrorCode);
// EventTarget
virtual const AtomicString& interfaceName() const;
virtual EventTargetInterface eventTargetInterface() const;
virtual ScriptExecutionContext* scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); }
using RefCounted<FileWriterBase>::ref;
......
......@@ -362,9 +362,9 @@ void IDBDatabase::stop()
m_contextStopped = true;
}
const AtomicString& IDBDatabase::interfaceName() const
EventTargetInterface IDBDatabase::eventTargetInterface() const
{
return eventNames().interfaceForIDBDatabase;
return IDBDatabaseEventTargetInterfaceType;
}
ScriptExecutionContext* IDBDatabase::scriptExecutionContext() const
......
......@@ -84,7 +84,7 @@ public:
virtual bool hasPendingActivity() const OVERRIDE;
// EventTarget
virtual const AtomicString& interfaceName() const;
virtual EventTargetInterface eventTargetInterface() const;
virtual ScriptExecutionContext* scriptExecutionContext() const;
bool isClosePending() const { return m_closePending; }
......
......@@ -57,9 +57,9 @@ IDBOpenDBRequest::~IDBOpenDBRequest()
{
}
const AtomicString& IDBOpenDBRequest::interfaceName() const
EventTargetInterface IDBOpenDBRequest::eventTargetInterface() const
{
return eventNames().interfaceForIDBOpenDBRequest;
return IDBOpenDBRequestEventTargetInterfaceType;
}
void IDBOpenDBRequest::onBlocked(int64_t oldVersion)
......
......@@ -46,7 +46,7 @@ public:
virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>, const IDBDatabaseMetadata&) OVERRIDE;
// EventTarget
virtual const AtomicString& interfaceName() const;
virtual EventTargetInterface eventTargetInterface() const;
virtual bool dispatchEvent(PassRefPtr<Event>) OVERRIDE;
DEFINE_ATTRIBUTE_EVENT_LISTENER(blocked);
......
......@@ -434,9 +434,9 @@ void IDBRequest::stop()
markEarlyDeath();
}
const AtomicString& IDBRequest::interfaceName() const
EventTargetInterface IDBRequest::eventTargetInterface() const
{
return eventNames().interfaceForIDBRequest;
return IDBRequestEventTargetInterfaceType;
}
ScriptExecutionContext* IDBRequest::scriptExecutionContext() const
......
......@@ -98,7 +98,7 @@ public:
virtual bool hasPendingActivity() const OVERRIDE;
// EventTarget
virtual const AtomicString& interfaceName() const;
virtual EventTargetInterface eventTargetInterface() const;
virtual ScriptExecutionContext* scriptExecutionContext() const;
virtual void uncaughtExceptionInEventHandler();
......
......@@ -368,9 +368,9 @@ const AtomicString& IDBTransaction::modeToString(IndexedDB::TransactionMode mode
return IDBTransaction::modeReadOnly();
}
const AtomicString& IDBTransaction::interfaceName() const
EventTargetInterface IDBTransaction::eventTargetInterface() const
{
return eventNames().interfaceForIDBTransaction;
return IDBTransactionEventTargetInterfaceType;
}
ScriptExecutionContext* IDBTransaction::scriptExecutionContext() const
......
......@@ -106,7 +106,7 @@ public:
virtual void onComplete();
// EventTarget
virtual const AtomicString& interfaceName() const;
virtual EventTargetInterface eventTargetInterface() const;
virtual ScriptExecutionContext* scriptExecutionContext() const;
using EventTarget::dispatchEvent;
......
......@@ -49,9 +49,9 @@ IDBVersionChangeEvent::~IDBVersionChangeEvent()
{
}
const AtomicString& IDBVersionChangeEvent::interfaceName() const
EventInterface IDBVersionChangeEvent::eventInterface() const
{
return eventNames().interfaceForIDBVersionChangeEvent;
return IDBVersionChangeEventInterfaceType;
}
} // namespace WebCore
......
......@@ -44,7 +44,7 @@ public:
virtual PassRefPtr<IDBAny> oldVersion() { return m_oldVersion; }
virtual PassRefPtr<IDBAny> newVersion() { return m_newVersion; }
virtual const AtomicString& interfaceName() const;
virtual EventInterface eventInterface() const;
private:
IDBVersionChangeEvent(PassRefPtr<IDBAny> oldVersion, PassRefPtr<IDBAny> newVersion, const AtomicString& eventType);
......
......@@ -74,9 +74,9 @@ UIRequestEvent::~UIRequestEvent()
{
}
const AtomicString& UIRequestEvent::interfaceName() const
EventInterface UIRequestEvent::eventInterface() const
{
return eventNames().interfaceForUIRequestEvent;
return UIRequestEventInterfaceType;
}
UIRequestEventDispatchMediator::UIRequestEventDispatchMediator(PassRefPtr<UIRequestEvent> event)
......
......@@ -57,7 +57,7 @@ protected:
UIRequestEvent();
const AtomicString& interfaceName() const OVERRIDE;
EventInterface eventInterface() const OVERRIDE;
private:
RefPtr<EventTarget> m_receiver;
......
......@@ -207,9 +207,9 @@ bool MediaSource::isTypeSupported(const String& type)
return MIMETypeRegistry::isSupportedMediaSourceMIMEType(contentType.type(), codecs);
}
const AtomicString& MediaSource::interfaceName() const
EventTargetInterface MediaSource::eventTargetInterface() const
{
return eventNames().interfaceForMediaSource;
return MediaSourceEventTargetInterfaceType;
}
} // namespace WebCore
......
......@@ -54,7 +54,7 @@ public:
static bool isTypeSupported(const String& type);
// EventTarget interface
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventTargetInterface eventTargetInterface() const OVERRIDE;
using RefCounted<MediaSourceBase>::ref;
using RefCounted<MediaSourceBase>::deref;
......
......@@ -214,9 +214,9 @@ ScriptExecutionContext* SourceBuffer::scriptExecutionContext() const
return ActiveDOMObject::scriptExecutionContext();
}
const AtomicString& SourceBuffer::interfaceName() const
EventTargetInterface SourceBuffer::eventTargetInterface() const
{
return eventNames().interfaceForSourceBuffer;
return SourceBufferEventTargetInterfaceType;
}
EventTargetData* SourceBuffer::eventTargetData()
......
......@@ -73,7 +73,7 @@ public:
// EventTarget interface
virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventTargetInterface eventTargetInterface() const OVERRIDE;
using RefCounted<SourceBuffer>::ref;
using RefCounted<SourceBuffer>::deref;
......
......@@ -78,9 +78,9 @@ void SourceBufferList::scheduleEvent(const AtomicString& eventName)
m_asyncEventQueue.enqueueEvent(event.release());
}
const AtomicString& SourceBufferList::interfaceName() const
EventTargetInterface SourceBufferList::eventTargetInterface() const
{
return eventNames().interfaceForSourceBufferList;
return SourceBufferListEventTargetInterfaceType;
}
ScriptExecutionContext* SourceBufferList::scriptExecutionContext() const
......
......@@ -60,7 +60,7 @@ public:
void clear();
// EventTarget interface
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventTargetInterface eventTargetInterface() const OVERRIDE;
virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
using RefCounted<SourceBufferList>::ref;
......
......@@ -197,9 +197,9 @@ bool WebKitMediaSource::isTypeSupported(const String& type)
return MIMETypeRegistry::isSupportedMediaSourceMIMEType(contentType.type(), codecs);
}
const AtomicString& WebKitMediaSource::interfaceName() const
EventTargetInterface WebKitMediaSource::eventTargetInterface() const
{
return eventNames().interfaceForWebKitMediaSource;
return WebKitMediaSourceEventTargetInterfaceType;
}
} // namespace WebCore
......
......@@ -54,7 +54,7 @@ public:
static bool isTypeSupported(const String& type);
// EventTarget interface
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventTargetInterface eventTargetInterface() const OVERRIDE;
using RefCounted<MediaSourceBase>::ref;
using RefCounted<MediaSourceBase>::deref;
......
......@@ -93,9 +93,9 @@ void WebKitSourceBufferList::createAndFireEvent(const AtomicString& eventName)
m_asyncEventQueue.enqueueEvent(event.release());
}
const AtomicString& WebKitSourceBufferList::interfaceName() const
EventTargetInterface WebKitSourceBufferList::eventTargetInterface() const
{
return eventNames().interfaceForWebKitSourceBufferList;
return WebKitSourceBufferListEventTargetInterfaceType;
}
ScriptExecutionContext* WebKitSourceBufferList::scriptExecutionContext() const
......
......@@ -60,7 +60,7 @@ public:
void clear();
// EventTarget interface
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventTargetInterface eventTargetInterface() const OVERRIDE;
virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
using RefCounted<WebKitSourceBufferList>::ref;
......
......@@ -257,9 +257,9 @@ void MediaStream::contextDestroyed()
m_stopped = true;
}
const AtomicString& MediaStream::interfaceName() const
EventTargetInterface MediaStream::eventTargetInterface() const
{
return eventNames().interfaceForMediaStream;
return MediaStreamEventTargetInterfaceType;
}
ScriptExecutionContext* MediaStream::scriptExecutionContext() const
......
......@@ -72,7 +72,7 @@ public:
MediaStreamDescriptor* descriptor() const { return m_descriptor.get(); }
// EventTarget
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventTargetInterface eventTargetInterface() const OVERRIDE;
virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
using RefCounted<MediaStream>::ref;
......
......@@ -77,9 +77,9 @@ MediaStream* MediaStreamEvent::stream() const
return m_stream.get();
}
const AtomicString& MediaStreamEvent::interfaceName() const
EventInterface MediaStreamEvent::eventInterface() const
{
return eventNames().interfaceForMediaStreamEvent;
return MediaStreamEventInterfaceType;
}
} // namespace WebCore
......
......@@ -49,7 +49,7 @@ public:
MediaStream* stream() const;
virtual const AtomicString& interfaceName() const;
virtual EventInterface eventInterface() const;
private:
MediaStreamEvent();
......
......@@ -174,9 +174,9 @@ void MediaStreamTrack::stop()
m_stopped = true;
}
const AtomicString& MediaStreamTrack::interfaceName() const
EventTargetInterface MediaStreamTrack::eventTargetInterface() const
{
return eventNames().interfaceForMediaStreamTrack;
return MediaStreamTrackEventTargetInterfaceType;
}
ScriptExecutionContext* MediaStreamTrack::scriptExecutionContext() const
......
......@@ -69,7 +69,7 @@ public:
bool ended() const;
// EventTarget
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventTargetInterface eventTargetInterface() const OVERRIDE;
virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
// ActiveDOMObject
......
......@@ -77,9 +77,9 @@ MediaStreamTrack* MediaStreamTrackEvent::track() const
return m_track.get();
}
const AtomicString& MediaStreamTrackEvent::interfaceName() const
EventInterface MediaStreamTrackEvent::eventInterface() const
{
return eventNames().interfaceForMediaStreamTrackEvent;
return MediaStreamTrackEventInterfaceType;
}
} // namespace WebCore
......
......@@ -51,7 +51,7 @@ public:
MediaStreamTrack* track() const;
// Event
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventInterface eventInterface() const OVERRIDE;
private:
MediaStreamTrackEvent();
......
......@@ -128,9 +128,9 @@ void RTCDTMFSender::didPlayTone(const String& tone)
scheduleDispatchEvent(RTCDTMFToneChangeEvent::create(tone));
}
const AtomicString& RTCDTMFSender::interfaceName() const
EventTargetInterface RTCDTMFSender::eventTargetInterface() const
{
return eventNames().interfaceForRTCDTMFSender;
return RTCDTMFSenderEventTargetInterfaceType;
}
ScriptExecutionContext* RTCDTMFSender::scriptExecutionContext() const
......
......@@ -59,7 +59,7 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(tonechange);
// EventTarget
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventTargetInterface eventTargetInterface() const OVERRIDE;
virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
// ActiveDOMObject
......
......@@ -73,9 +73,9 @@ const String& RTCDTMFToneChangeEvent::tone() const
return m_tone;
}
const AtomicString& RTCDTMFToneChangeEvent::interfaceName() const
EventInterface RTCDTMFToneChangeEvent::eventInterface() const
{
return eventNames().interfaceForRTCDTMFToneChangeEvent;
return RTCDTMFToneChangeEventInterfaceType;
}
} // namespace WebCore
......
......@@ -47,7 +47,7 @@ public:
const String& tone() const;
virtual const AtomicString& interfaceName() const;
virtual EventInterface eventInterface() const;
private:
RTCDTMFToneChangeEvent();
......
......@@ -285,9 +285,9 @@ void RTCDataChannel::didDetectError()
scheduleDispatchEvent(Event::create(eventNames().errorEvent, false, false));
}
const AtomicString& RTCDataChannel::interfaceName() const
EventTargetInterface RTCDataChannel::eventTargetInterface() const
{
return eventNames().interfaceForRTCDataChannel;
return RTCDataChannelEventTargetInterfaceType;
}
ScriptExecutionContext* RTCDataChannel::scriptExecutionContext() const
......
......@@ -79,7 +79,7 @@ public:
void stop();
// EventTarget
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventTargetInterface eventTargetInterface() const OVERRIDE;
virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
using RefCounted<RTCDataChannel>::ref;
......
......@@ -62,9 +62,9 @@ RTCDataChannel* RTCDataChannelEvent::channel() const
return m_channel.get();
}
const AtomicString& RTCDataChannelEvent::interfaceName() const
EventInterface RTCDataChannelEvent::eventInterface() const
{
return eventNames().interfaceForRTCDataChannelEvent;
return RTCDataChannelEventInterfaceType;
}
} // namespace WebCore
......
......@@ -42,7 +42,7 @@ public:
RTCDataChannel* channel() const;
virtual const AtomicString& interfaceName() const;
virtual EventInterface eventInterface() const;
private:
RTCDataChannelEvent();
......
......@@ -62,9 +62,9 @@ RTCIceCandidate* RTCIceCandidateEvent::candidate() const
return m_candidate.get();
}
const AtomicString& RTCIceCandidateEvent::interfaceName() const
EventInterface RTCIceCandidateEvent::eventInterface() const
{
return eventNames().interfaceForRTCIceCandidateEvent;
return RTCIceCandidateEventInterfaceType;
}
} // namespace WebCore
......
......@@ -42,7 +42,7 @@ public:
RTCIceCandidate* candidate() const;
virtual const AtomicString& interfaceName() const;
virtual EventInterface eventInterface() const;
private:
RTCIceCandidateEvent();
......
......@@ -585,9 +585,9 @@ void RTCPeerConnection::didAddRemoteDataChannel(PassOwnPtr<RTCDataChannelHandler
scheduleDispatchEvent(RTCDataChannelEvent::create(eventNames().datachannelEvent, false, false, channel.release()));
}
const AtomicString& RTCPeerConnection::interfaceName() const
EventTargetInterface RTCPeerConnection::eventTargetInterface() const
{
return eventNames().interfaceForRTCPeerConnection;
return RTCPeerConnectionEventTargetInterfaceType;
}
ScriptExecutionContext* RTCPeerConnection::scriptExecutionContext() const
......
......@@ -120,7 +120,7 @@ public:
virtual void didAddRemoteDataChannel(PassOwnPtr<RTCDataChannelHandler>) OVERRIDE;
// EventTarget
virtual const AtomicString& interfaceName() const OVERRIDE;
virtual EventTargetInterface eventTargetInterface() const OVERRIDE;
virtual ScriptExecutionContext* scriptExecutionContext() const OVERRIDE;
// ActiveDOMObject
......
......@@ -82,9 +82,9 @@ EventTargetData& NetworkInfoConnection::ensureEventTargetData()
return m_eventTargetData;