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

Side by Side Diff: webkit/fileapi/file_system_mount_point_provider.h

Issue 12193007: Deprecate MountPointProvider::IsAccessAllowed in favor of GetPermissionPolicy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 years, 10 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_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 const ValidateFileSystemCallback& callback) = 0; 53 const ValidateFileSystemCallback& callback) = 0;
54 54
55 // Retrieves the root path of the filesystem specified by the given 55 // Retrieves the root path of the filesystem specified by the given
56 // file system url on the file thread. 56 // file system url on the file thread.
57 // If |create| is true this may also create the root directory for 57 // If |create| is true this may also create the root directory for
58 // the filesystem if it doesn't exist. 58 // the filesystem if it doesn't exist.
59 virtual base::FilePath GetFileSystemRootPathOnFileThread( 59 virtual base::FilePath GetFileSystemRootPathOnFileThread(
60 const FileSystemURL& url, 60 const FileSystemURL& url,
61 bool create) = 0; 61 bool create) = 0;
62 62
63 // Checks if access to |virtual_path| is allowed from |origin_url|.
64 virtual bool IsAccessAllowed(const FileSystemURL& url) = 0;
65
66 // Checks if a given |name| contains any restricted names/chars in it.
67 // Callable on any thread.
68 virtual bool IsRestrictedFileName(const base::FilePath& filename) const = 0;
69
70 // Returns the specialized FileSystemFileUtil for this mount point. 63 // Returns the specialized FileSystemFileUtil for this mount point.
71 // It is ok to return NULL if the filesystem doesn't support synchronous 64 // It is ok to return NULL if the filesystem doesn't support synchronous
72 // version of FileUtil. 65 // version of FileUtil.
73 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) = 0; 66 virtual FileSystemFileUtil* GetFileUtil(FileSystemType type) = 0;
74 67
75 // Returns the specialized AsyncFileUtil for this mount point. 68 // Returns the specialized AsyncFileUtil for this mount point.
76 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) = 0; 69 virtual AsyncFileUtil* GetAsyncFileUtil(FileSystemType type) = 0;
77 70
78 // Returns file permission policy we should apply for the given |url|. 71 // Returns file permission policy we should apply for the given |url|.
79 virtual FilePermissionPolicy GetPermissionPolicy( 72 virtual FilePermissionPolicy GetPermissionPolicy(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 const GURL& origin_url, 118 const GURL& origin_url,
126 FileSystemType type, 119 FileSystemType type,
127 FileSystemContext* context, 120 FileSystemContext* context,
128 const DeleteFileSystemCallback& callback) = 0; 121 const DeleteFileSystemCallback& callback) = 0;
129 }; 122 };
130 123
131 // An interface to control external file system access permissions. 124 // An interface to control external file system access permissions.
132 class ExternalFileSystemMountPointProvider 125 class ExternalFileSystemMountPointProvider
133 : public FileSystemMountPointProvider { 126 : public FileSystemMountPointProvider {
134 public: 127 public:
128 // Returns true if |url| is allowed to be accessed.
129 virtual bool IsAccessAllowed(const fileapi::FileSystemURL& url) const = 0;
ericu 2013/02/13 01:45:56 Given the other methods, please add a comment expl
kinuko 2013/02/13 03:36:30 Done.
135 // Returns the list of top level directories that are exposed by this 130 // Returns the list of top level directories that are exposed by this
136 // provider. This list is used to set appropriate child process file access 131 // provider. This list is used to set appropriate child process file access
137 // permissions. 132 // permissions.
138 virtual std::vector<base::FilePath> GetRootDirectories() const = 0; 133 virtual std::vector<base::FilePath> GetRootDirectories() const = 0;
139 // Grants access to all external file system from extension identified with 134 // Grants access to all external file system from extension identified with
140 // |extension_id|. 135 // |extension_id|.
141 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0; 136 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0;
142 // Grants access to |virtual_path| from |origin_url|. 137 // Grants access to |virtual_path| from |origin_url|.
143 virtual void GrantFileAccessToExtension( 138 virtual void GrantFileAccessToExtension(
144 const std::string& extension_id, 139 const std::string& extension_id,
145 const base::FilePath& virtual_path) = 0; 140 const base::FilePath& virtual_path) = 0;
146 // Revokes file access from extension identified with |extension_id|. 141 // Revokes file access from extension identified with |extension_id|.
147 virtual void RevokeAccessForExtension( 142 virtual void RevokeAccessForExtension(
148 const std::string& extension_id) = 0; 143 const std::string& extension_id) = 0;
149 // Gets virtual path by known filesystem path. Returns false when filesystem 144 // Gets virtual path by known filesystem path. Returns false when filesystem
150 // path is not exposed by this provider. 145 // path is not exposed by this provider.
151 virtual bool GetVirtualPath(const base::FilePath& file_system_path, 146 virtual bool GetVirtualPath(const base::FilePath& file_system_path,
152 base::FilePath* virtual_path) = 0; 147 base::FilePath* virtual_path) = 0;
153 }; 148 };
154 149
155 } // namespace fileapi 150 } // namespace fileapi
156 151
157 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ 152 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698