diff options
Diffstat (limited to 'webkit/blob')
-rw-r--r-- | webkit/blob/blob_url_request_job.cc | 15 | ||||
-rw-r--r-- | webkit/blob/blob_url_request_job.h | 4 |
2 files changed, 13 insertions, 6 deletions
diff --git a/webkit/blob/blob_url_request_job.cc b/webkit/blob/blob_url_request_job.cc index ef2fcc6..5103458 100644 --- a/webkit/blob/blob_url_request_job.cc +++ b/webkit/blob/blob_url_request_job.cc @@ -106,19 +106,24 @@ void BlobURLRequestJob::ResolveFile(const FilePath& file_path) { // Continue asynchronously. MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod( - this, &BlobURLRequestJob::DidResolve, exists, file_info)); + this, &BlobURLRequestJob::DidResolve, + (exists ? base::PLATFORM_FILE_OK : base::PLATFORM_FILE_ERROR_NOT_FOUND), + file_info)); } -void BlobURLRequestJob::DidResolve( - bool exists, const file_util::FileInfo& file_info) { +void BlobURLRequestJob::DidResolve(base::PlatformFileError rv, + const file_util::FileInfo& file_info) { // We may have been orphaned... if (!request_) return; - // If the file does not exist, bail out. - if (!exists) { + // If an error occured, bail out. + if (rv == base::PLATFORM_FILE_ERROR_NOT_FOUND) { NotifyFailure(net::ERR_FILE_NOT_FOUND); return; + } else if (rv != base::PLATFORM_FILE_OK) { + NotifyFailure(net::ERR_FAILED); + return; } // Validate the expected modification time. diff --git a/webkit/blob/blob_url_request_job.h b/webkit/blob/blob_url_request_job.h index 9d24839..5445774 100644 --- a/webkit/blob/blob_url_request_job.h +++ b/webkit/blob/blob_url_request_job.h @@ -5,6 +5,7 @@ #ifndef WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ #define WEBKIT_BLOB_BLOB_URL_REQUEST_JOB_H_ +#include "base/platform_file.h" #include "base/ref_counted.h" #include "base/scoped_callback_factory.h" #include "base/scoped_ptr.h" @@ -56,7 +57,8 @@ class BlobURLRequestJob : public URLRequestJob { void NotifySuccess(); void NotifyFailure(int); - void DidResolve(bool exists, const file_util::FileInfo& file_info); + void DidResolve(base::PlatformFileError rv, + const file_util::FileInfo& file_info); void DidRead(int result); base::ScopedCallbackFactory<BlobURLRequestJob> callback_factory_; |