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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 class ScriptState; | 47 class ScriptState; |
48 class WebContentDecryptionModule; | 48 class WebContentDecryptionModule; |
49 | 49 |
50 // References are held by JS and HTMLMediaElement. | 50 // References are held by JS and HTMLMediaElement. |
51 // The WebContentDecryptionModule has the same lifetime as this object. | 51 // The WebContentDecryptionModule has the same lifetime as this object. |
52 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ActiveDOMO
bject, public ScriptWrappable { | 52 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ActiveDOMO
bject, public ScriptWrappable { |
53 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeys); | 53 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeys); |
54 DEFINE_WRAPPERTYPEINFO(); | 54 DEFINE_WRAPPERTYPEINFO(); |
55 public: | 55 public: |
56 static MediaKeys* create(ExecutionContext*, const WebVector<WebEncryptedMedi
aSessionType>& supportedSessionTypes, PassOwnPtr<WebContentDecryptionModule>); | 56 static MediaKeys* create(ExecutionContext*, const WebVector<WebEncryptedMedi
aSessionType>& supportedSessionTypes, PassOwnPtr<WebContentDecryptionModule>); |
57 virtual ~MediaKeys(); | 57 ~MediaKeys() override; |
58 | 58 |
59 MediaKeySession* createSession(ScriptState*, const String& sessionTypeString
, ExceptionState&); | 59 MediaKeySession* createSession(ScriptState*, const String& sessionTypeString
, ExceptionState&); |
60 | 60 |
61 ScriptPromise setServerCertificate(ScriptState*, const DOMArrayPiece& server
Certificate); | 61 ScriptPromise setServerCertificate(ScriptState*, const DOMArrayPiece& server
Certificate); |
62 | 62 |
63 // Indicates that the provided HTMLMediaElement wants to use this object. | 63 // Indicates that the provided HTMLMediaElement wants to use this object. |
64 // Returns true if no other HTMLMediaElement currently references this | 64 // Returns true if no other HTMLMediaElement currently references this |
65 // object, false otherwise. Will take a weak reference to HTMLMediaElement. | 65 // object, false otherwise. Will take a weak reference to HTMLMediaElement. |
66 bool setMediaElement(HTMLMediaElement*); | 66 bool setMediaElement(HTMLMediaElement*); |
67 // Indicates that no HTMLMediaElement is currently using this object. | 67 // Indicates that no HTMLMediaElement is currently using this object. |
68 void clearMediaElement(); | 68 void clearMediaElement(); |
69 | 69 |
70 WebContentDecryptionModule* contentDecryptionModule(); | 70 WebContentDecryptionModule* contentDecryptionModule(); |
71 | 71 |
72 DECLARE_VIRTUAL_TRACE(); | 72 DECLARE_VIRTUAL_TRACE(); |
73 | 73 |
74 // ActiveDOMObject implementation. | 74 // ActiveDOMObject implementation. |
75 // FIXME: This class could derive from ContextLifecycleObserver | 75 // FIXME: This class could derive from ContextLifecycleObserver |
76 // again once hasPendingActivity() is moved to ScriptWrappable | 76 // again once hasPendingActivity() is moved to ScriptWrappable |
77 // (http://crbug.com/483722). | 77 // (http://crbug.com/483722). |
78 virtual void contextDestroyed() override; | 78 void contextDestroyed() override; |
79 virtual bool hasPendingActivity() const override; | 79 bool hasPendingActivity() const override; |
80 virtual void stop() override; | 80 void stop() override; |
81 | 81 |
82 private: | 82 private: |
83 MediaKeys(ExecutionContext*, const WebVector<WebEncryptedMediaSessionType>&
supportedSessionTypes, PassOwnPtr<WebContentDecryptionModule>); | 83 MediaKeys(ExecutionContext*, const WebVector<WebEncryptedMediaSessionType>&
supportedSessionTypes, PassOwnPtr<WebContentDecryptionModule>); |
84 class PendingAction; | 84 class PendingAction; |
85 | 85 |
86 bool sessionTypeSupported(WebEncryptedMediaSessionType); | 86 bool sessionTypeSupported(WebEncryptedMediaSessionType); |
87 void timerFired(Timer<MediaKeys>*); | 87 void timerFired(Timer<MediaKeys>*); |
88 | 88 |
89 const WebVector<WebEncryptedMediaSessionType> m_supportedSessionTypes; | 89 const WebVector<WebEncryptedMediaSessionType> m_supportedSessionTypes; |
90 OwnPtr<WebContentDecryptionModule> m_cdm; | 90 OwnPtr<WebContentDecryptionModule> m_cdm; |
91 | 91 |
92 // Keep track of the HTMLMediaElement that references this object. Keeping | 92 // Keep track of the HTMLMediaElement that references this object. Keeping |
93 // a WeakMember so that HTMLMediaElement's lifetime isn't dependent on | 93 // a WeakMember so that HTMLMediaElement's lifetime isn't dependent on |
94 // this object. | 94 // this object. |
95 RawPtrWillBeWeakMember<HTMLMediaElement> m_mediaElement; | 95 RawPtrWillBeWeakMember<HTMLMediaElement> m_mediaElement; |
96 | 96 |
97 HeapDeque<Member<PendingAction>> m_pendingActions; | 97 HeapDeque<Member<PendingAction>> m_pendingActions; |
98 Timer<MediaKeys> m_timer; | 98 Timer<MediaKeys> m_timer; |
99 }; | 99 }; |
100 | 100 |
101 } // namespace blink | 101 } // namespace blink |
102 | 102 |
103 #endif // MediaKeys_h | 103 #endif // MediaKeys_h |
OLD | NEW |