| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_FILEAPI_COPY_OR_MOVE_FILE_VALIDATOR_H_ | 5 #ifndef WEBKIT_FILEAPI_COPY_OR_MOVE_FILE_VALIDATOR_H_ |
| 6 #define WEBKIT_FILEAPI_COPY_OR_MOVE_FILE_VALIDATOR_H_ | 6 #define WEBKIT_FILEAPI_COPY_OR_MOVE_FILE_VALIDATOR_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
| 10 #include "webkit/storage/webkit_storage_export.h" |
| 10 | 11 |
| 11 namespace base { | 12 namespace base { |
| 12 class FilePath; | 13 class FilePath; |
| 13 } | 14 } |
| 14 | 15 |
| 15 namespace fileapi { | 16 namespace fileapi { |
| 16 | 17 |
| 17 class FileSystemURL; | 18 class FileSystemURL; |
| 18 | 19 |
| 19 class CopyOrMoveFileValidator { | 20 class WEBKIT_STORAGE_EXPORT CopyOrMoveFileValidator { |
| 20 public: | 21 public: |
| 21 // Callback that is invoked when validation completes. A result of | 22 // Callback that is invoked when validation completes. A result of |
| 22 // base::PLATFORM_FILE_OK means the file validated. | 23 // base::PLATFORM_FILE_OK means the file validated. |
| 23 typedef base::Callback<void(base::PlatformFileError result)> ResultCallback; | 24 typedef base::Callback<void(base::PlatformFileError result)> ResultCallback; |
| 24 | 25 |
| 25 virtual ~CopyOrMoveFileValidator() {} | 26 virtual ~CopyOrMoveFileValidator() {} |
| 26 | 27 |
| 27 virtual void StartValidation(const ResultCallback& result_callback) = 0; | 28 virtual void StartValidation(const ResultCallback& result_callback) = 0; |
| 28 }; | 29 }; |
| 29 | 30 |
| 30 class CopyOrMoveFileValidatorFactory { | 31 class CopyOrMoveFileValidatorFactory { |
| 31 public: | 32 public: |
| 32 virtual ~CopyOrMoveFileValidatorFactory() {} | 33 virtual ~CopyOrMoveFileValidatorFactory() {} |
| 33 | 34 |
| 34 // This method must always return a non-NULL validator. |src_url| is needed | 35 // This method must always return a non-NULL validator. |src_url| is needed |
| 35 // in addition to |platform_path| because in the obfuscated file system | 36 // in addition to |platform_path| because in the obfuscated file system |
| 36 // case, |platform_path| will be an obfuscated filename and extension. | 37 // case, |platform_path| will be an obfuscated filename and extension. |
| 37 virtual CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( | 38 virtual CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( |
| 38 const FileSystemURL& src_url, | 39 const FileSystemURL& src_url, |
| 39 const base::FilePath& platform_path) = 0; | 40 const base::FilePath& platform_path) = 0; |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 } // namespace fileapi | 43 } // namespace fileapi |
| 43 | 44 |
| 44 #endif // WEBKIT_FILEAPI_COPY_OR_MOVE_FILE_VALIDATOR_H_ | 45 #endif // WEBKIT_FILEAPI_COPY_OR_MOVE_FILE_VALIDATOR_H_ |
| OLD | NEW |