| 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 19 matching lines...) Expand all Loading... |
| 30 #include "bindings/core/v8/ScriptWrappable.h" | 30 #include "bindings/core/v8/ScriptWrappable.h" |
| 31 #include "core/dom/ContextLifecycleObserver.h" | 31 #include "core/dom/ContextLifecycleObserver.h" |
| 32 #include "wtf/Forward.h" | 32 #include "wtf/Forward.h" |
| 33 #include "wtf/text/WTFString.h" | 33 #include "wtf/text/WTFString.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class ExceptionState; | 37 class ExceptionState; |
| 38 class ExecutionContext; | 38 class ExecutionContext; |
| 39 class HTMLMediaElement; | 39 class HTMLMediaElement; |
| 40 class MediaKeySession; |
| 40 class ScriptState; | 41 class ScriptState; |
| 41 class WebContentDecryptionModule; | 42 class WebContentDecryptionModule; |
| 42 | 43 |
| 43 // References are held by JS and HTMLMediaElement. | 44 // References are held by JS and HTMLMediaElement. |
| 44 // The WebContentDecryptionModule has the same lifetime as this object. | 45 // The WebContentDecryptionModule has the same lifetime as this object. |
| 45 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ContextLif
ecycleObserver, public ScriptWrappable { | 46 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ContextLif
ecycleObserver, public ScriptWrappable { |
| 46 DEFINE_WRAPPERTYPEINFO(); | 47 DEFINE_WRAPPERTYPEINFO(); |
| 47 public: | 48 public: |
| 48 static ScriptPromise create(ScriptState*, const String& keySystem); | 49 static ScriptPromise create(ScriptState*, const String& keySystem); |
| 49 virtual ~MediaKeys(); | 50 virtual ~MediaKeys(); |
| 50 | 51 |
| 51 const String& keySystem() const { return m_keySystem; } | 52 const String& keySystem() const { return m_keySystem; } |
| 52 | 53 |
| 53 ScriptPromise createSession(ScriptState*, const String& initDataType, ArrayB
uffer* initData, const String& sessionType); | 54 MediaKeySession* createSession(ScriptState*, const String& sessionType); |
| 54 ScriptPromise createSession(ScriptState*, const String& initDataType, ArrayB
ufferView* initData, const String& sessionType); | |
| 55 | 55 |
| 56 static bool isTypeSupported(const String& keySystem, const String& contentTy
pe); | 56 static bool isTypeSupported(const String& keySystem, const String& contentTy
pe); |
| 57 | 57 |
| 58 blink::WebContentDecryptionModule* contentDecryptionModule(); | 58 blink::WebContentDecryptionModule* contentDecryptionModule(); |
| 59 | 59 |
| 60 void trace(Visitor*); | 60 void trace(Visitor*); |
| 61 | 61 |
| 62 // ContextLifecycleObserver | 62 // ContextLifecycleObserver |
| 63 virtual void contextDestroyed() OVERRIDE; | 63 virtual void contextDestroyed() OVERRIDE; |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 friend class MediaKeysInitializer; | 66 friend class MediaKeysInitializer; |
| 67 MediaKeys(ExecutionContext*, const String& keySystem, PassOwnPtr<blink::WebC
ontentDecryptionModule>); | 67 MediaKeys(ExecutionContext*, const String& keySystem, PassOwnPtr<blink::WebC
ontentDecryptionModule>); |
| 68 | 68 |
| 69 ScriptPromise createSessionInternal(ScriptState*, const String& initDataType
, PassRefPtr<ArrayBuffer> initData, const String& sessionType); | |
| 70 | |
| 71 const String m_keySystem; | 69 const String m_keySystem; |
| 72 OwnPtr<blink::WebContentDecryptionModule> m_cdm; | 70 OwnPtr<blink::WebContentDecryptionModule> m_cdm; |
| 73 }; | 71 }; |
| 74 | 72 |
| 75 } // namespace blink | 73 } // namespace blink |
| 76 | 74 |
| 77 #endif // MediaKeys_h | 75 #endif // MediaKeys_h |
| OLD | NEW |