| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 result[i] = EncryptedMediaUtils::convertToInitDataType(initDataTypes[i]); | 44 result[i] = EncryptedMediaUtils::convertToInitDataType(initDataTypes[i]); |
| 45 return result; | 45 return result; |
| 46 } | 46 } |
| 47 | 47 |
| 48 static WebVector<WebMediaKeySystemMediaCapability> convertCapabilities( | 48 static WebVector<WebMediaKeySystemMediaCapability> convertCapabilities( |
| 49 const HeapVector<MediaKeySystemMediaCapability>& capabilities) { | 49 const HeapVector<MediaKeySystemMediaCapability>& capabilities) { |
| 50 WebVector<WebMediaKeySystemMediaCapability> result(capabilities.size()); | 50 WebVector<WebMediaKeySystemMediaCapability> result(capabilities.size()); |
| 51 for (size_t i = 0; i < capabilities.size(); ++i) { | 51 for (size_t i = 0; i < capabilities.size(); ++i) { |
| 52 const WebString& contentType = capabilities[i].contentType(); | 52 const WebString& contentType = capabilities[i].contentType(); |
| 53 result[i].contentType = contentType; | 53 result[i].contentType = contentType; |
| 54 if (isValidContentType(contentType)) { | 54 if (ParsedContentType(contentType).isValid()) { |
| 55 // FIXME: Fail if there are unrecognized parameters. | 55 // FIXME: Fail if there are unrecognized parameters. |
| 56 // http://crbug.com/690131 | 56 // http://crbug.com/690131 |
| 57 ContentType type(capabilities[i].contentType()); | 57 ContentType type(capabilities[i].contentType()); |
| 58 result[i].mimeType = type.type(); | 58 result[i].mimeType = type.type(); |
| 59 result[i].codecs = type.parameter("codecs"); | 59 result[i].codecs = type.parameter("codecs"); |
| 60 } | 60 } |
| 61 result[i].robustness = capabilities[i].robustness(); | 61 result[i].robustness = capabilities[i].robustness(); |
| 62 } | 62 } |
| 63 return result; | 63 return result; |
| 64 } | 64 } |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 WebEncryptedMediaClient* mediaClient = | 325 WebEncryptedMediaClient* mediaClient = |
| 326 controller->encryptedMediaClient(executionContext); | 326 controller->encryptedMediaClient(executionContext); |
| 327 mediaClient->requestMediaKeySystemAccess( | 327 mediaClient->requestMediaKeySystemAccess( |
| 328 WebEncryptedMediaRequest(initializer)); | 328 WebEncryptedMediaRequest(initializer)); |
| 329 | 329 |
| 330 // 7. Return promise. | 330 // 7. Return promise. |
| 331 return promise; | 331 return promise; |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace blink | 334 } // namespace blink |
| OLD | NEW |