Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef WEBKIT_FILEAPI_MOUNT_POINTS_H_ | |
| 6 #define WEBKIT_FILEAPI_MOUNT_POINTS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/file_path.h" | |
| 13 #include "webkit/fileapi/file_system_util.h" | |
| 14 #include "webkit/storage/webkit_storage_export.h" | |
| 15 | |
| 16 class GURL; | |
| 17 | |
| 18 namespace fileapi { | |
| 19 | |
| 20 // Represents a set of mount points for File API. | |
| 21 class WEBKIT_STORAGE_EXPORT MountPoints { | |
|
kinuko
2013/01/08 12:22:43
For now this common interface class is not necessa
tbarzic
2013/01/09 01:26:34
It's used both in IsolatedContext and ExternalMoun
| |
| 22 public: | |
| 23 struct WEBKIT_STORAGE_EXPORT MountPointInfo { | |
| 24 MountPointInfo(); | |
| 25 MountPointInfo(const std::string& name, const FilePath& path); | |
| 26 | |
| 27 // The name to be used to register the path. The registered file can | |
| 28 // be referred by a virtual path /<filesystem_id>/<name>. | |
| 29 // The name should NOT contain a path separator '/'. | |
| 30 std::string name; | |
| 31 | |
| 32 // The path of the file. | |
| 33 FilePath path; | |
| 34 | |
| 35 // For STL operation. | |
| 36 bool operator<(const MountPointInfo& that) const { | |
| 37 return name < that.name; | |
| 38 } | |
| 39 }; | |
| 40 | |
| 41 MountPoints() {} | |
| 42 virtual ~MountPoints() {} | |
| 43 | |
| 44 // Returns true if there is mount points implementation that manages given | |
| 45 // filesystem type. (Currently true for isolated and external file systems) | |
| 46 WEBKIT_STORAGE_EXPORT static bool HasMountPointsImplementation( | |
|
kinuko
2013/01/08 12:22:43
Can we remove this method?
tbarzic
2013/01/09 01:26:34
Done.
| |
| 47 FileSystemType type); | |
| 48 | |
| 49 // Returns true if the MountPoints implementation can crack FileSystemURL | |
| 50 // with given mount type. | |
| 51 virtual bool CanCrackMountType(FileSystemType type) const = 0; | |
| 52 | |
| 53 // Returns the mount point root path registered for a given |mount_name|. | |
| 54 // Returns false if the given |mount_name| is not valid. | |
| 55 virtual bool GetRegisteredPath(const std::string& mount_name, | |
| 56 FilePath* path) const = 0; | |
| 57 | |
| 58 // TODO(tbarzic): Add CrackURL methods here. | |
| 59 | |
| 60 // Revokes a mount point identified by |mount_name|. | |
| 61 // Returns false if the |mount_name| is not (no longer) registered. | |
| 62 // TODO(kinuko): Probably this should be rather named RevokeMountPoint. | |
| 63 virtual bool RevokeFileSystem(const std::string& mount_name) = 0; | |
| 64 | |
| 65 private: | |
| 66 DISALLOW_COPY_AND_ASSIGN(MountPoints); | |
| 67 }; | |
| 68 | |
| 69 } // namespace fileapi | |
| 70 | |
| 71 #endif // WEBKIT_FILEAPI_MOUNT_POINTS_H_ | |
| OLD | NEW |