| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 class ExceptionState; | 44 class ExceptionState; |
| 45 class ExecutionContext; | 45 class ExecutionContext; |
| 46 class HTMLMediaElement; | 46 class HTMLMediaElement; |
| 47 class MediaKeySession; | 47 class MediaKeySession; |
| 48 class ScriptState; | 48 class ScriptState; |
| 49 class WebContentDecryptionModule; | 49 class WebContentDecryptionModule; |
| 50 | 50 |
| 51 // References are held by JS and HTMLMediaElement. | 51 // References are held by JS and HTMLMediaElement. |
| 52 // The WebContentDecryptionModule has the same lifetime as this object. | 52 // The WebContentDecryptionModule has the same lifetime as this object. |
| 53 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ActiveScri
ptWrappable, public ActiveDOMObject, public ScriptWrappable { | 53 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ActiveScri
ptWrappable, public ActiveDOMObject, public ScriptWrappable { |
| 54 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeys); | 54 USING_GARBAGE_COLLECTED_MIXIN(MediaKeys); |
| 55 DEFINE_WRAPPERTYPEINFO(); | 55 DEFINE_WRAPPERTYPEINFO(); |
| 56 public: | 56 public: |
| 57 static MediaKeys* create(ExecutionContext*, const WebVector<WebEncryptedMedi
aSessionType>& supportedSessionTypes, PassOwnPtr<WebContentDecryptionModule>); | 57 static MediaKeys* create(ExecutionContext*, const WebVector<WebEncryptedMedi
aSessionType>& supportedSessionTypes, PassOwnPtr<WebContentDecryptionModule>); |
| 58 ~MediaKeys() override; | 58 ~MediaKeys() override; |
| 59 | 59 |
| 60 MediaKeySession* createSession(ScriptState*, const String& sessionTypeString
, ExceptionState&); | 60 MediaKeySession* createSession(ScriptState*, const String& sessionTypeString
, ExceptionState&); |
| 61 | 61 |
| 62 ScriptPromise setServerCertificate(ScriptState*, const DOMArrayPiece& server
Certificate); | 62 ScriptPromise setServerCertificate(ScriptState*, const DOMArrayPiece& server
Certificate); |
| 63 | 63 |
| 64 // Indicates that the provided HTMLMediaElement wants to use this object. | 64 // Indicates that the provided HTMLMediaElement wants to use this object. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 const WebVector<WebEncryptedMediaSessionType> m_supportedSessionTypes; | 100 const WebVector<WebEncryptedMediaSessionType> m_supportedSessionTypes; |
| 101 OwnPtr<WebContentDecryptionModule> m_cdm; | 101 OwnPtr<WebContentDecryptionModule> m_cdm; |
| 102 | 102 |
| 103 // Keep track of the HTMLMediaElement that references this object. Keeping | 103 // Keep track of the HTMLMediaElement that references this object. Keeping |
| 104 // a WeakMember so that HTMLMediaElement's lifetime isn't dependent on | 104 // a WeakMember so that HTMLMediaElement's lifetime isn't dependent on |
| 105 // this object. | 105 // this object. |
| 106 // Note that the referenced HTMLMediaElement must be destroyed | 106 // Note that the referenced HTMLMediaElement must be destroyed |
| 107 // before this object. This is due to WebMediaPlayerImpl (owned by | 107 // before this object. This is due to WebMediaPlayerImpl (owned by |
| 108 // HTMLMediaElement) possibly having a pointer to Decryptor created | 108 // HTMLMediaElement) possibly having a pointer to Decryptor created |
| 109 // by WebContentDecryptionModuleImpl (owned by this object). | 109 // by WebContentDecryptionModuleImpl (owned by this object). |
| 110 RawPtrWillBeWeakMember<HTMLMediaElement> m_mediaElement; | 110 WeakMember<HTMLMediaElement> m_mediaElement; |
| 111 | 111 |
| 112 // Keep track of whether this object has been reserved by HTMLMediaElement | 112 // Keep track of whether this object has been reserved by HTMLMediaElement |
| 113 // (i.e. a setMediaKeys operation is in progress). Destruction of this | 113 // (i.e. a setMediaKeys operation is in progress). Destruction of this |
| 114 // object will be prevented until the setMediaKeys() completes. | 114 // object will be prevented until the setMediaKeys() completes. |
| 115 bool m_reservedForMediaElement; | 115 bool m_reservedForMediaElement; |
| 116 | 116 |
| 117 HeapDeque<Member<PendingAction>> m_pendingActions; | 117 HeapDeque<Member<PendingAction>> m_pendingActions; |
| 118 Timer<MediaKeys> m_timer; | 118 Timer<MediaKeys> m_timer; |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } // namespace blink | 121 } // namespace blink |
| 122 | 122 |
| 123 #endif // MediaKeys_h | 123 #endif // MediaKeys_h |
| OLD | NEW |