| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MEDIA_BLINK_KEY_SYSTEM_CONFIG_SELECTOR_H_ | 5 #ifndef MEDIA_BLINK_KEY_SYSTEM_CONFIG_SELECTOR_H_ |
| 6 #define MEDIA_BLINK_KEY_SYSTEM_CONFIG_SELECTOR_H_ | 6 #define MEDIA_BLINK_KEY_SYSTEM_CONFIG_SELECTOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/callback.h" | |
| 13 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 15 #include "media/base/eme_constants.h" | 14 #include "media/base/eme_constants.h" |
| 16 #include "media/base/media_export.h" | 15 #include "media/base/media_export.h" |
| 17 #include "third_party/WebKit/public/platform/WebVector.h" | 16 #include "third_party/WebKit/public/platform/WebVector.h" |
| 18 | 17 |
| 19 namespace blink { | 18 namespace blink { |
| 20 | 19 |
| 21 struct WebMediaKeySystemConfiguration; | 20 struct WebMediaKeySystemConfiguration; |
| 22 struct WebMediaKeySystemMediaCapability; | 21 struct WebMediaKeySystemMediaCapability; |
| 23 class WebSecurityOrigin; | 22 class WebSecurityOrigin; |
| 24 class WebString; | 23 class WebString; |
| 25 | 24 |
| 26 } // namespace blink | 25 } // namespace blink |
| 27 | 26 |
| 28 namespace media { | 27 namespace media { |
| 29 | 28 |
| 30 class KeySystems; | 29 class KeySystems; |
| 31 class MediaPermission; | 30 class MediaPermission; |
| 32 | 31 |
| 33 class MEDIA_EXPORT KeySystemConfigSelector { | 32 class MEDIA_EXPORT KeySystemConfigSelector { |
| 34 public: | 33 public: |
| 35 KeySystemConfigSelector( | 34 KeySystemConfigSelector(const KeySystems* key_systems, |
| 36 const KeySystems* key_systems, | 35 MediaPermission* media_permission); |
| 37 MediaPermission* media_permission); | |
| 38 | 36 |
| 39 ~KeySystemConfigSelector(); | 37 ~KeySystemConfigSelector(); |
| 40 | 38 |
| 41 void SelectConfig( | 39 void SelectConfig( |
| 42 const blink::WebString& key_system, | 40 const blink::WebString& key_system, |
| 43 const blink::WebVector<blink::WebMediaKeySystemConfiguration>& | 41 const blink::WebVector<blink::WebMediaKeySystemConfiguration>& |
| 44 candidate_configurations, | 42 candidate_configurations, |
| 45 const blink::WebSecurityOrigin& security_origin, | 43 const blink::WebSecurityOrigin& security_origin, |
| 46 bool are_secure_codecs_supported, | 44 base::Callback<void(const blink::WebMediaKeySystemConfiguration&)> |
| 47 // The second argument is |are_secure_codecs_required|. | 45 succeeded_cb, |
| 48 base::Callback<void(const blink::WebMediaKeySystemConfiguration&, | |
| 49 bool)> succeeded_cb, | |
| 50 base::Callback<void(const blink::WebString&)> not_supported_cb); | 46 base::Callback<void(const blink::WebString&)> not_supported_cb); |
| 51 | 47 |
| 52 private: | 48 private: |
| 53 struct SelectionRequest; | 49 struct SelectionRequest; |
| 54 class ConfigState; | 50 class ConfigState; |
| 55 | 51 |
| 56 enum ConfigurationSupport { | 52 enum ConfigurationSupport { |
| 57 CONFIGURATION_NOT_SUPPORTED, | 53 CONFIGURATION_NOT_SUPPORTED, |
| 58 CONFIGURATION_REQUIRES_PERMISSION, | 54 CONFIGURATION_REQUIRES_PERMISSION, |
| 59 CONFIGURATION_SUPPORTED, | 55 CONFIGURATION_SUPPORTED, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 88 const KeySystems* key_systems_; | 84 const KeySystems* key_systems_; |
| 89 MediaPermission* media_permission_; | 85 MediaPermission* media_permission_; |
| 90 base::WeakPtrFactory<KeySystemConfigSelector> weak_factory_; | 86 base::WeakPtrFactory<KeySystemConfigSelector> weak_factory_; |
| 91 | 87 |
| 92 DISALLOW_COPY_AND_ASSIGN(KeySystemConfigSelector); | 88 DISALLOW_COPY_AND_ASSIGN(KeySystemConfigSelector); |
| 93 }; | 89 }; |
| 94 | 90 |
| 95 } // namespace media | 91 } // namespace media |
| 96 | 92 |
| 97 #endif // MEDIA_BLINK_KEY_SYSTEM_CONFIG_SELECTOR_H_ | 93 #endif // MEDIA_BLINK_KEY_SYSTEM_CONFIG_SELECTOR_H_ |
| OLD | NEW |