Chromium Code Reviews| Index: content_decryption_module_ext.h |
| diff --git a/content_decryption_module_ext.h b/content_decryption_module_ext.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..abea519bf4227b012396382c2992567abf7444c3 |
| --- /dev/null |
| +++ b/content_decryption_module_ext.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CDM_CONTENT_DECRYPTION_MODULE_EXT_H_ |
| +#define CDM_CONTENT_DECRYPTION_MODULE_EXT_H_ |
| + |
| +#if defined(WIN32) |
| +#include <windows.h> |
| +#endif |
| + |
| +#include "content_decryption_module_export.h" |
| + |
| +#if defined(_MSC_VER) |
| +typedef unsigned int uint32_t; |
|
ddorwin
2017/01/13 08:27:51
Is this still required even with the latest VS ver
xhwang
2017/01/13 18:34:06
I am not sure.
|
| +#else |
| +#include <stdint.h> |
| +#endif |
| + |
| +#if defined(WIN32) |
| +typedef wchar_t FilePathCharType; |
| +typedef HANDLE CdmPlatformFile; |
| +const CdmPlatformFile kInvalidPlatformFile = INVALID_HANDLE_VALUE; |
| +#elif defined(OS_POSIX) |
| +typedef char FilePathCharType; |
| +typedef int CdmPlatformFile; |
|
ddorwin
2017/01/13 08:27:51
...Id? ...Handle? As is, it would appear to be an
xhwang
2017/01/13 18:34:06
PlatformFile comes from base/file/file.h
https://
ddorwin
2017/01/13 18:47:38
Acknowledged.
|
| +const CdmPlatformFile kInvalidPlatformFile = -1; |
| +#endif // defined(WIN32) |
|
ddorwin
2017/01/13 08:27:51
Should we #error?
xhwang
2017/01/13 18:34:06
Done.
|
| + |
| +namespace cdm { |
| + |
| +struct CdmHostFile { |
| + CdmHostFile(const FilePathCharType* file_path, |
| + CdmPlatformFile file, |
| + CdmPlatformFile sig_file) |
| + : file_path(file_path), file(file), sig_file(sig_file) {} |
|
ddorwin
2017/01/13 08:27:51
The members and parameters have the same exact nam
xhwang
2017/01/13 18:34:06
Yes. Please see related discussion here:
http://st
|
| + |
| + const FilePathCharType* file_path = nullptr; |
| + CdmPlatformFile file = kInvalidPlatformFile; |
| + CdmPlatformFile sig_file = kInvalidPlatformFile; |
| +}; |
| + |
| +} // namespace cdm |
| + |
| +extern "C" { |
| + |
| +// Verifies CDM host files, which are opened in read-only mode and passed in |
| +// |cdm_host_files|. The CDM should return as soon as possible and process the |
|
ddorwin
2017/01/13 08:27:51
s/should/MUST/ here and below.
xhwang
2017/01/13 18:34:06
Done.
|
| +// files asynchronously. All files should be closed by the CDM after the |
| +// processing is finished. |
|
ddorwin
2017/01/13 08:27:51
...this one-time processing...
To make it clear t
xhwang
2017/01/13 18:34:06
Done.
|
| +CDM_API void VerifyHostFiles(const cdm::CdmHostFile* cdm_host_files, |
| + uint32_t num_files); |
| +} |
| + |
| +#endif // CDM_CONTENT_DECRYPTION_MODULE_EXT_H_ |