| Index: ui/display/manager/chromeos/display_configurator.cc
|
| diff --git a/ui/display/manager/chromeos/display_configurator.cc b/ui/display/manager/chromeos/display_configurator.cc
|
| index d718eb8f02b969562b4f8194f5cbd649fa4666c6..11f52c3f1aaf772fdd790e68e896039142077103 100644
|
| --- a/ui/display/manager/chromeos/display_configurator.cc
|
| +++ b/ui/display/manager/chromeos/display_configurator.cc
|
| @@ -490,7 +490,7 @@ DisplayConfigurator::~DisplayConfigurator() {
|
| CallAndClearQueuedCallbacks(false);
|
|
|
| while (!query_protection_callbacks_.empty()) {
|
| - query_protection_callbacks_.front().Run(QueryProtectionResponse());
|
| + query_protection_callbacks_.front().Run(false, 0, 0);
|
| query_protection_callbacks_.pop();
|
| }
|
|
|
| @@ -641,16 +641,15 @@ void DisplayConfigurator::ForceInitialConfigure(
|
| configuration_task_->Run();
|
| }
|
|
|
| -DisplayConfigurator::ContentProtectionClientId
|
| -DisplayConfigurator::RegisterContentProtectionClient() {
|
| +uint64_t DisplayConfigurator::RegisterContentProtectionClient() {
|
| if (!configure_display_ || display_externally_controlled_)
|
| - return kInvalidClientId;
|
| + return INVALID_CLIENT_ID;
|
|
|
| return next_display_protection_client_id_++;
|
| }
|
|
|
| void DisplayConfigurator::UnregisterContentProtectionClient(
|
| - ContentProtectionClientId client_id) {
|
| + uint64_t client_id) {
|
| client_protection_requests_.erase(client_id);
|
|
|
| ContentProtections protections;
|
| @@ -685,7 +684,7 @@ void DisplayConfigurator::OnContentProtectionClientUnregistered(bool success) {
|
| }
|
|
|
| void DisplayConfigurator::QueryContentProtectionStatus(
|
| - ContentProtectionClientId client_id,
|
| + uint64_t client_id,
|
| int64_t display_id,
|
| const QueryProtectionCallback& callback) {
|
| // Exclude virtual displays so that protected content will not be recaptured
|
| @@ -693,13 +692,13 @@ void DisplayConfigurator::QueryContentProtectionStatus(
|
| for (const DisplaySnapshot* display : cached_displays_) {
|
| if (display->display_id() == display_id &&
|
| !IsPhysicalDisplayType(display->type())) {
|
| - callback.Run(QueryProtectionResponse());
|
| + callback.Run(false, 0, 0);
|
| return;
|
| }
|
| }
|
|
|
| if (!configure_display_ || display_externally_controlled_) {
|
| - callback.Run(QueryProtectionResponse());
|
| + callback.Run(false, 0, 0);
|
| return;
|
| }
|
|
|
| @@ -715,20 +714,20 @@ void DisplayConfigurator::QueryContentProtectionStatus(
|
| }
|
|
|
| void DisplayConfigurator::OnContentProtectionQueried(
|
| - ContentProtectionClientId client_id,
|
| + uint64_t client_id,
|
| int64_t display_id,
|
| QueryContentProtectionTask::Response task_response) {
|
| - QueryProtectionResponse response;
|
| - response.success = task_response.success;
|
| - response.link_mask = task_response.link_mask;
|
| + bool success = task_response.success;
|
| + uint32_t link_mask = task_response.link_mask;
|
| + uint32_t protection_mask = task_response.link_mask;
|
|
|
| // Don't reveal protections requested by other clients.
|
| ProtectionRequests::iterator it = client_protection_requests_.find(client_id);
|
| - if (response.success && it != client_protection_requests_.end()) {
|
| + if (success && it != client_protection_requests_.end()) {
|
| uint32_t requested_mask = 0;
|
| if (it->second.find(display_id) != it->second.end())
|
| requested_mask = it->second[display_id];
|
| - response.protection_mask =
|
| + protection_mask =
|
| task_response.enabled & ~task_response.unfulfilled & requested_mask;
|
| }
|
|
|
| @@ -738,14 +737,14 @@ void DisplayConfigurator::OnContentProtectionQueried(
|
| DCHECK(!query_protection_callbacks_.empty());
|
| QueryProtectionCallback callback = query_protection_callbacks_.front();
|
| query_protection_callbacks_.pop();
|
| - callback.Run(response);
|
| + callback.Run(success, link_mask, protection_mask);
|
|
|
| if (!content_protection_tasks_.empty())
|
| content_protection_tasks_.front().Run();
|
| }
|
|
|
| void DisplayConfigurator::EnableContentProtection(
|
| - ContentProtectionClientId client_id,
|
| + uint64_t client_id,
|
| int64_t display_id,
|
| uint32_t desired_method_mask,
|
| const EnableProtectionCallback& callback) {
|
| @@ -779,7 +778,7 @@ void DisplayConfigurator::EnableContentProtection(
|
| }
|
|
|
| void DisplayConfigurator::OnContentProtectionEnabled(
|
| - ContentProtectionClientId client_id,
|
| + uint64_t client_id,
|
| int64_t display_id,
|
| uint32_t desired_method_mask,
|
| bool success) {
|
|
|