Index: media/cdm/ppapi/external_clear_key/clear_key_cdm.cc |
diff --git a/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc b/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc |
index 18e4f87ea8c06a4f1bbcaf57b54729f9f4a15ec4..655fd6a8a5e7ee06222a762ec1fe5feecbd842ba 100644 |
--- a/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc |
+++ b/media/cdm/ppapi/external_clear_key/clear_key_cdm.cc |
@@ -272,33 +272,22 @@ |
// Makes sure files and corresponding signature files are readable but not |
// writable. |
bool VerifyCdmHost_0(const cdm::HostFile* host_files, uint32_t num_files) { |
- DVLOG(1) << __func__ << ": " << num_files; |
- |
- // We should always have the CDM and CDM adapter and at lease one common file. |
- // The common CDM host file (e.g. chrome) might not exist since we are running |
- // in browser_tests. |
- const uint32_t kMinNumHostFiles = 3; |
+ DVLOG(1) << __func__; |
// We should always have the CDM and CDM adapter. |
- const int kNumCdmFiles = 2; |
- |
- if (num_files < kMinNumHostFiles) { |
+ // We might not have any common CDM host file (e.g. chrome) since we are |
+ // running in browser_tests. |
+ if (num_files < 2) { |
LOG(ERROR) << "Too few host files: " << num_files; |
g_verify_host_files_result = false; |
return true; |
} |
- int num_opened_files = 0; |
for (uint32_t i = 0; i < num_files; ++i) { |
const int kBytesToRead = 10; |
std::vector<char> buffer(kBytesToRead); |
base::File file(static_cast<base::PlatformFile>(host_files[i].file)); |
- if (!file.IsValid()) |
- continue; |
- |
- num_opened_files++; |
- |
int bytes_read = file.Read(0, buffer.data(), buffer.size()); |
if (bytes_read != kBytesToRead) { |
LOG(ERROR) << "File bytes read: " << bytes_read; |
@@ -308,13 +297,6 @@ |
// TODO(xhwang): Check that the files are not writable. |
// TODO(xhwang): Also verify the signature file when it's available. |
- } |
- |
- // We should always have CDM files opened. |
- if (num_opened_files < kNumCdmFiles) { |
- LOG(ERROR) << "Too few opened files: " << num_opened_files; |
- g_verify_host_files_result = false; |
- return true; |
} |
g_verify_host_files_result = true; |