OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 class MediaKeys : public RefCounted<MediaKeys>, public CDMClient { | 46 class MediaKeys : public RefCounted<MediaKeys>, public CDMClient { |
47 public: | 47 public: |
48 static PassRefPtr<MediaKeys> create(const String& keySystem, ExceptionCode&)
; | 48 static PassRefPtr<MediaKeys> create(const String& keySystem, ExceptionCode&)
; |
49 ~MediaKeys(); | 49 ~MediaKeys(); |
50 | 50 |
51 PassRefPtr<MediaKeySession> createSession(ScriptExecutionContext*, const Str
ing& mimeType, Uint8Array* initData, ExceptionCode&); | 51 PassRefPtr<MediaKeySession> createSession(ScriptExecutionContext*, const Str
ing& mimeType, Uint8Array* initData, ExceptionCode&); |
52 | 52 |
53 const String& keySystem() const { return m_keySystem; } | 53 const String& keySystem() const { return m_keySystem; } |
54 CDM* cdm() { return m_cdm.get(); } | 54 CDM* cdm() { return m_cdm.get(); } |
55 | 55 |
56 HTMLMediaElement* mediaElement() const { return m_mediaElement; } | 56 Result<HTMLMediaElement> mediaElement() const { return adoptRawResult(m_medi
aElement); } |
57 void setMediaElement(HTMLMediaElement*); | 57 void setMediaElement(const Handle<HTMLMediaElement>&); |
58 | 58 |
59 protected: | 59 protected: |
60 // CDMClient: | 60 // CDMClient: |
61 virtual MediaPlayer* cdmMediaPlayer(const CDM*) const OVERRIDE; | 61 virtual MediaPlayer* cdmMediaPlayer(const CDM*) const OVERRIDE; |
62 | 62 |
63 MediaKeys(const String& keySystem, PassOwnPtr<CDM>); | 63 MediaKeys(const String& keySystem, PassOwnPtr<CDM>); |
64 | 64 |
65 Vector<RefPtr<MediaKeySession> > m_sessions; | 65 Vector<RefPtr<MediaKeySession> > m_sessions; |
66 | 66 |
| 67 // FIXME(oilpan): This is a strong pointer. |
| 68 // MediaKeys and HTMLMediaElement should die together. |
67 HTMLMediaElement* m_mediaElement; | 69 HTMLMediaElement* m_mediaElement; |
68 String m_keySystem; | 70 String m_keySystem; |
69 OwnPtr<CDM> m_cdm; | 71 OwnPtr<CDM> m_cdm; |
70 }; | 72 }; |
71 | 73 |
72 } | 74 } |
73 | 75 |
74 #endif // ENABLE(ENCRYPTED_MEDIA_V2) | 76 #endif // ENABLE(ENCRYPTED_MEDIA_V2) |
75 | 77 |
76 #endif // MediaKeys_h | 78 #endif // MediaKeys_h |
OLD | NEW |