Changeset 184567 in webkit
- Timestamp:
- May 19, 2015 9:37:11 AM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r184555 r184567 1 2015-05-19 Ting-Wei Lan <lantw44@gmail.com> 2 3 [SOUP] Use st_birthtime to get creation time of files on systems support it 4 https://bugs.webkit.org/show_bug.cgi?id=144989 5 6 Reviewed by Carlos Garcia Campos. 7 8 Define HAVE(STAT_BIRTHTIME) as 1 on operating systems supporting 9 getting creation time of files using st_birthtime in stat. 10 11 * wtf/Platform.h: 12 1 13 2015-05-19 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WTF/wtf/Platform.h
r183936 r184567 606 606 #endif 607 607 608 #if OS(DARWIN) || OS(FREEBSD) || OS(NETBSD) 609 #define HAVE_STAT_BIRTHTIME 1 610 #endif 611 608 612 #if !OS(WINDOWS) && !OS(SOLARIS) 609 613 #define HAVE_TM_GMTOFF 1 -
trunk/Source/WebKit2/ChangeLog
r184555 r184567 1 2015-05-19 Ting-Wei Lan <lantw44@gmail.com> 2 3 [SOUP] Use st_birthtime to get creation time of files on systems support it 4 https://bugs.webkit.org/show_bug.cgi?id=144989 5 6 Reviewed by Carlos Garcia Campos. 7 8 FreeBSD and NetBSD have either st_birthtime field or compatiblity macro 9 with the same name in stat. It is better to use it instead of manually 10 setting xattr, which is unreliable because both operating systems and 11 file systems support are required. 12 13 * NetworkProcess/cache/NetworkCacheFileSystemPosix.h: 14 (WebKit::NetworkCache::fileTimes): 15 * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: 16 (WebKit::NetworkCache::IOChannel::IOChannel): 17 1 18 2015-05-19 Chris Dumez <cdumez@apple.com> 2 19 -
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h
r184330 r184567 78 78 inline FileTimes fileTimes(const String& path) 79 79 { 80 #if PLATFORM(COCOA)80 #if HAVE(STAT_BIRTHTIME) 81 81 struct stat fileInfo; 82 82 if (stat(WebCore::fileSystemRepresentation(path).data(), &fileInfo)) 83 83 return { }; 84 84 return { std::chrono::system_clock::from_time_t(fileInfo.st_birthtime), std::chrono::system_clock::from_time_t(fileInfo.st_mtime) }; 85 #endif 86 #if USE(SOUP) 85 #elif USE(SOUP) 87 86 // There's no st_birthtime in some operating systems like Linux, so we use xattrs to set/get the creation time. 88 87 GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(WebCore::fileSystemRepresentation(path).data())); -
trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp
r183801 r184567 50 50 m_outputStream = adoptGRef(G_OUTPUT_STREAM(g_file_create(file.get(), static_cast<GFileCreateFlags>(G_FILE_CREATE_PRIVATE), nullptr, nullptr))); 51 51 ASSERT(m_outputStream); 52 #if !HAVE(STAT_BIRTHTIME) 52 53 GUniquePtr<char> birthtimeString(g_strdup_printf("%" G_GUINT64_FORMAT, std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()))); 53 54 g_file_set_attribute_string(file.get(), "xattr::birthtime", birthtimeString.get(), G_FILE_QUERY_INFO_NONE, nullptr, nullptr); 55 #endif 54 56 break; 55 57 }
Note: See TracChangeset
for help on using the changeset viewer.