OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CDM_CONTENT_DECRYPTION_MODULE_EXT_H_ | |
6 #define CDM_CONTENT_DECRYPTION_MODULE_EXT_H_ | |
7 | |
8 #if defined(WIN32) | |
9 #include <windows.h> | |
10 #endif | |
11 | |
12 #include "content_decryption_module_export.h" | |
13 | |
14 #if defined(_MSC_VER) | |
15 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.
| |
16 #else | |
17 #include <stdint.h> | |
18 #endif | |
19 | |
20 #if defined(WIN32) | |
21 typedef wchar_t FilePathCharType; | |
22 typedef HANDLE CdmPlatformFile; | |
23 const CdmPlatformFile kInvalidPlatformFile = INVALID_HANDLE_VALUE; | |
24 #elif defined(OS_POSIX) | |
25 typedef char FilePathCharType; | |
26 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.
| |
27 const CdmPlatformFile kInvalidPlatformFile = -1; | |
28 #endif // defined(WIN32) | |
ddorwin
2017/01/13 08:27:51
Should we #error?
xhwang
2017/01/13 18:34:06
Done.
| |
29 | |
30 namespace cdm { | |
31 | |
32 struct CdmHostFile { | |
33 CdmHostFile(const FilePathCharType* file_path, | |
34 CdmPlatformFile file, | |
35 CdmPlatformFile sig_file) | |
36 : 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
| |
37 | |
38 const FilePathCharType* file_path = nullptr; | |
39 CdmPlatformFile file = kInvalidPlatformFile; | |
40 CdmPlatformFile sig_file = kInvalidPlatformFile; | |
41 }; | |
42 | |
43 } // namespace cdm | |
44 | |
45 extern "C" { | |
46 | |
47 // Verifies CDM host files, which are opened in read-only mode and passed in | |
48 // |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.
| |
49 // files asynchronously. All files should be closed by the CDM after the | |
50 // 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.
| |
51 CDM_API void VerifyHostFiles(const cdm::CdmHostFile* cdm_host_files, | |
52 uint32_t num_files); | |
53 } | |
54 | |
55 #endif // CDM_CONTENT_DECRYPTION_MODULE_EXT_H_ | |
OLD | NEW |