diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-23 21:41:16 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-23 21:41:16 +0000 |
commit | ca6667890dde9c98fc1ad8203f002757ea740110 (patch) | |
tree | 78e095e67430c8ab873c6198e9e9449cd04b9295 /webkit/fileapi | |
parent | 72a7922929363288647ccce827a56a752be66c24 (diff) | |
download | chromium_src-ca6667890dde9c98fc1ad8203f002757ea740110.zip chromium_src-ca6667890dde9c98fc1ad8203f002757ea740110.tar.gz chromium_src-ca6667890dde9c98fc1ad8203f002757ea740110.tar.bz2 |
Extend simple_file_system to use SandboxedFileSystemOperation
so that most of the code paths that run in chromium can be tested
in test_shell.
Also removed SandboxedFileSystemContext::CheckIfFilePathIsSafe that is not used at all.
BUG=60243
TEST=fast/filesystem
Review URL: http://codereview.chromium.org/4879001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67158 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r-- | webkit/fileapi/sandboxed_file_system_operation.cc | 17 | ||||
-rw-r--r-- | webkit/fileapi/sandboxed_file_system_operation.h | 6 |
2 files changed, 4 insertions, 19 deletions
diff --git a/webkit/fileapi/sandboxed_file_system_operation.cc b/webkit/fileapi/sandboxed_file_system_operation.cc index fc77ce3..dfc2884 100644 --- a/webkit/fileapi/sandboxed_file_system_operation.cc +++ b/webkit/fileapi/sandboxed_file_system_operation.cc @@ -115,9 +115,10 @@ void SandboxedFileSystemOperation::Truncate( FileSystemOperation::Truncate(path, length); } -void SandboxedFileSystemOperation::TouchFile(const FilePath& path, - const base::Time& last_access_time, - const base::Time& last_modified_time) { +void SandboxedFileSystemOperation::TouchFile( + const FilePath& path, + const base::Time& last_access_time, + const base::Time& last_modified_time) { if (!VerifyFileSystemPathForWrite(path, true /* create */, 0)) return; FileSystemOperation::TouchFile(path, last_access_time, last_modified_time); @@ -171,14 +172,4 @@ bool SandboxedFileSystemOperation::VerifyFileSystemPathForWrite( return true; } -bool SandboxedFileSystemOperation::CheckIfFilePathIsSafe( - const FilePath& path) { - if (file_system_context_->path_manager()->IsRestrictedFileName( - path.BaseName())) { - dispatcher()->DidFail(base::PLATFORM_FILE_ERROR_SECURITY); - return false; - } - return true; -} - } // namespace fileapi diff --git a/webkit/fileapi/sandboxed_file_system_operation.h b/webkit/fileapi/sandboxed_file_system_operation.h index 088a5f3..18d47f7 100644 --- a/webkit/fileapi/sandboxed_file_system_operation.h +++ b/webkit/fileapi/sandboxed_file_system_operation.h @@ -89,12 +89,6 @@ class SandboxedFileSystemOperation : public FileSystemOperation { bool create, int64 growth); - // Checks if a given |path| does not contain any restricted names/chars - // for new files. Returns true if the given |path| is safe. - // Otherwise it fires dispatcher's DidFail method with - // PLATFORM_FILE_ERROR_SECURITY and returns false. - bool CheckIfFilePathIsSafe(const FilePath& path); - // Not owned. See the comment at the constructor. SandboxedFileSystemContext* file_system_context_; |