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

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

Issue 2426813002: EME: Close existing sessions on CDM failure (Closed)
Patch Set: add new tests Created 4 years, 1 month 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 static const char kExternalClearKeyFileIOTestKeySystem[] = 71 static const char kExternalClearKeyFileIOTestKeySystem[] =
72 "org.chromium.externalclearkey.fileiotest"; 72 "org.chromium.externalclearkey.fileiotest";
73 static const char kExternalClearKeyOutputProtectionTestKeySystem[] = 73 static const char kExternalClearKeyOutputProtectionTestKeySystem[] =
74 "org.chromium.externalclearkey.outputprotectiontest"; 74 "org.chromium.externalclearkey.outputprotectiontest";
75 static const char kExternalClearKeyPlatformVerificationTestKeySystem[] = 75 static const char kExternalClearKeyPlatformVerificationTestKeySystem[] =
76 "org.chromium.externalclearkey.platformverificationtest"; 76 "org.chromium.externalclearkey.platformverificationtest";
77 static const char kExternalClearKeyInitializeFailKeySystem[] = 77 static const char kExternalClearKeyInitializeFailKeySystem[] =
78 "org.chromium.externalclearkey.initializefail"; 78 "org.chromium.externalclearkey.initializefail";
79 static const char kExternalClearKeyCrashKeySystem[] = 79 static const char kExternalClearKeyCrashKeySystem[] =
80 "org.chromium.externalclearkey.crash"; 80 "org.chromium.externalclearkey.crash";
81 static const char kExternalClearKeyCloseOnCrashKeySystem[] =
82 "org.chromium.externalclearkey.closeoncrash";
81 83
82 std::vector<base::string16> additional_param_names; 84 std::vector<base::string16> additional_param_names;
83 std::vector<base::string16> additional_param_values; 85 std::vector<base::string16> additional_param_values;
84 if (!IsPepperCdmAvailable(cdm::kExternalClearKeyPepperType, 86 if (!IsPepperCdmAvailable(cdm::kExternalClearKeyPepperType,
85 &additional_param_names, 87 &additional_param_names,
86 &additional_param_values)) { 88 &additional_param_values)) {
87 return; 89 return;
88 } 90 }
89 91
90 concrete_key_systems->emplace_back( 92 concrete_key_systems->emplace_back(
(...skipping 18 matching lines...) Expand all
109 // A key system that triggers the platform verification test in ClearKeyCdm. 111 // A key system that triggers the platform verification test in ClearKeyCdm.
110 concrete_key_systems->emplace_back(new cdm::ExternalClearKeyProperties( 112 concrete_key_systems->emplace_back(new cdm::ExternalClearKeyProperties(
111 kExternalClearKeyPlatformVerificationTestKeySystem)); 113 kExternalClearKeyPlatformVerificationTestKeySystem));
112 114
113 // A key system that Chrome thinks is supported by ClearKeyCdm, but actually 115 // A key system that Chrome thinks is supported by ClearKeyCdm, but actually
114 // will be refused by ClearKeyCdm. This is to test the CDM initialization 116 // will be refused by ClearKeyCdm. This is to test the CDM initialization
115 // failure case. 117 // failure case.
116 concrete_key_systems->emplace_back(new cdm::ExternalClearKeyProperties( 118 concrete_key_systems->emplace_back(new cdm::ExternalClearKeyProperties(
117 kExternalClearKeyInitializeFailKeySystem)); 119 kExternalClearKeyInitializeFailKeySystem));
118 120
119 // A key system that triggers a crash in ClearKeyCdm. 121 // Key systems that trigger a crash in ClearKeyCdm.
120 concrete_key_systems->emplace_back( 122 concrete_key_systems->emplace_back(
121 new cdm::ExternalClearKeyProperties(kExternalClearKeyCrashKeySystem)); 123 new cdm::ExternalClearKeyProperties(kExternalClearKeyCrashKeySystem));
124 concrete_key_systems->emplace_back(new cdm::ExternalClearKeyProperties(
125 kExternalClearKeyCloseOnCrashKeySystem));
122 } 126 }
123 127
124 #if defined(WIDEVINE_CDM_AVAILABLE) 128 #if defined(WIDEVINE_CDM_AVAILABLE)
125 // This function finds "codecs" and parses the value into the vector |codecs|. 129 // This function finds "codecs" and parses the value into the vector |codecs|.
126 // Converts the codec strings to UTF-8 since we only expect ASCII strings and 130 // Converts the codec strings to UTF-8 since we only expect ASCII strings and
127 // this simplifies the rest of the code in this file. 131 // this simplifies the rest of the code in this file.
128 void GetSupportedCodecsForPepperCdm( 132 void GetSupportedCodecsForPepperCdm(
129 const std::vector<base::string16>& additional_param_names, 133 const std::vector<base::string16>& additional_param_names,
130 const std::vector<base::string16>& additional_param_values, 134 const std::vector<base::string16>& additional_param_values,
131 std::vector<std::string>* codecs) { 135 std::vector<std::string>* codecs) {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 #if defined(WIDEVINE_CDM_AVAILABLE) 235 #if defined(WIDEVINE_CDM_AVAILABLE)
232 AddPepperBasedWidevine(key_systems_properties); 236 AddPepperBasedWidevine(key_systems_properties);
233 #endif // defined(WIDEVINE_CDM_AVAILABLE) 237 #endif // defined(WIDEVINE_CDM_AVAILABLE)
234 238
235 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS) 239 #endif // BUILDFLAG(ENABLE_PEPPER_CDMS)
236 240
237 #if defined(OS_ANDROID) 241 #if defined(OS_ANDROID)
238 cdm::AddAndroidWidevine(key_systems_properties); 242 cdm::AddAndroidWidevine(key_systems_properties);
239 #endif // defined(OS_ANDROID) 243 #endif // defined(OS_ANDROID)
240 } 244 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698