| 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 35b6c1d8d63d9644c7c6861a35be3e366d79f440..d46a5e72bda6107c7e1e759154068130281851d3 100644
|
| --- a/storage/browser/fileapi/file_system_dir_url_request_job.cc
|
| +++ b/storage/browser/fileapi/file_system_dir_url_request_job.cc
|
| @@ -44,15 +44,14 @@ FileSystemDirURLRequestJob::FileSystemDirURLRequestJob(
|
| FileSystemDirURLRequestJob::~FileSystemDirURLRequestJob() {
|
| }
|
|
|
| -bool FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest, int dest_size,
|
| - int *bytes_read) {
|
| - int count = std::min(dest_size, static_cast<int>(data_.size()));
|
| +int FileSystemDirURLRequestJob::ReadRawData(net::IOBuffer* dest,
|
| + int dest_size) {
|
| + int count = std::min(dest_size, base::checked_cast<int>(data_.size()));
|
| if (count > 0) {
|
| memcpy(dest->data(), data_.data(), count);
|
| data_.erase(0, count);
|
| }
|
| - *bytes_read = count;
|
| - return true;
|
| + return count;
|
| }
|
|
|
| void FileSystemDirURLRequestJob::Start() {
|
| @@ -98,8 +97,7 @@ void FileSystemDirURLRequestJob::StartAsync() {
|
| false);
|
| return;
|
| }
|
| - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
|
| - net::ERR_FILE_NOT_FOUND));
|
| + NotifyStartError(URLRequestStatus::FromError(net::ERR_FILE_NOT_FOUND));
|
| return;
|
| }
|
| file_system_context_->operation_runner()->ReadDirectory(
|
| @@ -112,8 +110,7 @@ void FileSystemDirURLRequestJob::DidAttemptAutoMount(base::File::Error result) {
|
| file_system_context_->CrackURL(request_->url()).is_valid()) {
|
| StartAsync();
|
| } else {
|
| - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED,
|
| - net::ERR_FILE_NOT_FOUND));
|
| + NotifyStartError(URLRequestStatus::FromError(net::ERR_FILE_NOT_FOUND));
|
| }
|
| }
|
|
|
| @@ -125,7 +122,7 @@ void FileSystemDirURLRequestJob::DidReadDirectory(
|
| int rv = net::ERR_FILE_NOT_FOUND;
|
| if (result == base::File::FILE_ERROR_INVALID_URL)
|
| rv = net::ERR_INVALID_URL;
|
| - NotifyDone(URLRequestStatus(URLRequestStatus::FAILED, rv));
|
| + NotifyStartError(URLRequestStatus::FromError(rv));
|
| return;
|
| }
|
|
|
|
|