summaryrefslogtreecommitdiffstats
path: root/webkit/blob
diff options
context:
space:
mode:
authordumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 19:30:27 +0000
committerdumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 19:30:27 +0000
commited65fece343181e91b4d36e161434cc763475de7 (patch)
tree27af7d7cb8a12f65b24dba3ebd5ede3d592e2d8e /webkit/blob
parent2d723bc66e60bedd617ebd464996ee2388c0c365 (diff)
downloadchromium_src-ed65fece343181e91b4d36e161434cc763475de7.zip
chromium_src-ed65fece343181e91b4d36e161434cc763475de7.tar.gz
chromium_src-ed65fece343181e91b4d36e161434cc763475de7.tar.bz2
Add an optional parameter to CreatePlatformFile() to report the type
of error that occured while trying to open/create a file. TEST=none BUG=none Review URL: http://codereview.chromium.org/3223007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/blob')
-rw-r--r--webkit/blob/blob_url_request_job.cc15
-rw-r--r--webkit/blob/blob_url_request_job.h4
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_;