WebKit Bugzilla
Attachment 356267 Details for
Bug 192263
: Add generic implementations to FileSystemPOSIX.cpp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
192263-2.diff (text/plain), 2.56 KB, created by
Christopher Reid
on 2018-11-30 17:20:04 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Christopher Reid
Created:
2018-11-30 17:20:04 PST
Size:
2.56 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index baed87771c2..1078ccf11f9 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2018-11-30 Christopher Reid <chris.reid@sony.com> >+ >+ Add generic implementations to FileSystemPOSIX.cpp >+ https://bugs.webkit.org/show_bug.cgi?id=192263 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests, no change in behavior. >+ >+ Add generic FileSystemPOSIX implementations for: >+ - stringFromFileSystemRepresentation >+ - fileSystemRepresentation >+ - moveFile >+ - getVolumeFreeSpace >+ >+ Also removing an unneeded PLATFORM(GTK) check since GTK is only using FileSystemGlib >+ >+ * platform/posix/FileSystemPOSIX.cpp: >+ > 2018-11-19 Fujii Hironori <Hironori.Fujii@sony.com> > > REGRESSION(r238350) [curl] CertificateInfo.h: error: template specialization requires 'template<>' >diff --git a/Source/WebCore/platform/posix/FileSystemPOSIX.cpp b/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >index 6b732069612..1e6823171d2 100644 >--- a/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >+++ b/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >@@ -37,6 +37,7 @@ > #include <libgen.h> > #include <stdio.h> > #include <sys/stat.h> >+#include <sys/statvfs.h> > #include <sys/types.h> > #include <unistd.h> > #include <wtf/EnumTraits.h> >@@ -381,7 +382,45 @@ Vector<String> listDirectory(const String& path, const String& filter) > return entries; > } > >-#if !OS(DARWIN) || PLATFORM(GTK) >+#if !PLATFORM(COCOA) >+String stringFromFileSystemRepresentation(const char* path) >+{ >+ if (!path) >+ return String(); >+ >+ return String::fromUTF8(path); >+} >+ >+CString fileSystemRepresentation(const String& path) >+{ >+ return path.utf8(); >+} >+ >+bool moveFile(const String& oldPath, const String& newPath) >+{ >+ auto oldFilename = fileSystemRepresentation(oldPath); >+ if (oldFilename.isNull()) >+ return false; >+ >+ auto newFilename = fileSystemRepresentation(newPath); >+ if (newFilename.isNull()) >+ return false; >+ >+ return rename(oldFilename.data(), newFilename.data()) != -1; >+} >+ >+bool getVolumeFreeSpace(const String& path, uint64_t& freeSpace) >+{ >+ struct statvfs fileSystemStat; >+ if (statvfs(fileSystemRepresentation(path).data(), &fileSystemStat)) { >+ freeSpace = fileSystemStat.f_bavail * fileSystemStat.f_frsize; >+ return true; >+ } >+ return false; >+} >+#endif >+ >+#if !OS(DARWIN) > String openTemporaryFile(const String& prefix, PlatformFileHandle& handle) > { > char buffer[PATH_MAX];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192263
:
356260
| 356267