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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 | 63 |
64 void setError(MediaKeyError*); | 64 void setError(MediaKeyError*); |
65 MediaKeyError* error() { return m_error.get(); } | 65 MediaKeyError* error() { return m_error.get(); } |
66 | 66 |
67 void generateKeyRequest(const String& mimeType, Uint8Array* initData); | 67 void generateKeyRequest(const String& mimeType, Uint8Array* initData); |
68 void update(Uint8Array* key, ExceptionState&); | 68 void update(Uint8Array* key, ExceptionState&); |
69 void close(); | 69 void close(); |
70 | 70 |
71 void enqueueEvent(PassRefPtr<Event>); | 71 void enqueueEvent(PassRefPtr<Event>); |
72 | 72 |
73 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitkeyadded); | 73 DEFINE_ATTRIBUTE_EVENT_LISTENER(error); |
ddorwin
2014/01/07 23:44:41
on* attributes do not exist in the WD, except for
jrummell
2014/01/08 18:05:52
Removed.
| |
74 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitkeyerror); | 74 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
75 DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitkeymessage); | 75 DEFINE_ATTRIBUTE_EVENT_LISTENER(ready); |
76 DEFINE_ATTRIBUTE_EVENT_LISTENER(closed); | |
76 | 77 |
77 virtual const AtomicString& interfaceName() const OVERRIDE; | 78 virtual const AtomicString& interfaceName() const OVERRIDE; |
78 virtual ExecutionContext* executionContext() const OVERRIDE; | 79 virtual ExecutionContext* executionContext() const OVERRIDE; |
79 | 80 |
80 private: | 81 private: |
81 MediaKeySession(ExecutionContext*, ContentDecryptionModule*, MediaKeys*); | 82 MediaKeySession(ExecutionContext*, ContentDecryptionModule*, MediaKeys*); |
82 void keyRequestTimerFired(Timer<MediaKeySession>*); | 83 void keyRequestTimerFired(Timer<MediaKeySession>*); |
83 void addKeyTimerFired(Timer<MediaKeySession>*); | 84 void addKeyTimerFired(Timer<MediaKeySession>*); |
84 | 85 |
85 // ContentDecryptionModuleSessionClient | 86 // ContentDecryptionModuleSessionClient |
86 virtual void keyAdded() OVERRIDE; | |
87 virtual void keyError(MediaKeyErrorCode, unsigned long systemCode) OVERRIDE; | 87 virtual void keyError(MediaKeyErrorCode, unsigned long systemCode) OVERRIDE; |
ddorwin
2014/01/07 23:44:41
I think we should drop "key" here.
jrummell
2014/01/08 18:05:52
Done.
| |
88 virtual void keyMessage(const unsigned char* message, size_t messageLength, const KURL& destinationURL) OVERRIDE; | 88 virtual void keyMessage(const unsigned char* message, size_t messageLength, const KURL& destinationURL) OVERRIDE; |
89 virtual void keyReady() OVERRIDE; | |
90 virtual void keyClosed() OVERRIDE; | |
89 | 91 |
90 String m_keySystem; | 92 String m_keySystem; |
91 RefPtr<MediaKeyError> m_error; | 93 RefPtr<MediaKeyError> m_error; |
92 OwnPtr<GenericEventQueue> m_asyncEventQueue; | 94 OwnPtr<GenericEventQueue> m_asyncEventQueue; |
93 OwnPtr<ContentDecryptionModuleSession> m_session; | 95 OwnPtr<ContentDecryptionModuleSession> m_session; |
94 // Used to remove the reference from the parent MediaKeys when close()'d. | 96 // Used to remove the reference from the parent MediaKeys when close()'d. |
95 MediaKeys* m_keys; | 97 MediaKeys* m_keys; |
96 | 98 |
97 struct PendingKeyRequest { | 99 struct PendingKeyRequest { |
98 PendingKeyRequest(const String& mimeType, Uint8Array* initData) : mimeTy pe(mimeType), initData(initData) { } | 100 PendingKeyRequest(const String& mimeType, Uint8Array* initData) : mimeTy pe(mimeType), initData(initData) { } |
99 String mimeType; | 101 String mimeType; |
100 RefPtr<Uint8Array> initData; | 102 RefPtr<Uint8Array> initData; |
101 }; | 103 }; |
102 Deque<PendingKeyRequest> m_pendingKeyRequests; | 104 Deque<PendingKeyRequest> m_pendingKeyRequests; |
103 Timer<MediaKeySession> m_keyRequestTimer; | 105 Timer<MediaKeySession> m_keyRequestTimer; |
104 | 106 |
105 Deque<RefPtr<Uint8Array> > m_pendingKeys; | 107 Deque<RefPtr<Uint8Array> > m_pendingKeys; |
106 Timer<MediaKeySession> m_addKeyTimer; | 108 Timer<MediaKeySession> m_addKeyTimer; |
107 }; | 109 }; |
108 | 110 |
109 } | 111 } |
110 | 112 |
111 #endif // MediaKeySession_h | 113 #endif // MediaKeySession_h |
OLD | NEW |