Chromium Code Reviews| 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_FILEAPI_FILE_SYSTEM_URL_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_URL_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_URL_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_URL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 // See the class comment for details. | 113 // See the class comment for details. |
| 114 const std::string& filesystem_id() const { return filesystem_id_; } | 114 const std::string& filesystem_id() const { return filesystem_id_; } |
| 115 | 115 |
| 116 FileSystemType mount_type() const { return mount_type_; } | 116 FileSystemType mount_type() const { return mount_type_; } |
| 117 | 117 |
| 118 std::string DebugString() const; | 118 std::string DebugString() const; |
| 119 | 119 |
| 120 // Returns true if this URL is a strict parent of the |child|. | 120 // Returns true if this URL is a strict parent of the |child|. |
| 121 bool IsParent(const FileSystemURL& child) const; | 121 bool IsParent(const FileSystemURL& child) const; |
| 122 | 122 |
| 123 // Returns URL to be used in file system operations. In general the returned | |
| 124 // URL is the same as |this|. The exceptions are FileSystemURLs that are build | |
| 125 // on top of other FileSystemURLs (e.g. Isolated urls on ChromeOS are build on | |
| 126 // top of External urls). In this case the underlying FileSystemURL is | |
| 127 // returned. | |
| 128 // | |
| 129 // Note that the underlying url is determined recursively. | |
| 130 FileSystemURL GetForOperations() const; | |
| 131 | |
| 123 bool operator==(const FileSystemURL& that) const; | 132 bool operator==(const FileSystemURL& that) const; |
| 124 | 133 |
| 125 struct WEBKIT_STORAGE_EXPORT Comparator { | 134 struct WEBKIT_STORAGE_EXPORT Comparator { |
| 126 bool operator() (const FileSystemURL& lhs, const FileSystemURL& rhs) const; | 135 bool operator() (const FileSystemURL& lhs, const FileSystemURL& rhs) const; |
| 127 }; | 136 }; |
| 128 | 137 |
| 129 private: | 138 private: |
| 130 friend class FileSystemContext; | 139 friend class FileSystemContext; |
| 131 friend class ExternalMountPoints; | 140 friend class ExternalMountPoints; |
| 132 friend class IsolatedContext; | 141 friend class IsolatedContext; |
| 133 | 142 |
| 134 explicit FileSystemURL(const GURL& filesystem_url); | 143 explicit FileSystemURL(const GURL& filesystem_url); |
| 135 FileSystemURL(const GURL& origin, | 144 FileSystemURL(const GURL& origin, |
| 136 FileSystemType mount_type, | 145 FileSystemType mount_type, |
| 137 const base::FilePath& virtual_path); | 146 const base::FilePath& virtual_path); |
| 138 // Creates a cracked FileSystemURL. | 147 // Creates a cracked FileSystemURL. |
| 139 FileSystemURL(const GURL& origin, | 148 FileSystemURL(const GURL& origin, |
| 140 FileSystemType mount_type, | 149 FileSystemType mount_type, |
| 141 const base::FilePath& virtual_path, | 150 const base::FilePath& virtual_path, |
| 142 const std::string& filesystem_id, | 151 const std::string& filesystem_id, |
| 143 FileSystemType cracked_type, | 152 FileSystemType cracked_type, |
| 144 const base::FilePath& cracked_path); | 153 const base::FilePath& cracked_path); |
| 145 | 154 |
| 155 // Sets parameters for the underlying file system URL (the one that will be | |
| 156 // returned by |GetForOperations|) that differ from |this|. | |
| 157 void SetUnderlyingURL(const FileSystemURL& underlying_url); | |
| 158 | |
| 146 bool is_valid_; | 159 bool is_valid_; |
| 147 | 160 |
| 148 GURL origin_; | 161 GURL origin_; |
| 149 FileSystemType type_; | 162 FileSystemType type_; |
| 150 FileSystemType mount_type_; | 163 FileSystemType mount_type_; |
| 151 base::FilePath path_; | 164 base::FilePath path_; |
| 152 | 165 |
| 153 // Values specific to cracked URLs. | 166 // Values specific to cracked URLs. |
| 154 std::string filesystem_id_; | 167 std::string filesystem_id_; |
| 155 base::FilePath virtual_path_; | 168 base::FilePath virtual_path_; |
| 156 | 169 |
| 170 // Parameters for the underlying file system URL that are different from this | |
| 171 // URL. | |
| 172 bool has_underlying_url_; | |
| 173 std::string underlying_filesystem_id_; | |
| 174 FileSystemType underlying_type_; | |
| 175 base::FilePath underlying_virtual_path_; | |
|
kinuko
2013/03/15 06:54:39
Hmm, do we need all these additional params? If so
tonibarzic
2013/03/15 07:36:57
we could do without underlaying virtual path, and
kinuko
2013/03/17 21:39:09
So are these changes basically for not changing th
| |
| 157 }; | 176 }; |
| 158 | 177 |
| 159 typedef std::set<FileSystemURL, FileSystemURL::Comparator> FileSystemURLSet; | 178 typedef std::set<FileSystemURL, FileSystemURL::Comparator> FileSystemURLSet; |
| 160 | 179 |
| 161 } // namespace fileapi | 180 } // namespace fileapi |
| 162 | 181 |
| 163 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_URL_H_ | 182 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_URL_H_ |
| OLD | NEW |