Chromium Code Reviews| Index: webkit/fileapi/mount_points.h |
| diff --git a/webkit/fileapi/mount_points.h b/webkit/fileapi/mount_points.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..223d02d540e95c918fa0d3db601492a2ba827409 |
| --- /dev/null |
| +++ b/webkit/fileapi/mount_points.h |
| @@ -0,0 +1,71 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef WEBKIT_FILEAPI_MOUNT_POINTS_H_ |
| +#define WEBKIT_FILEAPI_MOUNT_POINTS_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/file_path.h" |
| +#include "webkit/fileapi/file_system_util.h" |
| +#include "webkit/storage/webkit_storage_export.h" |
| + |
| +class GURL; |
| + |
| +namespace fileapi { |
| + |
| +// Represents a set of mount points for File API. |
| +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
|
| + public: |
| + struct WEBKIT_STORAGE_EXPORT MountPointInfo { |
| + MountPointInfo(); |
| + MountPointInfo(const std::string& name, const FilePath& path); |
| + |
| + // The name to be used to register the path. The registered file can |
| + // be referred by a virtual path /<filesystem_id>/<name>. |
| + // The name should NOT contain a path separator '/'. |
| + std::string name; |
| + |
| + // The path of the file. |
| + FilePath path; |
| + |
| + // For STL operation. |
| + bool operator<(const MountPointInfo& that) const { |
| + return name < that.name; |
| + } |
| + }; |
| + |
| + MountPoints() {} |
| + virtual ~MountPoints() {} |
| + |
| + // Returns true if there is mount points implementation that manages given |
| + // filesystem type. (Currently true for isolated and external file systems) |
| + 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.
|
| + FileSystemType type); |
| + |
| + // Returns true if the MountPoints implementation can crack FileSystemURL |
| + // with given mount type. |
| + virtual bool CanCrackMountType(FileSystemType type) const = 0; |
| + |
| + // Returns the mount point root path registered for a given |mount_name|. |
| + // Returns false if the given |mount_name| is not valid. |
| + virtual bool GetRegisteredPath(const std::string& mount_name, |
| + FilePath* path) const = 0; |
| + |
| + // TODO(tbarzic): Add CrackURL methods here. |
| + |
| + // Revokes a mount point identified by |mount_name|. |
| + // Returns false if the |mount_name| is not (no longer) registered. |
| + // TODO(kinuko): Probably this should be rather named RevokeMountPoint. |
| + virtual bool RevokeFileSystem(const std::string& mount_name) = 0; |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(MountPoints); |
| +}; |
| + |
| +} // namespace fileapi |
| + |
| +#endif // WEBKIT_FILEAPI_MOUNT_POINTS_H_ |