[webkit-changes] [WebKit/WebKit] 98761d: Lazily allocate ResourceResponse within CachedReso...

mattwoodrow noreply at github.com
Fri Feb 24 00:21:52 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 98761d6864f7dac2f22655a51bb8a00a2172edc3
      https://github.com/WebKit/WebKit/commit/98761d6864f7dac2f22655a51bb8a00a2172edc3
  Author: Matt Woodrow <mattwoodrow at apple.com>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    M Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
    M Source/WebCore/loader/cache/CachedImage.cpp
    M Source/WebCore/loader/cache/CachedRawResource.cpp
    M Source/WebCore/loader/cache/CachedResource.cpp
    M Source/WebCore/loader/cache/CachedResource.h
    M Source/WebCore/loader/cache/CachedScript.cpp
    M Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp

  Log Message:
  -----------
  Lazily allocate ResourceResponse within CachedResource
https://bugs.webkit.org/show_bug.cgi?id=252637

Reviewed by Cameron McCormack.

CachedResource objects often don't have an initialised ResourceResponse, especially in the case of Fonts.

We can move the ResourceResponse (and associated response data) into a lazily allocated inner structure to save memory

* Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::didAddClient):
(WebCore::CachedCSSStyleSheet::checkNotify):
(WebCore::CachedCSSStyleSheet::responseMIMEType const):
(WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff const):
* Source/WebCore/loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage):
(WebCore::CachedImage::isPDFResource const):
(WebCore::CachedImage::isPostScriptResource const):
(WebCore::CachedImage::responseReceived):
* Source/WebCore/loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::didAddClient):
(WebCore::CachedRawResource::responseReceived):
(WebCore::CachedRawResource::previewResponseReceived):
* Source/WebCore/loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::setBodyDataFrom):
(WebCore::CachedResource::cancelLoad):
(WebCore::CachedResource::isExpired const):
(WebCore::CachedResource::setResponse):
(WebCore::CachedResource::didAddClient):
(WebCore::CachedResource::addClientToSet):
(WebCore::CachedResource::destroyDecodedDataIfNeeded):
(WebCore::CachedResource::setDecodedSize):
(WebCore::CachedResource::setEncodedSize):
(WebCore::CachedResource::updateResponseAfterRevalidation):
(WebCore::CachedResource::canUseCacheValidator const):
(WebCore::CachedResource::makeRevalidationDecision const):
(WebCore::CachedResource::overheadSize const):
(WebCore::CachedResource::ResponseData::ResponseData):
(WebCore::CachedResource::mutableResponseData const):
(WebCore::CachedResource::mutableResponse):
(WebCore::CachedResource::response const):
(WebCore::CachedResource::stopDecodedDataDeletionTimer):
(WebCore::CachedResource::restartDecodedDataDeletionTimer):
(WebCore::CachedResource::resourceError const):
(WebCore::CachedResource::wasCanceled const):
(WebCore::CachedResource::loadFailedOrCanceled const):
(WebCore::CachedResource::encodedSize const):
(WebCore::CachedResource::decodedSize const):
* Source/WebCore/loader/cache/CachedResource.h:
(WebCore::CachedResource::setResourceError):
(WebCore::CachedResource::mimeType const):
(WebCore::CachedResource::expectedContentLength const):
(WebCore::CachedResource::takeNetworkLoadMetrics):
(WebCore::CachedResource::resourceError const): Deleted.
(WebCore::CachedResource::encodedSize const): Deleted.
(WebCore::CachedResource::decodedSize const): Deleted.
(WebCore::CachedResource::response const): Deleted.
(WebCore::CachedResource::wasCanceled const): Deleted.
(WebCore::CachedResource::loadFailedOrCanceled const): Deleted.
* Source/WebCore/loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script):
* Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::didAddClient):
(WebCore::CachedXSLStyleSheet::checkNotify):

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




More information about the webkit-changes mailing list