Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

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

Issue 10386069: Add RegisterMountPointProvider and TestMountPointProvider for testing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/platform_file.h" 14 #include "base/platform_file.h"
15 #include "webkit/fileapi/file_system_types.h" 15 #include "webkit/fileapi/file_system_types.h"
16 16
17 class GURL; 17 class GURL;
18 18
19 namespace webkit_blob { 19 namespace webkit_blob {
20 class FileReader; 20 class FileReader;
21 } 21 }
22 22
23 namespace fileapi { 23 namespace fileapi {
24 24
25 class FileSystemContext; 25 class FileSystemContext;
26 class FileSystemFileUtil; 26 class FileSystemFileUtil;
27 class FileSystemQuotaUtil;
tzik 2012/05/10 08:31:00 sort?
kinuko 2012/05/11 06:59:34 Done.
27 class FileSystemOperationInterface; 28 class FileSystemOperationInterface;
28 class RemoteFileSystemProxyInterface; 29 class RemoteFileSystemProxyInterface;
29 30
30 // An interface to provide mount-point-specific path-related utilities 31 // An interface to provide mount-point-specific path-related utilities
31 // and specialized FileSystemFileUtil instance. 32 // and specialized FileSystemFileUtil instance.
32 class FileSystemMountPointProvider { 33 class FileSystemMountPointProvider {
33 public: 34 public:
34 // Callback for ValidateFileSystemRoot. 35 // Callback for ValidateFileSystemRoot.
35 typedef base::Callback<void(base::PlatformFileError error)> 36 typedef base::Callback<void(base::PlatformFileError error)>
36 ValidateFileSystemCallback; 37 ValidateFileSystemCallback;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 93
93 // Creates a new file reader for a given filesystem URL |url| with a offset 94 // Creates a new file reader for a given filesystem URL |url| with a offset
94 // |offset|. 95 // |offset|.
95 // The returned object must be owned and managed by the caller. 96 // The returned object must be owned and managed by the caller.
96 // This method itself does *not* check if the given path exists and is a 97 // This method itself does *not* check if the given path exists and is a
97 // regular file. 98 // regular file.
98 virtual webkit_blob::FileReader* CreateFileReader( 99 virtual webkit_blob::FileReader* CreateFileReader(
99 const GURL& url, 100 const GURL& url,
100 int64 offset, 101 int64 offset,
101 FileSystemContext* context) const = 0; 102 FileSystemContext* context) const = 0;
103
104 // Returns the specialized FileSystemQuotaUtil for this mount point.
105 // This could return NULL if this mount point does not support quota.
106 virtual FileSystemQuotaUtil* GetQuotaUtil() { return NULL; }
102 }; 107 };
103 108
104 // An interface to control external file system access permissions. 109 // An interface to control external file system access permissions.
105 class ExternalFileSystemMountPointProvider 110 class ExternalFileSystemMountPointProvider
106 : public FileSystemMountPointProvider { 111 : public FileSystemMountPointProvider {
107 public: 112 public:
108 // Grant access to all external file system from extension identified with 113 // Grant access to all external file system from extension identified with
109 // |extension_id|. 114 // |extension_id|.
110 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0; 115 virtual void GrantFullAccessToExtension(const std::string& extension_id) = 0;
111 // Grants access to |virtual_path| from |origin_url|. 116 // Grants access to |virtual_path| from |origin_url|.
(...skipping 15 matching lines...) Expand all
127 virtual void RemoveMountPoint(const FilePath& mount_point) = 0; 132 virtual void RemoveMountPoint(const FilePath& mount_point) = 0;
128 // Gets virtual path by known filesystem path. Returns false when filesystem 133 // Gets virtual path by known filesystem path. Returns false when filesystem
129 // path is not exposed by this provider. 134 // path is not exposed by this provider.
130 virtual bool GetVirtualPath(const FilePath& file_system_path, 135 virtual bool GetVirtualPath(const FilePath& file_system_path,
131 FilePath* virtual_path) = 0; 136 FilePath* virtual_path) = 0;
132 }; 137 };
133 138
134 } // namespace fileapi 139 } // namespace fileapi
135 140
136 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ 141 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698