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

Unified Diff: media/cdm/player_tracker_impl.h

Issue 1407933010: media: Make MediaKeys ref-counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cdm/default_cdm_factory.cc ('k') | media/cdm/player_tracker_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/player_tracker_impl.h
diff --git a/media/cdm/player_tracker_impl.h b/media/cdm/player_tracker_impl.h
index 6d4cee3b879eec66ecaf868ae6f83096be20b18a..7da1a2546ad2a5fb4a11a5dcfcb6b09bb3b2cf22 100644
--- a/media/cdm/player_tracker_impl.h
+++ b/media/cdm/player_tracker_impl.h
@@ -9,15 +9,14 @@
#include "base/basictypes.h"
#include "base/callback.h"
-#include "base/threading/thread_checker.h"
+#include "base/synchronization/lock.h"
#include "media/base/media_export.h"
#include "media/base/player_tracker.h"
namespace media {
// A common implementation that can be shared by different PlayerTracker
-// implementations. This class is not thread safe and should only be called
-// on one thread.
+// implementations. This class is thread safe and can be called on any thread.
class MEDIA_EXPORT PlayerTrackerImpl : public PlayerTracker {
public:
PlayerTrackerImpl();
@@ -34,18 +33,20 @@ class MEDIA_EXPORT PlayerTrackerImpl : public PlayerTracker {
private:
struct PlayerCallbacks {
- PlayerCallbacks(base::Closure new_key_cb, base::Closure cdm_unset_cb);
+ PlayerCallbacks(const base::Closure& new_key_cb,
+ const base::Closure& cdm_unset_cb);
~PlayerCallbacks();
base::Closure new_key_cb;
base::Closure cdm_unset_cb;
};
+ // Lock used to serialize access to other data members.
+ base::Lock lock_;
+
int next_registration_id_;
std::map<int, PlayerCallbacks> player_callbacks_map_;
- base::ThreadChecker thread_checker_;
-
DISALLOW_COPY_AND_ASSIGN(PlayerTrackerImpl);
};
« no previous file with comments | « media/cdm/default_cdm_factory.cc ('k') | media/cdm/player_tracker_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698