Index: media/cdm/ppapi/ppapi_cdm_adapter.cc |
diff --git a/media/cdm/ppapi/ppapi_cdm_adapter.cc b/media/cdm/ppapi/ppapi_cdm_adapter.cc |
index a28d7037db85777666dbd642ffa4ceedd4415e68..d3a143a44aed157f8eee1474e0f6b74caacac6cd 100644 |
--- a/media/cdm/ppapi/ppapi_cdm_adapter.cc |
+++ b/media/cdm/ppapi/ppapi_cdm_adapter.cc |
@@ -320,14 +320,14 @@ |
PpapiCdmAdapter::PpapiCdmAdapter(PP_Instance instance, pp::Module* module) |
: pp::Instance(instance), |
pp::ContentDecryptor_Private(this), |
+#if defined(OS_CHROMEOS) |
output_protection_(this), |
+ platform_verification_(this), |
output_link_mask_(0), |
output_protection_mask_(0), |
query_output_protection_in_progress_(false), |
uma_for_output_protection_query_reported_(false), |
uma_for_output_protection_positive_result_reported_(false), |
-#if defined(OS_CHROMEOS) |
- platform_verification_(this), |
#endif |
allocator_(this), |
cdm_(NULL), |
@@ -1069,6 +1069,7 @@ |
} |
void PpapiCdmAdapter::EnableOutputProtection(uint32_t desired_protection_mask) { |
+#if defined(OS_CHROMEOS) |
int32_t result = output_protection_.EnableProtection( |
desired_protection_mask, |
callback_factory_.NewCallback(&PpapiCdmAdapter::EnableProtectionDone)); |
@@ -1078,9 +1079,11 @@ |
if (result != PP_OK && result != PP_OK_COMPLETIONPENDING) |
CDM_DLOG() << __FUNCTION__ << " failed!"; |
+#endif |
} |
void PpapiCdmAdapter::QueryOutputProtectionStatus() { |
+#if defined(OS_CHROMEOS) |
PP_DCHECK(!query_output_protection_in_progress_); |
output_link_mask_ = output_protection_mask_ = 0; |
@@ -1097,6 +1100,8 @@ |
// Fall through on error and issue an empty OnQueryOutputProtectionStatus(). |
PP_DCHECK(result != PP_OK); |
CDM_DLOG() << __FUNCTION__ << " failed, result = " << result; |
+#endif |
+ cdm_->OnQueryOutputProtectionStatus(cdm::kQueryFailed, 0, 0); |
} |
void PpapiCdmAdapter::OnDeferredInitializationDone(cdm::StreamType stream_type, |
@@ -1134,6 +1139,7 @@ |
callback_factory_.NewCallback(&PpapiCdmAdapter::OnFirstFileRead)); |
} |
+#if defined(OS_CHROMEOS) |
void PpapiCdmAdapter::ReportOutputProtectionUMA(OutputProtectionStatus status) { |
pp::UMAPrivate uma_interface(this); |
uma_interface.HistogramEnumeration("Media.EME.OutputProtection", status, |
@@ -1163,10 +1169,9 @@ |
const uint32_t kProtectableLinks = |
cdm::kLinkTypeHDMI | cdm::kLinkTypeDVI | cdm::kLinkTypeDisplayPort; |
- bool is_unprotectable_link_connected = |
- (external_links & ~kProtectableLinks) != 0; |
+ bool is_unprotectable_link_connected = external_links & ~kProtectableLinks; |
bool is_hdcp_enabled_on_all_protectable_links = |
- (output_protection_mask_ & cdm::kProtectionHDCP) != 0; |
+ output_protection_mask_ & cdm::kProtectionHDCP; |
if (!is_unprotectable_link_connected && |
is_hdcp_enabled_on_all_protectable_links) { |
@@ -1180,7 +1185,6 @@ |
// queries and success results. |
} |
-#if defined(OS_CHROMEOS) |
void PpapiCdmAdapter::SendPlatformChallengeDone( |
int32_t result, |
const linked_ptr<PepperPlatformChallengeResponse>& response) { |
@@ -1208,7 +1212,6 @@ |
signed_data_var.Unmap(); |
signed_data_signature_var.Unmap(); |
} |
-#endif |
void PpapiCdmAdapter::EnableProtectionDone(int32_t result) { |
// Does nothing since clients must call QueryOutputProtectionStatus() to |
@@ -1234,6 +1237,7 @@ |
cdm_->OnQueryOutputProtectionStatus(query_result, output_link_mask_, |
output_protection_mask_); |
} |
+#endif |
PpapiCdmAdapter::SessionError::SessionError( |
cdm::Error error, |