Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1189)

Unified Diff: Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h

Issue 1055503002: Eliminate MediaPlayer & MediaPlayerClient abstractions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h
diff --git a/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h b/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h
index 9e210715821304b016f87b64ed79cabce0ef7bec..841c163006b88b54e0306f4045e8179fce01143d 100644
--- a/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h
+++ b/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h
@@ -12,7 +12,7 @@
#include "platform/Supplementable.h"
#include "platform/heap/Handle.h"
#include "public/platform/WebEncryptedMediaTypes.h"
-#include "public/platform/WebMediaPlayerClient.h"
+#include "public/platform/WebMediaPlayerEncryptedMediaClient.h"
namespace blink {
@@ -21,8 +21,10 @@ class HTMLMediaElement;
class MediaKeys;
class ScriptPromise;
class ScriptState;
+class WebContentDecryptionModule;
+class WebMediaPlayer;
-class MODULES_EXPORT HTMLMediaElementEncryptedMedia final : public NoBaseWillBeGarbageCollected<HTMLMediaElementEncryptedMedia>, public WillBeHeapSupplement<HTMLMediaElement> {
+class MODULES_EXPORT HTMLMediaElementEncryptedMedia final : public NoBaseWillBeGarbageCollected<HTMLMediaElementEncryptedMedia>, public WillBeHeapSupplement<HTMLMediaElement>, public WebMediaPlayerEncryptedMediaClient {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElementEncryptedMedia);
DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(HTMLMediaElementEncryptedMedia);
public:
@@ -43,13 +45,14 @@ public:
static ScriptPromise setMediaKeys(ScriptState*, HTMLMediaElement&, MediaKeys*);
DEFINE_STATIC_ATTRIBUTE_EVENT_LISTENER(encrypted);
- 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&, WebEncryptedMediaInitDataType, const unsigned char* initData, unsigned initDataLength);
- static void didBlockPlaybackWaitingForKey(HTMLMediaElement&);
- static void didResumePlaybackBlockedForKey(HTMLMediaElement&);
- static WebContentDecryptionModule* contentDecryptionModule(HTMLMediaElement&);
+ // WebMediaPlayerEncryptedMediaClient methods
+ void keyAdded(const WebString& keySystem, const WebString& sessionId) final;
+ void keyError(const WebString& keySystem, const WebString& sessionId, WebMediaPlayerEncryptedMediaClient::MediaKeyErrorCode, unsigned short systemCode) final;
+ void keyMessage(const WebString& keySystem, const WebString& sessionId, const unsigned char* message, unsigned messageLength, const WebURL& defaultURL) final;
+ void encrypted(WebEncryptedMediaInitDataType, const unsigned char* initData, unsigned initDataLength) final;
+ void didBlockPlaybackWaitingForKey() final;
+ void didResumePlaybackBlockedForKey() final;
+ WebContentDecryptionModule* contentDecryptionModule();
static HTMLMediaElementEncryptedMedia& from(HTMLMediaElement&);
static const char* supplementName();
@@ -59,7 +62,7 @@ public:
private:
friend class SetMediaKeysHandler;
- HTMLMediaElementEncryptedMedia();
+ HTMLMediaElementEncryptedMedia(HTMLMediaElement&);
void generateKeyRequest(WebMediaPlayer*, const String& keySystem, PassRefPtr<DOMUint8Array> initData, ExceptionState&);
void addKey(WebMediaPlayer*, const String& keySystem, PassRefPtr<DOMUint8Array> key, PassRefPtr<DOMUint8Array> initData, const String& sessionId, ExceptionState&);
void cancelKeyRequest(WebMediaPlayer*, const String& keySystem, const String& sessionId, ExceptionState&);
@@ -78,8 +81,7 @@ private:
// (v0.1b or WD). Returns whether the mode is allowed and successfully set.
bool setEmeMode(EmeMode);
- WebContentDecryptionModule* contentDecryptionModule();
-
+ HTMLMediaElement& m_mediaElement;
EmeMode m_emeMode;
bool m_isWaitingForKey;
« no previous file with comments | « Source/core/loader/FrameLoaderClient.h ('k') | Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698