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

Unified Diff: media/base/browser_cdm.h

Issue 1341883003: Prepare MediaDrmBridge to work with MediaCodecPlayer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bug526755
Patch Set: Addressed Min's comments Created 5 years, 3 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: media/base/browser_cdm.h
diff --git a/media/base/browser_cdm.h b/media/base/browser_cdm.h
index f4902d8708bc16253b40a52b1dac41db923cab9d..8b116e74680eca62faba84cae0f9bc8775e9d5b1 100644
--- a/media/base/browser_cdm.h
+++ b/media/base/browser_cdm.h
@@ -5,6 +5,7 @@
#ifndef MEDIA_BASE_BROWSER_CDM_H_
#define MEDIA_BASE_BROWSER_CDM_H_
+#include "base/memory/scoped_ptr.h"
#include "media/base/media_export.h"
#include "media/base/media_keys.h"
#include "media/base/player_tracker.h"
@@ -16,6 +17,9 @@ class MEDIA_EXPORT BrowserCdm : public MediaKeys, public PlayerTracker {
public:
~BrowserCdm() override;
+ // Virtual destructor. For most subclasses we can delete on the caller thread.
+ virtual void DeleteOnCorrectThread();
+
protected:
BrowserCdm();
@@ -23,6 +27,14 @@ class MEDIA_EXPORT BrowserCdm : public MediaKeys, public PlayerTracker {
DISALLOW_COPY_AND_ASSIGN(BrowserCdm);
};
+struct MEDIA_EXPORT BrowserCdmDeleter {
+ inline void operator()(BrowserCdm* ptr) const {
+ ptr->DeleteOnCorrectThread();
+ }
+};
+
+typedef scoped_ptr<BrowserCdm, BrowserCdmDeleter> BrowserCdmPtr;
+
} // namespace media
#endif // MEDIA_BASE_BROWSER_CDM_H_

Powered by Google App Engine
This is Rietveld 408576698