This source file includes following definitions.
- info_
- Initialize
- AppendDataToFile
- Rename
- Detach
- Cancel
- Finish
- AnnotateWithSourceInformation
- FullPath
- InProgress
- BytesSoFar
- GetHash
- DebugString
#include "content/browser/download/save_file.h"
#include "base/logging.h"
#include "content/public/browser/browser_thread.h"
namespace content {
SaveFile::SaveFile(const SaveFileCreateInfo* info, bool calculate_hash)
: file_(base::FilePath(),
info->url,
GURL(),
0,
calculate_hash,
std::string(),
base::File(),
net::BoundNetLog()),
info_(info) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK(info);
DCHECK(info->path.empty());
}
SaveFile::~SaveFile() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
}
DownloadInterruptReason SaveFile::Initialize() {
return file_.Initialize(base::FilePath());
}
DownloadInterruptReason SaveFile::AppendDataToFile(const char* data,
size_t data_len) {
return file_.AppendDataToFile(data, data_len);
}
DownloadInterruptReason SaveFile::Rename(const base::FilePath& full_path) {
return file_.Rename(full_path);
}
void SaveFile::Detach() {
file_.Detach();
}
void SaveFile::Cancel() {
file_.Cancel();
}
void SaveFile::Finish() {
file_.Finish();
}
void SaveFile::AnnotateWithSourceInformation() {
file_.AnnotateWithSourceInformation();
}
base::FilePath SaveFile::FullPath() const {
return file_.full_path();
}
bool SaveFile::InProgress() const {
return file_.in_progress();
}
int64 SaveFile::BytesSoFar() const {
return file_.bytes_so_far();
}
bool SaveFile::GetHash(std::string* hash) {
return file_.GetHash(hash);
}
std::string SaveFile::DebugString() const {
return file_.DebugString();
}
}