WebKit Bugzilla
Attachment 360351 Details for
Bug 193789
: [JSCOnly][WTF] Expose FileSystem.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193789-20190128102528.patch (text/plain), 5.57 KB, created by
Ross Kirsling
on 2019-01-28 10:25:28 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Ross Kirsling
Created:
2019-01-28 10:25:28 PST
Size:
5.57 KB
patch
obsolete
>Subversion Revision: 240476 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index dfbc786068d3962e25f0c2697a1d07dde458a25c..9df835e66af5732aa762e84bc966966341e73405 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,17 @@ >+2019-01-28 Ross Kirsling <ross.kirsling@sony.com> >+ >+ [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-24 Youenn Fablet <youenn@apple.com> > > Use MonotonicTime in WorkerRunLoop >diff --git a/Source/WTF/wtf/FileSystem.h b/Source/WTF/wtf/FileSystem.h >index 95c3baf2e628b9cad7462a069eec00b9af86c2a3..f9ed75c09b3a343ca779d9d70fca5cc8103f8e32 100644 >--- a/Source/WTF/wtf/FileSystem.h >+++ b/Source/WTF/wtf/FileSystem.h >@@ -48,7 +48,7 @@ typedef const struct __CFData* CFDataRef; > > OBJC_CLASS NSString; > >-#if PLATFORM(WIN) >+#if OS(WINDOWS) > typedef void *HANDLE; > #endif > >@@ -63,10 +63,10 @@ struct FileMetadata; > 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,24 +169,22 @@ WTF_EXPORT_PRIVATE bool filesHaveSameVolume(const String&, const String&); > 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(); > #endif > >-#if PLATFORM(COCOA) >+#if OS(DARWIN) > WTF_EXPORT_PRIVATE NSString *createTemporaryDirectory(NSString *directoryPrefix); > 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&); > >diff --git a/Source/WTF/wtf/PlatformJSCOnly.cmake b/Source/WTF/wtf/PlatformJSCOnly.cmake >index ba05090f77b44eef3f4496a78b20f81714bd426b..ebaf6ba7a3f4b876b3b43835480f78d6713907f8 100644 >--- a/Source/WTF/wtf/PlatformJSCOnly.cmake >+++ b/Source/WTF/wtf/PlatformJSCOnly.cmake >@@ -7,18 +7,29 @@ if (WIN32) > 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 > > generic/MainThreadGeneric.cpp > >+ posix/FileSystemPOSIX.cpp >+ > text/unix/TextBreakIteratorInternalICUUnix.cpp > > unix/LanguageUnix.cpp >@@ -38,6 +49,9 @@ if (WIN32) > 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( >diff --git a/Source/WTF/wtf/posix/FileSystemPOSIX.cpp b/Source/WTF/wtf/posix/FileSystemPOSIX.cpp >index fb1efd63416459ccce97966db9e5dda2b72400a4..4a05aca144684ce5ed4cbddec2324b180e8901c1 100644 >--- a/Source/WTF/wtf/posix/FileSystemPOSIX.cpp >+++ b/Source/WTF/wtf/posix/FileSystemPOSIX.cpp >@@ -163,7 +163,7 @@ bool unlockFile(PlatformFileHandle handle) > } > #endif > >-#if !PLATFORM(MAC) >+#if !OS(MAC_OS_X) > bool deleteEmptyDirectory(const String& path) > { > CString fsRep = fileSystemRepresentation(path); >@@ -382,7 +382,7 @@ Vector<String> listDirectory(const String& path, const String& filter) > return entries; > } > >-#if !PLATFORM(COCOA) >+#if !OS(DARWIN) > String stringFromFileSystemRepresentation(const char* path) > { > if (!path) >@@ -418,9 +418,7 @@ bool getVolumeFreeSpace(const String& path, uint64_t& freeSpace) > } > return false; > } >-#endif > >-#if !OS(DARWIN) > String openTemporaryFile(const String& prefix, PlatformFileHandle& handle) > { > char buffer[PATH_MAX]; >@@ -442,7 +440,7 @@ end: > handle = invalidPlatformFileHandle; > return String(); > } >-#endif >+#endif // !OS(DARWIN) > > bool hardLinkOrCopyFile(const String& source, const String& destination) > { >diff --git a/Source/WTF/wtf/win/FileSystemWin.cpp b/Source/WTF/wtf/win/FileSystemWin.cpp >index 00e3352a36d8272efe93575a9ce99c10a538fdd4..d672af6374693cf0521ec3689689cebcc02ede38 100644 >--- a/Source/WTF/wtf/win/FileSystemWin.cpp >+++ b/Source/WTF/wtf/win/FileSystemWin.cpp >@@ -279,7 +279,7 @@ String pathByAppendingComponents(StringView path, const Vector<StringView>& comp > > 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;
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 193789
:
360186
|
360351
|
360353
|
360357