fix: revert "refactor: mmap asar files (#24470)" (#28137)

This reverts commit 01a2e23194.
This commit is contained in:
Jeremy Rose 2021-03-15 11:42:54 -07:00 committed by GitHub
parent b023b33c05
commit d27ad0d182
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 114 additions and 133 deletions

View file

@ -11,7 +11,6 @@
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/memory_mapped_file.h"
namespace base {
class DictionaryValue;
@ -62,13 +61,16 @@ class Archive {
// For unpacked file, this method will return its real path.
bool CopyFileOut(const base::FilePath& path, base::FilePath* out);
base::MemoryMappedFile* file() { return &file_; }
// Returns the file's fd.
int GetFD() const;
base::FilePath path() const { return path_; }
base::DictionaryValue* header() const { return header_.get(); }
private:
base::FilePath path_;
base::MemoryMappedFile file_;
base::File file_;
int fd_ = -1;
uint32_t header_size_ = 0;
std::unique_ptr<base::DictionaryValue> header_;