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_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // FileSystemBackend helpers. | 106 // FileSystemBackend helpers. |
107 void OpenFileSystem( | 107 void OpenFileSystem( |
108 const GURL& origin_url, | 108 const GURL& origin_url, |
109 FileSystemType type, | 109 FileSystemType type, |
110 OpenFileSystemMode mode, | 110 OpenFileSystemMode mode, |
111 const OpenFileSystemCallback& callback, | 111 const OpenFileSystemCallback& callback, |
112 const GURL& root_url); | 112 const GURL& root_url); |
113 scoped_ptr<FileSystemOperationContext> CreateFileSystemOperationContext( | 113 scoped_ptr<FileSystemOperationContext> CreateFileSystemOperationContext( |
114 const FileSystemURL& url, | 114 const FileSystemURL& url, |
115 FileSystemContext* context, | 115 FileSystemContext* context, |
116 base::PlatformFileError* error_code) const; | 116 base::File::Error* error_code) const; |
117 scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( | 117 scoped_ptr<webkit_blob::FileStreamReader> CreateFileStreamReader( |
118 const FileSystemURL& url, | 118 const FileSystemURL& url, |
119 int64 offset, | 119 int64 offset, |
120 const base::Time& expected_modification_time, | 120 const base::Time& expected_modification_time, |
121 FileSystemContext* context) const; | 121 FileSystemContext* context) const; |
122 scoped_ptr<FileStreamWriter> CreateFileStreamWriter( | 122 scoped_ptr<FileStreamWriter> CreateFileStreamWriter( |
123 const FileSystemURL& url, | 123 const FileSystemURL& url, |
124 int64 offset, | 124 int64 offset, |
125 FileSystemContext* context, | 125 FileSystemContext* context, |
126 FileSystemType type) const; | 126 FileSystemType type) const; |
127 | 127 |
128 // FileSystemQuotaUtil overrides. | 128 // FileSystemQuotaUtil overrides. |
129 virtual base::PlatformFileError DeleteOriginDataOnFileTaskRunner( | 129 virtual base::File::Error DeleteOriginDataOnFileTaskRunner( |
130 FileSystemContext* context, | 130 FileSystemContext* context, |
131 quota::QuotaManagerProxy* proxy, | 131 quota::QuotaManagerProxy* proxy, |
132 const GURL& origin_url, | 132 const GURL& origin_url, |
133 FileSystemType type) OVERRIDE; | 133 FileSystemType type) OVERRIDE; |
134 virtual void GetOriginsForTypeOnFileTaskRunner( | 134 virtual void GetOriginsForTypeOnFileTaskRunner( |
135 FileSystemType type, | 135 FileSystemType type, |
136 std::set<GURL>* origins) OVERRIDE; | 136 std::set<GURL>* origins) OVERRIDE; |
137 virtual void GetOriginsForHostOnFileTaskRunner( | 137 virtual void GetOriginsForHostOnFileTaskRunner( |
138 FileSystemType type, | 138 FileSystemType type, |
139 const std::string& host, | 139 const std::string& host, |
(...skipping 26 matching lines...) Expand all Loading... |
166 FileSystemType type) const OVERRIDE; | 166 FileSystemType type) const OVERRIDE; |
167 | 167 |
168 // Registers quota observer for file updates on filesystem of |type|. | 168 // Registers quota observer for file updates on filesystem of |type|. |
169 void RegisterQuotaUpdateObserver(FileSystemType type); | 169 void RegisterQuotaUpdateObserver(FileSystemType type); |
170 | 170 |
171 void InvalidateUsageCache(const GURL& origin_url, | 171 void InvalidateUsageCache(const GURL& origin_url, |
172 FileSystemType type); | 172 FileSystemType type); |
173 void StickyInvalidateUsageCache(const GURL& origin_url, | 173 void StickyInvalidateUsageCache(const GURL& origin_url, |
174 FileSystemType type); | 174 FileSystemType type); |
175 | 175 |
176 void CollectOpenFileSystemMetrics(base::PlatformFileError error_code); | 176 void CollectOpenFileSystemMetrics(base::File::Error error_code); |
177 | 177 |
178 base::SequencedTaskRunner* file_task_runner() { | 178 base::SequencedTaskRunner* file_task_runner() { |
179 return file_task_runner_.get(); | 179 return file_task_runner_.get(); |
180 } | 180 } |
181 | 181 |
182 AsyncFileUtil* file_util() { return sandbox_file_util_.get(); } | 182 AsyncFileUtil* file_util() { return sandbox_file_util_.get(); } |
183 FileSystemUsageCache* usage_cache() { return file_system_usage_cache_.get(); } | 183 FileSystemUsageCache* usage_cache() { return file_system_usage_cache_.get(); } |
184 SandboxQuotaObserver* quota_observer() { return quota_observer_.get(); } | 184 SandboxQuotaObserver* quota_observer() { return quota_observer_.get(); } |
185 | 185 |
186 quota::SpecialStoragePolicy* special_storage_policy() { | 186 quota::SpecialStoragePolicy* special_storage_policy() { |
(...skipping 23 matching lines...) Expand all Loading... |
210 // Returns a path to the usage cache file. | 210 // Returns a path to the usage cache file. |
211 base::FilePath GetUsageCachePathForOriginAndType( | 211 base::FilePath GetUsageCachePathForOriginAndType( |
212 const GURL& origin_url, | 212 const GURL& origin_url, |
213 FileSystemType type); | 213 FileSystemType type); |
214 | 214 |
215 // Returns a path to the usage cache file (static version). | 215 // Returns a path to the usage cache file (static version). |
216 static base::FilePath GetUsageCachePathForOriginAndType( | 216 static base::FilePath GetUsageCachePathForOriginAndType( |
217 ObfuscatedFileUtil* sandbox_file_util, | 217 ObfuscatedFileUtil* sandbox_file_util, |
218 const GURL& origin_url, | 218 const GURL& origin_url, |
219 FileSystemType type, | 219 FileSystemType type, |
220 base::PlatformFileError* error_out); | 220 base::File::Error* error_out); |
221 | 221 |
222 int64 RecalculateUsage(FileSystemContext* context, | 222 int64 RecalculateUsage(FileSystemContext* context, |
223 const GURL& origin, | 223 const GURL& origin, |
224 FileSystemType type); | 224 FileSystemType type); |
225 | 225 |
226 ObfuscatedFileUtil* obfuscated_file_util(); | 226 ObfuscatedFileUtil* obfuscated_file_util(); |
227 | 227 |
228 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; | 228 scoped_refptr<base::SequencedTaskRunner> file_task_runner_; |
229 | 229 |
230 scoped_ptr<AsyncFileUtil> sandbox_file_util_; | 230 scoped_ptr<AsyncFileUtil> sandbox_file_util_; |
(...skipping 20 matching lines...) Expand all Loading... |
251 base::Time next_release_time_for_open_filesystem_stat_; | 251 base::Time next_release_time_for_open_filesystem_stat_; |
252 | 252 |
253 base::WeakPtrFactory<SandboxFileSystemBackendDelegate> weak_factory_; | 253 base::WeakPtrFactory<SandboxFileSystemBackendDelegate> weak_factory_; |
254 | 254 |
255 DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackendDelegate); | 255 DISALLOW_COPY_AND_ASSIGN(SandboxFileSystemBackendDelegate); |
256 }; | 256 }; |
257 | 257 |
258 } // namespace fileapi | 258 } // namespace fileapi |
259 | 259 |
260 #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ | 260 #endif // WEBKIT_BROWSER_FILEAPI_SANDBOX_FILE_SYSTEM_BACKEND_DELEGATE_H_ |
OLD | NEW |