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

Unified Diff: media/blink/key_system_config_selector.cc

Issue 1137993004: Revert of Restrict use of hardware-secure codecs based on the RendererPreference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setsecurity
Patch Set: Created 5 years, 7 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/blink/key_system_config_selector.h ('k') | media/blink/webencryptedmediaclient_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/key_system_config_selector.cc
diff --git a/media/blink/key_system_config_selector.cc b/media/blink/key_system_config_selector.cc
index f34bd8fc463cfb00ea9d5b3a1029653ae34805af..324a28f6cec6f9c5612ba26d68b6a321e28cac03 100644
--- a/media/blink/key_system_config_selector.cc
+++ b/media/blink/key_system_config_selector.cc
@@ -131,12 +131,11 @@
blink::WebVector<blink::WebMediaKeySystemConfiguration>
candidate_configurations;
blink::WebSecurityOrigin security_origin;
- base::Callback<void(const blink::WebMediaKeySystemConfiguration&, bool)>
+ base::Callback<void(const blink::WebMediaKeySystemConfiguration&)>
succeeded_cb;
base::Callback<void(const blink::WebString&)> not_supported_cb;
bool was_permission_requested = false;
bool is_permission_granted = false;
- bool are_secure_codecs_supported = false;
};
// Accumulates configuration rules to determine if a feature (additional
@@ -157,10 +156,6 @@
bool IsIdentifierRequired() const { return is_identifier_required_; }
bool IsIdentifierRecommended() const { return is_identifier_recommended_; }
-
- bool AreSecureCodecsRequired() const {
- return are_secure_codecs_required_;
- }
// Checks whether a rule is compatible with all previously added rules.
bool IsRuleSupported(EmeConfigRule rule) const {
@@ -182,10 +177,12 @@
case EmeConfigRule::IDENTIFIER_AND_PERSISTENCE_REQUIRED:
return (!is_identifier_not_allowed_ && IsPermissionPossible() &&
!is_persistence_not_allowed_);
+#if defined(OS_ANDROID)
case EmeConfigRule::SECURE_CODECS_NOT_ALLOWED:
return !are_secure_codecs_required_;
case EmeConfigRule::SECURE_CODECS_REQUIRED:
return !are_secure_codecs_not_allowed_;
+#endif // defined(OS_ANDROID)
case EmeConfigRule::SUPPORTED:
return true;
}
@@ -219,12 +216,14 @@
is_identifier_required_ = true;
is_persistence_required_ = true;
return;
+#if defined(OS_ANDROID)
case EmeConfigRule::SECURE_CODECS_NOT_ALLOWED:
are_secure_codecs_not_allowed_ = true;
return;
case EmeConfigRule::SECURE_CODECS_REQUIRED:
are_secure_codecs_required_ = true;
return;
+#endif // defined(OS_ANDROID)
case EmeConfigRule::SUPPORTED:
return;
}
@@ -253,10 +252,11 @@
bool is_persistence_required_ = false;
bool is_persistence_not_allowed_ = false;
- // Whether a rule has been added that requires or blocks hardware-secure
- // codecs.
+#if defined(OS_ANDROID)
+ // Whether a rule has been added that requires or blocks secure codecs.
bool are_secure_codecs_required_ = false;
bool are_secure_codecs_not_allowed_ = false;
+#endif // defined(OS_ANDROID)
};
KeySystemConfigSelector::KeySystemConfigSelector(
@@ -392,6 +392,7 @@
const blink::WebMediaKeySystemConfiguration& candidate,
ConfigState* config_state,
blink::WebMediaKeySystemConfiguration* accumulated_configuration) {
+ // TODO(sandersd): Set state of SECURE_CODECS from renderer pref.
// From https://w3c.github.io/encrypted-media/#get-supported-configuration
// 1. Let accumulated configuration be empty. (Done by caller.)
// 2. If the initDataTypes member is present in candidate configuration, run
@@ -672,8 +673,7 @@
const blink::WebVector<blink::WebMediaKeySystemConfiguration>&
candidate_configurations,
const blink::WebSecurityOrigin& security_origin,
- bool are_secure_codecs_supported,
- base::Callback<void(const blink::WebMediaKeySystemConfiguration&, bool)>
+ base::Callback<void(const blink::WebMediaKeySystemConfiguration&)>
succeeded_cb,
base::Callback<void(const blink::WebString&)> not_supported_cb) {
// Continued from requestMediaKeySystemAccess(), step 7, from
@@ -699,7 +699,6 @@
request->key_system = key_system_ascii;
request->candidate_configurations = candidate_configurations;
request->security_origin = security_origin;
- request->are_secure_codecs_supported = are_secure_codecs_supported;
request->succeeded_cb = succeeded_cb;
request->not_supported_cb = not_supported_cb;
SelectConfigInternal(request.Pass());
@@ -722,10 +721,6 @@
// new MediaKeySystemAccess object.]
ConfigState config_state(request->was_permission_requested,
request->is_permission_granted);
- DCHECK(config_state.IsRuleSupported(
- EmeConfigRule::SECURE_CODECS_NOT_ALLOWED));
- if (!request->are_secure_codecs_supported)
- config_state.AddRule(EmeConfigRule::SECURE_CODECS_NOT_ALLOWED);
blink::WebMediaKeySystemConfiguration accumulated_configuration;
ConfigurationSupport support = GetSupportedConfiguration(
request->key_system, request->candidate_configurations[i],
@@ -746,8 +741,7 @@
weak_factory_.GetWeakPtr(), base::Passed(&request)));
return;
case CONFIGURATION_SUPPORTED:
- request->succeeded_cb.Run(accumulated_configuration,
- config_state.AreSecureCodecsRequired());
+ request->succeeded_cb.Run(accumulated_configuration);
return;
}
}
« no previous file with comments | « media/blink/key_system_config_selector.h ('k') | media/blink/webencryptedmediaclient_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698