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

Unified Diff: media/cdm/content_decryption_module_ext.h

Issue 2582463003: media: Verify CDM Host files (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: media/cdm/content_decryption_module_ext.h
diff --git a/media/cdm/content_decryption_module_ext.h b/media/cdm/content_decryption_module_ext.h
new file mode 100644
index 0000000000000000000000000000000000000000..81d1dfec380546306cf7947c8dca050343c39a86
--- /dev/null
+++ b/media/cdm/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_
xhwang 2016/12/16 01:06:55 Adding this new API in a different file since this
+
+#if defined(WIN32)
Haoming Chen 2017/01/04 22:23:39 s/WIN32/OS_WIN?
xhwang 2017/01/12 20:15:02 This interface is intended to be used independent
+#include <windows.h>
+#endif
+
+#include "media/cdm/content_decryption_module_export.h"
+
+#if defined(_MSC_VER)
+typedef unsigned int uint32_t;
+#else
+#include <stdint.h>
+#endif
+
+#if defined(WIN32)
Haoming Chen 2017/01/04 22:23:39 ditto
xhwang 2017/01/12 20:15:02 Acknowledged.
+typedef wchar_t FilePathCharType;
+typedef HANDLE CdmPlatformFile;
+const CdmPlatformFile kInvalidPlatformFile = INVALID_HANDLE_VALUE;
+#elif defined(OS_POSIX)
jrummell 2016/12/16 20:21:30 Why not just #else? That way it should compile eve
xhwang 2017/01/12 20:15:02 I am not sure whether the file descriptor is an in
+typedef char FilePathCharType;
+typedef int CdmPlatformFile;
+const CdmPlatformFile kInvalidPlatformFile = -1;
+#endif // defined(WIN32)
+
+namespace cdm {
+
+struct CdmHostFile {
+ CdmHostFile(const FilePathCharType* file_path,
+ CdmPlatformFile file,
+ CdmPlatformFile sig_file)
+ : file_path(file_path), file(file), sig_file(sig_file) {}
+
+ 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
+// files asynchronously. All files should be closed by the CDM after the
+// processing is finished.
+CDM_API void VerifyHostFiles(const cdm::CdmHostFile* cdm_host_files,
+ uint32_t num_files);
+}
+
+#endif // CDM_CONTENT_DECRYPTION_MODULE_EXT_H_

Powered by Google App Engine
This is Rietveld 408576698