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

Side by Side Diff: chrome/renderer/media/chrome_key_systems.cc

Issue 2085063002: media: Add OutputProtectionProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix windows compile error Created 4 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/renderer/media/chrome_key_systems.h" 5 #include "chrome/renderer/media/chrome_key_systems.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 127
128 // External Clear Key (used for testing). 128 // External Clear Key (used for testing).
129 static void AddExternalClearKey( 129 static void AddExternalClearKey(
130 std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) { 130 std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) {
131 static const char kExternalClearKeyKeySystem[] = 131 static const char kExternalClearKeyKeySystem[] =
132 "org.chromium.externalclearkey"; 132 "org.chromium.externalclearkey";
133 static const char kExternalClearKeyDecryptOnlyKeySystem[] = 133 static const char kExternalClearKeyDecryptOnlyKeySystem[] =
134 "org.chromium.externalclearkey.decryptonly"; 134 "org.chromium.externalclearkey.decryptonly";
135 static const char kExternalClearKeyFileIOTestKeySystem[] = 135 static const char kExternalClearKeyFileIOTestKeySystem[] =
136 "org.chromium.externalclearkey.fileiotest"; 136 "org.chromium.externalclearkey.fileiotest";
137 static const char kExternalClearKeyOutputProtectionTestKeySystem[] =
138 "org.chromium.externalclearkey.outputprotectiontest";
137 static const char kExternalClearKeyInitializeFailKeySystem[] = 139 static const char kExternalClearKeyInitializeFailKeySystem[] =
138 "org.chromium.externalclearkey.initializefail"; 140 "org.chromium.externalclearkey.initializefail";
139 static const char kExternalClearKeyCrashKeySystem[] = 141 static const char kExternalClearKeyCrashKeySystem[] =
140 "org.chromium.externalclearkey.crash"; 142 "org.chromium.externalclearkey.crash";
141 143
142 std::vector<base::string16> additional_param_names; 144 std::vector<base::string16> additional_param_names;
143 std::vector<base::string16> additional_param_values; 145 std::vector<base::string16> additional_param_values;
144 if (!IsPepperCdmAvailable(kExternalClearKeyPepperType, 146 if (!IsPepperCdmAvailable(kExternalClearKeyPepperType,
145 &additional_param_names, 147 &additional_param_names,
146 &additional_param_values)) { 148 &additional_param_values)) {
147 return; 149 return;
148 } 150 }
149 151
150 concrete_key_systems->emplace_back( 152 concrete_key_systems->emplace_back(
151 new ExternalClearKeyProperties(kExternalClearKeyKeySystem)); 153 new ExternalClearKeyProperties(kExternalClearKeyKeySystem));
152 154
153 // Add support of decrypt-only mode in ClearKeyCdm. 155 // Add support of decrypt-only mode in ClearKeyCdm.
154 concrete_key_systems->emplace_back( 156 concrete_key_systems->emplace_back(
155 new ExternalClearKeyProperties(kExternalClearKeyDecryptOnlyKeySystem)); 157 new ExternalClearKeyProperties(kExternalClearKeyDecryptOnlyKeySystem));
156 158
157 // A key system that triggers FileIO test in ClearKeyCdm. 159 // A key system that triggers FileIO test in ClearKeyCdm.
158 concrete_key_systems->emplace_back( 160 concrete_key_systems->emplace_back(
159 new ExternalClearKeyProperties(kExternalClearKeyFileIOTestKeySystem)); 161 new ExternalClearKeyProperties(kExternalClearKeyFileIOTestKeySystem));
160 162
163 // A key system that triggers output protection test in ClearKeyCdm.
ddorwin 2016/06/23 19:24:28 nit: triggers *the*... Same at 160.
xhwang 2016/06/23 20:53:49 Done.
164 concrete_key_systems->emplace_back(new ExternalClearKeyProperties(
165 kExternalClearKeyOutputProtectionTestKeySystem));
166
161 // A key system that Chrome thinks is supported by ClearKeyCdm, but actually 167 // A key system that Chrome thinks is supported by ClearKeyCdm, but actually
162 // will be refused by ClearKeyCdm. This is to test the CDM initialization 168 // will be refused by ClearKeyCdm. This is to test the CDM initialization
163 // failure case. 169 // failure case.
164 concrete_key_systems->emplace_back( 170 concrete_key_systems->emplace_back(
165 new ExternalClearKeyProperties(kExternalClearKeyInitializeFailKeySystem)); 171 new ExternalClearKeyProperties(kExternalClearKeyInitializeFailKeySystem));
166 172
167 // A key system that triggers a crash in ClearKeyCdm. 173 // A key system that triggers a crash in ClearKeyCdm.
168 concrete_key_systems->emplace_back( 174 concrete_key_systems->emplace_back(
169 new ExternalClearKeyProperties(kExternalClearKeyCrashKeySystem)); 175 new ExternalClearKeyProperties(kExternalClearKeyCrashKeySystem));
170 } 176 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 #if defined(WIDEVINE_CDM_AVAILABLE) 284 #if defined(WIDEVINE_CDM_AVAILABLE)
279 AddPepperBasedWidevine(key_systems_properties); 285 AddPepperBasedWidevine(key_systems_properties);
280 #endif // defined(WIDEVINE_CDM_AVAILABLE) 286 #endif // defined(WIDEVINE_CDM_AVAILABLE)
281 287
282 #endif // defined(ENABLE_PEPPER_CDMS) 288 #endif // defined(ENABLE_PEPPER_CDMS)
283 289
284 #if defined(OS_ANDROID) 290 #if defined(OS_ANDROID)
285 cdm::AddAndroidWidevine(key_systems_properties); 291 cdm::AddAndroidWidevine(key_systems_properties);
286 #endif // defined(OS_ANDROID) 292 #endif // defined(OS_ANDROID)
287 } 293 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698