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

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

Issue 16387015: Make unprefixed EME APIs use platform and Chromium. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: KURL.h moved Created 7 years, 6 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
« no previous file with comments | « Source/modules/encryptedmedia/MediaKeySession.cpp ('k') | Source/modules/encryptedmedia/MediaKeys.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/encryptedmedia/MediaKeys.h
diff --git a/Source/modules/encryptedmedia/MediaKeys.h b/Source/modules/encryptedmedia/MediaKeys.h
index 9691cfe40c3ec3de6b8da343d924ace605226028..2b13cc665bb0205efee0126fa28134e2292ebfbd 100644
--- a/Source/modules/encryptedmedia/MediaKeys.h
+++ b/Source/modules/encryptedmedia/MediaKeys.h
@@ -26,12 +26,9 @@
#ifndef MediaKeys_h
#define MediaKeys_h
-#if ENABLE(ENCRYPTED_MEDIA_V2)
-
#include "bindings/v8/ScriptWrappable.h"
#include "core/dom/EventTarget.h"
#include "core/dom/ExceptionCode.h"
-#include "modules/encryptedmedia/CDM.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
@@ -41,10 +38,15 @@
namespace WebCore {
+class ContentDecryptionModule;
class MediaKeySession;
class HTMLMediaElement;
-class MediaKeys : public RefCounted<MediaKeys>, public ScriptWrappable, public CDMClient {
+// References are held by JS and HTMLMediaElement.
+// The ContentDecryptionModule has the same lifetime as this object.
+// Maintains a reference to all MediaKeySessions created to ensure they live as
+// long as this object unless explicitly close()'d.
+class MediaKeys : public RefCounted<MediaKeys>, public ScriptWrappable {
public:
static PassRefPtr<MediaKeys> create(const String& keySystem, ExceptionCode&);
~MediaKeys();
@@ -52,26 +54,19 @@ public:
PassRefPtr<MediaKeySession> createSession(ScriptExecutionContext*, const String& mimeType, Uint8Array* initData, ExceptionCode&);
const String& keySystem() const { return m_keySystem; }
- CDM* cdm() { return m_cdm.get(); }
- HTMLMediaElement* mediaElement() const { return m_mediaElement; }
void setMediaElement(HTMLMediaElement*);
protected:
- // CDMClient:
- virtual MediaPlayer* cdmMediaPlayer(const CDM*) const OVERRIDE;
-
- MediaKeys(const String& keySystem, PassOwnPtr<CDM>);
+ MediaKeys(const String& keySystem, PassOwnPtr<ContentDecryptionModule>);
Vector<RefPtr<MediaKeySession> > m_sessions;
HTMLMediaElement* m_mediaElement;
- String m_keySystem;
- OwnPtr<CDM> m_cdm;
+ const String m_keySystem;
+ OwnPtr<ContentDecryptionModule> m_cdm;
};
}
-#endif // ENABLE(ENCRYPTED_MEDIA_V2)
-
#endif // MediaKeys_h
« no previous file with comments | « Source/modules/encryptedmedia/MediaKeySession.cpp ('k') | Source/modules/encryptedmedia/MediaKeys.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698