summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorxhwang <xhwang@chromium.org>2014-10-20 18:59:59 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-21 02:02:20 +0000
commitfa26b63208db8afbdc41d68dc2aa1243690d8325 (patch)
tree9eb4b9c123485ad04b6f40440b021a0cb07cafd6 /media
parent34989288c23b9af5d7d6ee3cb053f22d72fd7601 (diff)
downloadchromium_src-fa26b63208db8afbdc41d68dc2aa1243690d8325.zip
chromium_src-fa26b63208db8afbdc41d68dc2aa1243690d8325.tar.gz
chromium_src-fa26b63208db8afbdc41d68dc2aa1243690d8325.tar.bz2
Add MediaKeys::GetCdmId().
BUG=422730 Review URL: https://codereview.chromium.org/665563002 Cr-Commit-Position: refs/heads/master@{#300401}
Diffstat (limited to 'media')
-rw-r--r--media/base/cdm_factory.h3
-rw-r--r--media/base/media_keys.cc4
-rw-r--r--media/base/media_keys.h11
-rw-r--r--media/cdm/aes_decryptor.cc6
-rw-r--r--media/cdm/aes_decryptor.h3
5 files changed, 22 insertions, 5 deletions
diff --git a/media/base/cdm_factory.h b/media/base/cdm_factory.h
index 17dea81..570c042 100644
--- a/media/base/cdm_factory.h
+++ b/media/base/cdm_factory.h
@@ -23,9 +23,6 @@ class MEDIA_EXPORT CdmFactory {
virtual scoped_ptr<MediaKeys> Create(
const std::string& key_system,
const GURL& security_origin,
-#if defined(ENABLE_BROWSER_CDMS)
- int* cdm_id, // Output parameter indicating the CDM ID of the MediaKeys.
-#endif
const SessionMessageCB& session_message_cb,
const SessionReadyCB& session_ready_cb,
const SessionClosedCB& session_closed_cb,
diff --git a/media/base/media_keys.cc b/media/base/media_keys.cc
index fd01de1..a8e9481 100644
--- a/media/base/media_keys.cc
+++ b/media/base/media_keys.cc
@@ -10,6 +10,8 @@ MediaKeys::MediaKeys() {}
MediaKeys::~MediaKeys() {}
-Decryptor* MediaKeys::GetDecryptor() { return NULL; }
+Decryptor* MediaKeys::GetDecryptor() {
+ return NULL;
+}
} // namespace media
diff --git a/media/base/media_keys.h b/media/base/media_keys.h
index ac4f8a4..022f6bc 100644
--- a/media/base/media_keys.h
+++ b/media/base/media_keys.h
@@ -71,7 +71,10 @@ class MEDIA_EXPORT MediaKeys {
PERSISTENT_SESSION
};
- const static uint32 kInvalidSessionId = 0;
+ static const uint32 kInvalidSessionId = 0;
+#if defined(ENABLE_BROWSER_CDMS)
+ static const int kInvalidCdmId = 0;
+#endif
MediaKeys();
virtual ~MediaKeys();
@@ -123,6 +126,12 @@ class MEDIA_EXPORT MediaKeys {
// to be valid during the MediaKeys' lifetime.
virtual Decryptor* GetDecryptor();
+#if defined(ENABLE_BROWSER_CDMS)
+ // Returns the CDM ID associated with |this|. May be kInvalidCdmId if no CDM
+ // ID is associated.
+ virtual int GetCdmId() const = 0;
+#endif
+
private:
DISALLOW_COPY_AND_ASSIGN(MediaKeys);
};
diff --git a/media/cdm/aes_decryptor.cc b/media/cdm/aes_decryptor.cc
index 23f41d7..416ba57 100644
--- a/media/cdm/aes_decryptor.cc
+++ b/media/cdm/aes_decryptor.cc
@@ -388,6 +388,12 @@ Decryptor* AesDecryptor::GetDecryptor() {
return this;
}
+#if defined(ENABLE_BROWSER_CDMS)
+int AesDecryptor::GetCdmId() const {
+ return kInvalidCdmId;
+}
+#endif // defined(ENABLE_BROWSER_CDMS)
+
void AesDecryptor::RegisterNewKeyCB(StreamType stream_type,
const NewKeyCB& new_key_cb) {
base::AutoLock auto_lock(new_key_cb_lock_);
diff --git a/media/cdm/aes_decryptor.h b/media/cdm/aes_decryptor.h
index 306ceb9..1275dd5 100644
--- a/media/cdm/aes_decryptor.h
+++ b/media/cdm/aes_decryptor.h
@@ -55,6 +55,9 @@ class MEDIA_EXPORT AesDecryptor : public MediaKeys, public Decryptor {
virtual void GetUsableKeyIds(const std::string& web_session_id,
scoped_ptr<KeyIdsPromise> promise) override;
virtual Decryptor* GetDecryptor() override;
+#if defined(ENABLE_BROWSER_CDMS)
+ virtual int GetCdmId() const override;
+#endif // defined(ENABLE_BROWSER_CDMS)
// Decryptor implementation.
virtual void RegisterNewKeyCB(StreamType stream_type,