OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "webkit/browser/fileapi/async_file_util.h" | 9 #include "webkit/browser/fileapi/async_file_util.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 explicit AsyncFileUtilAdapter(FileSystemFileUtil* sync_file_util); | 30 explicit AsyncFileUtilAdapter(FileSystemFileUtil* sync_file_util); |
31 | 31 |
32 virtual ~AsyncFileUtilAdapter(); | 32 virtual ~AsyncFileUtilAdapter(); |
33 | 33 |
34 FileSystemFileUtil* sync_file_util() { | 34 FileSystemFileUtil* sync_file_util() { |
35 return sync_file_util_.get(); | 35 return sync_file_util_.get(); |
36 } | 36 } |
37 | 37 |
38 // AsyncFileUtil overrides. | 38 // AsyncFileUtil overrides. |
39 virtual bool CreateOrOpen( | 39 virtual bool CreateOrOpen( |
40 FileSystemOperationContext* context, | 40 scoped_ptr<FileSystemOperationContext> context, |
41 const FileSystemURL& url, | 41 const FileSystemURL& url, |
42 int file_flags, | 42 int file_flags, |
43 const CreateOrOpenCallback& callback) OVERRIDE; | 43 const CreateOrOpenCallback& callback) OVERRIDE; |
44 virtual bool EnsureFileExists( | 44 virtual bool EnsureFileExists( |
45 FileSystemOperationContext* context, | 45 scoped_ptr<FileSystemOperationContext> context, |
46 const FileSystemURL& url, | 46 const FileSystemURL& url, |
47 const EnsureFileExistsCallback& callback) OVERRIDE; | 47 const EnsureFileExistsCallback& callback) OVERRIDE; |
48 virtual bool CreateDirectory( | 48 virtual bool CreateDirectory( |
49 FileSystemOperationContext* context, | 49 scoped_ptr<FileSystemOperationContext> context, |
50 const FileSystemURL& url, | 50 const FileSystemURL& url, |
51 bool exclusive, | 51 bool exclusive, |
52 bool recursive, | 52 bool recursive, |
53 const StatusCallback& callback) OVERRIDE; | 53 const StatusCallback& callback) OVERRIDE; |
54 virtual bool GetFileInfo( | 54 virtual bool GetFileInfo( |
55 FileSystemOperationContext* context, | 55 scoped_ptr<FileSystemOperationContext> context, |
56 const FileSystemURL& url, | 56 const FileSystemURL& url, |
57 const GetFileInfoCallback& callback) OVERRIDE; | 57 const GetFileInfoCallback& callback) OVERRIDE; |
58 virtual bool ReadDirectory( | 58 virtual bool ReadDirectory( |
59 FileSystemOperationContext* context, | 59 scoped_ptr<FileSystemOperationContext> context, |
60 const FileSystemURL& url, | 60 const FileSystemURL& url, |
61 const ReadDirectoryCallback& callback) OVERRIDE; | 61 const ReadDirectoryCallback& callback) OVERRIDE; |
62 virtual bool Touch( | 62 virtual bool Touch( |
63 FileSystemOperationContext* context, | 63 scoped_ptr<FileSystemOperationContext> context, |
64 const FileSystemURL& url, | 64 const FileSystemURL& url, |
65 const base::Time& last_access_time, | 65 const base::Time& last_access_time, |
66 const base::Time& last_modified_time, | 66 const base::Time& last_modified_time, |
67 const StatusCallback& callback) OVERRIDE; | 67 const StatusCallback& callback) OVERRIDE; |
68 virtual bool Truncate( | 68 virtual bool Truncate( |
69 FileSystemOperationContext* context, | 69 scoped_ptr<FileSystemOperationContext> context, |
70 const FileSystemURL& url, | 70 const FileSystemURL& url, |
71 int64 length, | 71 int64 length, |
72 const StatusCallback& callback) OVERRIDE; | 72 const StatusCallback& callback) OVERRIDE; |
73 virtual bool CopyFileLocal( | 73 virtual bool CopyFileLocal( |
74 FileSystemOperationContext* context, | 74 scoped_ptr<FileSystemOperationContext> context, |
75 const FileSystemURL& src_url, | 75 const FileSystemURL& src_url, |
76 const FileSystemURL& dest_url, | 76 const FileSystemURL& dest_url, |
77 const StatusCallback& callback) OVERRIDE; | 77 const StatusCallback& callback) OVERRIDE; |
78 virtual bool MoveFileLocal( | 78 virtual bool MoveFileLocal( |
79 FileSystemOperationContext* context, | 79 scoped_ptr<FileSystemOperationContext> context, |
80 const FileSystemURL& src_url, | 80 const FileSystemURL& src_url, |
81 const FileSystemURL& dest_url, | 81 const FileSystemURL& dest_url, |
82 const StatusCallback& callback) OVERRIDE; | 82 const StatusCallback& callback) OVERRIDE; |
83 virtual bool CopyInForeignFile( | 83 virtual bool CopyInForeignFile( |
84 FileSystemOperationContext* context, | 84 scoped_ptr<FileSystemOperationContext> context, |
85 const base::FilePath& src_file_path, | 85 const base::FilePath& src_file_path, |
86 const FileSystemURL& dest_url, | 86 const FileSystemURL& dest_url, |
87 const StatusCallback& callback) OVERRIDE; | 87 const StatusCallback& callback) OVERRIDE; |
88 virtual bool DeleteFile( | 88 virtual bool DeleteFile( |
89 FileSystemOperationContext* context, | 89 scoped_ptr<FileSystemOperationContext> context, |
90 const FileSystemURL& url, | 90 const FileSystemURL& url, |
91 const StatusCallback& callback) OVERRIDE; | 91 const StatusCallback& callback) OVERRIDE; |
92 virtual bool DeleteDirectory( | 92 virtual bool DeleteDirectory( |
93 FileSystemOperationContext* context, | 93 scoped_ptr<FileSystemOperationContext> context, |
94 const FileSystemURL& url, | 94 const FileSystemURL& url, |
95 const StatusCallback& callback) OVERRIDE; | 95 const StatusCallback& callback) OVERRIDE; |
96 virtual bool CreateSnapshotFile( | 96 virtual bool CreateSnapshotFile( |
97 FileSystemOperationContext* context, | 97 scoped_ptr<FileSystemOperationContext> context, |
98 const FileSystemURL& url, | 98 const FileSystemURL& url, |
99 const CreateSnapshotFileCallback& callback) OVERRIDE; | 99 const CreateSnapshotFileCallback& callback) OVERRIDE; |
100 | 100 |
101 private: | 101 private: |
102 scoped_ptr<FileSystemFileUtil> sync_file_util_; | 102 scoped_ptr<FileSystemFileUtil> sync_file_util_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtilAdapter); | 104 DISALLOW_COPY_AND_ASSIGN(AsyncFileUtilAdapter); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace fileapi | 107 } // namespace fileapi |
108 | 108 |
109 #endif // WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ | 109 #endif // WEBKIT_BROWSER_FILEAPI_ASYNC_FILE_UTIL_ADAPTER_H_ |
OLD | NEW |