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_ |