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 MEDIA_EXPORT WebEncryptedMediaClientImpl | 19 class MEDIA_EXPORT WebEncryptedMediaClientImpl |
17 : public blink::WebEncryptedMediaClient { | 20 : public blink::WebEncryptedMediaClient { |
18 public: | 21 public: |
19 WebEncryptedMediaClientImpl(scoped_ptr<CdmFactory> cdm_factory); | 22 WebEncryptedMediaClientImpl(scoped_ptr<CdmFactory> cdm_factory); |
20 virtual ~WebEncryptedMediaClientImpl(); | 23 virtual ~WebEncryptedMediaClientImpl(); |
21 | 24 |
22 // WebEncryptedMediaClient implementation. | 25 // WebEncryptedMediaClient implementation. |
23 virtual void requestMediaKeySystemAccess( | 26 virtual void requestMediaKeySystemAccess( |
24 blink::WebEncryptedMediaRequest request); | 27 blink::WebEncryptedMediaRequest request); |
25 | 28 |
26 private: | 29 private: |
30 // Report usage of key system to UMA. There are 2 different counts logged: | |
31 // 1. The key system is requested. | |
32 // 2. The requested key system and options are supported. | |
33 // Each stat is only reported once per renderer process per key system. | |
34 class Reporter; | |
35 | |
36 // Add a Reporter for |key_system| to the map. | |
37 void AddReporter(const std::string& key_system); | |
38 | |
39 // Locate the Reporter for |key_system|. If not found return the one for | |
40 // key system "Unknown". | |
41 Reporter* LocateReporter(const std::string& key_system); | |
sandersd (OOO until July 31)
2015/01/27 19:04:07
GetReporter()?
jrummell
2015/01/28 21:08:09
Done.
| |
42 | |
43 // Key system <-> Reporter map. | |
44 typedef base::ScopedPtrHashMap<std::string, Reporter> Reporters; | |
45 Reporters reporters_; | |
46 | |
27 scoped_ptr<CdmFactory> cdm_factory_; | 47 scoped_ptr<CdmFactory> cdm_factory_; |
28 }; | 48 }; |
29 | 49 |
30 } // namespace media | 50 } // namespace media |
31 | 51 |
32 #endif // MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_ | 52 #endif // MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_ |
OLD | NEW |