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

Side by Side Diff: media/blink/key_system_config_selector.cc

Issue 2652373002: EME: Fail requestMediaKeySystemAccess if no capabilities specified (Closed)
Patch Set: more changes Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/blink/key_system_config_selector.h" 5 #include "media/blink/key_system_config_selector.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 EmeFeatureRequirement::Required; 663 EmeFeatureRequirement::Required;
664 } 664 }
665 } 665 }
666 666
667 // 14. Set the sessionTypes member of accumulated configuration to 667 // 14. Set the sessionTypes member of accumulated configuration to
668 // session types. 668 // session types.
669 accumulated_configuration->sessionTypes = session_types; 669 accumulated_configuration->sessionTypes = session_types;
670 670
671 // 15. If the videoCapabilities and audioCapabilities members in candidate 671 // 15. If the videoCapabilities and audioCapabilities members in candidate
672 // configuration are both empty, return NotSupported. 672 // configuration are both empty, return NotSupported.
673 // TODO(jrummell): Enforce this once the deprecation warning is removed. 673 if (candidate.videoCapabilities.isEmpty() &&
674 // See http://crbug.com/616233. 674 candidate.audioCapabilities.isEmpty()) {
675 return CONFIGURATION_NOT_SUPPORTED;
676 }
675 677
676 // 16. If the videoCapabilities member in candidate configuration is 678 // 16. If the videoCapabilities member in candidate configuration is
677 // non-empty: 679 // non-empty:
678 std::vector<blink::WebMediaKeySystemMediaCapability> video_capabilities; 680 std::vector<blink::WebMediaKeySystemMediaCapability> video_capabilities;
679 if (!candidate.videoCapabilities.isEmpty()) { 681 if (!candidate.videoCapabilities.isEmpty()) {
680 // 16.1. Let video capabilities be the result of executing the Get 682 // 16.1. Let video capabilities be the result of executing the Get
681 // Supported Capabilities for Audio/Video Type algorithm on Video, 683 // Supported Capabilities for Audio/Video Type algorithm on Video,
682 // candidate configuration's videoCapabilities member, accumulated 684 // candidate configuration's videoCapabilities member, accumulated
683 // configuration, and restrictions. 685 // configuration, and restrictions.
684 // 16.2. If video capabilities is null, return NotSupported. 686 // 16.2. If video capabilities is null, return NotSupported.
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 948
947 void KeySystemConfigSelector::OnPermissionResult( 949 void KeySystemConfigSelector::OnPermissionResult(
948 std::unique_ptr<SelectionRequest> request, 950 std::unique_ptr<SelectionRequest> request,
949 bool is_permission_granted) { 951 bool is_permission_granted) {
950 request->was_permission_requested = true; 952 request->was_permission_requested = true;
951 request->is_permission_granted = is_permission_granted; 953 request->is_permission_granted = is_permission_granted;
952 SelectConfigInternal(std::move(request)); 954 SelectConfigInternal(std::move(request));
953 } 955 }
954 956
955 } // namespace media 957 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698