Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(655)

Side by Side Diff: Source/modules/encryptedmedia/MediaKeys.h

Issue 946503002: Filter supported session types in createSession(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@export
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #ifndef MediaKeys_h 26 #ifndef MediaKeys_h
27 #define MediaKeys_h 27 #define MediaKeys_h
28 28
29 #include "bindings/core/v8/ScriptPromise.h" 29 #include "bindings/core/v8/ScriptPromise.h"
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 "core/dom/DOMArrayPiece.h" 32 #include "core/dom/DOMArrayPiece.h"
33 #include "platform/Timer.h" 33 #include "platform/Timer.h"
34 #include "public/platform/WebMediaKeySystemConfiguration.h"
34 #include "wtf/Forward.h" 35 #include "wtf/Forward.h"
35 #include "wtf/text/WTFString.h" 36 #include "wtf/text/WTFString.h"
36 37
37 namespace blink { 38 namespace blink {
38 39
39 class ExceptionState; 40 class ExceptionState;
40 class ExecutionContext; 41 class ExecutionContext;
41 class MediaKeySession; 42 class MediaKeySession;
42 class ScriptState; 43 class ScriptState;
43 class WebContentDecryptionModule; 44 class WebContentDecryptionModule;
44 45
45 // References are held by JS and HTMLMediaElement. 46 // References are held by JS and HTMLMediaElement.
46 // The WebContentDecryptionModule has the same lifetime as this object. 47 // The WebContentDecryptionModule has the same lifetime as this object.
47 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ContextLif ecycleObserver, public ScriptWrappable { 48 class MediaKeys : public GarbageCollectedFinalized<MediaKeys>, public ContextLif ecycleObserver, public ScriptWrappable {
48 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeys); 49 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeys);
49 DEFINE_WRAPPERTYPEINFO(); 50 DEFINE_WRAPPERTYPEINFO();
50 public: 51 public:
51 MediaKeys(ExecutionContext*, const String& keySystem, PassOwnPtr<WebContentD ecryptionModule>); 52 MediaKeys(ExecutionContext*, const String& keySystem, const blink::WebMediaK eySystemConfiguration&, PassOwnPtr<WebContentDecryptionModule>);
52 virtual ~MediaKeys(); 53 virtual ~MediaKeys();
53 54
54 // FIXME: This should be removed after crbug.com/425186 is fully 55 // FIXME: This should be removed after crbug.com/425186 is fully
55 // implemented. 56 // implemented.
56 const String& keySystem() const { return m_keySystem; } 57 const String& keySystem() const { return m_keySystem; }
57 58
58 MediaKeySession* createSession(ScriptState*, const String& sessionType, Exce ptionState&); 59 MediaKeySession* createSession(ScriptState*, const String& sessionType, Exce ptionState&);
59 60
60 ScriptPromise setServerCertificate(ScriptState*, const DOMArrayPiece& server Certificate); 61 ScriptPromise setServerCertificate(ScriptState*, const DOMArrayPiece& server Certificate);
61 62
62 blink::WebContentDecryptionModule* contentDecryptionModule(); 63 blink::WebContentDecryptionModule* contentDecryptionModule();
63 64
64 virtual void trace(Visitor*) override; 65 virtual void trace(Visitor*) override;
65 66
66 // ContextLifecycleObserver 67 // ContextLifecycleObserver
67 virtual void contextDestroyed() override; 68 virtual void contextDestroyed() override;
68 69
69 private: 70 private:
70 class PendingAction; 71 class PendingAction;
71 72
72 void timerFired(Timer<MediaKeys>*); 73 void timerFired(Timer<MediaKeys>*);
73 74
74 const String m_keySystem; 75 const String m_keySystem;
76 const blink::WebMediaKeySystemConfiguration m_configuration;
75 OwnPtr<blink::WebContentDecryptionModule> m_cdm; 77 OwnPtr<blink::WebContentDecryptionModule> m_cdm;
76 78
77 HeapDeque<Member<PendingAction>> m_pendingActions; 79 HeapDeque<Member<PendingAction>> m_pendingActions;
78 Timer<MediaKeys> m_timer; 80 Timer<MediaKeys> m_timer;
79 }; 81 };
80 82
81 } // namespace blink 83 } // namespace blink
82 84
83 #endif // MediaKeys_h 85 #endif // MediaKeys_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698