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 29 matching lines...) Expand all Loading... | |
| 40 class ExecutionContext; | 40 class ExecutionContext; |
| 41 class MediaKeySession; | 41 class MediaKeySession; |
| 42 class ScriptState; | 42 class ScriptState; |
| 43 class WebContentDecryptionModule; | 43 class WebContentDecryptionModule; |
| 44 | 44 |
| 45 // References are held by JS and HTMLMediaElement. | 45 // References are held by JS and HTMLMediaElement. |
| 46 // The WebContentDecryptionModule has the same lifetime as this object. | 46 // The WebContentDecryptionModule has the same lifetime as this object. |
| 47 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ContextLif ecycleObserver, public ScriptWrappable { | 47 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ContextLif ecycleObserver, public ScriptWrappable { |
| 48 DEFINE_WRAPPERTYPEINFO(); | 48 DEFINE_WRAPPERTYPEINFO(); |
| 49 public: | 49 public: |
| 50 static ScriptPromise create(ScriptState*, const String& keySystem); | 50 MediaKeys(ExecutionContext*, const String& keySystem, PassOwnPtr<blink::WebC ontentDecryptionModule>); |
| 51 virtual ~MediaKeys(); | 51 virtual ~MediaKeys(); |
| 52 | 52 |
| 53 const String& keySystem() const { return m_keySystem; } | 53 const String& keySystem() const { return m_keySystem; } |
|
ddorwin
2014/10/22 22:18:54
Do we need this anymore?
jrummell
2014/10/23 01:20:03
Yes. MediaKeySession.generateRequest() needs it in
| |
| 54 | 54 |
| 55 MediaKeySession* createSession(ScriptState*, const String& sessionType); | 55 MediaKeySession* createSession(ScriptState*, const String& sessionType); |
| 56 | 56 |
| 57 ScriptPromise setServerCertificate(ScriptState*, DOMArrayBuffer* serverCerti ficate); | 57 ScriptPromise setServerCertificate(ScriptState*, DOMArrayBuffer* serverCerti ficate); |
| 58 ScriptPromise setServerCertificate(ScriptState*, DOMArrayBufferView* serverC ertificate); | 58 ScriptPromise setServerCertificate(ScriptState*, DOMArrayBufferView* serverC ertificate); |
| 59 | 59 |
| 60 static bool isTypeSupported(const String& keySystem, const String& contentTy pe); | 60 static bool isTypeSupported(const String& keySystem, const String& contentTy pe); |
|
ddorwin
2014/10/22 22:18:54
FIXME: Remove this.
jrummell
2014/10/23 01:20:03
Done.
| |
| 61 | 61 |
| 62 blink::WebContentDecryptionModule* contentDecryptionModule(); | 62 blink::WebContentDecryptionModule* contentDecryptionModule(); |
| 63 | 63 |
| 64 void trace(Visitor*); | 64 void trace(Visitor*); |
| 65 | 65 |
| 66 // ContextLifecycleObserver | 66 // ContextLifecycleObserver |
| 67 virtual void contextDestroyed() override; | 67 virtual void contextDestroyed() override; |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 class PendingAction; | 70 class PendingAction; |
| 71 friend class MediaKeysInitializer; | |
| 72 MediaKeys(ExecutionContext*, const String& keySystem, PassOwnPtr<blink::WebC ontentDecryptionModule>); | |
| 73 | 71 |
| 74 ScriptPromise setServerCertificateInternal(ScriptState*, PassRefPtr<ArrayBuf fer> initData); | 72 ScriptPromise setServerCertificateInternal(ScriptState*, PassRefPtr<ArrayBuf fer> initData); |
| 75 | 73 |
| 76 void timerFired(Timer<MediaKeys>*); | 74 void timerFired(Timer<MediaKeys>*); |
| 77 | 75 |
| 78 const String m_keySystem; | 76 const String m_keySystem; |
| 79 OwnPtr<blink::WebContentDecryptionModule> m_cdm; | 77 OwnPtr<blink::WebContentDecryptionModule> m_cdm; |
| 80 | 78 |
| 81 HeapDeque<Member<PendingAction> > m_pendingActions; | 79 HeapDeque<Member<PendingAction> > m_pendingActions; |
| 82 Timer<MediaKeys> m_timer; | 80 Timer<MediaKeys> m_timer; |
| 83 }; | 81 }; |
| 84 | 82 |
| 85 } // namespace blink | 83 } // namespace blink |
| 86 | 84 |
| 87 #endif // MediaKeys_h | 85 #endif // MediaKeys_h |
| OLD | NEW |