Diff
Modified: trunk/Source/WTF/ChangeLog (240599 => 240600)
--- trunk/Source/WTF/ChangeLog 2019-01-28 21:19:52 UTC (rev 240599)
+++ trunk/Source/WTF/ChangeLog 2019-01-28 21:35:09 UTC (rev 240600)
@@ -1,3 +1,17 @@
+2019-01-28 Ross Kirsling <[email protected]>
+
+ [JSCOnly][WTF] Expose FileSystem.
+ https://bugs.webkit.org/show_bug.cgi?id=193789
+
+ Reviewed by Don Olmstead.
+
+ * wtf/FileSystem.h:
+ * wtf/PlatformJSCOnly.cmake:
+ * wtf/posix/FileSystemPOSIX.cpp:
+ (WTF::FileSystemImpl::getVolumeFreeSpace):
+ * wtf/win/FileSystemWin.cpp:
+ (WTF::FileSystemImpl::fileSystemRepresentation):
+
2019-01-28 Eric Carlson <[email protected]>
AVStreamSession isn't always available, make a HAVE compile flag for it
Modified: trunk/Source/WTF/wtf/FileSystem.h (240599 => 240600)
--- trunk/Source/WTF/wtf/FileSystem.h 2019-01-28 21:19:52 UTC (rev 240599)
+++ trunk/Source/WTF/wtf/FileSystem.h 2019-01-28 21:35:09 UTC (rev 240600)
@@ -48,7 +48,7 @@
OBJC_CLASS NSString;
-#if PLATFORM(WIN)
+#if OS(WINDOWS)
typedef void *HANDLE;
#endif
@@ -63,10 +63,10 @@
namespace FileSystemImpl {
// PlatformFileHandle
-#if USE(GLIB) && !PLATFORM(WIN)
+#if USE(GLIB) && !OS(WINDOWS)
typedef GFileIOStream* PlatformFileHandle;
const PlatformFileHandle invalidPlatformFileHandle = 0;
-#elif PLATFORM(WIN)
+#elif OS(WINDOWS)
typedef HANDLE PlatformFileHandle;
// FIXME: -1 is INVALID_HANDLE_VALUE, defined in <winbase.h>. Chromium tries to
// avoid using Windows headers in headers. We'd rather move this into the .cpp.
@@ -169,13 +169,15 @@
WTF_EXPORT_PRIVATE RetainPtr<CFURLRef> pathAsURL(const String&);
#endif
-#if PLATFORM(GTK) || PLATFORM(WPE)
+#if USE(GLIB)
String filenameForDisplay(const String&);
#endif
-#if PLATFORM(WIN)
+#if OS(WINDOWS)
WTF_EXPORT_PRIVATE String localUserSpecificStorageDirectory();
WTF_EXPORT_PRIVATE String roamingUserSpecificStorageDirectory();
+WTF_EXPORT_PRIVATE String createTemporaryDirectory();
+WTF_EXPORT_PRIVATE bool deleteNonEmptyDirectory(const String&);
#endif
#if PLATFORM(COCOA)
@@ -183,11 +185,6 @@
WTF_EXPORT_PRIVATE bool deleteNonEmptyDirectory(const String&);
#endif
-#if PLATFORM(WIN_CAIRO)
-WTF_EXPORT_PRIVATE String createTemporaryDirectory();
-WTF_EXPORT_PRIVATE bool deleteNonEmptyDirectory(const String&);
-#endif
-
WTF_EXPORT_PRIVATE String realPath(const String&);
class MappedFileData {
Modified: trunk/Source/WTF/wtf/PlatformJSCOnly.cmake (240599 => 240600)
--- trunk/Source/WTF/wtf/PlatformJSCOnly.cmake 2019-01-28 21:19:52 UTC (rev 240599)
+++ trunk/Source/WTF/wtf/PlatformJSCOnly.cmake 2019-01-28 21:35:09 UTC (rev 240600)
@@ -7,12 +7,21 @@
text/win/TextBreakIteratorInternalICUWin.cpp
win/CPUTimeWin.cpp
+ win/DbgHelperWin.cpp
+ win/FileSystemWin.cpp
win/LanguageWin.cpp
win/MainThreadWin.cpp
+ win/PathWalker.cpp
)
list(APPEND WTF_PUBLIC_HEADERS
+ win/DbgHelperWin.h
+ win/PathWalker.h
+
text/win/WCharStringExtras.h
)
+ list(APPEND WTF_LIBRARIES
+ shlwapi
+ )
else ()
list(APPEND WTF_SOURCES
UniStdExtras.cpp
@@ -19,6 +28,8 @@
generic/MainThreadGeneric.cpp
+ posix/FileSystemPOSIX.cpp
+
text/unix/TextBreakIteratorInternalICUUnix.cpp
unix/LanguageUnix.cpp
@@ -38,6 +49,9 @@
list(APPEND WTF_SOURCES
win/MemoryFootprintWin.cpp
)
+ list(APPEND WTF_PUBLIC_HEADERS
+ win/Win32Handle.h
+ )
elseif (APPLE)
file(COPY mac/MachExceptions.defs DESTINATION ${DERIVED_SOURCES_WTF_DIR})
add_custom_command(
Modified: trunk/Source/WTF/wtf/posix/FileSystemPOSIX.cpp (240599 => 240600)
--- trunk/Source/WTF/wtf/posix/FileSystemPOSIX.cpp 2019-01-28 21:19:52 UTC (rev 240599)
+++ trunk/Source/WTF/wtf/posix/FileSystemPOSIX.cpp 2019-01-28 21:35:09 UTC (rev 240600)
@@ -382,7 +382,7 @@
return entries;
}
-#if !PLATFORM(COCOA)
+#if !USE(CF)
String stringFromFileSystemRepresentation(const char* path)
{
if (!path)
@@ -395,7 +395,9 @@
{
return path.utf8();
}
+#endif
+#if !PLATFORM(COCOA)
bool moveFile(const String& oldPath, const String& newPath)
{
auto oldFilename = fileSystemRepresentation(oldPath);
@@ -418,9 +420,7 @@
}
return false;
}
-#endif
-#if !OS(DARWIN)
String openTemporaryFile(const String& prefix, PlatformFileHandle& handle)
{
char buffer[PATH_MAX];
@@ -442,7 +442,7 @@
handle = invalidPlatformFileHandle;
return String();
}
-#endif
+#endif // !PLATFORM(COCOA)
bool hardLinkOrCopyFile(const String& source, const String& destination)
{
Modified: trunk/Source/WTF/wtf/win/FileSystemWin.cpp (240599 => 240600)
--- trunk/Source/WTF/wtf/win/FileSystemWin.cpp 2019-01-28 21:19:52 UTC (rev 240599)
+++ trunk/Source/WTF/wtf/win/FileSystemWin.cpp 2019-01-28 21:35:09 UTC (rev 240600)
@@ -279,7 +279,7 @@
CString fileSystemRepresentation(const String& path)
{
- auto upconvertedCharacters = path.upconvertedCharacters();
+ auto upconvertedCharacters = StringView(path).upconvertedCharacters();
const UChar* characters = upconvertedCharacters;
int size = WideCharToMultiByte(CP_ACP, 0, characters, path.length(), 0, 0, 0, 0) - 1;