+2017-01-17 Zan Dobersek <zdobersek@igalia.com>
+
+ MediaKeySession: use existing 'message' event name
+ https://bugs.webkit.org/show_bug.cgi?id=167095
+
+ Reviewed by Sam Weinig.
+
+ When dispatching the 'message' event in MediaKeySession::enqueueMessage(),
+ use the messageEvent member that's provided by the EventNames object. This
+ removes the need for a custom static AtomicString object.
+
+ * Modules/encryptedmedia/MediaKeySession.cpp:
+ (WebCore::MediaKeySession::enqueueMessage):
+ (WebCore::messageEventName): Deleted.
+
2017-01-16 Joseph Pecoraro <pecoraro@apple.com>
Remove the REQUEST_ANIMATION_FRAME flag
#include "CDM.h"
#include "CDMInstance.h"
+#include "EventNames.h"
#include "MediaKeyMessageEvent.h"
#include "MediaKeyMessageType.h"
#include "MediaKeyStatusMap.h"
namespace WebCore {
-static AtomicString& messageEventName()
-{
- NeverDestroyed<AtomicString> message { "message" };
- return message.get();
-}
-
Ref<MediaKeySession> MediaKeySession::create(ScriptExecutionContext& context, MediaKeySessionType sessionType, bool useDistinctiveIdentifier, Ref<CDM>&& implementation, Ref<CDMInstance>&& instance)
{
auto session = adoptRef(*new MediaKeySession(context, sessionType, useDistinctiveIdentifier, WTFMove(implementation), WTFMove(instance)));
// 2. Queue a task to create an event named message that does not bubble and is not cancellable using the MediaKeyMessageEvent
// interface with its type attribute set to message and its isTrusted attribute initialized to true, and dispatch it at the
// session.
- auto messageEvent = MediaKeyMessageEvent::create(messageEventName(), {messageType, message.createArrayBuffer()}, Event::IsTrusted::Yes);
+ auto messageEvent = MediaKeyMessageEvent::create(eventNames().messageEvent, {messageType, message.createArrayBuffer()}, Event::IsTrusted::Yes);
m_eventQueue.enqueueEvent(WTFMove(messageEvent));
}