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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // References are held by JS and HTMLMediaElement. | 46 // References are held by JS and HTMLMediaElement. |
47 // The WebContentDecryptionModule has the same lifetime as this object. | 47 // The WebContentDecryptionModule has the same lifetime as this object. |
48 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ContextLif
ecycleObserver, public ScriptWrappable { | 48 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ContextLif
ecycleObserver, public ScriptWrappable { |
49 public: | 49 public: |
50 static ScriptPromise create(ScriptState*, const String& keySystem); | 50 static ScriptPromise create(ScriptState*, const String& keySystem); |
51 virtual ~MediaKeys(); | 51 virtual ~MediaKeys(); |
52 | 52 |
53 const String& keySystem() const { return m_keySystem; } | 53 const String& keySystem() const { return m_keySystem; } |
54 | 54 |
55 ScriptPromise createSession(ScriptState*, const String& initDataType, Uint8A
rray* initData, const String& sessionType); | 55 ScriptPromise createSession(ScriptState*, const String& initDataType, ArrayB
uffer* initData, const String& sessionType); |
| 56 ScriptPromise createSession(ScriptState*, const String& initDataType, ArrayB
ufferView* initData, const String& sessionType); |
56 | 57 |
57 static bool isTypeSupported(const String& keySystem, const String& contentTy
pe); | 58 static bool isTypeSupported(const String& keySystem, const String& contentTy
pe); |
58 | 59 |
59 blink::WebContentDecryptionModule* contentDecryptionModule(); | 60 blink::WebContentDecryptionModule* contentDecryptionModule(); |
60 | 61 |
61 void trace(Visitor*); | 62 void trace(Visitor*); |
62 | 63 |
63 // ContextLifecycleObserver | 64 // ContextLifecycleObserver |
64 virtual void contextDestroyed() OVERRIDE; | 65 virtual void contextDestroyed() OVERRIDE; |
65 | 66 |
66 private: | 67 private: |
67 friend class MediaKeysInitializer; | 68 friend class MediaKeysInitializer; |
68 MediaKeys(ExecutionContext*, const String& keySystem, PassOwnPtr<blink::WebC
ontentDecryptionModule>); | 69 MediaKeys(ExecutionContext*, const String& keySystem, PassOwnPtr<blink::WebC
ontentDecryptionModule>); |
69 | 70 |
| 71 ScriptPromise createSessionInternal(ScriptState*, const String& initDataType
, PassRefPtr<ArrayBuffer> initData, const String& sessionType); |
| 72 |
70 const String m_keySystem; | 73 const String m_keySystem; |
71 OwnPtr<blink::WebContentDecryptionModule> m_cdm; | 74 OwnPtr<blink::WebContentDecryptionModule> m_cdm; |
72 }; | 75 }; |
73 | 76 |
74 } | 77 } |
75 | 78 |
76 #endif // MediaKeys_h | 79 #endif // MediaKeys_h |
OLD | NEW |