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

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

Issue 1381463003: Add warning message for empty robustness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed and add UMA Created 5 years, 3 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698