#include "net/url_request/url_fetcher_response_writer.h"
-#include "base/file_util.h"
+#include "base/files/file_util.h"
#include "base/location.h"
#include "base/sequenced_task_runner.h"
#include "base/task_runner_util.h"
URLFetcherFileWriter::URLFetcherFileWriter(
scoped_refptr<base::SequencedTaskRunner> file_task_runner,
const base::FilePath& file_path)
- : weak_factory_(this),
- file_task_runner_(file_task_runner),
+ : file_task_runner_(file_task_runner),
file_path_(file_path),
- owns_file_(false) {
+ owns_file_(false),
+ weak_factory_(this) {
DCHECK(file_task_runner_.get());
}
}
int URLFetcherFileWriter::Initialize(const CompletionCallback& callback) {
- file_stream_.reset(new FileStream(NULL));
+ file_stream_.reset(new FileStream(file_task_runner_));
int result = ERR_IO_PENDING;
if (file_path_.empty()) {
} else {
result = file_stream_->Open(
file_path_,
- base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_ASYNC |
- base::PLATFORM_FILE_CREATE_ALWAYS,
+ base::File::FLAG_WRITE | base::File::FLAG_ASYNC |
+ base::File::FLAG_CREATE_ALWAYS,
base::Bind(&URLFetcherFileWriter::DidOpenFile,
weak_factory_.GetWeakPtr(),
callback));
owns_file_ = true;
const int result = file_stream_->Open(
file_path_,
- base::PLATFORM_FILE_WRITE | base::PLATFORM_FILE_ASYNC |
- base::PLATFORM_FILE_OPEN,
+ base::File::FLAG_WRITE | base::File::FLAG_ASYNC |
+ base::File::FLAG_OPEN,
base::Bind(&URLFetcherFileWriter::DidOpenFile,
weak_factory_.GetWeakPtr(),
callback));