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

Unified Diff: media/mojo/services/mojo_cdm_service.cc

Issue 2425663003: media: Use native CDM enum types in media mojo interfaces (Closed)
Patch Set: comments addressed Created 4 years, 2 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
« no previous file with comments | « media/mojo/services/mojo_cdm_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/mojo_cdm_service.cc
diff --git a/media/mojo/services/mojo_cdm_service.cc b/media/mojo/services/mojo_cdm_service.cc
index 83e885ca17261bbac0a98e8a926da7f8fd3d603d..0d23993ace6fec5587e7be0e675e98c1ab6988b2 100644
--- a/media/mojo/services/mojo_cdm_service.cc
+++ b/media/mojo/services/mojo_cdm_service.cc
@@ -127,24 +127,21 @@ void MojoCdmService::SetServerCertificate(
}
void MojoCdmService::CreateSessionAndGenerateRequest(
- mojom::ContentDecryptionModule::SessionType session_type,
- mojom::ContentDecryptionModule::InitDataType init_data_type,
+ SessionType session_type,
+ EmeInitDataType init_data_type,
const std::vector<uint8_t>& init_data,
const CreateSessionAndGenerateRequestCallback& callback) {
DVLOG(2) << __FUNCTION__;
cdm_->CreateSessionAndGenerateRequest(
- static_cast<MediaKeys::SessionType>(session_type),
- static_cast<EmeInitDataType>(init_data_type), init_data,
+ session_type, init_data_type, init_data,
base::MakeUnique<NewSessionMojoCdmPromise>(callback));
}
-void MojoCdmService::LoadSession(
- mojom::ContentDecryptionModule::SessionType session_type,
- const std::string& session_id,
- const LoadSessionCallback& callback) {
+void MojoCdmService::LoadSession(SessionType session_type,
+ const std::string& session_id,
+ const LoadSessionCallback& callback) {
DVLOG(2) << __FUNCTION__;
- cdm_->LoadSession(static_cast<MediaKeys::SessionType>(session_type),
- session_id,
+ cdm_->LoadSession(session_type, session_id,
base::MakeUnique<NewSessionMojoCdmPromise>(callback));
}
@@ -184,7 +181,7 @@ void MojoCdmService::OnCdmCreated(const InitializeCallback& callback,
// populated. See http://crbug.com/469366
if (!cdm || !context_) {
cdm_promise_result->success = false;
- cdm_promise_result->exception = mojom::CdmException::NOT_SUPPORTED_ERROR;
+ cdm_promise_result->exception = MediaKeys::Exception::NOT_SUPPORTED_ERROR;
cdm_promise_result->system_code = 0;
cdm_promise_result->error_message = error_message;
callback.Run(std::move(cdm_promise_result), 0, nullptr);
@@ -219,8 +216,7 @@ void MojoCdmService::OnSessionMessage(const std::string& session_id,
MediaKeys::MessageType message_type,
const std::vector<uint8_t>& message) {
DVLOG(2) << __FUNCTION__ << "(" << message_type << ")";
- client_->OnSessionMessage(
- session_id, static_cast<mojom::CdmMessageType>(message_type), message);
+ client_->OnSessionMessage(session_id, message_type, message);
}
void MojoCdmService::OnSessionKeysChange(const std::string& session_id,
« no previous file with comments | « media/mojo/services/mojo_cdm_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698