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

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

Issue 686893004: Remove obsolete ready and error events from MediaKeySession. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Completely remove events Created 6 years, 1 month 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<MediaKeyS ession>, public ActiveDOMObject, public EventTargetWithInlineData 60 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<MediaKeyS ession>, public ActiveDOMObject, public EventTargetWithInlineData
61 , private WebContentDecryptionModuleSession::Client { 61 , private WebContentDecryptionModuleSession::Client {
62 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<M ediaKeySession>); 62 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<M ediaKeySession>);
63 DEFINE_WRAPPERTYPEINFO(); 63 DEFINE_WRAPPERTYPEINFO();
64 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession); 64 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(MediaKeySession);
65 public: 65 public:
66 static MediaKeySession* create(ScriptState*, MediaKeys*, const String& sessi onType); 66 static MediaKeySession* create(ScriptState*, MediaKeys*, const String& sessi onType);
67 static bool isValidSessionType(const String& sessionType); 67 static bool isValidSessionType(const String& sessionType);
68 virtual ~MediaKeySession(); 68 virtual ~MediaKeySession();
69 69
70 const String& keySystem() const { return m_keySystem; }
71 String sessionId() const; 70 String sessionId() const;
72 double expiration() const { return m_expiration; } 71 double expiration() const { return m_expiration; }
73 ScriptPromise closed(ScriptState*); 72 ScriptPromise closed(ScriptState*);
74 73
75 ScriptPromise generateRequest(ScriptState*, const String& initDataType, DOMA rrayBuffer* initData); 74 ScriptPromise generateRequest(ScriptState*, const String& initDataType, DOMA rrayBuffer* initData);
76 ScriptPromise generateRequest(ScriptState*, const String& initDataType, DOMA rrayBufferView* initData); 75 ScriptPromise generateRequest(ScriptState*, const String& initDataType, DOMA rrayBufferView* initData);
77 ScriptPromise load(ScriptState*, const String& sessionId); 76 ScriptPromise load(ScriptState*, const String& sessionId);
78 77
79 void setError(MediaKeyError*);
80 MediaKeyError* error() { return m_error.get(); }
81
82 ScriptPromise update(ScriptState*, DOMArrayBuffer* response); 78 ScriptPromise update(ScriptState*, DOMArrayBuffer* response);
83 ScriptPromise update(ScriptState*, DOMArrayBufferView* response); 79 ScriptPromise update(ScriptState*, DOMArrayBufferView* response);
84 ScriptPromise close(ScriptState*); 80 ScriptPromise close(ScriptState*);
85 ScriptPromise remove(ScriptState*); 81 ScriptPromise remove(ScriptState*);
86 82
87 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>); 83 void enqueueEvent(PassRefPtrWillBeRawPtr<Event>);
88 84
89 // EventTarget 85 // EventTarget
90 virtual const AtomicString& interfaceName() const override; 86 virtual const AtomicString& interfaceName() const override;
91 virtual ExecutionContext* executionContext() const override; 87 virtual ExecutionContext* executionContext() const override;
92 88
93 // ActiveDOMObject 89 // ActiveDOMObject
94 virtual bool hasPendingActivity() const override; 90 virtual bool hasPendingActivity() const override;
95 virtual void stop() override; 91 virtual void stop() override;
96 92
97 virtual void trace(Visitor*) override; 93 virtual void trace(Visitor*) override;
98 94
99 private: 95 private:
100 class PendingAction; 96 class PendingAction;
101 friend class NewSessionResult; 97 friend class NewSessionResult;
102 friend class LoadSessionResult; 98 friend class LoadSessionResult;
103 99
104 MediaKeySession(ScriptState*, MediaKeys*, const String& sessionType); 100 MediaKeySession(ScriptState*, MediaKeys*, const String& sessionType);
105 101
106 void actionTimerFired(Timer<MediaKeySession>*); 102 void actionTimerFired(Timer<MediaKeySession>*);
107 103
108 // WebContentDecryptionModuleSession::Client 104 // WebContentDecryptionModuleSession::Client
109 virtual void message(const unsigned char* message, size_t messageLength, con st WebURL& destinationURL) override; 105 virtual void message(const unsigned char* message, size_t messageLength, con st WebURL& destinationURL) override;
110 virtual void ready() override;
111 virtual void close() override; 106 virtual void close() override;
112 virtual void error(MediaKeyErrorCode, unsigned long systemCode) override;
113 virtual void error(WebContentDecryptionModuleException, unsigned long system Code, const WebString& errorMessage) override;
114 virtual void expirationChanged(double updatedExpiryTimeInMS) override; 107 virtual void expirationChanged(double updatedExpiryTimeInMS) override;
115 108
116 ScriptPromise generateRequestInternal(ScriptState*, const String& initDataTy pe, PassRefPtr<ArrayBuffer> initData); 109 ScriptPromise generateRequestInternal(ScriptState*, const String& initDataTy pe, PassRefPtr<ArrayBuffer> initData);
117 ScriptPromise updateInternal(ScriptState*, PassRefPtr<ArrayBuffer> response) ; 110 ScriptPromise updateInternal(ScriptState*, PassRefPtr<ArrayBuffer> response) ;
118 111
119 // Called by NewSessionResult when the new session has been created. 112 // Called by NewSessionResult when the new session has been created.
120 void finishGenerateRequest(); 113 void finishGenerateRequest();
121 114
122 // Called by LoadSessionResult when the session has been loaded. 115 // Called by LoadSessionResult when the session has been loaded.
123 void finishLoad(); 116 void finishLoad();
124 117
125 String m_keySystem; 118 String m_keySystem;
126 RefPtrWillBeMember<MediaKeyError> m_error;
127 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; 119 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue;
128 OwnPtr<WebContentDecryptionModuleSession> m_session; 120 OwnPtr<WebContentDecryptionModuleSession> m_session;
129 121
130 // Used to determine if MediaKeys is still active. 122 // Used to determine if MediaKeys is still active.
131 WeakMember<MediaKeys> m_mediaKeys; 123 WeakMember<MediaKeys> m_mediaKeys;
132 124
133 // Session properties. 125 // Session properties.
134 String m_sessionType; 126 String m_sessionType;
135 double m_expiration; 127 double m_expiration;
136 128
137 // Session states. 129 // Session states.
138 bool m_isUninitialized; 130 bool m_isUninitialized;
139 bool m_isCallable; 131 bool m_isCallable;
140 bool m_isClosed; // Is the CDM finished with this session? 132 bool m_isClosed; // Is the CDM finished with this session?
141 133
142 // Keep track of the closed promise. 134 // Keep track of the closed promise.
143 typedef ScriptPromiseProperty<Member<MediaKeySession>, V8UndefinedType, RefP trWillBeMember<DOMException> > ClosedPromise; 135 typedef ScriptPromiseProperty<Member<MediaKeySession>, V8UndefinedType, RefP trWillBeMember<DOMException> > ClosedPromise;
144 Member<ClosedPromise> m_closedPromise; 136 Member<ClosedPromise> m_closedPromise;
145 137
146 HeapDeque<Member<PendingAction> > m_pendingActions; 138 HeapDeque<Member<PendingAction> > m_pendingActions;
147 Timer<MediaKeySession> m_actionTimer; 139 Timer<MediaKeySession> m_actionTimer;
148 }; 140 };
149 141
150 } // namespace blink 142 } // namespace blink
151 143
152 #endif // MediaKeySession_h 144 #endif // MediaKeySession_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698