Chromium Code Reviews| 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 eb3cf8122c8b651414ad6b409b242c2ccb98b701..c828b4f05cfd9cb0a8aa359725b5a95ede209163 100644 |
| --- a/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp |
| +++ b/third_party/WebKit/Source/modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.cpp |
| @@ -12,6 +12,7 @@ |
| #include "core/dom/ExceptionCode.h" |
| #include "core/frame/OriginsUsingFeatures.h" |
| #include "core/frame/UseCounter.h" |
| +#include "core/inspector/ConsoleMessage.h" |
| #include "modules/encryptedmedia/EncryptedMediaUtils.h" |
| #include "modules/encryptedmedia/MediaKeySession.h" |
| #include "modules/encryptedmedia/MediaKeySystemAccess.h" |
| @@ -19,6 +20,7 @@ |
| #include "platform/EncryptedMediaRequest.h" |
| #include "platform/Logging.h" |
| #include "platform/network/ParsedContentType.h" |
| +#include "public/platform/Platform.h" |
| #include "public/platform/WebEncryptedMediaClient.h" |
| #include "public/platform/WebEncryptedMediaRequest.h" |
| #include "public/platform/WebMediaKeySystemConfiguration.h" |
| @@ -144,6 +146,27 @@ MediaKeySystemAccessInitializer::MediaKeySystemAccessInitializer(ScriptState* sc |
| void MediaKeySystemAccessInitializer::requestSucceeded(WebContentDecryptionModuleAccess* access) |
|
ddorwin
2015/10/01 23:16:36
Since we're not checking whether any were selected
xhwang
2015/10/02 00:20:37
From the email discussion, I thought we want to li
|
| { |
| + // For widevine key system, generate warning and report to UMA if the |
| + // returned config contains video capabilities with empty robustness string. |
| + // TODO(xhwang): Remove after we handle empty robustness correctly. |
| + // See http://crbug.com/482277 |
| + if (keySystem() == "com.widevine.alpha") { |
| + WebMediaKeySystemConfiguration config = access->getConfiguration(); |
| + bool hasEmptyRobustness = false; |
| + |
| + for (const auto& capability : config.videoCapabilities) { |
| + if (capability.robustness.isEmpty()) |
| + hasEmptyRobustness = true; |
| + Platform::current()->histogramEnumeration("Media.EME.Widevine.VideoCapability.EmptyRobustness", capability.robustness.isEmpty(), 2); |
|
ddorwin
2015/10/01 23:16:36
Similarly, HasEmptyRobustness as the UMA name?
Th
ddorwin
2015/10/01 23:16:36
We're recording every entry. Is that what we want?
xhwang
2015/10/02 00:20:37
Done.
xhwang
2015/10/02 00:20:37
Done.
|
| + } |
| + |
| + if (hasEmptyRobustness) { |
| + m_resolver->executionContext()->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, |
| + "It is recommended that a robustness level be specified. Not specifying the robustness level could " |
| + "result in unexpected behavior in the future, potentially including failure to play.")); |
| + } |
| + } |
| + |
| m_resolver->resolve(new MediaKeySystemAccess(m_keySystem, adoptPtr(access))); |
| m_resolver.clear(); |
| } |