[webkit-changes] [WebKit/WebKit] 981e41: Add assertion in CacheStorageRecordInformation to ...

Sihui noreply at github.com
Wed Oct 30 09:56:29 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 981e412577e1141c506393efe25669b78a6819d5
      https://github.com/WebKit/WebKit/commit/981e412577e1141c506393efe25669b78a6819d5
  Author: Sihui Liu <sihui_liu at apple.com>
  Date:   2024-10-30 (Wed, 30 Oct 2024)

  Changed paths:
    M Source/WebKit/NetworkProcess/storage/CacheStorageCache.cpp
    M Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.cpp
    M Source/WebKit/NetworkProcess/storage/CacheStorageManager.h
    M Source/WebKit/NetworkProcess/storage/CacheStorageMemoryStore.cpp
    A Source/WebKit/NetworkProcess/storage/CacheStorageRecord.cpp
    M Source/WebKit/NetworkProcess/storage/CacheStorageRecord.h
    M Source/WebKit/NetworkProcess/storage/CacheStorageStore.h
    M Source/WebKit/Sources.txt
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj

  Log Message:
  -----------
  Add assertion in CacheStorageRecordInformation to ensure URL does not have AtomString
https://bugs.webkit.org/show_bug.cgi?id=282307
rdar://138880442

Reviewed by Youenn Fablet.

CrashTracer indicates the assertion in CacheStorageCache::findExistingRecord is hit, which means url in stored records
contains AtomString. This is unexpected because CacheStorageRecordInformation (and its members) stored in
CacheStorageCache::m_records should be created with isolatedCopy(). To figure out how CacheStorageRecordInformation
gets an AtomString URL, this patch makes CacheStorageRecordInformation a class and adds assertions in constructor and
URL setter.

* Source/WebKit/NetworkProcess/storage/CacheStorageCache.cpp:
(WebKit::CacheStorageCache::getSize):
(WebKit::CacheStorageCache::open):
(WebKit::toCacheStorageRecord):
(WebKit::CacheStorageCache::retrieveRecords):
(WebKit::CacheStorageCache::removeRecords):
(WebKit::CacheStorageCache::findExistingRecord):
(WebKit::CacheStorageCache::putRecords):
(WebKit::CacheStorageCache::putRecordsAfterQuotaCheck):
(WebKit::CacheStorageCache::putRecordsInStore):
(WebKit::CacheStorageCache::removeAllRecords):
* Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.cpp:
(WebKit::readRecordInfoFromFileData):
(WebKit::CacheStorageDiskStore::readRecordsInternal):
(WebKit::CacheStorageDiskStore::deleteRecords):
(WebKit::encodeRecordHeader):
(WebKit::CacheStorageDiskStore::writeRecords):
* Source/WebKit/NetworkProcess/storage/CacheStorageManager.h:
* Source/WebKit/NetworkProcess/storage/CacheStorageMemoryStore.cpp:
(WebKit::CacheStorageMemoryStore::readRecords):
(WebKit::CacheStorageMemoryStore::deleteRecords):
(WebKit::CacheStorageMemoryStore::writeRecords):
* Source/WebKit/NetworkProcess/storage/CacheStorageRecord.cpp: Added.
(WebKit::CacheStorageRecordInformation::CacheStorageRecordInformation):
(WebKit::CacheStorageRecordInformation::updateVaryHeaders):
(WebKit::CacheStorageRecordInformation::isolatedCopy):
(WebKit::CacheStorageRecordInformation::setURL):
* Source/WebKit/NetworkProcess/storage/CacheStorageRecord.h:
(WebKit::CacheStorageRecordInformation::key const):
(WebKit::CacheStorageRecordInformation::insertionTime const):
(WebKit::CacheStorageRecordInformation::identifier const):
(WebKit::CacheStorageRecordInformation::updateResponseCounter const):
(WebKit::CacheStorageRecordInformation::size const):
(WebKit::CacheStorageRecordInformation::url const):
(WebKit::CacheStorageRecordInformation::hasVaryStar const):
(WebKit::CacheStorageRecordInformation::varyHeaders const):
(WebKit::CacheStorageRecordInformation::setKey):
(WebKit::CacheStorageRecordInformation::setSize):
(WebKit::CacheStorageRecordInformation::setIdentifier):
(WebKit::CacheStorageRecordInformation::setUpdateResponseCounter):
(WebKit::CacheStorageRecordInformation::setInsertionTime):
(WebKit::CacheStorageRecordInformation::updateVaryHeaders): Deleted.
(WebKit::CacheStorageRecordInformation::isolatedCopy): Deleted.
* Source/WebKit/NetworkProcess/storage/CacheStorageStore.h:
* Source/WebKit/Sources.txt:
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list