Index: media/cdm/ppapi/external_clear_key/clear_key_cdm.cc |
diff --git a/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc b/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc |
index 026fd0c03ebb69e193dcb3c72026a6a9419cf67d..ea90a2e4baebb4d4840f87e07f82b6c15ffb1ac0 100644 |
--- a/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc |
+++ b/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc |
@@ -170,6 +170,21 @@ static media::MediaKeys::SessionType ConvertSessionType( |
return media::MediaKeys::TEMPORARY_SESSION; |
} |
+// TODO(jrummell): |init_data_type| should be an enum all the way through |
+// Chromium. http://crbug.com/469228 |
+static std::string ConvertInitDataType(cdm::InitDataType init_data_type) { |
+ switch (init_data_type) { |
+ case cdm::kCenc: |
+ return "cenc"; |
+ case cdm::kKeyIds: |
+ return "keyids"; |
+ case cdm::kWebM: |
+ return "webm"; |
+ } |
+ NOTIMPLEMENTED(); |
xhwang
2015/03/23 20:35:37
NOTREACHED()?
jrummell
2015/03/23 21:47:07
Done. I just copied what was used in the other con
|
+ return "keyids"; |
+} |
+ |
cdm::KeyStatus ConvertKeyStatus(media::CdmKeyInformation::KeyStatus status) { |
switch (status) { |
case media::CdmKeyInformation::KeyStatus::USABLE: |
@@ -279,12 +294,18 @@ ClearKeyCdm::ClearKeyCdm(ClearKeyCdmHost* host, const std::string& key_system) |
ClearKeyCdm::~ClearKeyCdm() {} |
-void ClearKeyCdm::CreateSessionAndGenerateRequest(uint32 promise_id, |
- cdm::SessionType session_type, |
- const char* init_data_type, |
- uint32 init_data_type_size, |
- const uint8* init_data, |
- uint32 init_data_size) { |
+void ClearKeyCdm::Initialize(bool allow_distinctive_identifier, |
+ bool allow_persistent_state) { |
xhwang
2015/03/23 20:35:37
Comment out /* unused_parameter */ ?
https://goog
jrummell
2015/03/23 21:47:07
Done.
|
+ // Implementation doesn't use distinctive identifier nor save persistent data, |
+ // so nothing to do with these values. |
+} |
+ |
+void ClearKeyCdm::CreateSessionAndGenerateRequest( |
+ uint32 promise_id, |
+ cdm::SessionType session_type, |
+ cdm::InitDataType init_data_type, |
+ const uint8* init_data, |
+ uint32 init_data_size) { |
DVLOG(1) << __FUNCTION__; |
scoped_ptr<media::NewSessionCdmPromise> promise( |
@@ -296,9 +317,8 @@ void ClearKeyCdm::CreateSessionAndGenerateRequest(uint32 promise_id, |
base::Unretained(this), |
promise_id))); |
decryptor_.CreateSessionAndGenerateRequest( |
- ConvertSessionType(session_type), |
- std::string(init_data_type, init_data_type_size), init_data, |
- init_data_size, promise.Pass()); |
+ ConvertSessionType(session_type), ConvertInitDataType(init_data_type), |
+ init_data, init_data_size, promise.Pass()); |
if (key_system_ == kExternalClearKeyFileIOTestKeySystem) |
StartFileIOTest(); |