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

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp

Issue 2731743003: [eme] Ignore capabilities with unrecognized parameters (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
index b85a831cd86bb46dab197716abd4f166b1a3a6c3..b2109156bbd1bb5bc8099062a7d2e7b4cd7b5654 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp
@@ -53,10 +53,13 @@ static WebVector<WebMediaKeySystemMediaCapability> convertCapabilities(
result[i].contentType = contentType;
ParsedContentType type(contentType);
if (type.isValid()) {
- // FIXME: Fail if there are unrecognized parameters.
- // http://crbug.com/690131
+ // Fail if there are unrecognized parameters. There is no way to
xhwang 2017/03/03 23:20:58 "Fail" isn't accurate since we just skip it..
xhwang 2017/03/03 23:20:58 Please quote the spec here: "If the user agent do
jrummell 2017/03/04 00:48:25 Removed.
jrummell 2017/03/04 00:48:26 Done.
+ // enumerate the parameters, so only look up "codecs" if a single
+ // parameter is available. Chromium expects "codecs" to be valid, so
xhwang 2017/03/03 23:20:58 ooc, what if we have two "codecs" parameters?
jrummell 2017/03/04 00:48:25 ParsedContentType only returns the last one, so it
+ // this capability will fail if codecs not the only parameter specified.
xhwang 2017/03/03 23:20:58 again, s/fail/skip, also s/not/is not/
jrummell 2017/03/04 00:48:25 Done.
result[i].mimeType = type.mimeType();
- result[i].codecs = type.parameterValueForName("codecs");
+ if (type.parameterCount() == 1u)
+ result[i].codecs = type.parameterValueForName("codecs");
}
result[i].robustness = capabilities[i].robustness();
}

Powered by Google App Engine
This is Rietveld 408576698