| Index: Source/modules/encryptedmedia/MediaKeySession.h
|
| diff --git a/Source/modules/encryptedmedia/MediaKeySession.h b/Source/modules/encryptedmedia/MediaKeySession.h
|
| index 26237a2fd6897032a31ba14b24de281803d623bb..31c1a202759f25c5051e316d90a397139bba4dcd 100644
|
| --- a/Source/modules/encryptedmedia/MediaKeySession.h
|
| +++ b/Source/modules/encryptedmedia/MediaKeySession.h
|
| @@ -65,13 +65,16 @@ class MediaKeySession FINAL
|
| DEFINE_WRAPPERTYPEINFO();
|
| WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession);
|
| public:
|
| - static ScriptPromise create(ScriptState*, MediaKeys*, const String& initDataType, PassRefPtr<ArrayBuffer> initData, const String& sessionType);
|
| + static MediaKeySession* create(ScriptState*, MediaKeys*, const String& sessionType);
|
| virtual ~MediaKeySession();
|
|
|
| const String& keySystem() const { return m_keySystem; }
|
| String sessionId() const;
|
| ScriptPromise closed(ScriptState*);
|
|
|
| + ScriptPromise generateRequest(ScriptState*, const String& initDataType, ArrayBuffer* initData);
|
| + ScriptPromise generateRequest(ScriptState*, const String& initDataType, ArrayBufferView* initData);
|
| +
|
| void setError(MediaKeyError*);
|
| MediaKeyError* error() { return m_error.get(); }
|
|
|
| @@ -93,9 +96,10 @@ public:
|
|
|
| private:
|
| class PendingAction;
|
| - friend class MediaKeySessionInitializer;
|
| + friend class NewSessionResult;
|
| +
|
| + MediaKeySession(ScriptState*, MediaKeys*, const String& sessionType);
|
|
|
| - MediaKeySession(ExecutionContext*, MediaKeys*, PassOwnPtr<WebContentDecryptionModuleSession>);
|
| void actionTimerFired(Timer<MediaKeySession>*);
|
|
|
| // WebContentDecryptionModuleSession::Client
|
| @@ -105,18 +109,27 @@ private:
|
| virtual void error(MediaKeyErrorCode, unsigned long systemCode) OVERRIDE;
|
| virtual void error(WebContentDecryptionModuleException, unsigned long systemCode, const WebString& errorMessage) OVERRIDE;
|
|
|
| + ScriptPromise generateRequestInternal(ScriptState*, const String& initDataType, PassRefPtr<ArrayBuffer> initData);
|
| ScriptPromise updateInternal(ScriptState*, PassRefPtr<ArrayBuffer> response);
|
|
|
| + // Called by NewSessionResult when the new sesison has been created.
|
| + void finishGenerateRequest();
|
| +
|
| String m_keySystem;
|
| RefPtrWillBeMember<MediaKeyError> m_error;
|
| OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue;
|
| OwnPtr<WebContentDecryptionModuleSession> m_session;
|
|
|
| // Used to determine if MediaKeys is still active.
|
| - WeakMember<MediaKeys> m_keys;
|
| + WeakMember<MediaKeys> m_mediaKeys;
|
| +
|
| + // Session properties.
|
| + String m_sessionType;
|
|
|
| - // Is the CDM finished with this session?
|
| - bool m_isClosed;
|
| + // Session states.
|
| + bool m_isUninitialized;
|
| + bool m_isCallable;
|
| + bool m_isClosed; // Is the CDM finished with this session?
|
|
|
| // Keep track of the closed promise.
|
| typedef ScriptPromiseProperty<Member<MediaKeySession>, V8UndefinedType, RefPtrWillBeMember<DOMException> > ClosedPromise;
|
|
|