WebKit Bugzilla
Attachment 356370 Details for
Bug 192287
: Use WallTime for file time
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192287-20181203191428.patch (text/plain), 54.14 KB, created by
Yusuke Suzuki
on 2018-12-03 02:14:29 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2018-12-03 02:14:29 PST
Size:
54.14 KB
patch
obsolete
>Subversion Revision: 238791 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d1ac56ff4ac01acd15196428b65162054f0bb8b9..39e118d222f231ba75657573bf3f446f1a963965 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,72 @@ >+2018-12-03 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Use WallTime for file time >+ https://bugs.webkit.org/show_bug.cgi?id=192287 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch changes a type of file time from double to WallTime to use strongly typed file time. >+ >+ No behavior change. >+ >+ * Modules/webdatabase/Database.cpp: >+ (WebCore::Database::details const): >+ * Modules/webdatabase/DatabaseDetails.h: >+ (WebCore::DatabaseDetails::DatabaseDetails): >+ (WebCore::DatabaseDetails::creationTime const): >+ (WebCore::DatabaseDetails::modificationTime const): >+ * Modules/webdatabase/DatabaseManager.cpp: >+ (WebCore::DatabaseManager::ProposedDatabase::ProposedDatabase): >+ * Modules/webdatabase/DatabaseTracker.cpp: >+ (WebCore::DatabaseTracker::detailsForNameAndOrigin): >+ * fileapi/AsyncFileStream.cpp: >+ (WebCore::AsyncFileStream::getSize): >+ * fileapi/AsyncFileStream.h: >+ * fileapi/File.cpp: >+ (WebCore::File::lastModified const): >+ * page/Page.cpp: >+ (WebCore::Page::userStyleSheetLocationChanged): >+ (WebCore::Page::userStyleSheet const): >+ * page/Page.h: >+ * platform/FileMetadata.h: >+ * platform/FileStream.cpp: >+ (WebCore::FileStream::getSize): >+ * platform/FileStream.h: >+ * platform/FileSystem.cpp: >+ (WebCore::FileSystem::getFileModificationTime): Deleted. >+ * platform/FileSystem.h: >+ (WebCore::FileSystem::invalidFileTime): Deleted. >+ (WebCore::FileSystem::isValidFileTime): Deleted. >+ * platform/glib/FileSystemGlib.cpp: >+ (WebCore::FileSystem::getFileCreationTime): >+ (WebCore::FileSystem::getFileModificationTime): >+ (WebCore::FileSystem::fileMetadataUsingFunction): >+ * platform/network/BlobDataFileReference.cpp: >+ (WebCore::BlobDataFileReference::BlobDataFileReference): >+ (WebCore::BlobDataFileReference::expectedModificationTime): >+ * platform/network/BlobDataFileReference.h: >+ * platform/network/FormData.cpp: >+ (WebCore::FormData::appendFile): >+ (WebCore::FormData::appendFileRange): >+ * platform/network/FormData.h: >+ (WebCore::FormDataElement::FormDataElement): >+ (WebCore::FormDataElement::EncodedFileData::decode): >+ * platform/network/cf/FormDataStreamCFNet.cpp: >+ (WebCore::advanceCurrentStream): >+ * platform/network/soup/ResourceRequestSoup.cpp: >+ (WebCore::appendEncodedBlobItemToSoupMessageBody): >+ * platform/posix/FileSystemPOSIX.cpp: >+ (WebCore::FileSystem::getFileCreationTime): >+ (WebCore::FileSystem::getFileModificationTime): >+ * platform/sql/SQLiteFileSystem.cpp: >+ (WebCore::SQLiteFileSystem::databaseCreationTime): >+ (WebCore::SQLiteFileSystem::databaseModificationTime): >+ * platform/sql/SQLiteFileSystem.h: >+ * platform/win/FileSystemWin.cpp: >+ (WebCore::FileSystem::getFileModificationTime): >+ (WebCore::FileSystem::getFileCreationTime): >+ (WebCore::FileSystem::findDataToFileMetadata): >+ > 2018-12-02 Zalan Bujtas <zalan@apple.com> > > Add a runtime feature flag for LayoutFormattingContext. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 6ac3e62f45e1b16b97b4059a65e36e529a7bf6a0..99d5961cd2773728fc95ed126a291c933276f90a 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,39 @@ >+2018-12-03 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Use WallTime for file time >+ https://bugs.webkit.org/show_bug.cgi?id=192287 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/SessionState.h: >+ * Shared/WebCoreArgumentCoders.cpp: >+ (IPC::ArgumentCoder<DatabaseDetails>::decode): >+ * UIProcess/API/C/WKKeyValueStorageManager.cpp: >+ (WKKeyValueStorageManagerGetStorageDetailsByOrigin): >+ * UIProcess/API/glib/WebKitWebViewSessionState.cpp: >+ (decodeHTTPBody): >+ * UIProcess/Plugins/gtk/PluginInfoCache.cpp: >+ (WebKit::PluginInfoCache::getPluginInfo): >+ (WebKit::PluginInfoCache::updatePluginInfo): >+ * UIProcess/ResourceLoadStatisticsPersistentStorage.cpp: >+ (WebKit::hasFileChangedSince): >+ * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp: >+ (WebKit::LocalStorageDatabaseTracker::databasesModifiedSince): >+ (WebKit::LocalStorageDatabaseTracker::originDetails): >+ * UIProcess/WebStorage/LocalStorageDatabaseTracker.h: >+ * UIProcess/mac/LegacySessionStateCoding.cpp: >+ (WebKit::encodeFormDataElement): >+ (WebKit::decodeFormDataElement): >+ * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp: >+ (WebKit::removeAllMediaKeyStorageForOriginPath): >+ (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin): >+ (WebKit::WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates): >+ (WebKit::WebMediaKeyStorageManager::deleteAllMediaKeyEntries): >+ * WebProcess/MediaCache/WebMediaKeyStorageManager.h: >+ * WebProcess/WebCoreSupport/SessionStateConversion.cpp: >+ (WebKit::toHTTPBody): >+ (WebKit::toFormData): >+ > 2018-12-02 Zalan Bujtas <zalan@apple.com> > > Add a runtime feature flag for LayoutFormattingContext. >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 3a77e7f06804b767015914abd8fc348588e860b6..55640617e4436e0e3dbdeb9803b900d95225dc95 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,13 @@ >+2018-12-03 Yusuke Suzuki <yusukesuzuki@slowstart.org> >+ >+ Use WallTime for file time >+ https://bugs.webkit.org/show_bug.cgi?id=192287 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Plugins/PluginDatabase.cpp: >+ (WebCore::PluginDatabase::refresh): >+ > 2018-11-30 Alex Christensen <achristensen@webkit.org> > > Fix Windows build. >diff --git a/Source/WebCore/Modules/webdatabase/Database.cpp b/Source/WebCore/Modules/webdatabase/Database.cpp >index e9f2501ef84bdd898f341c8a415bd6118e51b66a..ec9b05f9e6eee4693257d3b990f00bd6b73cf50a 100644 >--- a/Source/WebCore/Modules/webdatabase/Database.cpp >+++ b/Source/WebCore/Modules/webdatabase/Database.cpp >@@ -638,7 +638,7 @@ String Database::fileName() const > DatabaseDetails Database::details() const > { > // This code path is only used for database quota delegate calls, so file dates are irrelevant and left uninitialized. >- return DatabaseDetails(stringIdentifier(), displayName(), estimatedSize(), 0, 0, 0); >+ return DatabaseDetails(stringIdentifier(), displayName(), estimatedSize(), 0, std::nullopt, std::nullopt); > } > > void Database::disableAuthorizer() >diff --git a/Source/WebCore/Modules/webdatabase/DatabaseDetails.h b/Source/WebCore/Modules/webdatabase/DatabaseDetails.h >index 6a96e23f0755f05d306acdcf91d6b5b5a26d5896..670210240b2a868c627eb510defc72a8804d9527 100644 >--- a/Source/WebCore/Modules/webdatabase/DatabaseDetails.h >+++ b/Source/WebCore/Modules/webdatabase/DatabaseDetails.h >@@ -28,7 +28,9 @@ > > #pragma once > >+#include <wtf/Markable.h> > #include <wtf/Threading.h> >+#include <wtf/WallTime.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >@@ -64,7 +66,7 @@ class DatabaseDetails { > return *this; > } > >- DatabaseDetails(const String& databaseName, const String& displayName, unsigned long long expectedUsage, unsigned long long currentUsage, double creationTime, double modificationTime) >+ DatabaseDetails(const String& databaseName, const String& displayName, unsigned long long expectedUsage, unsigned long long currentUsage, std::optional<WallTime> creationTime, std::optional<WallTime> modificationTime) > : m_name(databaseName) > , m_displayName(displayName) > , m_expectedUsage(expectedUsage) >@@ -78,8 +80,8 @@ class DatabaseDetails { > const String& displayName() const { return m_displayName; } > uint64_t expectedUsage() const { return m_expectedUsage; } > uint64_t currentUsage() const { return m_currentUsage; } >- double creationTime() const { return m_creationTime; } >- double modificationTime() const { return m_modificationTime; } >+ std::optional<WallTime> creationTime() const { return m_creationTime; } >+ std::optional<WallTime> modificationTime() const { return m_modificationTime; } > #ifndef NDEBUG > Thread& thread() const { return m_thread.get(); } > #endif >@@ -89,8 +91,8 @@ class DatabaseDetails { > String m_displayName; > uint64_t m_expectedUsage { 0 }; > uint64_t m_currentUsage { 0 }; >- double m_creationTime { 0.0 }; >- double m_modificationTime { 0.0 }; >+ Markable<WallTime, WallTime::MarkableTraits> m_creationTime; >+ Markable<WallTime, WallTime::MarkableTraits> m_modificationTime; > #ifndef NDEBUG > Ref<Thread> m_thread { Thread::current() }; > #endif >diff --git a/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp b/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp >index ffb7e86a2895ff2dd56b080985fa7d916eecf962..23c3c3034fd6ac81b51a427869db3fdd7682afe5 100644 >--- a/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp >+++ b/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp >@@ -59,7 +59,7 @@ class DatabaseManager::ProposedDatabase { > DatabaseManager::ProposedDatabase::ProposedDatabase(DatabaseManager& manager, SecurityOrigin& origin, const String& name, const String& displayName, unsigned long estimatedSize) > : m_manager(manager) > , m_origin(origin.isolatedCopy()) >- , m_details(name.isolatedCopy(), displayName.isolatedCopy(), estimatedSize, 0, 0, 0) >+ , m_details(name.isolatedCopy(), displayName.isolatedCopy(), estimatedSize, 0, std::nullopt, std::nullopt) > { > m_manager.addProposedDatabase(*this); > } >diff --git a/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp b/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp >index 0d912913a023d237c3c8145df0924e6393771f43..9f5b5ae18c73947da97e3b2d6ad401d96e0d54ab 100644 >--- a/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp >+++ b/Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp >@@ -472,7 +472,7 @@ DatabaseDetails DatabaseTracker::detailsForNameAndOrigin(const String& name, con > > String path = fullPathForDatabase(origin, name, false); > if (path.isEmpty()) >- return DatabaseDetails(name, displayName, expectedUsage, 0, 0, 0); >+ return DatabaseDetails(name, displayName, expectedUsage, 0, std::nullopt, std::nullopt); > return DatabaseDetails(name, displayName, expectedUsage, SQLiteFileSystem::getDatabaseFileSize(path), SQLiteFileSystem::databaseCreationTime(path), SQLiteFileSystem::databaseModificationTime(path)); > } > >diff --git a/Source/WebCore/fileapi/AsyncFileStream.cpp b/Source/WebCore/fileapi/AsyncFileStream.cpp >index 73a365228799c16b9a988d9a1189e0cf9380fe9d..325e34d0c6b8e7cc93afdb6445f548f5fcebee3e 100644 >--- a/Source/WebCore/fileapi/AsyncFileStream.cpp >+++ b/Source/WebCore/fileapi/AsyncFileStream.cpp >@@ -134,7 +134,7 @@ void AsyncFileStream::perform(WTF::Function<WTF::Function<void(FileStreamClient& > }); > } > >-void AsyncFileStream::getSize(const String& path, double expectedModificationTime) >+void AsyncFileStream::getSize(const String& path, std::optional<WallTime> expectedModificationTime) > { > // FIXME: Explicit return type here and in all the other cases like this below is a workaround for a deficiency > // in the Windows compiler at the time of this writing. Could remove it if that is resolved. >diff --git a/Source/WebCore/fileapi/AsyncFileStream.h b/Source/WebCore/fileapi/AsyncFileStream.h >index 62caffe2d98ad1d5d10f4ed68817da90494ea178..7a9337e33be2c93e793266e611b13bc4ce36e438 100644 >--- a/Source/WebCore/fileapi/AsyncFileStream.h >+++ b/Source/WebCore/fileapi/AsyncFileStream.h >@@ -33,6 +33,7 @@ > > #include <wtf/Forward.h> > #include <wtf/Function.h> >+#include <wtf/WallTime.h> > > namespace WebCore { > >@@ -44,7 +45,7 @@ class WEBCORE_EXPORT AsyncFileStream { > explicit AsyncFileStream(FileStreamClient&); > ~AsyncFileStream(); > >- void getSize(const String& path, double expectedModificationTime); >+ void getSize(const String& path, std::optional<WallTime> expectedModificationTime); > void openForRead(const String& path, long long offset, long long length); > void close(); > void read(char* buffer, int length); >diff --git a/Source/WebCore/fileapi/File.cpp b/Source/WebCore/fileapi/File.cpp >index e7b0d3ec92f48e2a5c8e7618f61cc9850e8fe901..387d7f01fb0fb16039e3d65aa9f06dca9c2377cf 100644 >--- a/Source/WebCore/fileapi/File.cpp >+++ b/Source/WebCore/fileapi/File.cpp >@@ -112,11 +112,11 @@ int64_t File::lastModified() const > // FIXME: This does sync-i/o on the main thread and also recalculates every time the method is called. > // The i/o should be performed on a background thread, > // and the result should be cached along with an asynchronous monitor for changes to the file. >- time_t modificationTime; >- if (FileSystem::getFileModificationTime(m_path, modificationTime) && FileSystem::isValidFileTime(modificationTime)) >- result = modificationTime * msPerSecond; >+ auto modificationTime = FileSystem::getFileModificationTime(m_path); >+ if (modificationTime && !std::isnan(modificationTime.value())) >+ result = modificationTime->secondsSinceEpoch().millisecondsAs<int64_t>(); > else >- result = WallTime::now().secondsSinceEpoch().milliseconds(); >+ result = WallTime::now().secondsSinceEpoch().millisecondsAs<int64_t>(); > > return WTF::timeClip(result); > } >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index bd0347f76d725f834d90633f8317819683bedb7e..fb0fc389a044f9b17513102b09c691da2bcf739c 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -1347,7 +1347,7 @@ void Page::userStyleSheetLocationChanged() > > m_didLoadUserStyleSheet = false; > m_userStyleSheet = String(); >- m_userStyleSheetModificationTime = 0; >+ m_userStyleSheetModificationTime = std::nullopt; > > // Data URLs with base64-encoded UTF-8 style sheets are common. We can process them > // synchronously and avoid using a loader. >@@ -1370,8 +1370,8 @@ const String& Page::userStyleSheet() const > if (m_userStyleSheetPath.isEmpty()) > return m_userStyleSheet; > >- time_t modTime; >- if (!FileSystem::getFileModificationTime(m_userStyleSheetPath, modTime)) { >+ auto modificationTime = FileSystem::getFileModificationTime(m_userStyleSheetPath); >+ if (!modificationTime) { > // The stylesheet either doesn't exist, was just deleted, or is > // otherwise unreadable. If we've read the stylesheet before, we should > // throw away that data now as it no longer represents what's on disk. >@@ -1381,12 +1381,12 @@ const String& Page::userStyleSheet() const > > // If the stylesheet hasn't changed since the last time we read it, we can > // just return the old data. >- if (m_didLoadUserStyleSheet && modTime <= m_userStyleSheetModificationTime) >+ if (m_didLoadUserStyleSheet && (m_userStyleSheetModificationTime && modificationTime.value() <= m_userStyleSheetModificationTime.value())) > return m_userStyleSheet; > > m_didLoadUserStyleSheet = true; > m_userStyleSheet = String(); >- m_userStyleSheetModificationTime = modTime; >+ m_userStyleSheetModificationTime = modificationTime; > > // FIXME: It would be better to load this asynchronously to avoid blocking > // the process, but we will first need to create an asynchronous loading >diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h >index 411487f8375efbe79d28ae1d3244783891f580c2..d656f1e83effa14c58d572a18bbafbf7197d0e45 100644 >--- a/Source/WebCore/page/Page.h >+++ b/Source/WebCore/page/Page.h >@@ -811,7 +811,7 @@ class Page : public Supplementable<Page> { > String m_userStyleSheetPath; > mutable String m_userStyleSheet; > mutable bool m_didLoadUserStyleSheet { false }; >- mutable time_t m_userStyleSheetModificationTime { 0 }; >+ mutable std::optional<WallTime> m_userStyleSheetModificationTime; > > String m_captionUserPreferencesStyleSheet; > >diff --git a/Source/WebCore/platform/FileMetadata.h b/Source/WebCore/platform/FileMetadata.h >index 8164d6db8a08dd72008195cc19277fb8307ab026..7d884953e7675d92c0638decad857cd41a59c561 100644 >--- a/Source/WebCore/platform/FileMetadata.h >+++ b/Source/WebCore/platform/FileMetadata.h >@@ -30,11 +30,13 @@ > > #pragma once > >+#include <wtf/WallTime.h> >+ > namespace WebCore { > > struct FileMetadata { > // The last modification time of the file, in seconds. >- double modificationTime; >+ WallTime modificationTime; > > // The length of the file in bytes. > long long length; >diff --git a/Source/WebCore/platform/FileStream.cpp b/Source/WebCore/platform/FileStream.cpp >index ab48c04aceca39d0b77553dce75cadb5d4b335a4..a2190aa84baf875869e157dc00ede0dd655e5769 100644 >--- a/Source/WebCore/platform/FileStream.cpp >+++ b/Source/WebCore/platform/FileStream.cpp >@@ -49,14 +49,14 @@ FileStream::~FileStream() > close(); > } > >-long long FileStream::getSize(const String& path, double expectedModificationTime) >+long long FileStream::getSize(const String& path, std::optional<WallTime> expectedModificationTime) > { > // Check the modification time for the possible file change. >- time_t modificationTime; >- if (!FileSystem::getFileModificationTime(path, modificationTime)) >+ auto modificationTime = FileSystem::getFileModificationTime(path); >+ if (!modificationTime) > return -1; >- if (FileSystem::isValidFileTime(expectedModificationTime)) { >- if (static_cast<time_t>(expectedModificationTime) != modificationTime) >+ if (expectedModificationTime) { >+ if (expectedModificationTime->secondsSinceEpoch().secondsAs<time_t>() != modificationTime->secondsSinceEpoch().secondsAs<time_t>()) > return -1; > } > >diff --git a/Source/WebCore/platform/FileStream.h b/Source/WebCore/platform/FileStream.h >index b2aa284479f7b1226ebf7aaa9b7fdcac30c33761..7a681b49d50de23214acd20ca9ed9c917e33f2ab 100644 >--- a/Source/WebCore/platform/FileStream.h >+++ b/Source/WebCore/platform/FileStream.h >@@ -43,7 +43,7 @@ class FileStream { > > // Gets the size of a file. Also validates if the file has been changed or not if the expected modification time is provided, i.e. non-zero. > // Returns total number of bytes if successful. -1 otherwise. >- long long getSize(const String& path, double expectedModificationTime); >+ long long getSize(const String& path, std::optional<WallTime> expectedModificationTime); > > // Opens a file for reading. The reading starts at the specified offset and lasts till the specified length. > // Returns true on success. False otherwise. >diff --git a/Source/WebCore/platform/FileSystem.cpp b/Source/WebCore/platform/FileSystem.cpp >index 2fdb260f829362bbcac6597670b0388319fd246a..a77998ccf2070e4d1219d41f12cf927cba0a9de7 100644 >--- a/Source/WebCore/platform/FileSystem.cpp >+++ b/Source/WebCore/platform/FileSystem.cpp >@@ -361,13 +361,5 @@ bool fileIsDirectory(const String& path, ShouldFollowSymbolicLinks shouldFollowS > return metadata.value().type == FileMetadata::Type::Directory; > } > >-std::optional<WallTime> getFileModificationTime(const String& path) >-{ >- time_t modificationTime = 0; >- if (!getFileModificationTime(path, modificationTime)) >- return std::nullopt; >- return WallTime::fromRawSeconds(modificationTime); >-} >- > } // namespace FileSystem > } // namespace WebCore >diff --git a/Source/WebCore/platform/FileSystem.h b/Source/WebCore/platform/FileSystem.h >index e140b2457e1ae6ae8abef1e2b41470a8471ef811..8018935c386a0d999821cbcaf2d95a47100b3522 100644 >--- a/Source/WebCore/platform/FileSystem.h >+++ b/Source/WebCore/platform/FileSystem.h >@@ -104,9 +104,8 @@ WEBCORE_EXPORT bool deleteEmptyDirectory(const String&); > WEBCORE_EXPORT bool moveFile(const String& oldPath, const String& newPath); > WEBCORE_EXPORT bool getFileSize(const String&, long long& result); > WEBCORE_EXPORT bool getFileSize(PlatformFileHandle, long long& result); >-WEBCORE_EXPORT bool getFileModificationTime(const String&, time_t& result); > WEBCORE_EXPORT std::optional<WallTime> getFileModificationTime(const String&); >-WEBCORE_EXPORT bool getFileCreationTime(const String&, time_t& result); // Not all platforms store file creation time. >+WEBCORE_EXPORT std::optional<WallTime> getFileCreationTime(const String&); // Not all platforms store file creation time. > WEBCORE_EXPORT std::optional<FileMetadata> fileMetadata(const String& path); > WEBCORE_EXPORT std::optional<FileMetadata> fileMetadataFollowingSymlinks(const String& path); > WEBCORE_EXPORT bool fileIsDirectory(const String&, ShouldFollowSymbolicLinks); >@@ -133,9 +132,6 @@ String stringFromFileSystemRepresentation(const char*); > > inline bool isHandleValid(const PlatformFileHandle& handle) { return handle != invalidPlatformFileHandle; } > >-inline double invalidFileTime() { return std::numeric_limits<double>::quiet_NaN(); } >-inline bool isValidFileTime(double time) { return std::isfinite(time); } >- > // Prefix is what the filename should be prefixed with, not the full path. > WEBCORE_EXPORT String openTemporaryFile(const String& prefix, PlatformFileHandle&); > WEBCORE_EXPORT PlatformFileHandle openFile(const String& path, FileOpenMode); >diff --git a/Source/WebCore/platform/glib/FileSystemGlib.cpp b/Source/WebCore/platform/glib/FileSystemGlib.cpp >index f940815f51248015f73b0051782dd5b8256588af..8fc6864cec67adde29b312bb810eba5373b18831 100644 >--- a/Source/WebCore/platform/glib/FileSystemGlib.cpp >+++ b/Source/WebCore/platform/glib/FileSystemGlib.cpp >@@ -151,20 +151,19 @@ bool getFileSize(PlatformFileHandle, long long&) > return false; > } > >-bool getFileCreationTime(const String&, time_t&) >+std::optional<WallTime> getFileCreationTime(const String&) > { > // FIXME: Is there a way to retrieve file creation time with Gtk on platforms that support it? >- return false; >+ return std::nullopt; > } > >-bool getFileModificationTime(const String& path, time_t& modifiedTime) >+std::optional<WallTime> getFileModificationTime(const String& path) > { > GStatBuf statResult; > if (!getFileStat(path, &statResult)) >- return false; >+ return std::nullopt; > >- modifiedTime = statResult.st_mtime; >- return true; >+ return WallTime::fromRawSeconds(statResult.st_mtime); > } > > static FileMetadata::Type toFileMetataType(GStatBuf statResult) >@@ -186,7 +185,7 @@ static std::optional<FileMetadata> fileMetadataUsingFunction(const String& path, > bool isHidden = !filename.isEmpty() && filename[0] == '.'; > > return FileMetadata { >- static_cast<double>(statResult.st_mtime), >+ WallTime::fromRawSeconds(statResult.st_mtime), > statResult.st_size, > isHidden, > toFileMetataType(statResult) >diff --git a/Source/WebCore/platform/network/BlobDataFileReference.cpp b/Source/WebCore/platform/network/BlobDataFileReference.cpp >index 6a5f12e84d747d85c09e05fa143093f481006d31..b8d1312afe5ff1b42365b82bf215009fd54c87dc 100644 >--- a/Source/WebCore/platform/network/BlobDataFileReference.cpp >+++ b/Source/WebCore/platform/network/BlobDataFileReference.cpp >@@ -34,11 +34,6 @@ namespace WebCore { > > BlobDataFileReference::BlobDataFileReference(const String& path) > : m_path(path) >-#if ENABLE(FILE_REPLACEMENT) >- , m_replacementShouldBeGenerated(false) >-#endif >- , m_size(0) >- , m_expectedModificationTime(FileSystem::invalidFileTime()) > { > } > >@@ -73,15 +68,14 @@ unsigned long long BlobDataFileReference::size() > return m_size; > } > >-double BlobDataFileReference::expectedModificationTime() >+std::optional<WallTime> BlobDataFileReference::expectedModificationTime() > { > #if ENABLE(FILE_REPLACEMENT) > // We do not currently track modifications for generated files, because we have a snapshot. > // Unfortunately, this is inconsistent with regular file handling - File objects should be invalidated when underlying files change. > if (m_replacementShouldBeGenerated || !m_replacementPath.isNull()) >- return FileSystem::invalidFileTime(); >+ return std::nullopt; > #endif >- > return m_expectedModificationTime; > } > >diff --git a/Source/WebCore/platform/network/BlobDataFileReference.h b/Source/WebCore/platform/network/BlobDataFileReference.h >index a53f77551258b48f3ebb8aa47019b8e4e47dfafb..40def69f6f8c7ba8cb64307e5c99cda94fd2e808 100644 >--- a/Source/WebCore/platform/network/BlobDataFileReference.h >+++ b/Source/WebCore/platform/network/BlobDataFileReference.h >@@ -26,7 +26,9 @@ > #ifndef BlobDataFileReference_h > #define BlobDataFileReference_h > >+#include <wtf/Markable.h> > #include <wtf/RefCounted.h> >+#include <wtf/WallTime.h> > #include <wtf/text/WTFString.h> > > namespace WebCore { >@@ -44,7 +46,7 @@ class WEBCORE_EXPORT BlobDataFileReference : public RefCounted<BlobDataFileRefer > > const String& path(); > unsigned long long size(); >- double expectedModificationTime(); >+ std::optional<WallTime> expectedModificationTime(); > > virtual void prepareForFileAccess(); > virtual void revokeFileAccess(); >@@ -60,10 +62,10 @@ class WEBCORE_EXPORT BlobDataFileReference : public RefCounted<BlobDataFileRefer > String m_path; > #if ENABLE(FILE_REPLACEMENT) > String m_replacementPath; >- bool m_replacementShouldBeGenerated; >+ bool m_replacementShouldBeGenerated { false }; > #endif >- unsigned long long m_size; >- double m_expectedModificationTime; >+ unsigned long long m_size { 0 }; >+ Markable<WallTime, WallTime::MarkableTraits> m_expectedModificationTime; > }; > > } >diff --git a/Source/WebCore/platform/network/FormData.cpp b/Source/WebCore/platform/network/FormData.cpp >index 8db3dec6d95432f68f23c40269ce345b82245416..45aebae5209c9b5d50f1f2145da553f9e45ee9d3 100644 >--- a/Source/WebCore/platform/network/FormData.cpp >+++ b/Source/WebCore/platform/network/FormData.cpp >@@ -186,11 +186,11 @@ void FormData::appendData(const void* data, size_t size) > > void FormData::appendFile(const String& filename, bool shouldGenerateFile) > { >- m_elements.append(FormDataElement(filename, 0, BlobDataItem::toEndOfFile, FileSystem::invalidFileTime(), shouldGenerateFile)); >+ m_elements.append(FormDataElement(filename, 0, BlobDataItem::toEndOfFile, std::nullopt, shouldGenerateFile)); > m_lengthInBytes = std::nullopt; > } > >-void FormData::appendFileRange(const String& filename, long long start, long long length, double expectedModificationTime, bool shouldGenerateFile) >+void FormData::appendFileRange(const String& filename, long long start, long long length, std::optional<WallTime> expectedModificationTime, bool shouldGenerateFile) > { > m_elements.append(FormDataElement(filename, start, length, expectedModificationTime, shouldGenerateFile)); > m_lengthInBytes = std::nullopt; >diff --git a/Source/WebCore/platform/network/FormData.h b/Source/WebCore/platform/network/FormData.h >index bbaade185b79f54f8c0707539632166346ec2dec..59f55f8338bdbe5e240fc45e05485f5c23fabad1 100644 >--- a/Source/WebCore/platform/network/FormData.h >+++ b/Source/WebCore/platform/network/FormData.h >@@ -45,7 +45,7 @@ struct FormDataElement { > : data(WTFMove(data)) { } > explicit FormDataElement(Vector<char>&& array) > : data(WTFMove(array)) { } >- FormDataElement(const String& filename, int64_t fileStart, int64_t fileLength, double expectedFileModificationTime, bool shouldGenerateFile) >+ FormDataElement(const String& filename, int64_t fileStart, int64_t fileLength, std::optional<WallTime> expectedFileModificationTime, bool shouldGenerateFile) > : data(EncodedFileData { filename, fileStart, fileLength, expectedFileModificationTime, { }, shouldGenerateFile, false }) { } > explicit FormDataElement(const URL& blobURL) > : data(EncodedBlobData { blobURL }) { } >@@ -71,7 +71,7 @@ struct FormDataElement { > String filename; > int64_t fileStart { 0 }; > int64_t fileLength { 0 }; >- double expectedFileModificationTime { 0 }; >+ std::optional<WallTime> expectedFileModificationTime; > String generatedFilename; > bool shouldGenerateFile { false }; > bool ownsGeneratedFile { false }; >@@ -116,7 +116,7 @@ struct FormDataElement { > if (!fileLength) > return std::nullopt; > >- std::optional<double> expectedFileModificationTime; >+ std::optional<std::optional<WallTime>> expectedFileModificationTime; > decoder >> expectedFileModificationTime; > if (!expectedFileModificationTime) > return std::nullopt; >@@ -218,7 +218,7 @@ class FormData : public RefCounted<FormData> { > > WEBCORE_EXPORT void appendData(const void* data, size_t); > void appendFile(const String& filePath, bool shouldGenerateFile = false); >- WEBCORE_EXPORT void appendFileRange(const String& filename, long long start, long long length, double expectedModificationTime, bool shouldGenerateFile = false); >+ WEBCORE_EXPORT void appendFileRange(const String& filename, long long start, long long length, std::optional<WallTime> expectedModificationTime, bool shouldGenerateFile = false); > WEBCORE_EXPORT void appendBlob(const URL& blobURL); > > Vector<char> flatten() const; // omits files >diff --git a/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp b/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp >index 45e31e5437af8d9a412494d426fd2dc380582994..9e2d881d635491525d71af456c2d195fd13b94d6 100644 >--- a/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp >+++ b/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp >@@ -145,9 +145,11 @@ static bool advanceCurrentStream(FormStreamFields* form) > return true; > }, [form] (const FormDataElement::EncodedFileData& fileData) { > // Check if the file has been changed or not if required. >- if (FileSystem::isValidFileTime(fileData.expectedFileModificationTime)) { >- time_t fileModificationTime; >- if (!FileSystem::getFileModificationTime(fileData.filename, fileModificationTime) || fileModificationTime != static_cast<time_t>(fileData.expectedFileModificationTime)) >+ if (fileData.expectedFileModificationTime) { >+ auto fileModificationTime = FileSystem::getFileModificationTime(fileData.filename); >+ if (!fileModificationTime) >+ return false; >+ if (fileModificationTime->secondsSinceEpoch().secondsAs<time_t>() != fileData.expectedFileModificationTime->secondsSinceEpoch().secondsAs<time_t>()) > return false; > } > const String& path = fileData.shouldGenerateFile ? fileData.generatedFilename : fileData.filename; >diff --git a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >index 229c53cf5720276e525e9a6fb6f762b8ff58ee07..ec4903e4027f5a3491bd892694ac2451d81585d5 100644 >--- a/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >+++ b/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp >@@ -41,12 +41,14 @@ static uint64_t appendEncodedBlobItemToSoupMessageBody(SoupMessage* soupMessage, > soup_message_body_append(soupMessage->request_body, SOUP_MEMORY_TEMPORARY, blobItem.data().data()->data() + blobItem.offset(), blobItem.length()); > return blobItem.length(); > case BlobDataItem::Type::File: { >- if (!FileSystem::isValidFileTime(blobItem.file()->expectedModificationTime())) >+ if (!blobItem.file()->expectedModificationTime()) > return 0; > >- time_t fileModificationTime; >- if (!FileSystem::getFileModificationTime(blobItem.file()->path(), fileModificationTime) >- || fileModificationTime != static_cast<time_t>(blobItem.file()->expectedModificationTime())) >+ auto fileModificationTime = FileSystem::getFileModificationTime(blobItem.file()->path()); >+ if (!fileModificationTime) >+ return 0; >+ >+ if (fileModificationTime->secondsSinceEpoch().secondsAs<time_t>() != blobItem.file()->expectedModificationTime()->secondsSinceEpoch().secondsAs<time_t>()) > return 0; > > if (RefPtr<SharedBuffer> buffer = SharedBuffer::createWithContentsOfFile(blobItem.file()->path())) { >diff --git a/Source/WebCore/platform/posix/FileSystemPOSIX.cpp b/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >index 1e6823171d2f52cc924b3c978b43f302a861d12a..8d284c25fa01057786c73c056c27784c80f5b7bc 100644 >--- a/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >+++ b/Source/WebCore/platform/posix/FileSystemPOSIX.cpp >@@ -202,42 +202,39 @@ bool getFileSize(PlatformFileHandle handle, long long& result) > return true; > } > >-bool getFileCreationTime(const String& path, time_t& result) >+std::optional<WallTime> getFileCreationTime(const String& path) > { > #if OS(DARWIN) || OS(OPENBSD) || OS(NETBSD) || OS(FREEBSD) > CString fsRep = fileSystemRepresentation(path); > > if (!fsRep.data() || fsRep.data()[0] == '\0') >- return false; >+ return std::nullopt; > > struct stat fileInfo; > > if (stat(fsRep.data(), &fileInfo)) >- return false; >+ return std::nullopt; > >- result = fileInfo.st_birthtime; >- return true; >+ return WallTime::fromRawSeconds(fileInfo.st_birthtime); > #else > UNUSED_PARAM(path); >- UNUSED_PARAM(result); >- return false; >+ return std::nullopt; > #endif > } > >-bool getFileModificationTime(const String& path, time_t& result) >+std::optional<WallTime> getFileModificationTime(const String& path) > { > CString fsRep = fileSystemRepresentation(path); > > if (!fsRep.data() || fsRep.data()[0] == '\0') >- return false; >+ return std::nullopt; > > struct stat fileInfo; > > if (stat(fsRep.data(), &fileInfo)) >- return false; >+ return std::nullopt; > >- result = fileInfo.st_mtime; >- return true; >+ return WallTime::fromRawSeconds(fileInfo.st_mtime); > } > > static FileMetadata::Type toFileMetataType(struct stat fileInfo) >@@ -263,7 +260,7 @@ static std::optional<FileMetadata> fileMetadataUsingFunction(const String& path, > String filename = pathGetFileName(path); > bool isHidden = !filename.isEmpty() && filename[0] == '.'; > return FileMetadata { >- static_cast<double>(fileInfo.st_mtime), >+ WallTime::fromRawSeconds(fileInfo.st_mtime), > fileInfo.st_size, > isHidden, > toFileMetataType(fileInfo) >diff --git a/Source/WebCore/platform/sql/SQLiteFileSystem.cpp b/Source/WebCore/platform/sql/SQLiteFileSystem.cpp >index 9ef1868707e030703f690199a12c666274754b52..5b110a8bde8238ec9e1899ada32d94225b7d77ea 100644 >--- a/Source/WebCore/platform/sql/SQLiteFileSystem.cpp >+++ b/Source/WebCore/platform/sql/SQLiteFileSystem.cpp >@@ -108,16 +108,14 @@ long long SQLiteFileSystem::getDatabaseFileSize(const String& fileName) > return FileSystem::getFileSize(fileName, size) ? size : 0; > } > >-double SQLiteFileSystem::databaseCreationTime(const String& fileName) >+std::optional<WallTime> SQLiteFileSystem::databaseCreationTime(const String& fileName) > { >- time_t time; >- return FileSystem::getFileCreationTime(fileName, time) ? time : 0; >+ return FileSystem::getFileCreationTime(fileName); > } > >-double SQLiteFileSystem::databaseModificationTime(const String& fileName) >+std::optional<WallTime> SQLiteFileSystem::databaseModificationTime(const String& fileName) > { >- time_t time; >- return FileSystem::getFileModificationTime(fileName, time) ? time : 0; >+ return FileSystem::getFileModificationTime(fileName); > } > > } // namespace WebCore >diff --git a/Source/WebCore/platform/sql/SQLiteFileSystem.h b/Source/WebCore/platform/sql/SQLiteFileSystem.h >index c8a4f940e8168e71470234011abb28fe36f1e087..17bfa0628790bb981294093eea5a0c0b386b894a 100644 >--- a/Source/WebCore/platform/sql/SQLiteFileSystem.h >+++ b/Source/WebCore/platform/sql/SQLiteFileSystem.h >@@ -97,8 +97,8 @@ class SQLiteFileSystem { > #endif > > static long long getDatabaseFileSize(const String& fileName); >- WEBCORE_EXPORT static double databaseCreationTime(const String& fileName); >- WEBCORE_EXPORT static double databaseModificationTime(const String& fileName); >+ WEBCORE_EXPORT static std::optional<WallTime> databaseCreationTime(const String& fileName); >+ WEBCORE_EXPORT static std::optional<WallTime> databaseModificationTime(const String& fileName); > > private: > // do not instantiate this class >diff --git a/Source/WebCore/platform/win/FileSystemWin.cpp b/Source/WebCore/platform/win/FileSystemWin.cpp >index 49fa14412a96520f83486ee70cdf45019953e34f..b30621f9430b281b3452026532d5c310faa8d4f9 100644 >--- a/Source/WebCore/platform/win/FileSystemWin.cpp >+++ b/Source/WebCore/platform/win/FileSystemWin.cpp >@@ -124,24 +124,26 @@ bool getFileSize(PlatformFileHandle fileHandle, long long& size) > return getFileSizeFromByHandleFileInformationStructure(fileInformation, size); > } > >-bool getFileModificationTime(const String& path, time_t& time) >+std::optional<WallTime> getFileModificationTime(const String& path) > { > WIN32_FIND_DATAW findData; > if (!getFindData(path, findData)) >- return false; >+ return std::nullopt; > >+ time_t time = 0; > getFileModificationTimeFromFindData(findData, time); >- return true; >+ return WallTime::fromRawSeconds(time); > } > >-bool getFileCreationTime(const String& path, time_t& time) >+std::optional<WallTime> getFileCreationTime(const String& path) > { > WIN32_FIND_DATAW findData; > if (!getFindData(path, findData)) >- return false; >+ return std::nullopt; > >+ time_t time = 0; > getFileCreationTimeFromFindData(findData, time); >- return true; >+ return WallTime::fromRawSeconds(time); > } > > static String getFinalPathName(const String& path) >@@ -185,7 +187,7 @@ static std::optional<FileMetadata> findDataToFileMetadata(WIN32_FIND_DATAW findD > getFileModificationTimeFromFindData(findData, modificationTime); > > return FileMetadata { >- static_cast<double>(modificationTime), >+ WallTime::fromRawSeconds(modificationTime), > length, > static_cast<bool>(findData.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN), > toFileMetadataType(findData) >diff --git a/Source/WebKit/Shared/SessionState.h b/Source/WebKit/Shared/SessionState.h >index fe81a5d80955ece5d2c625f896962ea9e6c336bd..92afdc598a2b37f91197adf897c61cf594165c3b 100644 >--- a/Source/WebKit/Shared/SessionState.h >+++ b/Source/WebKit/Shared/SessionState.h >@@ -69,7 +69,7 @@ struct HTTPBody { > String filePath; > int64_t fileStart; > std::optional<int64_t> fileLength; >- std::optional<double> expectedFileModificationTime; >+ std::optional<WallTime> expectedFileModificationTime; > > // Blob. > String blobURLString; >diff --git a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >index 66ffe9194b047e1cf5e608a297fae52f28892340..2c63c6f06a45ddb1f62f611c3353c724b252e773 100644 >--- a/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >+++ b/Source/WebKit/Shared/WebCoreArgumentCoders.cpp >@@ -1622,11 +1622,11 @@ bool ArgumentCoder<DatabaseDetails>::decode(Decoder& decoder, DatabaseDetails& d > if (!decoder.decode(currentUsage)) > return false; > >- double creationTime; >+ std::optional<WallTime> creationTime; > if (!decoder.decode(creationTime)) > return false; > >- double modificationTime; >+ std::optional<WallTime> modificationTime; > if (!decoder.decode(modificationTime)) > return false; > >diff --git a/Source/WebKit/UIProcess/API/C/WKKeyValueStorageManager.cpp b/Source/WebKit/UIProcess/API/C/WKKeyValueStorageManager.cpp >index 391f85e375ef2653a0e241899eb0fd354075418d..efaebf7e66c3b22d3450ac1b9b211949ad0fd340 100644 >--- a/Source/WebKit/UIProcess/API/C/WKKeyValueStorageManager.cpp >+++ b/Source/WebKit/UIProcess/API/C/WKKeyValueStorageManager.cpp >@@ -102,9 +102,9 @@ void WKKeyValueStorageManagerGetStorageDetailsByOrigin(WKKeyValueStorageManagerR > > detailsMap.set(toImpl(WKKeyValueStorageManagerGetOriginKey())->string(), origin); > if (originDetails.creationTime) >- detailsMap.set(toImpl(WKKeyValueStorageManagerGetCreationTimeKey())->string(), API::Double::create(originDetails.creationTime.secondsSinceEpoch().value())); >+ detailsMap.set(toImpl(WKKeyValueStorageManagerGetCreationTimeKey())->string(), API::Double::create(originDetails.creationTime->secondsSinceEpoch().value())); > if (originDetails.modificationTime) >- detailsMap.set(toImpl(WKKeyValueStorageManagerGetModificationTimeKey())->string(), API::Double::create(originDetails.modificationTime.secondsSinceEpoch().value())); >+ detailsMap.set(toImpl(WKKeyValueStorageManagerGetModificationTimeKey())->string(), API::Double::create(originDetails.modificationTime->secondsSinceEpoch().value())); > > result.uncheckedAppend(API::Dictionary::create(WTFMove(detailsMap))); > } >diff --git a/Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp b/Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp >index c79b5678732d2014c2ee85a6b2e7bcd275d01644..7ee045dcc5876cf7b8d1c9b627d942f85c6017a9 100644 >--- a/Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp >+++ b/Source/WebKit/UIProcess/API/glib/WebKitWebViewSessionState.cpp >@@ -271,7 +271,7 @@ static inline bool decodeHTTPBody(GVariant* httpBodyVariant, HTTPBody& httpBody) > if (hasFileLength) > element.fileLength = fileLength; > if (hasFileModificationTime) >- element.expectedFileModificationTime = fileModificationTime; >+ element.expectedFileModificationTime = WallTime::fromRawSeconds(fileModificationTime); > element.blobURLString = String::fromUTF8(blobURLString); > > httpBody.elements.uncheckedAppend(WTFMove(element)); >diff --git a/Source/WebKit/UIProcess/Plugins/gtk/PluginInfoCache.cpp b/Source/WebKit/UIProcess/Plugins/gtk/PluginInfoCache.cpp >index b9b0c2eae360b4e01ff44448cb26b43948e9c6ca..80647eb12ee52511a119e85fde2f59c4e2377885 100644 >--- a/Source/WebKit/UIProcess/Plugins/gtk/PluginInfoCache.cpp >+++ b/Source/WebKit/UIProcess/Plugins/gtk/PluginInfoCache.cpp >@@ -112,11 +112,11 @@ bool PluginInfoCache::getPluginInfo(const String& pluginPath, PluginModuleInfo& > if (!g_key_file_has_group(m_cacheFile.get(), pluginGroup.data())) > return false; > >- time_t lastModified; >- if (!WebCore::FileSystem::getFileModificationTime(pluginPath, lastModified)) >+ auto lastModifiedTime = WebCore::FileSystem::getFileModificationTime(pluginPath); >+ if (!lastModifiedTime) > return false; > time_t cachedLastModified = static_cast<time_t>(g_key_file_get_uint64(m_cacheFile.get(), pluginGroup.data(), "mtime", nullptr)); >- if (lastModified != cachedLastModified) >+ if (lastModifiedTime->secondsSinceEpoch().secondsAs<time_t>() != cachedLastModified) > return false; > > plugin.path = pluginPath; >@@ -140,12 +140,12 @@ bool PluginInfoCache::getPluginInfo(const String& pluginPath, PluginModuleInfo& > > void PluginInfoCache::updatePluginInfo(const String& pluginPath, const PluginModuleInfo& plugin) > { >- time_t lastModified; >- if (!WebCore::FileSystem::getFileModificationTime(pluginPath, lastModified)) >+ auto lastModifiedTime = WebCore::FileSystem::getFileModificationTime(pluginPath); >+ if (!lastModifiedTime) > return; > > CString pluginGroup = pluginPath.utf8(); >- g_key_file_set_uint64(m_cacheFile.get(), pluginGroup.data(), "mtime", static_cast<guint64>(lastModified)); >+ g_key_file_set_uint64(m_cacheFile.get(), pluginGroup.data(), "mtime", lastModifiedTime->secondsSinceEpoch().secondsAs<guint64>()); > g_key_file_set_string(m_cacheFile.get(), pluginGroup.data(), "name", plugin.info.name.utf8().data()); > g_key_file_set_string(m_cacheFile.get(), pluginGroup.data(), "description", plugin.info.desc.utf8().data()); > >diff --git a/Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.cpp b/Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.cpp >index 6f85d36f947ac216450f75c05358565686784afc..770e837857063370a47ede1c0fd2747fefbcad18 100644 >--- a/Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.cpp >+++ b/Source/WebKit/UIProcess/ResourceLoadStatisticsPersistentStorage.cpp >@@ -45,11 +45,11 @@ using namespace WebCore; > static bool hasFileChangedSince(const String& path, WallTime since) > { > ASSERT(!RunLoop::isMain()); >- time_t modificationTime; >- if (!FileSystem::getFileModificationTime(path, modificationTime)) >+ auto modificationTime = FileSystem::getFileModificationTime(path); >+ if (!modificationTime) > return true; > >- return WallTime::fromRawSeconds(modificationTime) > since; >+ return modificationTime.value() > since; > } > > static std::unique_ptr<KeyedDecoder> createDecoderForFile(const String& path) >diff --git a/Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp b/Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp >index 0a0a1560c54e57ce0363a804d307bf0d41ee21c8..d19404d50617f614513294a6cdb6bdf5888dd6e9 100644 >--- a/Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp >+++ b/Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp >@@ -102,8 +102,11 @@ Vector<SecurityOriginData> LocalStorageDatabaseTracker::databasesModifiedSince(W > for (auto origin : databaseOrigins) { > auto path = databasePath(origin); > >- auto modificationTime = WallTime::fromRawSeconds(SQLiteFileSystem::databaseModificationTime(path)); >- if (modificationTime >= time) >+ auto modificationTime = SQLiteFileSystem::databaseModificationTime(path); >+ if (!modificationTime) >+ continue; >+ >+ if (modificationTime.value() >= time) > databaseOriginsModified.append(origin); > } > >@@ -139,8 +142,8 @@ Vector<LocalStorageDatabaseTracker::OriginDetails> LocalStorageDatabaseTracker:: > > OriginDetails details; > details.originIdentifier = origin.databaseIdentifier(); >- details.creationTime = WallTime::fromRawSeconds(SQLiteFileSystem::databaseCreationTime(path)); >- details.modificationTime = WallTime::fromRawSeconds(SQLiteFileSystem::databaseModificationTime(path)); >+ details.creationTime = SQLiteFileSystem::databaseCreationTime(path); >+ details.modificationTime = SQLiteFileSystem::databaseModificationTime(path); > result.uncheckedAppend(details); > } > >diff --git a/Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.h b/Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.h >index a04df5a56babcb2c683e7000a9f2ad108c06a50a..4083869c6c0f5c2273e24828e7a1a815daed1120 100644 >--- a/Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.h >+++ b/Source/WebKit/UIProcess/WebStorage/LocalStorageDatabaseTracker.h >@@ -27,6 +27,7 @@ > > #include <WebCore/SecurityOriginData.h> > #include <wtf/HashSet.h> >+#include <wtf/Markable.h> > #include <wtf/Optional.h> > #include <wtf/RefPtr.h> > #include <wtf/ThreadSafeRefCounted.h> >@@ -57,8 +58,8 @@ class LocalStorageDatabaseTracker : public ThreadSafeRefCounted<LocalStorageData > > struct OriginDetails { > String originIdentifier; >- WallTime creationTime; >- WallTime modificationTime; >+ Markable<WallTime, WallTime::MarkableTraits> creationTime; >+ Markable<WallTime, WallTime::MarkableTraits> modificationTime; > }; > Vector<OriginDetails> originDetails(); > >diff --git a/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp b/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp >index 5ee8dbae43f00da8108dc761ec86dc981ddc16d9..f44c4d64c34bc7fa6a0d6ee4d77b43ec5c8c459b 100644 >--- a/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp >+++ b/Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp >@@ -283,7 +283,7 @@ static void encodeFormDataElement(HistoryEntryDataEncoder& encoder, const HTTPBo > > encoder << element.fileStart; > encoder << element.fileLength.value_or(-1); >- encoder << element.expectedFileModificationTime.value_or(std::numeric_limits<double>::quiet_NaN()); >+ encoder << element.expectedFileModificationTime.value_or(WallTime::nan()).secondsSinceEpoch().value(); > break; > > case HTTPBody::Element::Type::Blob: >@@ -825,11 +825,10 @@ static void decodeFormDataElement(HistoryEntryDataDecoder& decoder, HTTPBody::El > formDataElement.fileLength = fileLength; > } > >- > double expectedFileModificationTime; > decoder >> expectedFileModificationTime; >- if (expectedFileModificationTime != std::numeric_limits<double>::quiet_NaN()) >- formDataElement.expectedFileModificationTime = expectedFileModificationTime; >+ if (!std::isnan(expectedFileModificationTime)) >+ formDataElement.expectedFileModificationTime = WallTime::fromRawSeconds(expectedFileModificationTime); > > break; > } >diff --git a/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.cpp b/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.cpp >index 903c6d012c1db288fba238b578bd06563448d814..4bf48d0e94eef76066ca30ea9cf35704ab3deaeb 100644 >--- a/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.cpp >+++ b/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.cpp >@@ -79,7 +79,7 @@ Vector<SecurityOriginData> WebMediaKeyStorageManager::getMediaKeyOrigins() > return results; > } > >-static void removeAllMediaKeyStorageForOriginPath(const String& originPath, double startDate, double endDate) >+static void removeAllMediaKeyStorageForOriginPath(const String& originPath, WallTime startDate, WallTime endDate) > { > Vector<String> mediaKeyPaths = FileSystem::listDirectory(originPath, "*"); > >@@ -89,10 +89,10 @@ static void removeAllMediaKeyStorageForOriginPath(const String& originPath, doub > if (!FileSystem::fileExists(mediaKeyFile)) > continue; > >- time_t modTime; >- FileSystem::getFileModificationTime(mediaKeyFile, modTime); >- >- if (modTime < startDate || modTime > endDate) >+ auto modificationTime = FileSystem::getFileModificationTime(mediaKeyFile); >+ if (!modificationTime) >+ continue; >+ if (modificationTime.value() < startDate || modificationTime.value() > endDate) > continue; > > FileSystem::deleteFile(mediaKeyFile); >@@ -108,10 +108,10 @@ void WebMediaKeyStorageManager::deleteMediaKeyEntriesForOrigin(const SecurityOri > return; > > String originPath = mediaKeyStorageDirectoryForOrigin(originData); >- removeAllMediaKeyStorageForOriginPath(originPath, std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max()); >+ removeAllMediaKeyStorageForOriginPath(originPath, -WallTime::infinity(), WallTime::infinity()); > } > >-void WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates(double startDate, double endDate) >+void WebMediaKeyStorageManager::deleteMediaKeyEntriesModifiedBetweenDates(WallTime startDate, WallTime endDate) > { > if (m_mediaKeyStorageDirectory.isEmpty()) > return; >@@ -128,7 +128,7 @@ void WebMediaKeyStorageManager::deleteAllMediaKeyEntries() > > Vector<String> originPaths = FileSystem::listDirectory(m_mediaKeyStorageDirectory, "*"); > for (auto& originPath : originPaths) >- removeAllMediaKeyStorageForOriginPath(originPath, std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max()); >+ removeAllMediaKeyStorageForOriginPath(originPath, -WallTime::infinity(), WallTime::infinity()); > } > > } >diff --git a/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.h b/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.h >index 119ece834e44dce89a3b37c157de293f9b3ff942..cc0bd14c91d0d50ca537af1a11591ffa98b58d82 100644 >--- a/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.h >+++ b/Source/WebKit/WebProcess/MediaCache/WebMediaKeyStorageManager.h >@@ -50,7 +50,7 @@ class WebMediaKeyStorageManager : public WebProcessSupplement { > > Vector<WebCore::SecurityOriginData> getMediaKeyOrigins(); > void deleteMediaKeyEntriesForOrigin(const WebCore::SecurityOriginData&); >- void deleteMediaKeyEntriesModifiedBetweenDates(double startDate, double endDate); >+ void deleteMediaKeyEntriesModifiedBetweenDates(WallTime startDate, WallTime endDate); > void deleteAllMediaKeyEntries(); > > private: >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/SessionStateConversion.cpp b/Source/WebKit/WebProcess/WebCoreSupport/SessionStateConversion.cpp >index 92879575b70cd1ed18d93e8ce01bd1da14973df3..f283c728630ed4e424d6d0bdd4e2806e28234802 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/SessionStateConversion.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/SessionStateConversion.cpp >@@ -51,8 +51,7 @@ static HTTPBody toHTTPBody(const FormData& formData) > element.fileStart = fileData.fileStart; > if (fileData.fileLength != BlobDataItem::toEndOfFile) > element.fileLength = fileData.fileLength; >- if (fileData.expectedFileModificationTime != FileSystem::invalidFileTime()) >- element.expectedFileModificationTime = fileData.expectedFileModificationTime; >+ element.expectedFileModificationTime = fileData.expectedFileModificationTime; > }, [&] (const FormDataElement::EncodedBlobData& blobData) { > element.blobURLString = blobData.url.string(); > } >@@ -129,7 +128,7 @@ static Ref<FormData> toFormData(const HTTPBody& httpBody) > break; > > case HTTPBody::Element::Type::File: >- formData->appendFileRange(element.filePath, element.fileStart, element.fileLength.value_or(BlobDataItem::toEndOfFile), element.expectedFileModificationTime.value_or(FileSystem::invalidFileTime())); >+ formData->appendFileRange(element.filePath, element.fileStart, element.fileLength.value_or(BlobDataItem::toEndOfFile), element.expectedFileModificationTime); > break; > > case HTTPBody::Element::Type::Blob: >diff --git a/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp b/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp >index 9cdcc145b71999cda698414e52fe22c37a897b84..5c0771211eaed649073e103e904a5ec9049b463f 100644 >--- a/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp >+++ b/Source/WebKitLegacy/win/Plugins/PluginDatabase.cpp >@@ -125,9 +125,10 @@ bool PluginDatabase::refresh() > > auto pathsEnd = paths.end(); > for (auto it = paths.begin(); it != pathsEnd; ++it) { >- time_t lastModified; >- if (!FileSystem::getFileModificationTime(*it, lastModified)) >+ auto lastModifiedTime = FileSystem::getFileModificationTime(*it); >+ if (!lastModifiedTime) > continue; >+ time_t lastModified = lastModifiedTime->secondsSinceEpoch().secondsAs<time_t>(); > > pathsWithTimes.add(*it, lastModified); >
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 192287
:
356337
|
356368
|
356370
|
356376