Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Side by Side Diff: webkit/browser/fileapi/file_system_backend.h

Issue 452043003: [ew] Add basic classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_FILE_SYSTEM_BACKEND_H_ 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 15 matching lines...) Expand all
26 namespace fileapi { 26 namespace fileapi {
27 27
28 class AsyncFileUtil; 28 class AsyncFileUtil;
29 class CopyOrMoveFileValidatorFactory; 29 class CopyOrMoveFileValidatorFactory;
30 class FileSystemURL; 30 class FileSystemURL;
31 class FileStreamWriter; 31 class FileStreamWriter;
32 class FileSystemContext; 32 class FileSystemContext;
33 class FileSystemFileUtil; 33 class FileSystemFileUtil;
34 class FileSystemOperation; 34 class FileSystemOperation;
35 class FileSystemQuotaUtil; 35 class FileSystemQuotaUtil;
36 class WatcherManager;
36 37
37 // An interface for defining a file system backend. 38 // An interface for defining a file system backend.
38 // 39 //
39 // NOTE: when you implement a new FileSystemBackend for your own 40 // NOTE: when you implement a new FileSystemBackend for your own
40 // FileSystem module, please contact to kinuko@chromium.org. 41 // FileSystem module, please contact to kinuko@chromium.org.
41 // 42 //
42 class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemBackend { 43 class WEBKIT_STORAGE_BROWSER_EXPORT FileSystemBackend {
43 public: 44 public:
44 // Callback for InitializeFileSystem. 45 // Callback for InitializeFileSystem.
45 typedef base::Callback<void(const GURL& root_url, 46 typedef base::Callback<void(const GURL& root_url,
(...skipping 17 matching lines...) Expand all
63 // If |mode| is CREATE_IF_NONEXISTENT calling this may also create the root 64 // If |mode| is CREATE_IF_NONEXISTENT calling this may also create the root
64 // directory (and/or related database entries etc) for the filesystem if it 65 // directory (and/or related database entries etc) for the filesystem if it
65 // doesn't exist. 66 // doesn't exist.
66 virtual void ResolveURL(const FileSystemURL& url, 67 virtual void ResolveURL(const FileSystemURL& url,
67 OpenFileSystemMode mode, 68 OpenFileSystemMode mode,
68 const OpenFileSystemCallback& callback) = 0; 69 const OpenFileSystemCallback& callback) = 0;
69 70
70 // Returns the specialized AsyncFileUtil for this backend. 71 // Returns the specialized AsyncFileUtil for this backend.
71 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) = 0; 72 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) = 0;
72 73
74 // Returns the specialized WatcherManager for this backend.
75 virtual WatcherManager* GetWatcherManager(FileSystemType type) = 0;
76
73 // Returns the specialized CopyOrMoveFileValidatorFactory for this backend 77 // Returns the specialized CopyOrMoveFileValidatorFactory for this backend
74 // and |type|. If |error_code| is File::FILE_OK and the result is NULL, 78 // and |type|. If |error_code| is File::FILE_OK and the result is NULL,
75 // then no validator is required. 79 // then no validator is required.
76 virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory( 80 virtual CopyOrMoveFileValidatorFactory* GetCopyOrMoveFileValidatorFactory(
77 FileSystemType type, base::File::Error* error_code) = 0; 81 FileSystemType type, base::File::Error* error_code) = 0;
78 82
79 // Returns a new instance of the specialized FileSystemOperation for this 83 // Returns a new instance of the specialized FileSystemOperation for this
80 // backend based on the given triplet of |origin_url|, |file_system_type| 84 // backend based on the given triplet of |origin_url|, |file_system_type|
81 // and |virtual_path|. On failure to create a file system operation, set 85 // and |virtual_path|. On failure to create a file system operation, set
82 // |error_code| correspondingly. 86 // |error_code| correspondingly.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const std::string& extension_id) = 0; 148 const std::string& extension_id) = 0;
145 // Gets virtual path by known filesystem path. Returns false when filesystem 149 // Gets virtual path by known filesystem path. Returns false when filesystem
146 // path is not exposed by this provider. 150 // path is not exposed by this provider.
147 virtual bool GetVirtualPath(const base::FilePath& file_system_path, 151 virtual bool GetVirtualPath(const base::FilePath& file_system_path,
148 base::FilePath* virtual_path) = 0; 152 base::FilePath* virtual_path) = 0;
149 }; 153 };
150 154
151 } // namespace fileapi 155 } // namespace fileapi
152 156
153 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ 157 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698