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

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

Issue 1124863005: Restrict use of hardware-secure codecs based on the RendererPreference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@setsecurity
Patch Set: Rename secure_codec -> secure_surface in some cases. 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 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"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "build/build_config.h"
14 #include "media/base/eme_constants.h" 16 #include "media/base/eme_constants.h"
15 #include "media/base/media_export.h" 17 #include "media/base/media_export.h"
16 #include "third_party/WebKit/public/platform/WebVector.h" 18 #include "third_party/WebKit/public/platform/WebVector.h"
17 19
18 namespace blink { 20 namespace blink {
19 21
20 struct WebMediaKeySystemConfiguration; 22 struct WebMediaKeySystemConfiguration;
21 struct WebMediaKeySystemMediaCapability; 23 struct WebMediaKeySystemMediaCapability;
22 class WebSecurityOrigin; 24 class WebSecurityOrigin;
23 class WebString; 25 class WebString;
24 26
25 } // namespace blink 27 } // namespace blink
26 28
27 namespace media { 29 namespace media {
28 30
29 class KeySystems; 31 class KeySystems;
30 class MediaPermission; 32 class MediaPermission;
31 33
32 class MEDIA_EXPORT KeySystemConfigSelector { 34 class MEDIA_EXPORT KeySystemConfigSelector {
33 public: 35 public:
34 KeySystemConfigSelector(const KeySystems* key_systems, 36 KeySystemConfigSelector(
35 MediaPermission* media_permission); 37 const KeySystems* key_systems,
38 MediaPermission* media_permission);
36 39
37 ~KeySystemConfigSelector(); 40 ~KeySystemConfigSelector();
38 41
42 #if defined(OS_ANDROID)
43 typedef base::Callback<void(const blink::WebMediaKeySystemConfiguration&,
44 const bool)>
45 SucceededCB;
46 #else
47 typedef base::Callback<void(const blink::WebMediaKeySystemConfiguration&)>
48 SucceededCB;
49 #endif // defined(OS_ANDROID)
50
39 void SelectConfig( 51 void SelectConfig(
40 const blink::WebString& key_system, 52 const blink::WebString& key_system,
53 #if defined(OS_ANDROID)
ddorwin 2015/05/06 02:17:11 So may ifdefs. Perhaps we should just note that th
sandersd (OOO until July 31) 2015/05/08 00:37:42 Done.
54 const bool allow_secure_surfaces,
ddorwin 2015/05/06 02:17:12 is_...
sandersd (OOO until July 31) 2015/05/08 00:37:42 Done.
55 #endif // defined(OS_ANDROID)
41 const blink::WebVector<blink::WebMediaKeySystemConfiguration>& 56 const blink::WebVector<blink::WebMediaKeySystemConfiguration>&
42 candidate_configurations, 57 candidate_configurations,
43 const blink::WebSecurityOrigin& security_origin, 58 const blink::WebSecurityOrigin& security_origin,
44 base::Callback<void(const blink::WebMediaKeySystemConfiguration&)> 59 SucceededCB succeeded_cb,
45 succeeded_cb,
46 base::Callback<void(const blink::WebString&)> not_supported_cb); 60 base::Callback<void(const blink::WebString&)> not_supported_cb);
47 61
48 private: 62 private:
49 struct SelectionRequest; 63 struct SelectionRequest;
50 class ConfigState; 64 class ConfigState;
51 65
52 enum ConfigurationSupport { 66 enum ConfigurationSupport {
53 CONFIGURATION_NOT_SUPPORTED, 67 CONFIGURATION_NOT_SUPPORTED,
54 CONFIGURATION_REQUIRES_PERMISSION, 68 CONFIGURATION_REQUIRES_PERMISSION,
55 CONFIGURATION_SUPPORTED, 69 CONFIGURATION_SUPPORTED,
(...skipping 28 matching lines...) Expand all
84 const KeySystems* key_systems_; 98 const KeySystems* key_systems_;
85 MediaPermission* media_permission_; 99 MediaPermission* media_permission_;
86 base::WeakPtrFactory<KeySystemConfigSelector> weak_factory_; 100 base::WeakPtrFactory<KeySystemConfigSelector> weak_factory_;
87 101
88 DISALLOW_COPY_AND_ASSIGN(KeySystemConfigSelector); 102 DISALLOW_COPY_AND_ASSIGN(KeySystemConfigSelector);
89 }; 103 };
90 104
91 } // namespace media 105 } // namespace media
92 106
93 #endif // MEDIA_BLINK_KEY_SYSTEM_CONFIG_SELECTOR_H_ 107 #endif // MEDIA_BLINK_KEY_SYSTEM_CONFIG_SELECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698