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 <string> |
| 9 |
| 10 #include "base/containers/scoped_ptr_hash_map.h" |
8 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
9 #include "media/base/cdm_factory.h" | 12 #include "media/base/cdm_factory.h" |
10 #include "media/base/media_export.h" | 13 #include "media/base/media_export.h" |
11 #include "third_party/WebKit/public/platform/WebEncryptedMediaClient.h" | 14 #include "third_party/WebKit/public/platform/WebEncryptedMediaClient.h" |
12 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 15 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
13 | 16 |
14 namespace media { | 17 namespace media { |
15 | 18 |
16 class MediaPermission; | 19 class MediaPermission; |
17 | 20 |
18 class MEDIA_EXPORT WebEncryptedMediaClientImpl | 21 class MEDIA_EXPORT WebEncryptedMediaClientImpl |
19 : public blink::WebEncryptedMediaClient { | 22 : public blink::WebEncryptedMediaClient { |
20 public: | 23 public: |
21 WebEncryptedMediaClientImpl(scoped_ptr<CdmFactory> cdm_factory, | 24 WebEncryptedMediaClientImpl(scoped_ptr<CdmFactory> cdm_factory, |
22 MediaPermission* media_permission); | 25 MediaPermission* media_permission); |
23 virtual ~WebEncryptedMediaClientImpl(); | 26 virtual ~WebEncryptedMediaClientImpl(); |
24 | 27 |
25 // WebEncryptedMediaClient implementation. | 28 // WebEncryptedMediaClient implementation. |
26 virtual void requestMediaKeySystemAccess( | 29 virtual void requestMediaKeySystemAccess( |
27 blink::WebEncryptedMediaRequest request); | 30 blink::WebEncryptedMediaRequest request); |
28 | 31 |
29 private: | 32 private: |
| 33 // Report usage of key system to UMA. There are 2 different counts logged: |
| 34 // 1. The key system is requested. |
| 35 // 2. The requested key system and options are supported. |
| 36 // Each stat is only reported once per renderer frame per key system. |
| 37 class Reporter; |
| 38 |
| 39 // Gets the Reporter for |key_system|. If it doesn't already exist, |
| 40 // create one. |
| 41 Reporter* GetReporter(const std::string& key_system); |
| 42 |
| 43 // Key system <-> Reporter map. |
| 44 typedef base::ScopedPtrHashMap<std::string, Reporter> Reporters; |
| 45 Reporters reporters_; |
| 46 |
30 scoped_ptr<CdmFactory> cdm_factory_; | 47 scoped_ptr<CdmFactory> cdm_factory_; |
31 }; | 48 }; |
32 | 49 |
33 } // namespace media | 50 } // namespace media |
34 | 51 |
35 #endif // MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_ | 52 #endif // MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_ |
OLD | NEW |