OLD | NEW |
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 "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h" | 5 #include "modules/encryptedmedia/NavigatorRequestMediaKeySystemAccess.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptPromise.h" | 7 #include "bindings/core/v8/ScriptPromise.h" |
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 "bindings/core/v8/V8ThrowException.h" | 10 #include "bindings/core/v8/V8ThrowException.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // This is only checking that at least one capability is provided in the | 307 // This is only checking that at least one capability is provided in the |
308 // selected configuration, as apps may pass empty capabilities for | 308 // selected configuration, as apps may pass empty capabilities for |
309 // compatibility with other implementations. | 309 // compatibility with other implementations. |
310 bool atLeastOneAudioCapability = config.audioCapabilities.size() > 0; | 310 bool atLeastOneAudioCapability = config.audioCapabilities.size() > 0; |
311 bool atLeastOneVideoCapability = config.videoCapabilities.size() > 0; | 311 bool atLeastOneVideoCapability = config.videoCapabilities.size() > 0; |
312 | 312 |
313 if (atLeastOneAudioCapability || atLeastOneVideoCapability) { | 313 if (atLeastOneAudioCapability || atLeastOneVideoCapability) { |
314 UseCounter::count(m_resolver->getExecutionContext(), | 314 UseCounter::count(m_resolver->getExecutionContext(), |
315 UseCounter::EncryptedMediaCapabilityProvided); | 315 UseCounter::EncryptedMediaCapabilityProvided); |
316 } else { | 316 } else { |
317 // TODO(jrummell): Switch to deprecation message once we understand | 317 Deprecation::countDeprecation( |
318 // current usage. http://crbug.com/616233. | 318 m_resolver->getExecutionContext(), |
319 UseCounter::count(m_resolver->getExecutionContext(), | 319 UseCounter::EncryptedMediaCapabilityNotProvided); |
320 UseCounter::EncryptedMediaCapabilityNotProvided); | |
321 } | 320 } |
322 } | 321 } |
323 | 322 |
324 } // namespace | 323 } // namespace |
325 | 324 |
326 ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess( | 325 ScriptPromise NavigatorRequestMediaKeySystemAccess::requestMediaKeySystemAccess( |
327 ScriptState* scriptState, | 326 ScriptState* scriptState, |
328 Navigator& navigator, | 327 Navigator& navigator, |
329 const String& keySystem, | 328 const String& keySystem, |
330 const HeapVector<MediaKeySystemConfiguration>& supportedConfigurations) { | 329 const HeapVector<MediaKeySystemConfiguration>& supportedConfigurations) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 WebEncryptedMediaClient* mediaClient = | 388 WebEncryptedMediaClient* mediaClient = |
390 controller->encryptedMediaClient(executionContext); | 389 controller->encryptedMediaClient(executionContext); |
391 mediaClient->requestMediaKeySystemAccess( | 390 mediaClient->requestMediaKeySystemAccess( |
392 WebEncryptedMediaRequest(initializer)); | 391 WebEncryptedMediaRequest(initializer)); |
393 | 392 |
394 // 7. Return promise. | 393 // 7. Return promise. |
395 return promise; | 394 return promise; |
396 } | 395 } |
397 | 396 |
398 } // namespace blink | 397 } // namespace blink |
OLD | NEW |