| 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 15 matching lines...) Expand all Loading... |
| 26 #ifndef MediaKeySession_h | 26 #ifndef MediaKeySession_h |
| 27 #define MediaKeySession_h | 27 #define MediaKeySession_h |
| 28 | 28 |
| 29 #include "bindings/core/v8/ScriptPromiseProperty.h" | 29 #include "bindings/core/v8/ScriptPromiseProperty.h" |
| 30 #include "core/dom/ActiveDOMObject.h" | 30 #include "core/dom/ActiveDOMObject.h" |
| 31 #include "core/dom/DOMException.h" | 31 #include "core/dom/DOMException.h" |
| 32 #include "modules/EventTargetModules.h" | 32 #include "modules/EventTargetModules.h" |
| 33 #include "platform/Timer.h" | 33 #include "platform/Timer.h" |
| 34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
| 35 #include "public/platform/WebContentDecryptionModuleSession.h" | 35 #include "public/platform/WebContentDecryptionModuleSession.h" |
| 36 #include "wtf/Forward.h" | |
| 37 | 36 |
| 38 namespace blink { | 37 namespace blink { |
| 39 | 38 |
| 40 class ScriptPromise; | 39 class DOMArrayBuffer; |
| 41 class ScriptState; | 40 class DOMArrayBufferView; |
| 42 class GenericEventQueue; | 41 class GenericEventQueue; |
| 43 class MediaKeyError; | 42 class MediaKeyError; |
| 44 class MediaKeys; | 43 class MediaKeys; |
| 45 class WebString; | 44 class WebString; |
| 46 | 45 |
| 47 // References are held by JS only. However, even if all JS references are | 46 // References are held by JS only. However, even if all JS references are |
| 48 // dropped, it won't be garbage collected until close event received or | 47 // dropped, it won't be garbage collected until close event received or |
| 49 // MediaKeys goes away (as determined by the validity of a WeakPtr). This allows | 48 // MediaKeys goes away (as determined by the validity of a WeakPtr). This allows |
| 50 // the CDM to continue to fire events for this session, as long as the session | 49 // the CDM to continue to fire events for this session, as long as the session |
| 51 // is open. | 50 // is open. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 66 public: | 65 public: |
| 67 static MediaKeySession* create(ScriptState*, MediaKeys*, const String& sessi
onType); | 66 static MediaKeySession* create(ScriptState*, MediaKeys*, const String& sessi
onType); |
| 68 static bool isValidSessionType(const String& sessionType); | 67 static bool isValidSessionType(const String& sessionType); |
| 69 virtual ~MediaKeySession(); | 68 virtual ~MediaKeySession(); |
| 70 | 69 |
| 71 const String& keySystem() const { return m_keySystem; } | 70 const String& keySystem() const { return m_keySystem; } |
| 72 String sessionId() const; | 71 String sessionId() const; |
| 73 double expiration() const { return m_expiration; } | 72 double expiration() const { return m_expiration; } |
| 74 ScriptPromise closed(ScriptState*); | 73 ScriptPromise closed(ScriptState*); |
| 75 | 74 |
| 76 ScriptPromise generateRequest(ScriptState*, const String& initDataType, Arra
yBuffer* initData); | 75 ScriptPromise generateRequest(ScriptState*, const String& initDataType, DOMA
rrayBuffer* initData); |
| 77 ScriptPromise generateRequest(ScriptState*, const String& initDataType, Arra
yBufferView* initData); | 76 ScriptPromise generateRequest(ScriptState*, const String& initDataType, DOMA
rrayBufferView* initData); |
| 78 ScriptPromise load(ScriptState*, const String& sessionId); | 77 ScriptPromise load(ScriptState*, const String& sessionId); |
| 79 | 78 |
| 80 void setError(MediaKeyError*); | 79 void setError(MediaKeyError*); |
| 81 MediaKeyError* error() { return m_error.get(); } | 80 MediaKeyError* error() { return m_error.get(); } |
| 82 | 81 |
| 83 ScriptPromise update(ScriptState*, ArrayBuffer* response); | 82 ScriptPromise update(ScriptState*, DOMArrayBuffer* response); |
| 84 ScriptPromise update(ScriptState*, ArrayBufferView* response); | 83 ScriptPromise update(ScriptState*, DOMArrayBufferView* response); |
| 85 ScriptPromise close(ScriptState*); | 84 ScriptPromise close(ScriptState*); |
| 86 ScriptPromise remove(ScriptState*); | 85 ScriptPromise remove(ScriptState*); |
| 87 | 86 |
| 88 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); | 87 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); |
| 89 | 88 |
| 90 // EventTarget | 89 // EventTarget |
| 91 virtual const AtomicString& interfaceName() const override; | 90 virtual const AtomicString& interfaceName() const override; |
| 92 virtual ExecutionContext* executionContext() const override; | 91 virtual ExecutionContext* executionContext() const override; |
| 93 | 92 |
| 94 // ActiveDOMObject | 93 // ActiveDOMObject |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 typedef ScriptPromiseProperty<Member<MediaKeySession>, V8UndefinedType, RefP
trWillBeMember<DOMException> > ClosedPromise; | 143 typedef ScriptPromiseProperty<Member<MediaKeySession>, V8UndefinedType, RefP
trWillBeMember<DOMException> > ClosedPromise; |
| 145 Member<ClosedPromise> m_closedPromise; | 144 Member<ClosedPromise> m_closedPromise; |
| 146 | 145 |
| 147 HeapDeque<Member<PendingAction> > m_pendingActions; | 146 HeapDeque<Member<PendingAction> > m_pendingActions; |
| 148 Timer<MediaKeySession> m_actionTimer; | 147 Timer<MediaKeySession> m_actionTimer; |
| 149 }; | 148 }; |
| 150 | 149 |
| 151 } // namespace blink | 150 } // namespace blink |
| 152 | 151 |
| 153 #endif // MediaKeySession_h | 152 #endif // MediaKeySession_h |
| OLD | NEW |