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

Side by Side 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, 2 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h" 6 #include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h"
7 7
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "bindings/core/v8/ScriptState.h" 9 #include "bindings/core/v8/ScriptState.h"
10 #include "core/dom/DOMException.h" 10 #include "core/dom/DOMException.h"
11 #include "core/dom/Document.h" 11 #include "core/dom/Document.h"
12 #include "core/dom/ExceptionCode.h" 12 #include "core/dom/ExceptionCode.h"
13 #include "core/frame/OriginsUsingFeatures.h" 13 #include "core/frame/OriginsUsingFeatures.h"
14 #include "core/frame/UseCounter.h" 14 #include "core/frame/UseCounter.h"
15 #include "core/inspector/ConsoleMessage.h"
15 #include "modules/encryptedmedia/EncryptedMediaUtils.h" 16 #include "modules/encryptedmedia/EncryptedMediaUtils.h"
16 #include "modules/encryptedmedia/MediaKeySession.h" 17 #include "modules/encryptedmedia/MediaKeySession.h"
17 #include "modules/encryptedmedia/MediaKeySystemAccess.h" 18 #include "modules/encryptedmedia/MediaKeySystemAccess.h"
18 #include "modules/encryptedmedia/MediaKeysController.h" 19 #include "modules/encryptedmedia/MediaKeysController.h"
19 #include "platform/EncryptedMediaRequest.h" 20 #include "platform/EncryptedMediaRequest.h"
20 #include "platform/Logging.h" 21 #include "platform/Logging.h"
21 #include "platform/network/ParsedContentType.h" 22 #include "platform/network/ParsedContentType.h"
23 #include "public/platform/Platform.h"
22 #include "public/platform/WebEncryptedMediaClient.h" 24 #include "public/platform/WebEncryptedMediaClient.h"
23 #include "public/platform/WebEncryptedMediaRequest.h" 25 #include "public/platform/WebEncryptedMediaRequest.h"
24 #include "public/platform/WebMediaKeySystemConfiguration.h" 26 #include "public/platform/WebMediaKeySystemConfiguration.h"
25 #include "public/platform/WebMediaKeySystemMediaCapability.h" 27 #include "public/platform/WebMediaKeySystemMediaCapability.h"
26 #include "public/platform/WebVector.h" 28 #include "public/platform/WebVector.h"
27 #include "wtf/Vector.h" 29 #include "wtf/Vector.h"
28 #include "wtf/text/WTFString.h" 30 #include "wtf/text/WTFString.h"
29 31
30 namespace blink { 32 namespace blink {
31 33
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 if (config.hasSessionTypes()) { 137 if (config.hasSessionTypes()) {
136 webConfig.hasSessionTypes = true; 138 webConfig.hasSessionTypes = true;
137 webConfig.sessionTypes = convertSessionTypes(config.sessionTypes()); 139 webConfig.sessionTypes = convertSessionTypes(config.sessionTypes());
138 } 140 }
139 // If |label| is not present, it will be a null string. 141 // If |label| is not present, it will be a null string.
140 webConfig.label = config.label(); 142 webConfig.label = config.label();
141 m_supportedConfigurations[i] = webConfig; 143 m_supportedConfigurations[i] = webConfig;
142 } 144 }
143 } 145 }
144 146
145 void MediaKeySystemAccessInitializer::requestSucceeded(WebContentDecryptionModul eAccess* access) 147 void MediaKeySystemAccessInitializer::requestSucceeded(WebContentDecryptionModul eAccess* 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
146 { 148 {
149 // For widevine key system, generate warning and report to UMA if the
150 // returned config contains video capabilities with empty robustness string.
151 // TODO(xhwang): Remove after we handle empty robustness correctly.
152 // See http://crbug.com/482277
153 if (keySystem() == "com.widevine.alpha") {
154 WebMediaKeySystemConfiguration config = access->getConfiguration();
155 bool hasEmptyRobustness = false;
156
157 for (const auto& capability : config.videoCapabilities) {
158 if (capability.robustness.isEmpty())
159 hasEmptyRobustness = true;
160 Platform::current()->histogramEnumeration("Media.EME.Widevine.VideoC apability.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.
161 }
162
163 if (hasEmptyRobustness) {
164 m_resolver->executionContext()->addConsoleMessage(ConsoleMessage::cr eate(JSMessageSource, WarningMessageLevel,
165 "It is recommended that a robustness level be specified. Not spe cifying the robustness level could "
166 "result in unexpected behavior in the future, potentially includ ing failure to play."));
167 }
168 }
169
147 m_resolver->resolve(new MediaKeySystemAccess(m_keySystem, adoptPtr(access))) ; 170 m_resolver->resolve(new MediaKeySystemAccess(m_keySystem, adoptPtr(access))) ;
148 m_resolver.clear(); 171 m_resolver.clear();
149 } 172 }
150 173
151 void MediaKeySystemAccessInitializer::requestNotSupported(const WebString& error Message) 174 void MediaKeySystemAccessInitializer::requestNotSupported(const WebString& error Message)
152 { 175 {
153 m_resolver->reject(DOMException::create(NotSupportedError, errorMessage)); 176 m_resolver->reject(DOMException::create(NotSupportedError, errorMessage));
154 m_resolver.clear(); 177 m_resolver.clear();
155 } 178 }
156 179
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 // initialize the MediaKeySystemAccess object. 233 // initialize the MediaKeySystemAccess object.
211 MediaKeysController* controller = MediaKeysController::from(document->page() ); 234 MediaKeysController* controller = MediaKeysController::from(document->page() );
212 WebEncryptedMediaClient* mediaClient = controller->encryptedMediaClient(exec utionContext); 235 WebEncryptedMediaClient* mediaClient = controller->encryptedMediaClient(exec utionContext);
213 mediaClient->requestMediaKeySystemAccess(WebEncryptedMediaRequest(initialize r)); 236 mediaClient->requestMediaKeySystemAccess(WebEncryptedMediaRequest(initialize r));
214 237
215 // 8. Return promise. 238 // 8. Return promise.
216 return promise; 239 return promise;
217 } 240 }
218 241
219 } // namespace blink 242 } // namespace blink
OLDNEW
« 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