Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: media/blink/webencryptedmediaclient_impl.h

Issue 1132773003: Revert of Plumb |use_secure_codecs| through to BrowserCdmFactoryAndroid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/containers/scoped_ptr_hash_map.h" 11 #include "base/containers/scoped_ptr_hash_map.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "media/base/media_export.h" 14 #include "media/base/media_export.h"
15 #include "media/blink/key_system_config_selector.h" 15 #include "media/blink/key_system_config_selector.h"
16 #include "third_party/WebKit/public/platform/WebEncryptedMediaClient.h" 16 #include "third_party/WebKit/public/platform/WebEncryptedMediaClient.h"
17 17
18 namespace blink { 18 namespace blink {
19 19
20 class WebContentDecryptionModuleResult; 20 class WebContentDecryptionModuleResult;
21 struct WebMediaKeySystemConfiguration; 21 struct WebMediaKeySystemConfiguration;
22 class WebSecurityOrigin; 22 class WebSecurityOrigin;
23 23
24 } // namespace blink 24 } // namespace blink
25 25
26 namespace media { 26 namespace media {
27 27
28 struct CdmConfig;
29 class CdmFactory; 28 class CdmFactory;
30 class KeySystems; 29 class KeySystems;
31 class MediaPermission; 30 class MediaPermission;
32 31
33 class MEDIA_EXPORT WebEncryptedMediaClientImpl 32 class MEDIA_EXPORT WebEncryptedMediaClientImpl
34 : public blink::WebEncryptedMediaClient { 33 : public blink::WebEncryptedMediaClient {
35 public: 34 public:
36 WebEncryptedMediaClientImpl( 35 WebEncryptedMediaClientImpl(
37 base::Callback<bool(void)> are_secure_codecs_supported_cb, 36 base::Callback<bool(void)> are_secure_codecs_supported_cb,
38 CdmFactory* cdm_factory, 37 CdmFactory* cdm_factory,
39 MediaPermission* media_permission); 38 MediaPermission* media_permission);
40 virtual ~WebEncryptedMediaClientImpl(); 39 virtual ~WebEncryptedMediaClientImpl();
41 40
42 // WebEncryptedMediaClient implementation. 41 // WebEncryptedMediaClient implementation.
43 virtual void requestMediaKeySystemAccess( 42 virtual void requestMediaKeySystemAccess(
44 blink::WebEncryptedMediaRequest request); 43 blink::WebEncryptedMediaRequest request);
45 44
46 // Create the CDM for |key_system| and |security_origin|. The caller owns 45 // Create the CDM for |key_system| and |security_origin|. The caller owns
47 // the created cdm (passed back using |result|). 46 // the created cdm (passed back using |result|).
48 void CreateCdm(const blink::WebString& key_system, 47 void CreateCdm(const blink::WebString& key_system,
48 bool allow_distinctive_identifier,
49 bool allow_persistent_state,
49 const blink::WebSecurityOrigin& security_origin, 50 const blink::WebSecurityOrigin& security_origin,
50 const CdmConfig& cdm_config,
51 blink::WebContentDecryptionModuleResult result); 51 blink::WebContentDecryptionModuleResult result);
52 52
53 private: 53 private:
54 // Report usage of key system to UMA. There are 2 different counts logged: 54 // Report usage of key system to UMA. There are 2 different counts logged:
55 // 1. The key system is requested. 55 // 1. The key system is requested.
56 // 2. The requested key system and options are supported. 56 // 2. The requested key system and options are supported.
57 // Each stat is only reported once per renderer frame per key system. 57 // Each stat is only reported once per renderer frame per key system.
58 class Reporter; 58 class Reporter;
59 59
60 // Complete a requestMediaKeySystemAccess() request with a supported 60 // Complete a requestMediaKeySystemAccess() request with a supported
61 // accumulated configuration. 61 // accumulated configuration.
62 void OnRequestSucceeded( 62 void OnRequestSucceeded(
63 blink::WebEncryptedMediaRequest request, 63 blink::WebEncryptedMediaRequest request,
64 const blink::WebMediaKeySystemConfiguration& accumulated_configuration, 64 const blink::WebMediaKeySystemConfiguration& accumulated_configuration,
65 const CdmConfig& cdm_config); 65 bool are_secure_codecs_required);
66 66
67 // Complete a requestMediaKeySystemAccess() request with an error message. 67 // Complete a requestMediaKeySystemAccess() request with an error message.
68 void OnRequestNotSupported(blink::WebEncryptedMediaRequest request, 68 void OnRequestNotSupported(blink::WebEncryptedMediaRequest request,
69 const blink::WebString& error_message); 69 const blink::WebString& error_message);
70 70
71 // Gets the Reporter for |key_system|. If it doesn't already exist, 71 // Gets the Reporter for |key_system|. If it doesn't already exist,
72 // create one. 72 // create one.
73 Reporter* GetReporter(const blink::WebString& key_system); 73 Reporter* GetReporter(const blink::WebString& key_system);
74 74
75 // Reporter singletons. 75 // Reporter singletons.
76 base::ScopedPtrHashMap<std::string, scoped_ptr<Reporter>> reporters_; 76 base::ScopedPtrHashMap<std::string, scoped_ptr<Reporter>> reporters_;
77 77
78 base::Callback<bool(void)> are_secure_codecs_supported_cb_; 78 base::Callback<bool(void)> are_secure_codecs_supported_cb_;
79 CdmFactory* cdm_factory_; 79 CdmFactory* cdm_factory_;
80 KeySystemConfigSelector key_system_config_selector_; 80 KeySystemConfigSelector key_system_config_selector_;
81 base::WeakPtrFactory<WebEncryptedMediaClientImpl> weak_factory_; 81 base::WeakPtrFactory<WebEncryptedMediaClientImpl> weak_factory_;
82 }; 82 };
83 83
84 } // namespace media 84 } // namespace media
85 85
86 #endif // MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_ 86 #endif // MEDIA_BLINK_WEBENCRYPTEDMEDIACLIENT_IMPL_H_
OLDNEW
« no previous file with comments | « media/blink/webcontentdecryptionmoduleaccess_impl.cc ('k') | media/blink/webencryptedmediaclient_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698