Keep archive's file opened in the archive's whole life time
This commit is contained in:
parent
f02cae1b0a
commit
f8e1dfbbc6
4 changed files with 15 additions and 10 deletions
|
@ -36,13 +36,12 @@ bool ScopedTemporaryFile::Init() {
|
|||
return base::CreateTemporaryFile(&path_);
|
||||
}
|
||||
|
||||
bool ScopedTemporaryFile::InitFromFile(const base::FilePath& path,
|
||||
bool ScopedTemporaryFile::InitFromFile(base::File& src,
|
||||
uint64 offset, uint64 size) {
|
||||
if (!Init())
|
||||
if (!src.IsValid())
|
||||
return false;
|
||||
|
||||
base::File src(path, base::File::FLAG_OPEN | base::File::FLAG_READ);
|
||||
if (!src.IsValid())
|
||||
if (!Init())
|
||||
return false;
|
||||
|
||||
std::vector<char> buf(size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue