| 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 #include "webkit/fileapi/file_system_util.h" | 5 #include "webkit/fileapi/file_system_util.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } | 216 } |
| 217 | 217 |
| 218 std::string GetFileSystemTypeString(FileSystemType type) { | 218 std::string GetFileSystemTypeString(FileSystemType type) { |
| 219 switch (type) { | 219 switch (type) { |
| 220 case kFileSystemTypeTemporary: | 220 case kFileSystemTypeTemporary: |
| 221 return fileapi::kTemporaryName; | 221 return fileapi::kTemporaryName; |
| 222 case kFileSystemTypePersistent: | 222 case kFileSystemTypePersistent: |
| 223 return fileapi::kPersistentName; | 223 return fileapi::kPersistentName; |
| 224 case kFileSystemTypeExternal: | 224 case kFileSystemTypeExternal: |
| 225 return fileapi::kExternalName; | 225 return fileapi::kExternalName; |
| 226 case kFileSystemTypeIsolated: |
| 227 return fileapi::kIsolatedName; |
| 226 case kFileSystemTypeTest: | 228 case kFileSystemTypeTest: |
| 227 return fileapi::kTestName; | 229 return fileapi::kTestName; |
| 228 case kFileSystemTypeUnknown: | 230 case kFileSystemTypeUnknown: |
| 229 default: | 231 default: |
| 230 return std::string(); | 232 return std::string(); |
| 231 } | 233 } |
| 232 } | 234 } |
| 233 | 235 |
| 234 std::string FilePathToString(const FilePath& file_path) { | 236 std::string FilePathToString(const FilePath& file_path) { |
| 235 #if defined(OS_WIN) | 237 #if defined(OS_WIN) |
| 236 return UTF16ToUTF8(file_path.value()); | 238 return UTF16ToUTF8(file_path.value()); |
| 237 #elif defined(OS_POSIX) | 239 #elif defined(OS_POSIX) |
| 238 return file_path.value(); | 240 return file_path.value(); |
| 239 #endif | 241 #endif |
| 240 } | 242 } |
| 241 | 243 |
| 242 FilePath StringToFilePath(const std::string& file_path_string) { | 244 FilePath StringToFilePath(const std::string& file_path_string) { |
| 243 #if defined(OS_WIN) | 245 #if defined(OS_WIN) |
| 244 return FilePath(UTF8ToUTF16(file_path_string)); | 246 return FilePath(UTF8ToUTF16(file_path_string)); |
| 245 #elif defined(OS_POSIX) | 247 #elif defined(OS_POSIX) |
| 246 return FilePath(file_path_string); | 248 return FilePath(file_path_string); |
| 247 #endif | 249 #endif |
| 248 } | 250 } |
| 249 | 251 |
| 250 } // namespace fileapi | 252 } // namespace fileapi |
| OLD | NEW |