| 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_UTIL_H_ | 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ |
| 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ | 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 std::vector<FilePath::StringType>* components); | 59 std::vector<FilePath::StringType>* components); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // Returns the root URI of the filesystem that can be specified by a pair of | 62 // Returns the root URI of the filesystem that can be specified by a pair of |
| 63 // |origin_url| and |type|. The returned URI can be used as a root path | 63 // |origin_url| and |type|. The returned URI can be used as a root path |
| 64 // of the filesystem (e.g. <returned_URI> + "/relative/path" will compose | 64 // of the filesystem (e.g. <returned_URI> + "/relative/path" will compose |
| 65 // a path pointing to the entry "/relative/path" in the filesystem). | 65 // a path pointing to the entry "/relative/path" in the filesystem). |
| 66 // | 66 // |
| 67 // For Isolated filesystem this returns the 'common' root part, e.g. | 67 // For Isolated filesystem this returns the 'common' root part, e.g. |
| 68 // returns URL without the filesystem ID. | 68 // returns URL without the filesystem ID. |
| 69 // |
| 70 // |type| needs to be public type as the returned URI is given to the renderer. |
| 69 FILEAPI_EXPORT GURL GetFileSystemRootURI(const GURL& origin_url, | 71 FILEAPI_EXPORT GURL GetFileSystemRootURI(const GURL& origin_url, |
| 70 FileSystemType type); | 72 FileSystemType type); |
| 71 | 73 |
| 72 // Returns the name for the filesystem that is specified by a pair of | 74 // Returns the name for the filesystem that is specified by a pair of |
| 73 // |origin_url| and |type|. | 75 // |origin_url| and |type|. |
| 74 // (The name itself is neither really significant nor a formal identifier | 76 // (The name itself is neither really significant nor a formal identifier |
| 75 // but can be read as the .name field of the returned FileSystem object | 77 // but can be read as the .name field of the returned FileSystem object |
| 76 // as a user-friendly name in the javascript layer). | 78 // as a user-friendly name in the javascript layer). |
| 77 // | 79 // |
| 80 // |type| needs to be public type as the returned name is given to the renderer. |
| 81 // |
| 78 // Example: | 82 // Example: |
| 79 // The name for a TEMPORARY filesystem of "http://www.example.com:80/" | 83 // The name for a TEMPORARY filesystem of "http://www.example.com:80/" |
| 80 // should look like: "http_www.example.host_80:temporary" | 84 // should look like: "http_www.example.host_80:temporary" |
| 81 FILEAPI_EXPORT std::string GetFileSystemName(const GURL& origin_url, | 85 FILEAPI_EXPORT std::string GetFileSystemName(const GURL& origin_url, |
| 82 FileSystemType type); | 86 FileSystemType type); |
| 83 | 87 |
| 84 // Converts FileSystemType |type| to/from the StorageType |storage_type| that | 88 // Converts FileSystemType |type| to/from the StorageType |storage_type| that |
| 85 // is used for the unified quota system. | 89 // is used for the unified quota system. |
| 86 // (Basically this naively maps TEMPORARY storage type to TEMPORARY filesystem | 90 // (Basically this naively maps TEMPORARY storage type to TEMPORARY filesystem |
| 87 // type, PERSISTENT storage type to PERSISTENT filesystem type and vice versa.) | 91 // type, PERSISTENT storage type to PERSISTENT filesystem type and vice versa.) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // platform apps. This function will return false if the file system name is | 137 // platform apps. This function will return false if the file system name is |
| 134 // not of the form {origin}:Isolated_{id}, and will also check that there is an | 138 // not of the form {origin}:Isolated_{id}, and will also check that there is an |
| 135 // origin and id present. It will not check that the origin or id are valid. | 139 // origin and id present. It will not check that the origin or id are valid. |
| 136 FILEAPI_EXPORT bool CrackIsolatedFileSystemName( | 140 FILEAPI_EXPORT bool CrackIsolatedFileSystemName( |
| 137 const std::string& filesystem_name, | 141 const std::string& filesystem_name, |
| 138 std::string* filesystem_id); | 142 std::string* filesystem_id); |
| 139 | 143 |
| 140 } // namespace fileapi | 144 } // namespace fileapi |
| 141 | 145 |
| 142 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ | 146 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ |
| OLD | NEW |