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/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
11 | 11 |
12 namespace fileapi { | 12 namespace fileapi { |
13 | 13 |
14 class CopyOrMoveFileValidator { | 14 class CopyOrMoveFileValidator { |
15 public: | 15 public: |
16 // Callback that is invoked when validation completes. A result of | 16 // Callback that is invoked when validation completes. A result of |
17 // base::PLATFORM_FILE_OK means the file validated. | 17 // base::PLATFORM_FILE_OK means the file validated. |
18 typedef base::Callback<void(base::PlatformFileError result)> ResultCallback; | 18 typedef base::Callback<void(base::PlatformFileError result)> ResultCallback; |
19 | 19 |
20 virtual ~CopyOrMoveFileValidator() {} | 20 virtual ~CopyOrMoveFileValidator() {} |
21 | 21 |
22 virtual void StartValidation(const ResultCallback& result_callback) = 0; | 22 virtual void StartValidation(const ResultCallback& result_callback) = 0; |
23 }; | 23 }; |
24 | 24 |
25 class CopyOrMoveFileValidatorFactory { | 25 class CopyOrMoveFileValidatorFactory { |
26 public: | 26 public: |
27 virtual ~CopyOrMoveFileValidatorFactory() {} | 27 virtual ~CopyOrMoveFileValidatorFactory() {} |
28 | 28 |
29 // This method must always return a non-NULL validator. | 29 // This method must always return a non-NULL validator. |virtual_path| is |
30 // the logical file name and |platform_path| is the real filename as stored | |
31 // on disk. Generally the two will match, except in the case of an obfuscated | |
32 // file system. | |
30 virtual CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( | 33 virtual CopyOrMoveFileValidator* CreateCopyOrMoveFileValidator( |
34 const base::FilePath& virtual_path, | |
kinuko
2013/04/18 03:32:00
Does it make sense if we just pass the source File
| |
31 const base::FilePath& platform_path) = 0; | 35 const base::FilePath& platform_path) = 0; |
32 }; | 36 }; |
33 | 37 |
34 } // namespace fileapi | 38 } // namespace fileapi |
35 | 39 |
36 #endif // WEBKIT_FILEAPI_COPY_OR_MOVE_FILE_VALIDATOR_H_ | 40 #endif // WEBKIT_FILEAPI_COPY_OR_MOVE_FILE_VALIDATOR_H_ |
OLD | NEW |