| Index: storage/browser/fileapi/file_system_dir_url_request_job.cc
|
| diff --git a/storage/browser/fileapi/file_system_dir_url_request_job.cc b/storage/browser/fileapi/file_system_dir_url_request_job.cc
|
| index c053773526b530ccbb08dbe257b6e28612b08a11..fc91f3bc63f2034cc4b48ae3957441589c01f13a 100644
|
| --- a/storage/browser/fileapi/file_system_dir_url_request_job.cc
|
| +++ b/storage/browser/fileapi/file_system_dir_url_request_job.cc
|
| @@ -14,6 +14,7 @@
|
| #include "base/time/time.h"
|
| #include "build/build_config.h"
|
| #include "net/base/io_buffer.h"
|
| +#include "net/base/net_errors.h"
|
| #include "net/base/net_util.h"
|
| #include "net/url_request/url_request.h"
|
| #include "storage/browser/fileapi/file_system_context.h"
|
| @@ -43,14 +44,16 @@ FileSystemDirURLRequestJob::FileSystemDirURLRequestJob(
|
| FileSystemDirURLRequestJob::~FileSystemDirURLRequestJob() {
|
| }
|
|
|
| -int FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest,
|
| - int dest_size) {
|
| - int count = std::min(dest_size, base::checked_cast<int>(data_.size()));
|
| +bool FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest,
|
| + int dest_size,
|
| + int* bytes_read) {
|
| + int count = std::min(dest_size, static_cast<int>(data_.size()));
|
| if (count > 0) {
|
| memcpy(dest->data(), data_.data(), count);
|
| data_.erase(0, count);
|
| }
|
| - return count;
|
| + *bytes_read = count;
|
| + return true;
|
| }
|
|
|
| void FileSystemDirURLRequestJob::Start() {
|
| @@ -96,7 +99,8 @@ void FileSystemDirURLRequestJob::StartAsync() {
|
| false);
|
| return;
|
| }
|
| - NotifyStartError(URLRequestStatus::FromError(net::ERR_FILE_NOT_FOUND));
|
| + NotifyDone(
|
| + URLRequestStatus(URLRequestStatus::FAILED, net::ERR_FILE_NOT_FOUND));
|
| return;
|
| }
|
| file_system_context_->operation_runner()->ReadDirectory(
|
| @@ -109,7 +113,8 @@ void FileSystemDirURLRequestJob::DidAttemptAutoMount(base::File::Error result) {
|
| file_system_context_->CrackURL(request_->url()).is_valid()) {
|
| StartAsync();
|
| } else {
|
| - NotifyStartError(URLRequestStatus::FromError(net::ERR_FILE_NOT_FOUND));
|
| + NotifyDone(
|
| + URLRequestStatus(URLRequestStatus::FAILED, net::ERR_FILE_NOT_FOUND));
|
| }
|
| }
|
|
|
| @@ -121,7 +126,7 @@ void FileSystemDirURLRequestJob::DidReadDirectory(
|
| int rv = net::ERR_FILE_NOT_FOUND;
|
| if (result == base::File::FILE_ERROR_INVALID_URL)
|
| rv = net::ERR_INVALID_URL;
|
| - NotifyStartError(URLRequestStatus::FromError(rv));
|
| + NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv));
|
| return;
|
| }
|
|
|
| @@ -170,7 +175,7 @@ void FileSystemDirURLRequestJob::DidGetMetadata(
|
| int rv = net::ERR_FILE_NOT_FOUND;
|
| if (result == base::File::FILE_ERROR_INVALID_URL)
|
| rv = net::ERR_INVALID_URL;
|
| - NotifyStartError(URLRequestStatus(URLRequestStatus::FAILED, rv));
|
| + NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv));
|
| }
|
|
|
| if (!request_)
|
|
|