Skip to content

Commit

Permalink
Use more smart pointers in SubresourceLoader
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=263999

Reviewed by Chris Dumez.

* Source/WebCore/loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::protectedDocumentLoader const):
* Source/WebCore/loader/ResourceLoader.h:
(WebCore::ResourceLoader::protectedCachedResource const):
* Source/WebCore/loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::init):
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::SubresourceLoader::didSendData):
(WebCore::SubresourceLoader::didReceivePreviewResponse):
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::didReceiveBuffer):
(WebCore::SubresourceLoader::responseHasHTTPStatusCodeError const):
(WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::didFail):
(WebCore::SubresourceLoader::willCancel):
(WebCore::SubresourceLoader::didCancel):
(WebCore::SubresourceLoader::notifyDone):
(WebCore::SubresourceLoader::releaseResources):
(WebCore::SubresourceLoader::reportResourceTiming):

Canonical link: https://commits.webkit.org/270049@main
  • Loading branch information
fujii committed Nov 1, 2023
1 parent 9860d77 commit 85c7594
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 77 deletions.
5 changes: 5 additions & 0 deletions Source/WebCore/loader/ResourceLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ FrameLoader* ResourceLoader::frameLoader() const
return &m_frame->loader();
}

RefPtr<DocumentLoader> ResourceLoader::protectedDocumentLoader() const
{
return m_documentLoader;
}

void ResourceLoader::loadDataURL()
{
auto url = m_request.url();
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/loader/ResourceLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#pragma once

#include "CachedResourceHandle.h"
#include "ResourceHandleClient.h"
#include "ResourceLoadTiming.h"
#include "ResourceLoaderIdentifier.h"
Expand Down Expand Up @@ -80,6 +81,7 @@ class ResourceLoader : public CanMakeWeakPtr<ResourceLoader>, public RefCounted<

WEBCORE_EXPORT FrameLoader* frameLoader() const;
DocumentLoader* documentLoader() const { return m_documentLoader.get(); }
RefPtr<DocumentLoader> protectedDocumentLoader() const;
const ResourceRequest& originalRequest() const { return m_originalRequest; }

WEBCORE_EXPORT void start();
Expand Down Expand Up @@ -136,6 +138,7 @@ class ResourceLoader : public CanMakeWeakPtr<ResourceLoader>, public RefCounted<
WEBCORE_EXPORT bool shouldIncludeCertificateInfo() const;

virtual CachedResource* cachedResource() const { return nullptr; }
CachedResourceHandle<CachedResource> protectedCachedResource() const { return cachedResource(); }

bool reachedTerminalState() const { return m_reachedTerminalState; }

Expand Down
Loading

0 comments on commit 85c7594

Please sign in to comment.