Chromium Code Reviews| 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 , private WebContentDecryptionModuleSession::Client { | 63 , private WebContentDecryptionModuleSession::Client { |
| 64 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<M ediaKeySession>); | 64 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<M ediaKeySession>); |
| 65 DEFINE_WRAPPERTYPEINFO(); | 65 DEFINE_WRAPPERTYPEINFO(); |
| 66 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession); | 66 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession); |
| 67 public: | 67 public: |
| 68 static MediaKeySession* create(ScriptState*, MediaKeys*, const String& sessi onType); | 68 static MediaKeySession* create(ScriptState*, MediaKeys*, const String& sessi onType); |
| 69 virtual ~MediaKeySession(); | 69 virtual ~MediaKeySession(); |
| 70 | 70 |
| 71 const String& keySystem() const { return m_keySystem; } | 71 const String& keySystem() const { return m_keySystem; } |
| 72 String sessionId() const; | 72 String sessionId() const; |
| 73 double expiration() { return m_expiration; } | |
|
ddorwin
2014/10/01 23:00:53
const function
jrummell
2014/10/03 00:36:10
Done.
| |
| 73 ScriptPromise closed(ScriptState*); | 74 ScriptPromise closed(ScriptState*); |
| 74 | 75 |
| 75 ScriptPromise generateRequest(ScriptState*, const String& initDataType, Arra yBuffer* initData); | 76 ScriptPromise generateRequest(ScriptState*, const String& initDataType, Arra yBuffer* initData); |
| 76 ScriptPromise generateRequest(ScriptState*, const String& initDataType, Arra yBufferView* initData); | 77 ScriptPromise generateRequest(ScriptState*, const String& initDataType, Arra yBufferView* initData); |
| 77 | 78 |
| 78 void setError(MediaKeyError*); | 79 void setError(MediaKeyError*); |
| 79 MediaKeyError* error() { return m_error.get(); } | 80 MediaKeyError* error() { return m_error.get(); } |
| 80 | 81 |
| 81 ScriptPromise update(ScriptState*, ArrayBuffer* response); | 82 ScriptPromise update(ScriptState*, ArrayBuffer* response); |
| 82 ScriptPromise update(ScriptState*, ArrayBufferView* response); | 83 ScriptPromise update(ScriptState*, ArrayBufferView* response); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 101 MediaKeySession(ScriptState*, MediaKeys*, const String& sessionType); | 102 MediaKeySession(ScriptState*, MediaKeys*, const String& sessionType); |
| 102 | 103 |
| 103 void actionTimerFired(Timer<MediaKeySession>*); | 104 void actionTimerFired(Timer<MediaKeySession>*); |
| 104 | 105 |
| 105 // WebContentDecryptionModuleSession::Client | 106 // WebContentDecryptionModuleSession::Client |
| 106 virtual void message(const unsigned char* message, size_t messageLength, con st WebURL& destinationURL) OVERRIDE; | 107 virtual void message(const unsigned char* message, size_t messageLength, con st WebURL& destinationURL) OVERRIDE; |
| 107 virtual void ready() OVERRIDE; | 108 virtual void ready() OVERRIDE; |
| 108 virtual void close() OVERRIDE; | 109 virtual void close() OVERRIDE; |
| 109 virtual void error(MediaKeyErrorCode, unsigned long systemCode) OVERRIDE; | 110 virtual void error(MediaKeyErrorCode, unsigned long systemCode) OVERRIDE; |
| 110 virtual void error(WebContentDecryptionModuleException, unsigned long system Code, const WebString& errorMessage) OVERRIDE; | 111 virtual void error(WebContentDecryptionModuleException, unsigned long system Code, const WebString& errorMessage) OVERRIDE; |
| 112 virtual void expirationChanged(double updatedExpiryTimeInMS) OVERRIDE; | |
| 111 | 113 |
| 112 ScriptPromise generateRequestInternal(ScriptState*, const String& initDataTy pe, PassRefPtr<ArrayBuffer> initData); | 114 ScriptPromise generateRequestInternal(ScriptState*, const String& initDataTy pe, PassRefPtr<ArrayBuffer> initData); |
| 113 ScriptPromise updateInternal(ScriptState*, PassRefPtr<ArrayBuffer> response) ; | 115 ScriptPromise updateInternal(ScriptState*, PassRefPtr<ArrayBuffer> response) ; |
| 114 | 116 |
| 115 // Called by NewSessionResult when the new sesison has been created. | 117 // Called by NewSessionResult when the new sesison has been created. |
| 116 void finishGenerateRequest(); | 118 void finishGenerateRequest(); |
| 117 | 119 |
| 118 String m_keySystem; | 120 String m_keySystem; |
| 119 RefPtrWillBeMember<MediaKeyError> m_error; | 121 RefPtrWillBeMember<MediaKeyError> m_error; |
| 120 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; | 122 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; |
| 121 OwnPtr<WebContentDecryptionModuleSession> m_session; | 123 OwnPtr<WebContentDecryptionModuleSession> m_session; |
| 122 | 124 |
| 123 // Used to determine if MediaKeys is still active. | 125 // Used to determine if MediaKeys is still active. |
| 124 WeakMember<MediaKeys> m_mediaKeys; | 126 WeakMember<MediaKeys> m_mediaKeys; |
| 125 | 127 |
| 126 // Session properties. | 128 // Session properties. |
| 127 String m_sessionType; | 129 String m_sessionType; |
| 130 double m_expiration; | |
| 128 | 131 |
| 129 // Session states. | 132 // Session states. |
| 130 bool m_isUninitialized; | 133 bool m_isUninitialized; |
| 131 bool m_isCallable; | 134 bool m_isCallable; |
| 132 bool m_isClosed; // Is the CDM finished with this session? | 135 bool m_isClosed; // Is the CDM finished with this session? |
| 133 | 136 |
| 134 // Keep track of the closed promise. | 137 // Keep track of the closed promise. |
| 135 typedef ScriptPromiseProperty<Member<MediaKeySession>, V8UndefinedType, RefP trWillBeMember<DOMException> > ClosedPromise; | 138 typedef ScriptPromiseProperty<Member<MediaKeySession>, V8UndefinedType, RefP trWillBeMember<DOMException> > ClosedPromise; |
| 136 Member<ClosedPromise> m_closedPromise; | 139 Member<ClosedPromise> m_closedPromise; |
| 137 | 140 |
| 138 HeapDeque<Member<PendingAction> > m_pendingActions; | 141 HeapDeque<Member<PendingAction> > m_pendingActions; |
| 139 Timer<MediaKeySession> m_actionTimer; | 142 Timer<MediaKeySession> m_actionTimer; |
| 140 }; | 143 }; |
| 141 | 144 |
| 142 } // namespace blink | 145 } // namespace blink |
| 143 | 146 |
| 144 #endif // MediaKeySession_h | 147 #endif // MediaKeySession_h |
| OLD | NEW |