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

Unified Diff: content/common/media/cdm_host_file.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: content/common/media/cdm_host_file.h
diff --git a/content/common/media/cdm_host_file.h b/content/common/media/cdm_host_file.h
new file mode 100644
index 0000000000000000000000000000000000000000..adeb939baefd8354202f96515f7168aa77b4126a
--- /dev/null
+++ b/content/common/media/cdm_host_file.h
@@ -0,0 +1,46 @@
+// 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 CONTENT_COMMON_MEDIA_CDM_HOST_FILE_H_
+#define CONTENT_COMMON_MEDIA_CDM_HOST_FILE_H_
+
+#include <memory>
+
+#include "base/files/file.h"
+#include "base/files/file_path.h"
+#include "base/macros.h"
+
+namespace cdm {
+struct CdmHostFile;
+}
+
+namespace content {
+
+// Represents a single file that participated in hosting the CDM.
+class CdmHostFile {
+ public:
+ // Opens the file at |file_path| and the corresponding signature file. Upon
+ // success, constructs and returns a CdmHostFile object. Otherwise returns
+ // nullptr. The opened files are closed when |this| is destructed.
+ static std::unique_ptr<CdmHostFile> Create(const base::FilePath& file_path);
+
+ cdm::CdmHostFile TakePlatformFile();
jrummell 2016/12/16 20:21:30 Does this take ownership of the File objects? or a
xhwang 2017/01/12 20:15:02 I can't use a unique_ptr since I need to push the
xhwang 2017/01/18 06:03:58 Added comments.
+
+ private:
+ CdmHostFile(const base::FilePath& file_path,
+ base::File file,
+ base::File sig_file);
+
+ base::FilePath file_path_;
+ base::File file_;
+
+ // The signature file associated with |file_|.
+ base::File sig_file_;
+
+ DISALLOW_COPY_AND_ASSIGN(CdmHostFile);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_MEDIA_CDM_HOST_FILE_H_

Powered by Google App Engine
This is Rietveld 408576698