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 |
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/WebKit/chromium/public/WebFileError.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileError.h" |
14 #include "webkit/fileapi/file_system_types.h" | 15 #include "webkit/fileapi/file_system_types.h" |
15 #include "webkit/quota/quota_types.h" | 16 #include "webkit/quota/quota_types.h" |
16 #include "webkit/storage/webkit_storage_export.h" | 17 #include "webkit/storage/webkit_storage_export.h" |
17 | 18 |
18 class GURL; | 19 class GURL; |
19 | 20 |
20 namespace fileapi { | 21 namespace fileapi { |
21 | 22 |
22 class FileSystemURL; | 23 class FileSystemURL; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const std::string& origin_identifier); | 108 const std::string& origin_identifier); |
108 | 109 |
109 // Returns the string representation of the given filesystem |type|. | 110 // Returns the string representation of the given filesystem |type|. |
110 // Returns an empty string if the |type| is invalid. | 111 // Returns an empty string if the |type| is invalid. |
111 WEBKIT_STORAGE_EXPORT std::string GetFileSystemTypeString(FileSystemType type); | 112 WEBKIT_STORAGE_EXPORT std::string GetFileSystemTypeString(FileSystemType type); |
112 | 113 |
113 // Sets type to FileSystemType enum that corresponds to the string name. | 114 // Sets type to FileSystemType enum that corresponds to the string name. |
114 // Returns false if the |type_string| is invalid. | 115 // Returns false if the |type_string| is invalid. |
115 WEBKIT_STORAGE_EXPORT bool GetFileSystemPublicType( | 116 WEBKIT_STORAGE_EXPORT bool GetFileSystemPublicType( |
116 std::string type_string, | 117 std::string type_string, |
117 WebKit::WebFileSystem::Type* type); | 118 #ifdef WEBKIT_USE_NEW_WEBFILESYSTEMTYPE |
| 119 WebKit::WebFileSystemType* type |
| 120 #else |
| 121 WebKit::WebFileSystem::Type* type |
| 122 #endif |
| 123 ); |
118 | 124 |
119 // Encodes |file_path| to a string. | 125 // Encodes |file_path| to a string. |
120 // Following conditions should be held: | 126 // Following conditions should be held: |
121 // - StringToFilePath(FilePathToString(path)) == path | 127 // - StringToFilePath(FilePathToString(path)) == path |
122 // - StringToFilePath(FilePathToString(path) + "/" + "SubDirectory") == | 128 // - StringToFilePath(FilePathToString(path) + "/" + "SubDirectory") == |
123 // path.AppendASCII("SubDirectory"); | 129 // path.AppendASCII("SubDirectory"); |
124 // | 130 // |
125 // TODO(tzik): Replace CreateFilePath and FilePathToString in | 131 // TODO(tzik): Replace CreateFilePath and FilePathToString in |
126 // third_party/leveldatabase/env_chromium.cc with them. | 132 // third_party/leveldatabase/env_chromium.cc with them. |
127 WEBKIT_STORAGE_EXPORT std::string FilePathToString(const base::FilePath& file_pa
th); | 133 WEBKIT_STORAGE_EXPORT std::string FilePathToString(const base::FilePath& file_pa
th); |
(...skipping 30 matching lines...) Expand all Loading... |
158 | 164 |
159 // Returns true if |url1| and |url2| belong to the same filesystem | 165 // Returns true if |url1| and |url2| belong to the same filesystem |
160 // (i.e. url1.origin() == url2.origin() && url1.type() == url2.type()) | 166 // (i.e. url1.origin() == url2.origin() && url1.type() == url2.type()) |
161 WEBKIT_STORAGE_EXPORT bool AreSameFileSystem( | 167 WEBKIT_STORAGE_EXPORT bool AreSameFileSystem( |
162 const FileSystemURL& url1, | 168 const FileSystemURL& url1, |
163 const FileSystemURL& url2); | 169 const FileSystemURL& url2); |
164 | 170 |
165 } // namespace fileapi | 171 } // namespace fileapi |
166 | 172 |
167 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ | 173 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_UTIL_H_ |
OLD | NEW |