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 MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_ | 5 #ifndef MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_ |
6 #define MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_ | 6 #define MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <unordered_map> | 10 #include <unordered_map> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/memory/ref_counted.h" |
13 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
14 #include "media/blink/key_system_config_selector.h" | 15 #include "media/blink/key_system_config_selector.h" |
15 #include "media/blink/media_blink_export.h" | 16 #include "media/blink/media_blink_export.h" |
16 #include "third_party/WebKit/public/platform/WebEncryptedMediaClient.h" | 17 #include "third_party/WebKit/public/platform/WebEncryptedMediaClient.h" |
17 | 18 |
18 namespace blink { | 19 namespace blink { |
19 | 20 |
20 class WebContentDecryptionModuleResult; | 21 class WebContentDecryptionModuleResult; |
21 struct WebMediaKeySystemConfiguration; | 22 struct WebMediaKeySystemConfiguration; |
22 class WebSecurityOrigin; | 23 class WebSecurityOrigin; |
23 | 24 |
24 } // namespace blink | 25 } // namespace blink |
25 | 26 |
26 namespace media { | 27 namespace media { |
27 | 28 |
28 struct CdmConfig; | 29 struct CdmConfig; |
29 class CdmFactory; | 30 class CdmFactory; |
| 31 class MediaLog; |
30 class MediaPermission; | 32 class MediaPermission; |
31 | 33 |
32 class MEDIA_BLINK_EXPORT WebEncryptedMediaClientImpl | 34 class MEDIA_BLINK_EXPORT WebEncryptedMediaClientImpl |
33 : public blink::WebEncryptedMediaClient { | 35 : public blink::WebEncryptedMediaClient { |
34 public: | 36 public: |
35 WebEncryptedMediaClientImpl( | 37 WebEncryptedMediaClientImpl( |
36 base::Callback<bool(void)> are_secure_codecs_supported_cb, | 38 base::Callback<bool(void)> are_secure_codecs_supported_cb, |
37 CdmFactory* cdm_factory, | 39 CdmFactory* cdm_factory, |
38 MediaPermission* media_permission); | 40 MediaPermission* media_permission, |
| 41 const scoped_refptr<MediaLog>& media_log); |
39 ~WebEncryptedMediaClientImpl() override; | 42 ~WebEncryptedMediaClientImpl() override; |
40 | 43 |
41 // WebEncryptedMediaClient implementation. | 44 // WebEncryptedMediaClient implementation. |
42 void requestMediaKeySystemAccess( | 45 void requestMediaKeySystemAccess( |
43 blink::WebEncryptedMediaRequest request) override; | 46 blink::WebEncryptedMediaRequest request) override; |
44 | 47 |
45 // Create the CDM for |key_system| and |security_origin|. The caller owns | 48 // Create the CDM for |key_system| and |security_origin|. The caller owns |
46 // the created cdm (passed back using |result|). | 49 // the created cdm (passed back using |result|). |
47 void CreateCdm( | 50 void CreateCdm( |
48 const blink::WebString& key_system, | 51 const blink::WebString& key_system, |
(...skipping 22 matching lines...) Expand all Loading... |
71 // Gets the Reporter for |key_system|. If it doesn't already exist, | 74 // Gets the Reporter for |key_system|. If it doesn't already exist, |
72 // create one. | 75 // create one. |
73 Reporter* GetReporter(const blink::WebString& key_system); | 76 Reporter* GetReporter(const blink::WebString& key_system); |
74 | 77 |
75 // Reporter singletons. | 78 // Reporter singletons. |
76 std::unordered_map<std::string, std::unique_ptr<Reporter>> reporters_; | 79 std::unordered_map<std::string, std::unique_ptr<Reporter>> reporters_; |
77 | 80 |
78 base::Callback<bool(void)> are_secure_codecs_supported_cb_; | 81 base::Callback<bool(void)> are_secure_codecs_supported_cb_; |
79 CdmFactory* cdm_factory_; | 82 CdmFactory* cdm_factory_; |
80 KeySystemConfigSelector key_system_config_selector_; | 83 KeySystemConfigSelector key_system_config_selector_; |
| 84 scoped_refptr<MediaLog> media_log_; |
81 base::WeakPtrFactory<WebEncryptedMediaClientImpl> weak_factory_; | 85 base::WeakPtrFactory<WebEncryptedMediaClientImpl> weak_factory_; |
82 }; | 86 }; |
83 | 87 |
84 } // namespace media | 88 } // namespace media |
85 | 89 |
86 #endif // MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_ | 90 #endif // MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_ |
OLD | NEW |