| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "webkit/fileapi/file_system_types.h" | 9 #include "webkit/fileapi/file_system_types.h" |
| 10 #include "webkit/quota/quota_types.h" | 10 #include "webkit/quota/quota_types.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // what platform you're on. | 28 // what platform you're on. |
| 29 bool CrackFileSystemURL(const GURL& url, | 29 bool CrackFileSystemURL(const GURL& url, |
| 30 GURL* origin_url, | 30 GURL* origin_url, |
| 31 FileSystemType* type, | 31 FileSystemType* type, |
| 32 FilePath* file_path); | 32 FilePath* file_path); |
| 33 | 33 |
| 34 // Returns the root URI of the filesystem that can be specified by a pair of | 34 // Returns the root URI of the filesystem that can be specified by a pair of |
| 35 // |origin_url| and |type|. The returned URI can be used as a root path | 35 // |origin_url| and |type|. The returned URI can be used as a root path |
| 36 // of the filesystem (e.g. <returned_URI> + "/relative/path" will compose | 36 // of the filesystem (e.g. <returned_URI> + "/relative/path" will compose |
| 37 // a path pointing to the entry "/relative/path" in the filesystem). | 37 // a path pointing to the entry "/relative/path" in the filesystem). |
| 38 GURL GetFileSystemRootURI(const GURL& origin_url, fileapi::FileSystemType type); | 38 GURL GetFileSystemRootURI(const GURL& origin_url, FileSystemType type); |
| 39 |
| 40 // Returns the name for the filesystem that is specified by a pair of |
| 41 // |origin_url| and |type|. |
| 42 std::string GetFileSystemName(const GURL& origin_url, FileSystemType type); |
| 39 | 43 |
| 40 // Converts FileSystemType |type| to/from the StorageType |storage_type| that | 44 // Converts FileSystemType |type| to/from the StorageType |storage_type| that |
| 41 // is used for the unified quota system. | 45 // is used for the unified quota system. |
| 42 // (Basically this naively maps TEMPORARY storage type to TEMPORARY filesystem | 46 // (Basically this naively maps TEMPORARY storage type to TEMPORARY filesystem |
| 43 // type, PERSISTENT storage type to PERSISTENT filesystem type and vice versa.) | 47 // type, PERSISTENT storage type to PERSISTENT filesystem type and vice versa.) |
| 44 FileSystemType QuotaStorageTypeToFileSystemType( | 48 FileSystemType QuotaStorageTypeToFileSystemType( |
| 45 quota::StorageType storage_type); | 49 quota::StorageType storage_type); |
| 46 quota::StorageType FileSystemTypeToQuotaStorageType(FileSystemType type); | 50 quota::StorageType FileSystemTypeToQuotaStorageType(FileSystemType type); |
| 47 | 51 |
| 48 // Returns the origin identifier string for the given |url| and vice versa. | 52 // Returns the origin identifier string for the given |url| and vice versa. |
| 49 // The origin identifier string is a serialized form of a security origin | 53 // The origin identifier string is a serialized form of a security origin |
| 50 // and can be used as a path name as it contains no "/" or other possibly | 54 // and can be used as a path name as it contains no "/" or other possibly |
| 51 // unsafe characters. (See WebKit's SecurityOrigin code for more details.) | 55 // unsafe characters. (See WebKit's SecurityOrigin code for more details.) |
| 52 // | 56 // |
| 53 // Example: | 57 // Example: |
| 54 // "http://www.example.com:80/"'s identifier should look like: | 58 // "http://www.example.com:80/"'s identifier should look like: |
| 55 // "http_www.example.host_80" | 59 // "http_www.example.host_80" |
| 56 std::string GetOriginIdentifierFromURL(const GURL& url); | 60 std::string GetOriginIdentifierFromURL(const GURL& url); |
| 57 GURL GetOriginURLFromIdentifier(const std::string& origin_identifier); | 61 GURL GetOriginURLFromIdentifier(const std::string& origin_identifier); |
| 58 | 62 |
| 59 // Returns the string representation of the given filesystem |type|. | 63 // Returns the string representation of the given filesystem |type|. |
| 60 // Returns an empty string if the |type| is invalid. | 64 // Returns an empty string if the |type| is invalid. |
| 61 std::string GetFileSystemTypeString(FileSystemType type); | 65 std::string GetFileSystemTypeString(FileSystemType type); |
| 62 | 66 |
| 63 } // namespace fileapi | 67 } // namespace fileapi |
| 64 | 68 |
| 65 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ | 69 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ |
| OLD | NEW |