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 CONTENT_COMMON_MEDIA_CDM_HOST_FILE_H_ | |
6 #define CONTENT_COMMON_MEDIA_CDM_HOST_FILE_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "base/files/file.h" | |
11 #include "base/files/file_path.h" | |
12 #include "base/macros.h" | |
13 | |
14 namespace cdm { | |
15 struct CdmHostFile; | |
16 } | |
17 | |
18 namespace content { | |
19 | |
20 // Represents a single file that participated in hosting the CDM. | |
21 class CdmHostFile { | |
22 public: | |
23 // Opens the file at |file_path| and the corresponding signature file. Upon | |
24 // success, constructs and returns a CdmHostFile object. Otherwise returns | |
25 // nullptr. The opened files are closed when |this| is destructed. | |
26 static std::unique_ptr<CdmHostFile> Create(const base::FilePath& file_path); | |
27 | |
28 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.
| |
29 | |
30 private: | |
31 CdmHostFile(const base::FilePath& file_path, | |
32 base::File file, | |
33 base::File sig_file); | |
34 | |
35 base::FilePath file_path_; | |
36 base::File file_; | |
37 | |
38 // The signature file associated with |file_|. | |
39 base::File sig_file_; | |
40 | |
41 DISALLOW_COPY_AND_ASSIGN(CdmHostFile); | |
42 }; | |
43 | |
44 } // namespace content | |
45 | |
46 #endif // CONTENT_COMMON_MEDIA_CDM_HOST_FILE_H_ | |
OLD | NEW |