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

Unified Diff: media/base/player_tracker.h

Issue 308073004: Add PlayerTracker and BrowserCdm interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 7 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
« no previous file with comments | « media/base/cdm_factory.h ('k') | media/base/player_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/player_tracker.h
diff --git a/media/base/player_tracker.h b/media/base/player_tracker.h
new file mode 100644
index 0000000000000000000000000000000000000000..0ed1b3f8001be27318bf7ea778fa09c45cbc9870
--- /dev/null
+++ b/media/base/player_tracker.h
@@ -0,0 +1,41 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_BASE_PLAYER_TRACKER_H_
+#define MEDIA_BASE_PLAYER_TRACKER_H_
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+// An interface for players to register to be notified when a new decryption key
+// becomes available or when the CDM is unset.
+class MEDIA_EXPORT PlayerTracker {
+ public:
+ virtual ~PlayerTracker();
+
+ // Registers player callbacks with the CDM.
+ // - |new_key_cb| is fired when a new decryption key becomes available.
+ // - |cdm_unset_cb| is fired when the CDM is detached from the player.
+ // Returns a registration ID which can be used to unregister a player.
+ virtual int RegisterPlayer(const base::Closure& new_key_cb,
+ const base::Closure& cdm_unset_cb) = 0;
+
+ // Unregisters a previously registered player. This should be called when
+ // the CDM is detached from the player (e.g. setMediaKeys(0)), or when the
+ // player is destroyed.
+ virtual void UnregisterPlayer(int registration_id) = 0;
+
+ protected:
+ PlayerTracker();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PlayerTracker);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_PLAYER_TRACKER_H_
« no previous file with comments | « media/base/cdm_factory.h ('k') | media/base/player_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698