Bug Summary

File:Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/Source/WebCore/loader/LinkPreloadResourceClients.h
Warning:line 69, column 9
Call argument for 'this' parameter is uncounted and unsafe

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple arm64-apple-ios26.2.0-simulator -O3 -Wundef-prefix=TARGET_OS_ -Werror=undef-prefix -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name UnifiedSource282.cpp -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=osx -analyzer-checker=security.insecureAPI.decodeValueOfObjCType -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -ffp-contract=on -fno-rounding-math -target-sdk-version=26.2 -fdepfile-entry=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/SDKSettings.json -fcompatibility-qualified-id-block-type-checking -fvisibility-inlines-hidden-static-local-var -fno-modulemap-allow-subdirectory-search -fdefine-target-os-macros -enable-tlsdesc -target-cpu apple-m1 -target-feature +v8.4a -target-feature +aes -target-feature +altnzcv -target-feature +ccdp -target-feature +ccpp -target-feature +complxnum -target-feature +crc -target-feature +dotprod -target-feature +flagm -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +fptoint -target-feature +fullfp16 -target-feature +jsconv -target-feature +lse -target-feature +neon -target-feature +pauth -target-feature +perfmon -target-feature +predres -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sb -target-feature +sha2 -target-feature +sha3 -target-feature +specrestrict -target-feature +ssbs -target-abi darwinpcs -dwarf-ext-refs -fmodule-format=obj -debug-info-kind=standalone -dwarf-version=5 -debugger-tuning=lldb -fdebug-compilation-dir=/Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/Source/WebCore -target-linker-version 1230.1 -fcoverage-compilation-dir=/Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/Source/WebCore -resource-dir /Users/buildbot/Library/Developer/Toolchains/swift-webkit.xctoolchain/usr/lib/clang/21 -dependency-file /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/scan-build-output/StaticAnalyzer/WebCore/WebCore/normal/arm64/UnifiedSource282.d -skip-unused-modulemap-deps -MT dependencies -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk -iquote /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/WebCore.build/Release-iphonesimulator/WebCore.build/WebCore-generated-files.hmap -iquote /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/WebCore.build/Release-iphonesimulator/WebCore.build/WebCore-project-headers.hmap -isystem /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/Source/WebCore/PAL/ThirdParty/dav1d/include -isystem /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator/SDKAdditions/usr/include -iframework /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator/SDKAdditions/System/Library/Frameworks -iframework /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitLibraries/SDKs/iphonesimulator26.0-additions.sdk/System/Library/PrivateFrameworks -iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/System/Library/Frameworks -include-pch /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/PrecompiledHeaders/SharedPrecompiledHeaders/11721353671419897710/WebCorePrefix.h.gch -D _LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D NDEBUG -D BUILDING_WEBKIT -D GL_SILENCE_DEPRECATION=1 -D GLES_SILENCE_DEPRECATION=1 -D __clang_analyzer__ -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/WebCore.build/Release-iphonesimulator/WebCore.build/WebCore-own-target-headers.hmap -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/WebCore.build/Release-iphonesimulator/WebCore.build/WebCore-all-target-headers.hmap -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator/include -I PAL -I ForwardingHeaders -I /usr/include/libxslt -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/usr/include/libxml2 -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator/DerivedSources/WebCore -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator/usr/local/include -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator/usr/local/include/WebKitAdditions -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/usr/local/include/WebKitAdditions -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator/usr/local/include -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitLibraries/SDKs/iphonesimulator26.0-additions.sdk/usr/local/include -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/usr/local/include -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator/usr/local/include/webrtc -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/usr/local/include/webrtc -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator/usr/local/include/webm -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/usr/local/include/webm -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/PAL.build/PAL.build/DerivedSources -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/PAL.build/Release-iphonesimulator/PAL.build/DerivedSources -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/Source/WebCore -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/WebCore.build/Release-iphonesimulator/WebCore.build/DerivedSources-normal/arm64 -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/WebCore.build/Release-iphonesimulator/WebCore.build/DerivedSources/arm64 -I /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/WebCore.build/Release-iphonesimulator/WebCore.build/DerivedSources -F/Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator -F/Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator -I/usr/local/include -stdlib=libc++ -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/usr/local/include -internal-isystem /Users/buildbot/Library/Developer/Toolchains/swift-webkit.xctoolchain/usr/lib/clang/21/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/usr/include -internal-iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/System/Library/Frameworks -internal-iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/System/Library/SubFrameworks -internal-iframework /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator26.2.sdk/Library/Frameworks -Wno-trigraphs -Werror -Wno-missing-field-initializers -Wmissing-prototypes -Wunreachable-code -Wnon-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wsign-compare -Wno-shorten-64-to-32 -Wnewline-eof -Wno-c++11-extensions -Wno-implicit-fallthrough -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -Wall -Wc99-designator -Wconditional-uninitialized -Wextra -Wdeprecated-enum-enum-conversion -Wdeprecated-enum-float-conversion -Wenum-float-conversion -Wfinal-dtor-non-final-class -Wformat=2 -Wmisleading-indentation -Wpointer-to-int-cast -Wreorder-init-list -Wundef -Wunused-but-set-variable -Wvla -Werror=unguarded-availability -Wno-elaborated-enum-base -Wcast-qual -Wchar-subscripts -Wextra-tokens -Winit-self -Wmissing-noreturn -Wpacked -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wexit-time-destructors -Wglobal-constructors -Wtautological-compare -Wimplicit-fallthrough -Wvla -Wno-unknown-warning-option -Wliteral-conversion -Wthread-safety -Wno-profile-instr-out-of-date -Wno-profile-instr-unprofiled -Wno-backend-plugin -Wunsafe-buffer-usage -std=c++2b -fdeprecated-macro -ferror-limit 19 -fmacro-backtrace-limit=0 -fvisibility=hidden -fvisibility-inlines-hidden -stack-protector 1 -fblocks -fencode-extended-block-signature -fno-rtti -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fno-implicit-modules -fskip-odr-check-in-gmf -fpascal-strings -fmax-type-align=16 -fdiagnostics-show-note-include-stack -vectorize-loops -vectorize-slp -fsafe-buffer-usage-suggestions -analyzer-output=html -analyzer-config report-in-main-source-file=true -analyzer-config nullability:NoDiagnoseCallsToSystemHeaders=true -analyzer-checker optin.osx.cocoa.localizability.NonLocalizedStringChecker -analyzer-checker security.insecureAPI.UncheckedReturn -analyzer-checker security.insecureAPI.getpw -analyzer-checker security.insecureAPI.gets -analyzer-checker security.insecureAPI.mkstemp -analyzer-checker security.insecureAPI.mktemp -analyzer-disable-checker security.insecureAPI.rand -analyzer-disable-checker security.insecureAPI.strcpy -analyzer-checker security.insecureAPI.vfork -analyzer-disable-checker alpha,apiModeling,core,cplusplus,deadcode,debug,fuchsia,nullability,optin,osx,security,unix,webkit -analyzer-checker alpha.webkit.ForwardDeclChecker,alpha.webkit.MemoryUnsafeCastChecker,alpha.webkit.NoDeleteChecker,alpha.webkit.NoUncheckedPtrMemberChecker,alpha.webkit.NoUnretainedMemberChecker,alpha.webkit.RetainPtrCtorAdoptChecker,alpha.webkit.UncheckedCallArgsChecker,alpha.webkit.UncheckedLocalVarsChecker,alpha.webkit.UncountedCallArgsChecker,alpha.webkit.UncountedLocalVarsChecker,alpha.webkit.UnretainedCallArgsChecker,alpha.webkit.UnretainedLambdaCapturesChecker,alpha.webkit.UnretainedLocalVarsChecker,webkit.NoUncountedMemberChecker,webkit.RefCntblBaseVirtualDtor,webkit.UncountedLambdaCapturesChecker -analyzer-config max-nodes=10000000 -analyzer-config verbose-report-filename=true -fdwarf2-cfi-asm -o /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/scan-build-output/StaticAnalyzer/WebCore/WebCore/normal/arm64/UnifiedSource282.plist -x c++ /Volumes/Data/worker/Apple-iOS-26-Safer-CPP-Checks-EWS/build/WebKitBuild/Release-iphonesimulator/DerivedSources/WebCore/unified-sources/UnifiedSource282.cpp
1/*
2 * Copyright 2016 The Chromium Authors. All rights reserved.
3 * Copyright (C) 2016 Akamai Technologies Inc. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#pragma once
28
29#include "CachedCSSStyleSheet.h"
30#include "CachedFont.h"
31#include "CachedFontClient.h"
32#include <WebCore/CachedImage.h>
33#include <WebCore/CachedImageClient.h>
34#include <WebCore/CachedRawResource.h>
35#include <WebCore/CachedRawResourceClient.h>
36#include <WebCore/CachedResourceHandle.h>
37#include "CachedScript.h"
38#include <WebCore/CachedStyleSheetClient.h>
39#include "CachedTextTrack.h"
40#include <wtf/AbstractRefCounted.h>
41#include <wtf/RefCounted.h>
42#include <wtf/WeakPtr.h>
43
44namespace WebCore {
45
46class LinkLoader;
47
48class LinkPreloadResourceClient : public AbstractRefCounted {
49public:
50 virtual ~LinkPreloadResourceClient() = default;
51
52 void triggerEvents(const CachedResource&);
53
54 virtual void clear() = 0;
55
56protected:
57 LinkPreloadResourceClient(LinkLoader&, CachedResource&);
58
59 void addResource(CachedResourceClient& client)
60 {
61 m_resource->addClient(client);
62 }
63
64 void clearResource(CachedResourceClient& client)
65 {
66 if (!m_resource)
67 return;
68
69 m_resource->removeClient(client);
Call argument for 'this' parameter is uncounted and unsafe
70 m_resource = nullptr;
71 }
72
73 CachedResource* ownedResource() { return m_resource.get(); }
74
75private:
76 SingleThreadWeakPtr<LinkLoader> m_loader;
77 CachedResourceHandle<CachedResource> m_resource;
78};
79
80class LinkPreloadDefaultResourceClient : public LinkPreloadResourceClient, CachedResourceClient, public RefCounted<LinkPreloadDefaultResourceClient> {
81 WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(LinkPreloadDefaultResourceClient, Loader)public: static_assert(!WTF::usesTZoneHeap<LinkPreloadDefaultResourceClient
>(), "Decendents of TZONE_ALLOCATED classes must also be TZONE_ALLOCATED"
); void* operator new(size_t, void* p) { return p; } void* operator
new[](size_t, void* p) { return p; } void* operator new(size_t
size) { return ::WTF::fastMalloc(size); } void operator delete
(void* p) { ::WTF::fastFree(p); } void* operator new[](size_t
size) { return ::WTF::fastMalloc(size); } void operator delete
[](void* p) { ::WTF::fastFree(p); } void* operator new(size_t
, NotNullTag, void* location) { ((void)0); return location; }
static void freeAfterDestruction(void* p) { ::WTF::fastFree(
p); } using WTFIsFastMallocAllocated = int; private: using __thisIsHereToForceASemicolonAfterThisMacro
__attribute__((unused)) = int
;
82public:
83 static Ref<LinkPreloadDefaultResourceClient> create(LinkLoader& loader, CachedResource& resource)
84 {
85 return adoptRef(*new LinkPreloadDefaultResourceClient(loader, resource));
86 }
87
88 // LinkPreloadResourceClient.
89 void ref() const final { RefCounted::ref(); }
90 void deref() const final { RefCounted::deref(); }
91
92private:
93 LinkPreloadDefaultResourceClient(LinkLoader& loader, CachedResource& resource)
94 : LinkPreloadResourceClient(loader, resource)
95 {
96 addResource(*this);
97 }
98
99 void notifyFinished(CachedResource& resource, const NetworkLoadMetrics&, LoadWillContinueInAnotherProcess) final { triggerEvents(resource); }
100 void clear() final { clearResource(*this); }
101 bool shouldMarkAsReferenced() const final { return false; }
102};
103
104class LinkPreloadStyleResourceClient : public LinkPreloadResourceClient, public CachedStyleSheetClient, public RefCounted<LinkPreloadStyleResourceClient> {
105 WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(LinkPreloadStyleResourceClient, Loader)public: static_assert(!WTF::usesTZoneHeap<LinkPreloadStyleResourceClient
>(), "Decendents of TZONE_ALLOCATED classes must also be TZONE_ALLOCATED"
); void* operator new(size_t, void* p) { return p; } void* operator
new[](size_t, void* p) { return p; } void* operator new(size_t
size) { return ::WTF::fastMalloc(size); } void operator delete
(void* p) { ::WTF::fastFree(p); } void* operator new[](size_t
size) { return ::WTF::fastMalloc(size); } void operator delete
[](void* p) { ::WTF::fastFree(p); } void* operator new(size_t
, NotNullTag, void* location) { ((void)0); return location; }
static void freeAfterDestruction(void* p) { ::WTF::fastFree(
p); } using WTFIsFastMallocAllocated = int; private: using __thisIsHereToForceASemicolonAfterThisMacro
__attribute__((unused)) = int
;
106public:
107 static Ref<LinkPreloadStyleResourceClient> create(LinkLoader& loader, CachedCSSStyleSheet& resource)
108 {
109 return adoptRef(*new LinkPreloadStyleResourceClient(loader, resource));
110 }
111
112 // LinkPreloadResourceClient.
113 void ref() const final { RefCounted::ref(); }
114 void deref() const final { RefCounted::deref(); }
115
116private:
117 LinkPreloadStyleResourceClient(LinkLoader& loader, CachedCSSStyleSheet& resource)
118 : LinkPreloadResourceClient(loader, resource)
119 {
120 addResource(*this);
121 }
122
123 void setCSSStyleSheet(const String&, const URL&, ASCIILiteral, const CachedCSSStyleSheet* resource) final
124 {
125 ASSERT(resource)((void)0);
126 ASSERT(ownedResource() == resource)((void)0);
127 triggerEvents(*resource);
128 }
129
130 void clear() final { clearResource(*this); }
131 bool shouldMarkAsReferenced() const final { return false; }
132};
133
134class LinkPreloadImageResourceClient : public LinkPreloadResourceClient, public CachedImageClient, public RefCounted<LinkPreloadImageResourceClient> {
135 WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(LinkPreloadImageResourceClient, Loader)public: static_assert(!WTF::usesTZoneHeap<LinkPreloadImageResourceClient
>(), "Decendents of TZONE_ALLOCATED classes must also be TZONE_ALLOCATED"
); void* operator new(size_t, void* p) { return p; } void* operator
new[](size_t, void* p) { return p; } void* operator new(size_t
size) { return ::WTF::fastMalloc(size); } void operator delete
(void* p) { ::WTF::fastFree(p); } void* operator new[](size_t
size) { return ::WTF::fastMalloc(size); } void operator delete
[](void* p) { ::WTF::fastFree(p); } void* operator new(size_t
, NotNullTag, void* location) { ((void)0); return location; }
static void freeAfterDestruction(void* p) { ::WTF::fastFree(
p); } using WTFIsFastMallocAllocated = int; private: using __thisIsHereToForceASemicolonAfterThisMacro
__attribute__((unused)) = int
;
136public:
137 static Ref<LinkPreloadImageResourceClient> create(LinkLoader& loader, CachedImage& resource)
138 {
139 return adoptRef(*new LinkPreloadImageResourceClient(loader, resource));
140 }
141
142 // LinkPreloadResourceClient.
143 void ref() const final { RefCounted::ref(); }
144 void deref() const final { RefCounted::deref(); }
145
146private:
147 LinkPreloadImageResourceClient(LinkLoader& loader, CachedImage& resource)
148 : LinkPreloadResourceClient(loader, resource)
149 {
150 addResource(*this);
151 }
152
153 void notifyFinished(CachedResource& resource, const NetworkLoadMetrics&, LoadWillContinueInAnotherProcess) final { triggerEvents(resource); }
154 void clear() final { clearResource(*this); }
155 bool shouldMarkAsReferenced() const final { return false; }
156};
157
158class LinkPreloadFontResourceClient : public LinkPreloadResourceClient, public CachedFontClient, public RefCounted<LinkPreloadFontResourceClient> {
159 WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(LinkPreloadFontResourceClient, Loader)public: static_assert(!WTF::usesTZoneHeap<LinkPreloadFontResourceClient
>(), "Decendents of TZONE_ALLOCATED classes must also be TZONE_ALLOCATED"
); void* operator new(size_t, void* p) { return p; } void* operator
new[](size_t, void* p) { return p; } void* operator new(size_t
size) { return ::WTF::fastMalloc(size); } void operator delete
(void* p) { ::WTF::fastFree(p); } void* operator new[](size_t
size) { return ::WTF::fastMalloc(size); } void operator delete
[](void* p) { ::WTF::fastFree(p); } void* operator new(size_t
, NotNullTag, void* location) { ((void)0); return location; }
static void freeAfterDestruction(void* p) { ::WTF::fastFree(
p); } using WTFIsFastMallocAllocated = int; private: using __thisIsHereToForceASemicolonAfterThisMacro
__attribute__((unused)) = int
;
160public:
161 static Ref<LinkPreloadFontResourceClient> create(LinkLoader& loader, CachedFont& resource)
162 {
163 return adoptRef(*new LinkPreloadFontResourceClient(loader, resource));
164 }
165
166 // LinkPreloadResourceClient.
167 void ref() const final { RefCounted::ref(); }
168 void deref() const final { RefCounted::deref(); }
169
170private:
171 LinkPreloadFontResourceClient(LinkLoader& loader, CachedFont& resource)
172 : LinkPreloadResourceClient(loader, resource)
173 {
174 addResource(*this);
175 }
176
177 void fontLoaded(CachedFont& resource) final
178 {
179 ASSERT(ownedResource() == &resource)((void)0);
180 triggerEvents(resource);
181 }
182
183 void clear() final { clearResource(*this); }
184 bool shouldMarkAsReferenced() const final { return false; }
185};
186
187class LinkPreloadRawResourceClient : public LinkPreloadResourceClient, public CachedRawResourceClient, public RefCounted<LinkPreloadRawResourceClient> {
188 WTF_DEPRECATED_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(LinkPreloadRawResourceClient, Loader)public: static_assert(!WTF::usesTZoneHeap<LinkPreloadRawResourceClient
>(), "Decendents of TZONE_ALLOCATED classes must also be TZONE_ALLOCATED"
); void* operator new(size_t, void* p) { return p; } void* operator
new[](size_t, void* p) { return p; } void* operator new(size_t
size) { return ::WTF::fastMalloc(size); } void operator delete
(void* p) { ::WTF::fastFree(p); } void* operator new[](size_t
size) { return ::WTF::fastMalloc(size); } void operator delete
[](void* p) { ::WTF::fastFree(p); } void* operator new(size_t
, NotNullTag, void* location) { ((void)0); return location; }
static void freeAfterDestruction(void* p) { ::WTF::fastFree(
p); } using WTFIsFastMallocAllocated = int; private: using __thisIsHereToForceASemicolonAfterThisMacro
__attribute__((unused)) = int
;
189public:
190 static Ref<LinkPreloadRawResourceClient> create(LinkLoader& loader, CachedRawResource& resource)
191 {
192 return adoptRef(*new LinkPreloadRawResourceClient(loader, resource));
193 }
194
195 // LinkPreloadResourceClient.
196 void ref() const final { RefCounted::ref(); }
197 void deref() const final { RefCounted::deref(); }
198
199private:
200 LinkPreloadRawResourceClient(LinkLoader& loader, CachedRawResource& resource)
201 : LinkPreloadResourceClient(loader, resource)
202 {
203 addResource(*this);
204 }
205
206 void notifyFinished(CachedResource& resource, const NetworkLoadMetrics&, LoadWillContinueInAnotherProcess) final { triggerEvents(resource); }
207 void clear() final { clearResource(*this); }
208 bool shouldMarkAsReferenced() const final { return false; }
209};
210
211}