OLD | NEW |
---|---|
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 29 matching lines...) Expand all Loading... | |
40 // NOTE: when you implement a new FileSystemBackend for your own | 40 // NOTE: when you implement a new FileSystemBackend for your own |
41 // FileSystem module, please contact to kinuko@chromium.org. | 41 // FileSystem module, please contact to kinuko@chromium.org. |
42 // | 42 // |
43 class STORAGE_EXPORT FileSystemBackend { | 43 class STORAGE_EXPORT FileSystemBackend { |
44 public: | 44 public: |
45 // Callback for InitializeFileSystem. | 45 // Callback for InitializeFileSystem. |
46 typedef base::Callback<void(const GURL& root_url, | 46 typedef base::Callback<void(const GURL& root_url, |
47 const std::string& name, | 47 const std::string& name, |
48 base::File::Error error)> | 48 base::File::Error error)> |
49 OpenFileSystemCallback; | 49 OpenFileSystemCallback; |
50 typedef base::Callback<void(const GURL& url)> URLCallback; | |
mtomasz
2014/09/04 05:30:01
nit: Comment is missing, but there is one for the
hirono
2014/09/04 06:10:59
Done.
| |
50 virtual ~FileSystemBackend() {} | 51 virtual ~FileSystemBackend() {} |
51 | 52 |
52 // Returns true if this filesystem backend can handle |type|. | 53 // Returns true if this filesystem backend can handle |type|. |
53 // One filesystem backend may be able to handle multiple filesystem types. | 54 // One filesystem backend may be able to handle multiple filesystem types. |
54 virtual bool CanHandleType(FileSystemType type) const = 0; | 55 virtual bool CanHandleType(FileSystemType type) const = 0; |
55 | 56 |
56 // This method is called right after the backend is registered in the | 57 // This method is called right after the backend is registered in the |
57 // FileSystemContext and before any other methods are called. Each backend can | 58 // FileSystemContext and before any other methods are called. Each backend can |
58 // do additional initialization which depends on FileSystemContext here. | 59 // do additional initialization which depends on FileSystemContext here. |
59 virtual void Initialize(FileSystemContext* context) = 0; | 60 virtual void Initialize(FileSystemContext* context) = 0; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 virtual void GrantFileAccessToExtension( | 151 virtual void GrantFileAccessToExtension( |
151 const std::string& extension_id, | 152 const std::string& extension_id, |
152 const base::FilePath& virtual_path) = 0; | 153 const base::FilePath& virtual_path) = 0; |
153 // Revokes file access from extension identified with |extension_id|. | 154 // Revokes file access from extension identified with |extension_id|. |
154 virtual void RevokeAccessForExtension( | 155 virtual void RevokeAccessForExtension( |
155 const std::string& extension_id) = 0; | 156 const std::string& extension_id) = 0; |
156 // Gets virtual path by known filesystem path. Returns false when filesystem | 157 // Gets virtual path by known filesystem path. Returns false when filesystem |
157 // path is not exposed by this provider. | 158 // path is not exposed by this provider. |
158 virtual bool GetVirtualPath(const base::FilePath& file_system_path, | 159 virtual bool GetVirtualPath(const base::FilePath& file_system_path, |
159 base::FilePath* virtual_path) = 0; | 160 base::FilePath* virtual_path) = 0; |
161 // Gets an redirect URL for browser tab. e.g. Google Drive URL for hosted | |
mtomasz
2014/09/04 05:30:01
nit: an -> a
hirono
2014/09/04 06:10:59
Done.
| |
162 // documents. Returns empty URL if the entry does not have the redirect URL. | |
163 virtual void GetURLForBrowserTab( | |
mtomasz
2014/09/04 05:30:01
Naming of this method is still confusing to me. Lo
hirono
2014/09/04 06:10:59
Done.
| |
164 const storage::FileSystemURL& url, | |
165 const URLCallback& callback) = 0; | |
mtomasz
2014/09/04 05:30:01
I just realized one thing. Is this safe? What if a
hirono
2014/09/04 06:10:59
I added a comment to ExternalFileSystemBackendDele
| |
160 }; | 166 }; |
161 | 167 |
162 } // namespace storage | 168 } // namespace storage |
163 | 169 |
164 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ | 170 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_BACKEND_H_ |
OLD | NEW |