| 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_COMMON_FILEAPI_FILE_SYSTEM_UTIL_H_ |
| 6 #define WEBKIT_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 |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/platform_file.h" | 12 #include "base/platform_file.h" |
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystemType.h
" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystemType.h
" |
| 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileError.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileError.h" |
| 15 #include "webkit/fileapi/file_system_types.h" | 15 #include "webkit/common/fileapi/file_system_types.h" |
| 16 #include "webkit/quota/quota_types.h" | 16 #include "webkit/quota/quota_types.h" |
| 17 #include "webkit/storage/webkit_storage_export.h" | 17 #include "webkit/storage/webkit_storage_export.h" |
| 18 | 18 |
| 19 class GURL; | 19 class GURL; |
| 20 | 20 |
| 21 namespace fileapi { | 21 namespace fileapi { |
| 22 | 22 |
| 23 extern const char kPersistentDir[]; | 23 extern const char kPersistentDir[]; |
| 24 extern const char kTemporaryDir[]; | 24 extern const char kTemporaryDir[]; |
| 25 extern const char kExternalDir[]; | 25 extern const char kExternalDir[]; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 WebKit::WebFileSystemType* type); | 104 WebKit::WebFileSystemType* type); |
| 105 | 105 |
| 106 // Encodes |file_path| to a string. | 106 // Encodes |file_path| to a string. |
| 107 // Following conditions should be held: | 107 // Following conditions should be held: |
| 108 // - StringToFilePath(FilePathToString(path)) == path | 108 // - StringToFilePath(FilePathToString(path)) == path |
| 109 // - StringToFilePath(FilePathToString(path) + "/" + "SubDirectory") == | 109 // - StringToFilePath(FilePathToString(path) + "/" + "SubDirectory") == |
| 110 // path.AppendASCII("SubDirectory"); | 110 // path.AppendASCII("SubDirectory"); |
| 111 // | 111 // |
| 112 // TODO(tzik): Replace CreateFilePath and FilePathToString in | 112 // TODO(tzik): Replace CreateFilePath and FilePathToString in |
| 113 // third_party/leveldatabase/env_chromium.cc with them. | 113 // third_party/leveldatabase/env_chromium.cc with them. |
| 114 WEBKIT_STORAGE_EXPORT std::string FilePathToString(const base::FilePath& file_pa
th); | 114 WEBKIT_STORAGE_EXPORT std::string FilePathToString( |
| 115 const base::FilePath& file_path); |
| 115 | 116 |
| 116 // Decode a file path from |file_path_string|. | 117 // Decode a file path from |file_path_string|. |
| 117 WEBKIT_STORAGE_EXPORT base::FilePath StringToFilePath( | 118 WEBKIT_STORAGE_EXPORT base::FilePath StringToFilePath( |
| 118 const std::string& file_path_string); | 119 const std::string& file_path_string); |
| 119 | 120 |
| 120 // File error conversion | 121 // File error conversion |
| 121 WEBKIT_STORAGE_EXPORT WebKit::WebFileError PlatformFileErrorToWebFileError( | 122 WEBKIT_STORAGE_EXPORT WebKit::WebFileError PlatformFileErrorToWebFileError( |
| 122 base::PlatformFileError error_code); | 123 base::PlatformFileError error_code); |
| 123 | 124 |
| 124 // Generate a file system name for the given arguments. Should only be used by | 125 // Generate a file system name for the given arguments. Should only be used by |
| (...skipping 13 matching lines...) Expand all Loading... |
| 138 // Returns the root URI for an isolated filesystem for origin |origin_url| | 139 // Returns the root URI for an isolated filesystem for origin |origin_url| |
| 139 // and |filesystem_id|. If the |optional_root_name| is given the resulting | 140 // and |filesystem_id|. If the |optional_root_name| is given the resulting |
| 140 // root URI will point to the subfolder within the isolated filesystem. | 141 // root URI will point to the subfolder within the isolated filesystem. |
| 141 WEBKIT_STORAGE_EXPORT std::string GetIsolatedFileSystemRootURIString( | 142 WEBKIT_STORAGE_EXPORT std::string GetIsolatedFileSystemRootURIString( |
| 142 const GURL& origin_url, | 143 const GURL& origin_url, |
| 143 const std::string& filesystem_id, | 144 const std::string& filesystem_id, |
| 144 const std::string& optional_root_name); | 145 const std::string& optional_root_name); |
| 145 | 146 |
| 146 } // namespace fileapi | 147 } // namespace fileapi |
| 147 | 148 |
| 148 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ | 149 #endif // WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_UTIL_H_ |
| OLD | NEW |