summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-27 14:39:32 +0000
committerhidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-27 14:39:32 +0000
commitdb35109625b2deb56899389d381003aa07448e6c (patch)
tree297680747cc2240f3b210f5f87184087e3a4f292
parent15ce384fde9be34c54a15fcf784c229ce3a236e6 (diff)
downloadchromium_src-db35109625b2deb56899389d381003aa07448e6c.zip
chromium_src-db35109625b2deb56899389d381003aa07448e6c.tar.gz
chromium_src-db35109625b2deb56899389d381003aa07448e6c.tar.bz2
Let LocalFileSystemOperation::SyncGetPlatformPath failed if context returns NULL for GetFileUtil.
This is a part of {Local,Remote}FileSystemOperation merging. After the merging the context may not support GetFileUtil(). In such a case, lets the method fail. Returned error code should be the same one for the current RemoteFileSystemOperation case. BUG=110121 TEST=Ran unit_tests Review URL: https://chromiumcodereview.appspot.com/18016002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208918 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/browser/fileapi/file_system_operation_runner.cc3
-rw-r--r--webkit/browser/fileapi/local_file_system_operation.cc6
-rw-r--r--webkit/browser/fileapi/local_file_system_operation.h7
3 files changed, 10 insertions, 6 deletions
diff --git a/webkit/browser/fileapi/file_system_operation_runner.cc b/webkit/browser/fileapi/file_system_operation_runner.cc
index 13da4fe..d16b727 100644
--- a/webkit/browser/fileapi/file_system_operation_runner.cc
+++ b/webkit/browser/fileapi/file_system_operation_runner.cc
@@ -442,9 +442,8 @@ base::PlatformFileError FileSystemOperationRunner::SyncGetPlatformPath(
if (!operation)
return error;
- operation->AsLocalFileSystemOperation()->SyncGetPlatformPath(
+ return operation->AsLocalFileSystemOperation()->SyncGetPlatformPath(
url, platform_path);
- return base::PLATFORM_FILE_OK;
}
FileSystemOperationRunner::FileSystemOperationRunner(
diff --git a/webkit/browser/fileapi/local_file_system_operation.cc b/webkit/browser/fileapi/local_file_system_operation.cc
index 4d5aec4..8e5287f 100644
--- a/webkit/browser/fileapi/local_file_system_operation.cc
+++ b/webkit/browser/fileapi/local_file_system_operation.cc
@@ -239,14 +239,16 @@ LocalFileSystemOperation::AsLocalFileSystemOperation() {
return this;
}
-void LocalFileSystemOperation::SyncGetPlatformPath(
+base::PlatformFileError LocalFileSystemOperation::SyncGetPlatformPath(
const FileSystemURL& url,
base::FilePath* platform_path) {
DCHECK(SetPendingOperationType(kOperationGetLocalPath));
FileSystemFileUtil* file_util = file_system_context()->GetFileUtil(
url.type());
- DCHECK(file_util);
+ if (!file_util)
+ return base::PLATFORM_FILE_ERROR_INVALID_OPERATION;
file_util->GetLocalFilePath(operation_context_.get(), url, platform_path);
+ return base::PLATFORM_FILE_OK;
}
void LocalFileSystemOperation::CreateSnapshotFile(
diff --git a/webkit/browser/fileapi/local_file_system_operation.h b/webkit/browser/fileapi/local_file_system_operation.h
index 1a73d39..63613b2 100644
--- a/webkit/browser/fileapi/local_file_system_operation.h
+++ b/webkit/browser/fileapi/local_file_system_operation.h
@@ -152,8 +152,11 @@ class WEBKIT_STORAGE_BROWSER_EXPORT LocalFileSystemOperation
const StatusCallback& callback);
// Synchronously gets the platform path for the given |url|.
- void SyncGetPlatformPath(const FileSystemURL& url,
- base::FilePath* platform_path);
+ // This may fail if |file_system_context| returns NULL on GetFileUtil().
+ // In such a case, base::PLATFORM_FILE_ERROR_INVALID_OPERATION will be
+ // returned.
+ base::PlatformFileError SyncGetPlatformPath(const FileSystemURL& url,
+ base::FilePath* platform_path);
FileSystemContext* file_system_context() const {
return file_system_context_.get();