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

Unified Diff: Source/modules/encryptedmedia/MediaKeys.h

Issue 132823005: Schedule session initialization in MediaKeys. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@rename_close_gkr
Patch Set: Initial patch set. Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/encryptedmedia/MediaKeys.h
diff --git a/Source/modules/encryptedmedia/MediaKeys.h b/Source/modules/encryptedmedia/MediaKeys.h
index 96700140ec3bbd2bdeaa77ee6718f4aa8926d41d..f4e5eb54f1e121e3294431f1753634060c9e6369 100644
--- a/Source/modules/encryptedmedia/MediaKeys.h
+++ b/Source/modules/encryptedmedia/MediaKeys.h
@@ -28,6 +28,9 @@
#include "bindings/v8/ScriptWrappable.h"
#include "core/events/EventTarget.h"
+#include "modules/encryptedmedia/MediaKeySession.h"
acolwell GONE FROM CHROMIUM 2014/01/13 18:35:37 Why do you need to include this now?
xhwang 2014/01/13 19:06:03 For the template parameter on l.80.
+#include "platform/Timer.h"
+#include "wtf/Deque.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
@@ -42,7 +45,6 @@ class WebContentDecryptionModule;
namespace WebCore {
class ContentDecryptionModule;
-class MediaKeySession;
class HTMLMediaElement;
class ExceptionState;
@@ -65,12 +67,26 @@ public:
protected:
MediaKeys(const String& keySystem, PassOwnPtr<ContentDecryptionModule>);
+ void initializeNewSessionTimerFired(Timer<MediaKeys>*);
Vector<RefPtr<MediaKeySession> > m_sessions;
HTMLMediaElement* m_mediaElement;
const String m_keySystem;
OwnPtr<ContentDecryptionModule> m_cdm;
+
+ // FIXME: Check whether |initData| can be changed by JS. Maybe we should not pass it as a pointer.
+ struct InitializeNewSessionData {
+ InitializeNewSessionData(PassRefPtr<MediaKeySession> session, const String& mimeType, Uint8Array* initData)
acolwell GONE FROM CHROMIUM 2014/01/13 18:35:37 Use PassRefPtr<Uint8Array> for initData.
xhwang 2014/01/13 19:06:03 Done.
+ : session(session)
+ , mimeType(mimeType)
+ , initData(initData) { }
+ RefPtr<MediaKeySession> session;
+ String mimeType;
+ RefPtr<Uint8Array> initData;
+ };
+ Deque<InitializeNewSessionData> m_pendingInitializeNewSessionData;
+ Timer<MediaKeys> m_initializeNewSessionTimer;
};
}

Powered by Google App Engine
This is Rietveld 408576698