[Speculative revert to fix browser_tests on Blink canaries.]

Revert "Remove "needkey" event and add it's replacement, "encrypted"."

This reverts commit ad09c3ed1914691ee4a089cfe95988892ed42407.

BUG=
TBR=sandersd

Review URL: https://codereview.chromium.org/647383002

git-svn-id: svn://svn.chromium.org/blink/trunk@183580 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c3897cd3
Test reloading during encrypted media playback.
EVENT(encrypted)
EVENT(encrypted)
EVENT(needkey)
EVENT(needkey)
EVENT(message)
EVENT(playing)
This is a testharness.js-based test.
......
......@@ -21,11 +21,11 @@
var rawKey = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]);
function onEncrypted(event)
function onNeedKey(event)
{
assert_equals(event.target, video);
assert_true(event instanceof window.MediaEncryptedEvent);
assert_equals(event.type, 'encrypted');
assert_true(event instanceof window.MediaKeyNeededEvent);
assert_equals(event.type, 'needkey');
// The same decryption key is shared by all streams so only
// create a shared session once.
......@@ -35,7 +35,7 @@
mediaKeySession = video.mediaKeys.createSession();
waitForEventAndRunStep('message', mediaKeySession, onMessage, test);
mediaKeySession.generateRequest(event.initDataType, event.initData).catch(function(error) {
mediaKeySession.generateRequest(event.contentType, event.initData).catch(function(error) {
forceTestFailureFromPromise(test, error);
});
}
......@@ -78,7 +78,7 @@
}
MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) {
waitForEventAndRunStep('encrypted', video, onEncrypted, test);
waitForEventAndRunStep('needkey', video, onNeedKey, test);
waitForEventAndRunStep('playing', video, onPlaying, test);
video.src = '../content/test-encrypted.webm';
return video.setMediaKeys(mediaKeys);
......
Test that encrypted event is fired on an encrypted media file.
Test that needkey event is fired on an encrypted media file.
EVENT(encrypted)
EVENT(encrypted)
EVENT(needkey)
EVENT(needkey)
This is a testharness.js-based test.
PASS encrypted fired on encrypted media file.
PASS Needkey fired on encrypted media file.
Harness: the test ran to completion.
<!DOCTYPE html>
<html>
<head>
<title>onencrypted</title>
<title>NeedKey</title>
<script src="encrypted-media-utils.js"></script>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
......@@ -9,7 +9,7 @@
<body>
<video id="testVideo" controls></video>
<div id="log"></div>
<p>Test that encrypted event is fired on an encrypted media file.</p>
<p>Test that needkey event is fired on an encrypted media file.</p>
<script>
var expectedInitData = stringToUint8Array('0123456789012345');
......@@ -20,21 +20,20 @@
{
var video = document.getElementById('testVideo');
var onEncrypted = function(event)
var onNeedKey = function(event)
{
assert_equals(event.target, video);
assert_true(event instanceof window.MediaEncryptedEvent);
assert_equals(event.type, 'encrypted');
assert_equals(event.initDataType, 'webm');
assert_array_equals(new Uint8Array(event.initData), expectedInitData);
assert_true(event instanceof window.MediaKeyNeededEvent);
assert_equals(event.type, 'needkey');
assert_array_equals(event.initData, expectedInitData);
if (--expectedEvents == 0)
test.done();
};
waitForEventAndRunStep('encrypted', video, onEncrypted, test);
waitForEventAndRunStep('needkey', video, onNeedKey, test);
video.src = '../content/test-encrypted.webm';
}, 'encrypted fired on encrypted media file.');
}, 'Needkey fired on encrypted media file.');
</script>
</body>
</html>
Test playback of encrypted media using Clear Key key system with multiple sessions.
EVENT(encrypted)
EVENT(encrypted)
EVENT(needkey)
EVENT(needkey)
EVENT(message)
EVENT(message)
EVENT(playing)
......
......@@ -27,13 +27,13 @@
var videoKey = new Uint8Array([0x7A, 0x7A, 0x62, 0xF1, 0x68, 0x14, 0xD2, 0x7B,
0x68, 0xEF, 0x12, 0x2A, 0xFC, 0xE4, 0xAE, 0x0A]);
function onEncrypted(event)
function onNeedKey(event)
{
var keyId = String.fromCharCode.apply(null, new Uint8Array(event.initData));
var keyId = String.fromCharCode.apply(null, event.initData);
var mediaKeySession = video.mediaKeys.createSession();
waitForEventAndRunStep('message', mediaKeySession, onMessage, test);
mediaKeySession.generateRequest(event.initDataType, event.initData).then(function() {
mediaKeySession.generateRequest(event.contentType, event.initData).then(function() {
if (keyId == videoKeyId) {
assert_equals(videoMediaKeySession, null);
videoMediaKeySession = mediaKeySession;
......@@ -91,7 +91,7 @@
}
MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) {
waitForEventAndRunStep('encrypted', video, onEncrypted, test);
waitForEventAndRunStep('needkey', video, onNeedKey, test);
waitForEventAndRunStep('playing', video, onPlaying, test);
video.src = '../content/test-encrypted-different-av-keys.webm';
return video.setMediaKeys(mediaKeys);
......
Test playback of encrypted media using Clear Key key system.
EVENT(encrypted)
EVENT(encrypted)
EVENT(needkey)
EVENT(needkey)
EVENT(message)
EVENT(playing)
This is a testharness.js-based test.
......
......@@ -20,11 +20,11 @@
var rawKey = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]);
function onEncrypted(event)
function onNeedKey(event)
{
assert_equals(event.target, video);
assert_true(event instanceof window.MediaEncryptedEvent);
assert_equals(event.type, 'encrypted');
assert_true(event instanceof window.MediaKeyNeededEvent);
assert_equals(event.type, 'needkey');
// The same decryption key is shared by all streams so
// only create a shared session once.
......@@ -34,7 +34,7 @@
var mediaKeySession = video.mediaKeys.createSession();
waitForEventAndRunStep('message', mediaKeySession, onMessage, test);
mediaKeySession.generateRequest(event.initDataType, event.initData).catch(function(error) {
mediaKeySession.generateRequest(event.contentType, event.initData).catch(function(error) {
forceTestFailureFromPromise(test, error);
});
}
......@@ -70,7 +70,7 @@
MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) {
waitForEventAndRunStep('encrypted', video, onEncrypted, test);
waitForEventAndRunStep('needkey', video, onNeedKey, test);
waitForEventAndRunStep('playing', video, onPlaying, test);
video.src = '../content/test-encrypted.webm';
......
Test playback of encrypted media using Clear Key key system.
EVENT(encrypted)
EVENT(encrypted)
EVENT(needkey)
EVENT(needkey)
EVENT(message)
EVENT(playing)
This is a testharness.js-based test.
......
......@@ -20,11 +20,11 @@
var rawKey = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]);
function onEncrypted(event)
function onNeedKey(event)
{
assert_equals(event.target, video);
assert_true(event instanceof window.MediaEncryptedEvent);
assert_equals(event.type, 'encrypted');
assert_true(event instanceof window.MediaKeyNeededEvent);
assert_equals(event.type, 'needkey');
// The same decryption key is shared by all streams so only create a shared session once.
if (isSessionCreated)
......@@ -33,7 +33,7 @@
var mediaKeySession = video.mediaKeys.createSession();
waitForEventAndRunStep('message', mediaKeySession, onMessage, test);
mediaKeySession.generateRequest(event.initDataType, event.initData).catch(function(error) {
mediaKeySession.generateRequest(event.contentType, event.initData).catch(function(error) {
forceTestFailureFromPromise(test, error);
});
}
......@@ -69,7 +69,7 @@
MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) {
waitForEventAndRunStep('encrypted', video, onEncrypted, test);
waitForEventAndRunStep('needkey', video, onNeedKey, test);
waitForEventAndRunStep('playing', video, onPlaying, test);
return video.setMediaKeys(mediaKeys);
......
......@@ -591,7 +591,7 @@
// FIXME: Add syntax checks for MediaKeys.IsTypeSupported().
// FIXME: Add syntax checks for MediaKeyError and MediaKeySession events.
// FIXME: Add HTMLMediaElement syntax checks, e.g. setMediaKeys, mediakeys, onencrypted.
// FIXME: Add HTMLMediaElement syntax checks, e.g. setMediaKeys, mediakeys, onneedkey.
</script>
</body>
</html>
EVENT(encrypted)
EVENT(encrypted)
EVENT(needkey)
EVENT(needkey)
EVENT(message)
EVENT(playing)
This is a testharness.js-based test.
......
......@@ -21,11 +21,11 @@
var rawKey = new Uint8Array([0xeb, 0xdd, 0x62, 0xf1, 0x68, 0x14, 0xd2, 0x7b,
0x68, 0xef, 0x12, 0x2a, 0xfc, 0xe4, 0xae, 0x3c]);
function onEncrypted(event)
function onNeedKey(event)
{
assert_equals(event.target, video);
assert_true(event instanceof window.MediaEncryptedEvent);
assert_equals(event.type, 'encrypted');
assert_true(event instanceof window.MediaKeyNeededEvent);
assert_equals(event.type, 'needkey');
// The same decryption key is shared by all streams so only
// create a shared session once.
......@@ -35,7 +35,7 @@
mediaKeySession = video.mediaKeys.createSession();
waitForEventAndRunStep('message', mediaKeySession, onMessage, test);
mediaKeySession.generateRequest(event.initDataType, event.initData).catch(function(error) {
mediaKeySession.generateRequest(event.contentType, event.initData).catch(function(error) {
forceTestFailureFromPromise(test, error);
});
}
......@@ -89,7 +89,7 @@
}
MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) {
waitForEventAndRunStep('encrypted', video, onEncrypted, test);
waitForEventAndRunStep('needkey', video, onNeedKey, test);
waitForEventAndRunStep('playing', video, onPlaying, test);
video.src = '../content/test-encrypted.webm';
return video.setMediaKeys(mediaKeys);
......
......@@ -3,7 +3,7 @@ Test all the key-related events.
EXPECTED (messageEvent != 'null') OK
EXPECTED (messageEvent instanceof window.MediaKeyMessageEvent == 'true') OK
EXPECTED (keyNeededEvent != 'null') OK
EXPECTED (keyNeededEvent instanceof window.MediaKeyEvent == 'true') OK
EXPECTED (keyNeededEvent instanceof window.MediaKeyNeededEvent == 'true') OK
*** Verify the presence of on* attributes. These would return undefined if they are not present. ***
EXPECTED (video.onwebkitkeyadded === 'null') OK
......
......@@ -14,9 +14,9 @@
var messageEvent = document.createEvent("MediaKeyMessageEvent");
testExpected("messageEvent", null, "!=");
testExpected("messageEvent instanceof window.MediaKeyMessageEvent", true);
var keyNeededEvent = document.createEvent("MediaKeyEvent");
var keyNeededEvent = document.createEvent("MediaKeyNeededEvent");
testExpected("keyNeededEvent", null, "!=");
testExpected("keyNeededEvent instanceof window.MediaKeyEvent", true);
testExpected("keyNeededEvent instanceof window.MediaKeyNeededEvent", true);
// Next, The test runs twice, once using on* and then using addEventListener().
var isFirstRun = true;
......
......@@ -229,11 +229,11 @@ MIDIMessageEvent
Map
MediaController
MediaElementAudioSourceNode
MediaEncryptedEvent
MediaError
MediaKeyError
MediaKeyEvent
MediaKeyMessageEvent
MediaKeyNeededEvent
MediaKeySession
MediaKeys
MediaList
......
......@@ -75,7 +75,6 @@ dragstart
drop
durationchange
emptied
encrypted
end
ended
endEvent
......@@ -131,6 +130,7 @@ mouseover
mouseup
mousewheel
mute
needkey
negotiationneeded
nomatch
noupdate
......
......@@ -14,13 +14,12 @@
#include "core/html/HTMLMediaElement.h"
#include "core/html/MediaKeyError.h"
#include "core/html/MediaKeyEvent.h"
#include "modules/encryptedmedia/MediaEncryptedEvent.h"
#include "modules/encryptedmedia/MediaKeyNeededEvent.h"
#include "modules/encryptedmedia/MediaKeys.h"
#include "modules/encryptedmedia/SimpleContentDecryptionModuleResult.h"
#include "platform/ContentDecryptionModuleResult.h"
#include "platform/Logging.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "wtf/ArrayBuffer.h"
#include "wtf/Functional.h"
#include "wtf/Uint8Array.h"
......@@ -287,20 +286,20 @@ ScriptPromise HTMLMediaElementEncryptedMedia::setMediaKeys(ScriptState* scriptSt
return SetMediaKeysHandler::create(scriptState, element, mediaKeys);
}
// Create a MediaEncryptedEvent for WD EME.
static PassRefPtrWillBeRawPtr<Event> createEncryptedEvent(const String& initDataType, const unsigned char* initData, unsigned initDataLength)
// Create a MediaKeyNeededEvent for WD EME.
static PassRefPtrWillBeRawPtr<Event> createNeedKeyEvent(const String& contentType, const unsigned char* initData, unsigned initDataLength)
{
MediaEncryptedEventInit initializer;
initializer.initDataType = initDataType;
initializer.initData = ArrayBuffer::create(initData, initDataLength);
MediaKeyNeededEventInit initializer;
initializer.contentType = contentType;
initializer.initData = Uint8Array::create(initData, initDataLength);
initializer.bubbles = false;
initializer.cancelable = false;
return MediaEncryptedEvent::create(EventTypeNames::encrypted, initializer);
return MediaKeyNeededEvent::create(EventTypeNames::needkey, initializer);
}
// Create a 'needkey' MediaKeyEvent for v0.1b EME.
static PassRefPtrWillBeRawPtr<Event> createWebkitNeedKeyEvent(const unsigned char* initData, unsigned initDataLength)
static PassRefPtrWillBeRawPtr<Event> createWebkitNeedKeyEvent(const String& contentType, const unsigned char* initData, unsigned initDataLength)
{
MediaKeyEventInit webkitInitializer;
webkitInitializer.keySystem = String();
......@@ -501,21 +500,20 @@ void HTMLMediaElementEncryptedMedia::keyMessage(HTMLMediaElement& element, const
element.scheduleEvent(event.release());
}
void HTMLMediaElementEncryptedMedia::encrypted(HTMLMediaElement& element, const String& initDataType, const unsigned char* initData, unsigned initDataLength)
void HTMLMediaElementEncryptedMedia::keyNeeded(HTMLMediaElement& element, const String& contentType, const unsigned char* initData, unsigned initDataLength)
{
WTF_LOG(Media, "HTMLMediaElementEncryptedMedia::encrypted: initDataType=%s", initDataType.utf8().data());
WTF_LOG(Media, "HTMLMediaElementEncryptedMedia::mediaPlayerKeyNeeded: contentType=%s", contentType.utf8().data());
if (RuntimeEnabledFeatures::encryptedMediaEnabled()) {
// Send event for WD EME.
// FIXME: Check origin before providing initData. http://crbug.com/418233.
RefPtrWillBeRawPtr<Event> event = createEncryptedEvent(initDataType, initData, initDataLength);
RefPtrWillBeRawPtr<Event> event = createNeedKeyEvent(contentType, initData, initDataLength);
event->setTarget(&element);
element.scheduleEvent(event.release());
}
if (RuntimeEnabledFeatures::prefixedEncryptedMediaEnabled()) {
// Send event for v0.1b EME.
RefPtrWillBeRawPtr<Event> event = createWebkitNeedKeyEvent(initData, initDataLength);
RefPtrWillBeRawPtr<Event> event = createWebkitNeedKeyEvent(contentType, initData, initDataLength);
event->setTarget(&element);
element.scheduleEvent(event.release());
}
......
......@@ -39,12 +39,12 @@ public:
// encrypted media extensions (WD)
static MediaKeys* mediaKeys(HTMLMediaElement&);
static ScriptPromise setMediaKeys(ScriptState*, HTMLMediaElement&, MediaKeys*);
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(encrypted);
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(needkey);
static void keyAdded(HTMLMediaElement&, const String& keySystem, const String& sessionId);
static void keyError(HTMLMediaElement&, const String& keySystem, const String& sessionId, WebMediaPlayerClient::MediaKeyErrorCode, unsigned short systemCode);
static void keyMessage(HTMLMediaElement&, const String& keySystem, const String& sessionId, const unsigned char* message, unsigned messageLength, const WebURL& defaultURL);
static void encrypted(HTMLMediaElement&, const String& initDataType, const unsigned char* initData, unsigned initDataLength);
static void keyNeeded(HTMLMediaElement&, const String& contentType, const unsigned char* initData, unsigned initDataLength);
static void playerDestroyed(HTMLMediaElement&);
static WebContentDecryptionModule* contentDecryptionModule(HTMLMediaElement&);
......
......@@ -14,5 +14,5 @@ partial interface HTMLMediaElement {
[RuntimeEnabled=EncryptedMedia] readonly attribute MediaKeys mediaKeys;
[RuntimeEnabled=EncryptedMedia, TypeChecking=Interface, CallWith=ScriptState] Promise setMediaKeys(MediaKeys? mediaKeys);
[RuntimeEnabled=EncryptedMedia] attribute EventHandler onencrypted;
[RuntimeEnabled=EncryptedMedia] attribute EventHandler onneedkey;
};
......@@ -24,35 +24,37 @@
*/
#include "config.h"
#include "modules/encryptedmedia/MediaEncryptedEvent.h"
#include "modules/encryptedmedia/MediaKeyNeededEvent.h"
#include "wtf/Uint8Array.h"
namespace blink {
MediaEncryptedEventInit::MediaEncryptedEventInit()
MediaKeyNeededEventInit::MediaKeyNeededEventInit()
{
}
MediaEncryptedEvent::MediaEncryptedEvent()
MediaKeyNeededEvent::MediaKeyNeededEvent()
{
}
MediaEncryptedEvent::MediaEncryptedEvent(const AtomicString& type, const MediaEncryptedEventInit& initializer)
MediaKeyNeededEvent::MediaKeyNeededEvent(const AtomicString& type, const MediaKeyNeededEventInit& initializer)
: Event(type, initializer)
, m_initDataType(initializer.initDataType)
, m_contentType(initializer.contentType)
, m_initData(initializer.initData)
{
}
MediaEncryptedEvent::~MediaEncryptedEvent()
MediaKeyNeededEvent::~MediaKeyNeededEvent()
{
}
const AtomicString& MediaEncryptedEvent::interfaceName() const
const AtomicString& MediaKeyNeededEvent::interfaceName() const
{
return EventNames::MediaEncryptedEvent;
return EventNames::MediaKeyNeededEvent;
}
void MediaEncryptedEvent::trace(Visitor* visitor)
void MediaKeyNeededEvent::trace(Visitor* visitor)
{
Event::trace(visitor);
}
......
......@@ -23,51 +23,51 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef MediaEncryptedEvent_h
#define MediaEncryptedEvent_h
#ifndef MediaKeyNeededEvent_h
#define MediaKeyNeededEvent_h
#include "core/html/MediaKeyError.h"
#include "modules/EventModules.h"
#include "wtf/ArrayBuffer.h"
namespace blink {
struct MediaEncryptedEventInit : public EventInit {
MediaEncryptedEventInit();
struct MediaKeyNeededEventInit : public EventInit {
MediaKeyNeededEventInit();
String initDataType;
RefPtr<ArrayBuffer> initData;
String contentType;
RefPtr<Uint8Array> initData;
};
class MediaEncryptedEvent final : public Event {
class MediaKeyNeededEvent final : public Event {
DEFINE_WRAPPERTYPEINFO();
public:
virtual ~MediaEncryptedEvent();
virtual ~MediaKeyNeededEvent();
static PassRefPtrWillBeRawPtr<MediaEncryptedEvent> create()
static PassRefPtrWillBeRawPtr<MediaKeyNeededEvent> create()
{
return adoptRefWillBeNoop(new MediaEncryptedEvent);
return adoptRefWillBeNoop(new MediaKeyNeededEvent);
}
static PassRefPtrWillBeRawPtr<MediaEncryptedEvent> create(const AtomicString& type, const MediaEncryptedEventInit& initializer)
static PassRefPtrWillBeRawPtr<MediaKeyNeededEvent> create(const AtomicString& type, const MediaKeyNeededEventInit& initializer)
{
return adoptRefWillBeNoop(new MediaEncryptedEvent(type, initializer));
return adoptRefWillBeNoop(new MediaKeyNeededEvent(type, initializer));
}
virtual const AtomicString& interfaceName() const override;
String initDataType() const { return m_initDataType; }
ArrayBuffer* initData() const { return m_initData.get(); }
String contentType() const { return m_contentType; }
Uint8Array* initData() const { return m_initData.get(); }
virtual void trace(Visitor*) override;
private:
MediaEncryptedEvent();
MediaEncryptedEvent(const AtomicString& type, const MediaEncryptedEventInit& initializer);
MediaKeyNeededEvent();
MediaKeyNeededEvent(const AtomicString& type, const MediaKeyNeededEventInit& initializer);
String m_initDataType;
RefPtr<ArrayBuffer> m_initData;
String m_contentType;
RefPtr<Uint8Array> m_initData;
};
} // namespace blink
#endif // MediaEncryptedEvent_h
#endif // MediaKeyNeededEvent_h
......@@ -26,8 +26,8 @@
[
EventConstructor,
RuntimeEnabled=EncryptedMedia
] interface MediaEncryptedEvent : Event {
readonly attribute DOMString initDataType;
readonly attribute ArrayBuffer? initData;
] interface MediaKeyNeededEvent : Event {
readonly attribute DOMString contentType;
readonly attribute Uint8Array initData;
};
......@@ -32,8 +32,8 @@
'device_orientation/DeviceRotationRate.idl',
'encoding/TextDecoder.idl',
'encoding/TextEncoder.idl',
'encryptedmedia/MediaEncryptedEvent.idl',
'encryptedmedia/MediaKeyMessageEvent.idl',
'encryptedmedia/MediaKeyNeededEvent.idl',
'encryptedmedia/MediaKeySession.idl',
'encryptedmedia/MediaKeys.idl',
'filesystem/DOMFileSystem.idl',
......@@ -260,8 +260,8 @@
'device_light/DeviceLightEvent.idl',
'device_orientation/DeviceMotionEvent.idl',
'device_orientation/DeviceOrientationEvent.idl',
'encryptedmedia/MediaEncryptedEvent.idl',
'encryptedmedia/MediaKeyMessageEvent.idl',
'encryptedmedia/MediaKeyNeededEvent.idl',
'gamepad/GamepadEvent.idl',
'geofencing/GeofencingEvent.idl',
'indexeddb/IDBVersionChangeEvent.idl',
......@@ -409,10 +409,10 @@
'encoding/TextEncoder.h',
'encryptedmedia/HTMLMediaElementEncryptedMedia.cpp',
'encryptedmedia/HTMLMediaElementEncryptedMedia.h',
'encryptedmedia/MediaEncryptedEvent.cpp',
'encryptedmedia/MediaEncryptedEvent.h',
'encryptedmedia/MediaKeyMessageEvent.cpp',
'encryptedmedia/MediaKeyMessageEvent.h',
'encryptedmedia/MediaKeyNeededEvent.cpp',
'encryptedmedia/MediaKeyNeededEvent.h',
'encryptedmedia/MediaKeySession.cpp',
'encryptedmedia/MediaKeySession.h',
'encryptedmedia/MediaKeys.cpp',
......
......@@ -11,6 +11,7 @@
#include "core/rendering/RenderView.h"
#include "core/rendering/compositing/RenderLayerCompositor.h"
#include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h"
#include "modules/encryptedmedia/MediaKeyNeededEvent.h"
#include "modules/mediastream/MediaStreamRegistry.h"
#include "platform/audio/AudioBus.h"
#include "platform/audio/AudioSourceProviderClient.h"
......@@ -125,12 +126,7 @@ void WebMediaPlayerClientImpl::keyMessage(const WebString& keySystem, const WebS
void WebMediaPlayerClientImpl::keyNeeded(const WebString& contentType, const unsigned char* initData, unsigned initDataLength)
{
HTMLMediaElementEncryptedMedia::encrypted(mediaElement(), contentType, initData, initDataLength);
}
void WebMediaPlayerClientImpl::encrypted(const WebString& initDataType, const unsigned char* initData, unsigned initDataLength)
{
HTMLMediaElementEncryptedMedia::encrypted(mediaElement(), initDataType, initData, initDataLength);
HTMLMediaElementEncryptedMedia::keyNeeded(mediaElement(), contentType, initData, initDataLength);
}
void WebMediaPlayerClientImpl::setWebLayer(WebLayer* layer)
......
......@@ -70,9 +70,7 @@ public:
virtual void keyAdded(const WebString& keySystem, const WebString& sessionId) override;
virtual void keyError(const WebString& keySystem, const WebString& sessionId, MediaKeyErrorCode, unsigned short systemCode) override;
virtual void keyMessage(const WebString& keySystem, const WebString& sessionId, const unsigned char* message, unsigned messageLength, const WebURL& defaultURL) override;
// FIXME: Remove keyNeeded() once rename to encrypted() is complete.
virtual void keyNeeded(const WebString& contentType, const unsigned char* initData, unsigned initDataLength) override;
virtual void encrypted(const WebString& initDataType, const unsigned char* initData, unsigned initDataLength) override;
virtual void setWebLayer(WebLayer*) override;
virtual WebMediaPlayer::TrackId addAudioTrack(const WebString& id, AudioTrackKind, const WebString& label, const WebString& language, bool enabled) override;
......
......@@ -83,9 +83,7 @@ public:
virtual void keyAdded(const WebString& keySystem, const WebString& sessionId) = 0;
virtual void keyError(const WebString& keySystem, const WebString& sessionId, MediaKeyErrorCode, unsigned short systemCode) = 0;
virtual void keyMessage(const WebString& keySystem, const WebString& sessionId, const unsigned char* message, unsigned messageLength, const WebURL& defaultURL) = 0;
// FIXME: Remove keyNeeded() once rename to encrypted() is complete.
virtual void keyNeeded(const WebString& contentType, const unsigned char* initData, unsigned initDataLength) = 0;
virtual void encrypted(const WebString& initDataType, const unsigned char* initData, unsigned initDataLength) = 0;
virtual void setWebLayer(WebLayer*) = 0;
virtual WebMediaPlayer::TrackId addAudioTrack(const WebString& id, AudioTrackKind, const WebString& label, const WebString& language, bool enabled) = 0;
virtual void removeAudioTrack(WebMediaPlayer::TrackId) = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment