| 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 #ifndef WebMediaKeySystemConfiguration_h | 5 #ifndef WebMediaKeySystemConfiguration_h |
| 6 #define WebMediaKeySystemConfiguration_h | 6 #define WebMediaKeySystemConfiguration_h |
| 7 | 7 |
| 8 #include "public/platform/WebEncryptedMediaTypes.h" | 8 #include "public/platform/WebEncryptedMediaTypes.h" |
| 9 #include "public/platform/WebMediaKeySystemMediaCapability.h" | 9 #include "public/platform/WebMediaKeySystemMediaCapability.h" |
| 10 #include "public/platform/WebVector.h" | 10 #include "public/platform/WebVector.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 struct WebMediaKeySystemConfiguration { | 14 struct WebMediaKeySystemConfiguration { |
| 15 enum class Requirement { | 15 enum class Requirement { |
| 16 Required, | 16 Required, |
| 17 Optional, | 17 Optional, |
| 18 NotAllowed, | 18 NotAllowed, |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 // As MediaKeySystemConfiguration is a dictionary, some members may be | |
| 22 // not-present. Because requestMediaKeySystemAccess() distinguishes empty | |
| 23 // from not-present, we require a presence flag for each member. | |
| 24 bool hasInitDataTypes = false; | |
| 25 WebVector<WebEncryptedMediaInitDataType> initDataTypes; | 21 WebVector<WebEncryptedMediaInitDataType> initDataTypes; |
| 26 | |
| 27 bool hasAudioCapabilities = false; | |
| 28 WebVector<WebMediaKeySystemMediaCapability> audioCapabilities; | 22 WebVector<WebMediaKeySystemMediaCapability> audioCapabilities; |
| 29 | |
| 30 bool hasVideoCapabilities = false; | |
| 31 WebVector<WebMediaKeySystemMediaCapability> videoCapabilities; | 23 WebVector<WebMediaKeySystemMediaCapability> videoCapabilities; |
| 32 | |
| 33 // |distinctiveIdentifier| and |persistentState| are always present because | |
| 34 // they have default values. | |
| 35 Requirement distinctiveIdentifier = Requirement::Optional; | 24 Requirement distinctiveIdentifier = Requirement::Optional; |
| 36 Requirement persistentState = Requirement::Optional; | 25 Requirement persistentState = Requirement::Optional; |
| 37 | 26 |
| 27 // As |sessionTypes| is optional, we require a presence flag for it. |
| 38 bool hasSessionTypes = false; | 28 bool hasSessionTypes = false; |
| 39 WebVector<WebEncryptedMediaSessionType> sessionTypes; | 29 WebVector<WebEncryptedMediaSessionType> sessionTypes; |
| 40 | 30 |
| 41 // |label| may be not-present, but we use a null string to represent that. | 31 // |label| may be not-present, but we use a null string to represent that. |
| 42 WebString label; | 32 WebString label; |
| 43 }; | 33 }; |
| 44 | 34 |
| 45 } // namespace blink | 35 } // namespace blink |
| 46 | 36 |
| 47 #endif // WebMediaKeySystemConfiguration_h | 37 #endif // WebMediaKeySystemConfiguration_h |
| OLD | NEW |