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 |
11 #include "base/files/file.h" | 11 #include "base/files/file.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "third_party/WebKit/public/platform/WebFileError.h" | 13 #include "third_party/WebKit/public/platform/WebFileError.h" |
14 #include "third_party/WebKit/public/platform/WebFileSystemType.h" | 14 #include "third_party/WebKit/public/platform/WebFileSystemType.h" |
15 #include "webkit/common/fileapi/file_system_info.h" | 15 #include "webkit/common/fileapi/file_system_info.h" |
16 #include "webkit/common/fileapi/file_system_types.h" | 16 #include "webkit/common/fileapi/file_system_types.h" |
17 #include "webkit/common/quota/quota_types.h" | 17 #include "webkit/common/quota/quota_types.h" |
18 #include "webkit/common/webkit_storage_common_export.h" | 18 #include "webkit/common/webkit_storage_common_export.h" |
19 | 19 |
20 class GURL; | 20 class GURL; |
21 | 21 |
22 namespace fileapi { | 22 namespace storage { |
23 | 23 |
24 WEBKIT_STORAGE_COMMON_EXPORT extern const char kPersistentDir[]; | 24 WEBKIT_STORAGE_COMMON_EXPORT extern const char kPersistentDir[]; |
25 WEBKIT_STORAGE_COMMON_EXPORT extern const char kTemporaryDir[]; | 25 WEBKIT_STORAGE_COMMON_EXPORT extern const char kTemporaryDir[]; |
26 WEBKIT_STORAGE_COMMON_EXPORT extern const char kExternalDir[]; | 26 WEBKIT_STORAGE_COMMON_EXPORT extern const char kExternalDir[]; |
27 WEBKIT_STORAGE_COMMON_EXPORT extern const char kIsolatedDir[]; | 27 WEBKIT_STORAGE_COMMON_EXPORT extern const char kIsolatedDir[]; |
28 WEBKIT_STORAGE_COMMON_EXPORT extern const char kTestDir[]; | 28 WEBKIT_STORAGE_COMMON_EXPORT extern const char kTestDir[]; |
29 | 29 |
30 class WEBKIT_STORAGE_COMMON_EXPORT VirtualPath { | 30 class WEBKIT_STORAGE_COMMON_EXPORT VirtualPath { |
31 public: | 31 public: |
32 static const base::FilePath::CharType kRoot[]; | 32 static const base::FilePath::CharType kRoot[]; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 // The name for a TEMPORARY filesystem of "http://www.example.com:80/" | 99 // The name for a TEMPORARY filesystem of "http://www.example.com:80/" |
100 // should look like: "http_www.example.host_80:temporary" | 100 // should look like: "http_www.example.host_80:temporary" |
101 WEBKIT_STORAGE_COMMON_EXPORT std::string | 101 WEBKIT_STORAGE_COMMON_EXPORT std::string |
102 GetFileSystemName(const GURL& origin_url, FileSystemType type); | 102 GetFileSystemName(const GURL& origin_url, FileSystemType type); |
103 | 103 |
104 // Converts FileSystemType |type| to/from the StorageType |storage_type| that | 104 // Converts FileSystemType |type| to/from the StorageType |storage_type| that |
105 // is used for the unified quota system. | 105 // is used for the unified quota system. |
106 // (Basically this naively maps TEMPORARY storage type to TEMPORARY filesystem | 106 // (Basically this naively maps TEMPORARY storage type to TEMPORARY filesystem |
107 // type, PERSISTENT storage type to PERSISTENT filesystem type and vice versa.) | 107 // type, PERSISTENT storage type to PERSISTENT filesystem type and vice versa.) |
108 WEBKIT_STORAGE_COMMON_EXPORT FileSystemType | 108 WEBKIT_STORAGE_COMMON_EXPORT FileSystemType |
109 QuotaStorageTypeToFileSystemType(quota::StorageType storage_type); | 109 QuotaStorageTypeToFileSystemType(storage::StorageType storage_type); |
110 | 110 |
111 WEBKIT_STORAGE_COMMON_EXPORT quota::StorageType | 111 WEBKIT_STORAGE_COMMON_EXPORT storage::StorageType |
112 FileSystemTypeToQuotaStorageType(FileSystemType type); | 112 FileSystemTypeToQuotaStorageType(FileSystemType type); |
113 | 113 |
114 // Returns the string representation of the given filesystem |type|. | 114 // Returns the string representation of the given filesystem |type|. |
115 // Returns an empty string if the |type| is invalid. | 115 // Returns an empty string if the |type| is invalid. |
116 WEBKIT_STORAGE_COMMON_EXPORT std::string | 116 WEBKIT_STORAGE_COMMON_EXPORT std::string |
117 GetFileSystemTypeString(FileSystemType type); | 117 GetFileSystemTypeString(FileSystemType type); |
118 | 118 |
119 // Sets type to FileSystemType enum that corresponds to the string name. | 119 // Sets type to FileSystemType enum that corresponds to the string name. |
120 // Returns false if the |type_string| is invalid. | 120 // Returns false if the |type_string| is invalid. |
121 WEBKIT_STORAGE_COMMON_EXPORT bool GetFileSystemPublicType( | 121 WEBKIT_STORAGE_COMMON_EXPORT bool GetFileSystemPublicType( |
122 std::string type_string, | 122 std::string type_string, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // Returns the root URI for an external filesystem for origin |origin_url| | 170 // Returns the root URI for an external filesystem for origin |origin_url| |
171 // and |mount_name|. | 171 // and |mount_name|. |
172 WEBKIT_STORAGE_COMMON_EXPORT std::string GetExternalFileSystemRootURIString( | 172 WEBKIT_STORAGE_COMMON_EXPORT std::string GetExternalFileSystemRootURIString( |
173 const GURL& origin_url, | 173 const GURL& origin_url, |
174 const std::string& mount_name); | 174 const std::string& mount_name); |
175 | 175 |
176 // Translates the net::Error to base::File::Error. | 176 // Translates the net::Error to base::File::Error. |
177 WEBKIT_STORAGE_COMMON_EXPORT base::File::Error | 177 WEBKIT_STORAGE_COMMON_EXPORT base::File::Error |
178 NetErrorToFileError(int error); | 178 NetErrorToFileError(int error); |
179 | 179 |
180 } // namespace fileapi | 180 } // namespace storage |
181 | 181 |
182 #endif // WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_UTIL_H_ | 182 #endif // WEBKIT_COMMON_FILEAPI_FILE_SYSTEM_UTIL_H_ |
OLD | NEW |