[webkit-changes] [WebKit/WebKit] 22004f: Rename FileSystem::FileOpenMode::Write to FileSyst...

Sihui noreply at github.com
Wed Feb 1 09:20:07 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 22004f62ebe45a346a22574601e6b5191cc62cc5
      https://github.com/WebKit/WebKit/commit/22004f62ebe45a346a22574601e6b5191cc62cc5
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2023-02-01 (Wed, 01 Feb 2023)

  Changed paths:
    M Source/JavaScriptCore/jsc.cpp
    M Source/JavaScriptCore/wasm/WasmStreamingParser.cpp
    M Source/WTF/wtf/FileSystem.cpp
    M Source/WTF/wtf/FileSystem.h
    M Source/WTF/wtf/glib/FileSystemGlib.cpp
    M Source/WTF/wtf/posix/FileSystemPOSIX.cpp
    M Source/WTF/wtf/win/FileSystemWin.cpp
    M Source/WebCore/Modules/webdatabase/OriginLock.cpp
    M Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp
    M Source/WebCore/platform/network/BlobRegistryImpl.cpp
    M Source/WebCore/platform/network/curl/CookieJarDB.cpp
    M Source/WebCore/platform/network/curl/CurlCacheEntry.cpp
    M Source/WebCore/platform/network/curl/CurlCacheManager.cpp
    M Source/WebCore/workers/service/server/SWScriptStorage.cpp
    M Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp
    M Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerDownloadTask.cpp
    M Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp
    M Source/WebKit/NetworkProcess/cache/NetworkCache.cpp
    M Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp
    M Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp
    M Source/WebKit/NetworkProcess/storage/CacheStorageManager.cpp
    M Source/WebKit/Shared/PersistencyUtils.cpp
    M Source/WebKit/Shared/WebMemorySampler.cpp
    M Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm
    M Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp
    M Source/WebKit/UIProcess/ios/WKModelView.mm
    M Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm
    M Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp
    M Tools/TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm

  Log Message:
  -----------
  Rename FileSystem::FileOpenMode::Write to FileSystem::FileOpenMode::Truncate
https://bugs.webkit.org/show_bug.cgi?id=251073
rdar://104590894

Reviewed by Žan Doberšek.

In existing implementation, file opened with FileSystem::FileOpenMode::Write will be truncated or recreated if it
exists. This behavior is not clearly indicated in the name, and it causes confusion to users. For example, some places
check file size or truncate file after opening it with FileSystem::FileOpenMode::Write mode. They may actually need to
use FileSystem::FileOpenMode::ReadWrite mode. Therefore, this patch renames FileSystem::FileOpenMode::Write to
FileSystem::FileOpenMode::Truncate. Also, this patch makes glib implementation of FileSystem::FileOpenMode::Truncate
mode aligned with POSIX and win implementation, which recreates file when file with same name already exists.

* Source/JavaScriptCore/jsc.cpp:
(JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/wasm/WasmStreamingParser.cpp:
(JSC::Wasm::dumpWasmSource):
* Source/WTF/wtf/FileSystem.cpp:
(WTF::FileSystemImpl::MappedFileData::mapFileHandle):
(WTF::FileSystemImpl::readOrMakeSalt):
(WTF::FileSystemImpl::overwriteEntireFile):
* Source/WTF/wtf/FileSystem.h:
* Source/WTF/wtf/glib/FileSystemGlib.cpp:
(WTF::FileSystemImpl::openFile):
* Source/WTF/wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::openFile):
* Source/WTF/wtf/win/FileSystemWin.cpp:
(WTF::FileSystemImpl::openFile):
(WTF::FileSystemImpl::MappedFileData::mapFileHandle):
* Source/WebCore/Modules/webdatabase/OriginLock.cpp:
* Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
* Source/WebCore/platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::writeBlobToFilePath):
* Source/WebCore/platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::flagDatabaseCorruption):
* Source/WebCore/platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::saveResponseHeaders):
(WebCore::CurlCacheEntry::openContentFile):
* Source/WebCore/platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::saveIndex):
* Source/WebCore/workers/service/server/SWScriptStorage.cpp:
(WebCore::SWScriptStorage::store):
* Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::download):
* Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerDownloadTask.cpp:
(WebKit::ServiceWorkerDownloadTask::setPendingDownloadLocation):
* Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::writeSizeFile):
* Source/WebKit/NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::dumpContentsToFile):
* Source/WebKit/NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp:
(WebKit::NetworkCache::IOChannel::IOChannel):
* Source/WebKit/NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::invokeDidReceiveResponse):
* Source/WebKit/NetworkProcess/storage/CacheStorageManager.cpp:
(WebKit::writeCachesList):
* Source/WebKit/Shared/PersistencyUtils.cpp:
(WebKit::writeToDisk):
* Source/WebKit/Shared/WebMemorySampler.cpp:
(WebKit::WebMemorySampler::initializeSandboxedLogFile):
* Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::writeSandboxDataToCacheFile):
* Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp:
(API::ContentRuleListStore::invalidateContentRuleListVersion):
* Source/WebKit/UIProcess/ios/WKModelView.mm:
(-[WKModelView createFileForModel:]):
* Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm:
(WebKit::ARKitInlinePreviewModelPlayerMac::createFile):
* Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp:
(TestWebKitAPI::createTestFile):
(TestWebKitAPI::TEST_F):
* Tools/TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:
(TestWebKitAPI::TEST_F):
* Tools/TestWebKitAPI/Tests/WebCore/cocoa/DatabaseTrackerTest.mm:
(TestWebKitAPI::createFileAtPath):

Canonical link: https://commits.webkit.org/259689@main




More information about the webkit-changes mailing list