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