| 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_COMMON_FILEAPI_FILE_SYSTEM_UTIL_H_ | 5 #ifndef WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_UTIL_H_ |
| 6 #define WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_UTIL_H_ | 6 #define WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 // Returns the string representation of the given filesystem |type|. | 104 // Returns the string representation of the given filesystem |type|. |
| 105 // Returns an empty string if the |type| is invalid. | 105 // Returns an empty string if the |type| is invalid. |
| 106 WEBKIT_STORAGE_COMMON_EXPORT std::string | 106 WEBKIT_STORAGE_COMMON_EXPORT std::string |
| 107 GetFileSystemTypeString(FileSystemType type); | 107 GetFileSystemTypeString(FileSystemType type); |
| 108 | 108 |
| 109 // Sets type to FileSystemType enum that corresponds to the string name. | 109 // Sets type to FileSystemType enum that corresponds to the string name. |
| 110 // Returns false if the |type_string| is invalid. | 110 // Returns false if the |type_string| is invalid. |
| 111 WEBKIT_STORAGE_COMMON_EXPORT bool GetFileSystemPublicType( | 111 WEBKIT_STORAGE_COMMON_EXPORT bool GetFileSystemPublicType( |
| 112 std::string type_string, | 112 std::string type_string, |
| 113 WebKit::WebFileSystemType* type); | 113 blink::WebFileSystemType* type); |
| 114 | 114 |
| 115 // Encodes |file_path| to a string. | 115 // Encodes |file_path| to a string. |
| 116 // Following conditions should be held: | 116 // Following conditions should be held: |
| 117 // - StringToFilePath(FilePathToString(path)) == path | 117 // - StringToFilePath(FilePathToString(path)) == path |
| 118 // - StringToFilePath(FilePathToString(path) + "/" + "SubDirectory") == | 118 // - StringToFilePath(FilePathToString(path) + "/" + "SubDirectory") == |
| 119 // path.AppendASCII("SubDirectory"); | 119 // path.AppendASCII("SubDirectory"); |
| 120 // | 120 // |
| 121 // TODO(tzik): Replace CreateFilePath and FilePathToString in | 121 // TODO(tzik): Replace CreateFilePath and FilePathToString in |
| 122 // third_party/leveldatabase/env_chromium.cc with them. | 122 // third_party/leveldatabase/env_chromium.cc with them. |
| 123 WEBKIT_STORAGE_COMMON_EXPORT std::string FilePathToString( | 123 WEBKIT_STORAGE_COMMON_EXPORT std::string FilePathToString( |
| 124 const base::FilePath& file_path); | 124 const base::FilePath& file_path); |
| 125 | 125 |
| 126 // Decode a file path from |file_path_string|. | 126 // Decode a file path from |file_path_string|. |
| 127 WEBKIT_STORAGE_COMMON_EXPORT base::FilePath StringToFilePath( | 127 WEBKIT_STORAGE_COMMON_EXPORT base::FilePath StringToFilePath( |
| 128 const std::string& file_path_string); | 128 const std::string& file_path_string); |
| 129 | 129 |
| 130 // File error conversion | 130 // File error conversion |
| 131 WEBKIT_STORAGE_COMMON_EXPORT WebKit::WebFileError | 131 WEBKIT_STORAGE_COMMON_EXPORT blink::WebFileError |
| 132 PlatformFileErrorToWebFileError(base::PlatformFileError error_code); | 132 PlatformFileErrorToWebFileError(base::PlatformFileError error_code); |
| 133 | 133 |
| 134 // Generate a file system name for the given arguments. Should only be used by | 134 // Generate a file system name for the given arguments. Should only be used by |
| 135 // platform apps. | 135 // platform apps. |
| 136 WEBKIT_STORAGE_COMMON_EXPORT std::string GetIsolatedFileSystemName( | 136 WEBKIT_STORAGE_COMMON_EXPORT std::string GetIsolatedFileSystemName( |
| 137 const GURL& origin_url, | 137 const GURL& origin_url, |
| 138 const std::string& filesystem_id); | 138 const std::string& filesystem_id); |
| 139 | 139 |
| 140 // Find the file system id from |filesystem_name|. Should only be used by | 140 // Find the file system id from |filesystem_name|. Should only be used by |
| 141 // platform apps. This function will return false if the file system name is | 141 // platform apps. This function will return false if the file system name is |
| (...skipping 30 matching lines...) Expand all Loading... |
| 172 // TODO(nhiroki): This should be deprecated and use | 172 // TODO(nhiroki): This should be deprecated and use |
| 173 // GetExternalFileSystemRootURIString() to get separate file systems for each | 173 // GetExternalFileSystemRootURIString() to get separate file systems for each |
| 174 // mount type. http://crbug.com/284963. | 174 // mount type. http://crbug.com/284963. |
| 175 WEBKIT_STORAGE_COMMON_EXPORT FileSystemInfo | 175 WEBKIT_STORAGE_COMMON_EXPORT FileSystemInfo |
| 176 GetFileSystemInfoForChromeOS(const GURL& origin_url); | 176 GetFileSystemInfoForChromeOS(const GURL& origin_url); |
| 177 #endif | 177 #endif |
| 178 | 178 |
| 179 } // namespace fileapi | 179 } // namespace fileapi |
| 180 | 180 |
| 181 #endif // WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_UTIL_H_ | 181 #endif // WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_UTIL_H_ |
| OLD | NEW |