Changeset 238782 in webkit
- Timestamp:
- Dec 1, 2018 11:34:44 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r238781 r238782 1 2018-12-01 Christopher Reid <chris.reid@sony.com> 2 3 Add generic implementations to FileSystemPOSIX.cpp 4 https://bugs.webkit.org/show_bug.cgi?id=192263 5 6 Reviewed by Yusuke Suzuki. 7 8 No new tests, no change in behavior. 9 10 Add generic FileSystemPOSIX implementations for: 11 - stringFromFileSystemRepresentation 12 - fileSystemRepresentation 13 - moveFile 14 - getVolumeFreeSpace 15 16 Also removing an unneeded PLATFORM(GTK) check since GTK is only using FileSystemGlib 17 18 * platform/posix/FileSystemPOSIX.cpp: 19 1 20 2018-12-01 Zalan Bujtas <zalan@apple.com> 2 21 -
trunk/Source/WebCore/platform/posix/FileSystemPOSIX.cpp
r233487 r238782 38 38 #include <stdio.h> 39 39 #include <sys/stat.h> 40 #include <sys/statvfs.h> 40 41 #include <sys/types.h> 41 42 #include <unistd.h> … … 382 383 } 383 384 384 #if !OS(DARWIN) || PLATFORM(GTK) 385 #if !PLATFORM(COCOA) 386 String stringFromFileSystemRepresentation(const char* path) 387 { 388 if (!path) 389 return String(); 390 391 return String::fromUTF8(path); 392 } 393 394 CString fileSystemRepresentation(const String& path) 395 { 396 return path.utf8(); 397 } 398 399 bool moveFile(const String& oldPath, const String& newPath) 400 { 401 auto oldFilename = fileSystemRepresentation(oldPath); 402 if (oldFilename.isNull()) 403 return false; 404 405 auto newFilename = fileSystemRepresentation(newPath); 406 if (newFilename.isNull()) 407 return false; 408 409 return rename(oldFilename.data(), newFilename.data()) != -1; 410 } 411 412 bool getVolumeFreeSpace(const String& path, uint64_t& freeSpace) 413 { 414 struct statvfs fileSystemStat; 415 if (statvfs(fileSystemRepresentation(path).data(), &fileSystemStat)) { 416 freeSpace = fileSystemStat.f_bavail * fileSystemStat.f_frsize; 417 return true; 418 } 419 return false; 420 } 421 #endif 422 423 #if !OS(DARWIN) 385 424 String openTemporaryFile(const String& prefix, PlatformFileHandle& handle) 386 425 {
Note: See TracChangeset
for help on using the changeset viewer.