Skip to content

Commit

Permalink
Add a Loader malloc heap zone
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=260623
rdar://114340888

Reviewed by Brent Fulgham and Simon Fraser.

This adds a generic Loader allocator that fast malloc classes can use in
the loading subsystem. This will allow us to categorize classes with
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER into a loader malloc zone
without the need to make a zone for each class.

Use by including "LoaderMalloc.h" (if necessary) and replacing
WTF_MAKE_FAST_ALLOCATED with
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader) in your loader class.

* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/loader/ApplicationManifestLoader.h:
* Source/WebCore/loader/ContentFilter.h:
* Source/WebCore/loader/CrossOriginPreflightResultCache.h:
* Source/WebCore/loader/DocumentThreadableLoader.h:
* Source/WebCore/loader/FrameLoader.cpp:
* Source/WebCore/loader/FrameLoader.h:
* Source/WebCore/loader/HistoryController.h:
* Source/WebCore/loader/ImageLoader.h:
* Source/WebCore/loader/LinkPreloadResourceClients.h:
* Source/WebCore/loader/LoaderMalloc.cpp: Copied from Source/WebCore/loader/ProgressTrackerClient.h.
* Source/WebCore/loader/LoaderMalloc.h: Copied from Source/WebCore/loader/ProgressTrackerClient.h.
* Source/WebCore/loader/LocalFrameLoaderClient.h:
* Source/WebCore/loader/NavigationDisabler.h:
* Source/WebCore/loader/NavigationScheduler.cpp:
* Source/WebCore/loader/NavigationScheduler.h:
* Source/WebCore/loader/PolicyChecker.h:
* Source/WebCore/loader/ProgressTracker.cpp:
* Source/WebCore/loader/ProgressTracker.h:
* Source/WebCore/loader/ProgressTrackerClient.h:
* Source/WebCore/loader/ResourceLoadObserver.h:
* Source/WebCore/loader/ResourceTiming.h:
* Source/WebCore/loader/SubframeLoader.h:
* Source/WebCore/loader/SubresourceLoader.h:
* Source/WebCore/loader/TextTrackLoader.h:
* Source/WebCore/loader/ThreadableLoaderClient.h:
* Source/WebCore/loader/WorkerThreadableLoader.h:
* Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp:
* Source/WebCore/loader/appcache/ApplicationCacheGroup.h:
* Source/WebCore/loader/appcache/ApplicationCacheHost.h:
* Source/WebCore/loader/archive/ArchiveResourceCollection.h:
* Source/WebCore/loader/cache/CachedFontLoadRequest.h:
* Source/WebCore/loader/cache/CachedResource.h:
* Source/WebCore/loader/cache/CachedResourceLoader.h:
* Source/WebCore/loader/cache/CachedResourceRequestInitiatorTypes.h:
* Source/WebCore/loader/cache/CachedSVGDocumentReference.h:
* Source/WebCore/loader/cache/MemoryCache.h:
* Source/WebCore/loader/icon/IconLoader.h:
* Source/WebCore/loader/ios/LegacyPreviewLoader.h:

Canonical link: https://commits.webkit.org/267205@main
  • Loading branch information
rreno committed Aug 23, 2023
1 parent 346fdad commit 66b6285
Show file tree
Hide file tree
Showing 41 changed files with 131 additions and 42 deletions.
1 change: 1 addition & 0 deletions Source/WebCore/Headers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1363,6 +1363,7 @@ set(WebCore_PRIVATE_FRAMEWORK_HEADERS
loader/LinkLoader.h
loader/LinkLoaderClient.h
loader/LoadSchedulingMode.h
loader/LoaderMalloc.h
loader/LoaderStrategy.h
loader/LocalFrameLoaderClient.h
loader/MediaResourceLoader.h
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/Sources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1777,6 +1777,7 @@ loader/ImageLoader.cpp
loader/LinkHeader.cpp
loader/LinkLoader.cpp
loader/LinkPreloadResourceClients.cpp
loader/LoaderMalloc.cpp
loader/LoaderStrategy.cpp
loader/MediaResourceLoader.cpp
loader/MixedContentChecker.cpp
Expand Down
6 changes: 6 additions & 0 deletions Source/WebCore/WebCore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1567,6 +1567,7 @@
453EB637159C570400001BB7 /* DateTimeFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 453EB635159C570400001BB7 /* DateTimeFormat.h */; settings = {ATTRIBUTES = (Private, ); }; };
45830D4E1679B4F800ACF8C3 /* AutoscrollController.h in Headers */ = {isa = PBXBuildFile; fileRef = 45830D4C1679B4F800ACF8C3 /* AutoscrollController.h */; settings = {ATTRIBUTES = (Private, ); }; };
458FE40A1589DF0B005609E6 /* RenderSearchField.h in Headers */ = {isa = PBXBuildFile; fileRef = 458FE4081589DF0B005609E6 /* RenderSearchField.h */; };
45B5D8612A968620004C85A0 /* LoaderMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 45B5D85F2A968620004C85A0 /* LoaderMalloc.h */; settings = {ATTRIBUTES = (Private, ); }; };
45FEA5D0156DDE8C00654101 /* Decimal.h in Headers */ = {isa = PBXBuildFile; fileRef = 45FEA5CE156DDE8C00654101 /* Decimal.h */; settings = {ATTRIBUTES = (Private, ); }; };
46014ACC28333F65004C0B84 /* FrameDestructionObserverInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 46014ACB28333F52004C0B84 /* FrameDestructionObserverInlines.h */; settings = {ATTRIBUTES = (Private, ); }; };
46037DD528400F3600D464FC /* WebCoreOpaqueRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 46037DD428400F3500D464FC /* WebCoreOpaqueRoot.h */; settings = {ATTRIBUTES = (Private, ); }; };
Expand Down Expand Up @@ -10305,6 +10306,8 @@
45830D4C1679B4F800ACF8C3 /* AutoscrollController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoscrollController.h; sourceTree = "<group>"; };
458FE4071589DF0B005609E6 /* RenderSearchField.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSearchField.cpp; sourceTree = "<group>"; };
458FE4081589DF0B005609E6 /* RenderSearchField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSearchField.h; sourceTree = "<group>"; };
45B5D85E2A968620004C85A0 /* LoaderMalloc.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = LoaderMalloc.cpp; sourceTree = "<group>"; };
45B5D85F2A968620004C85A0 /* LoaderMalloc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoaderMalloc.h; sourceTree = "<group>"; };
45FEA5CD156DDE8C00654101 /* Decimal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Decimal.cpp; sourceTree = "<group>"; };
45FEA5CE156DDE8C00654101 /* Decimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Decimal.h; sourceTree = "<group>"; };
46014ACB28333F52004C0B84 /* FrameDestructionObserverInlines.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FrameDestructionObserverInlines.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -32770,6 +32773,8 @@
984264EF12D5280A000D88A4 /* LinkLoaderClient.h */,
CBB6B2D11CB7ADC6009EDE1A /* LinkPreloadResourceClients.cpp */,
CBB6B2D21CB7ADD0009EDE1A /* LinkPreloadResourceClients.h */,
45B5D85E2A968620004C85A0 /* LoaderMalloc.cpp */,
45B5D85F2A968620004C85A0 /* LoaderMalloc.h */,
51ABF64C16392E2800132A7A /* LoaderStrategy.cpp */,
51E6820F16387302003BBF3C /* LoaderStrategy.h */,
E47FC8A125B84D71005495FC /* LoadSchedulingMode.h */,
Expand Down Expand Up @@ -39609,6 +39614,7 @@
E3B2F0EE1D7F4CA900B0C9D1 /* LoadableScriptClient.h in Headers */,
46C0D8E628F1E70300BDE218 /* LoadableScriptError.h in Headers */,
9759E94914EF1D490026A2DD /* LoadableTextTrack.h in Headers */,
45B5D8612A968620004C85A0 /* LoaderMalloc.h in Headers */,
656D37320ADBA5DE00A4554D /* LoaderNSURLExtras.h in Headers */,
51E6821016387302003BBF3C /* LoaderStrategy.h in Headers */,
E47FC8A325B84D72005495FC /* LoadSchedulingMode.h in Headers */,
Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/loader/ApplicationManifestLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "ApplicationManifest.h"
#include "CachedRawResourceClient.h"
#include "CachedResourceHandle.h"
#include "LoaderMalloc.h"
#include <wtf/CheckedRef.h>
#include <wtf/Noncopyable.h>
#include <wtf/URL.h>
Expand All @@ -40,7 +41,7 @@ class CachedApplicationManifest;
class DocumentLoader;

class ApplicationManifestLoader final : private CachedRawResourceClient {
WTF_MAKE_NONCOPYABLE(ApplicationManifestLoader); WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_NONCOPYABLE(ApplicationManifestLoader); WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
typedef Function<void (CachedResourceHandle<CachedApplicationManifest>)> CompletionHandlerType;

Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/loader/ContentFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#if ENABLE(CONTENT_FILTERING)

#include "CachedResourceHandle.h"
#include "LoaderMalloc.h"
#include "PlatformContentFilter.h"
#include "ResourceError.h"
#include <functional>
Expand All @@ -44,7 +45,7 @@ class ResourceResponse;
class SubstituteData;

class ContentFilter {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
WTF_MAKE_NONCOPYABLE(ContentFilter);

public:
Expand Down
5 changes: 3 additions & 2 deletions Source/WebCore/loader/CrossOriginPreflightResultCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#pragma once

#include "LoaderMalloc.h"
#include "StoredCredentialsPolicy.h"
#include <pal/SessionID.h>
#include <wtf/Expected.h>
Expand All @@ -41,7 +42,7 @@ class HTTPHeaderMap;
class ResourceResponse;

class CrossOriginPreflightResultCacheItem {
WTF_MAKE_NONCOPYABLE(CrossOriginPreflightResultCacheItem); WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_NONCOPYABLE(CrossOriginPreflightResultCacheItem); WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
static Expected<UniqueRef<CrossOriginPreflightResultCacheItem>, String> create(StoredCredentialsPolicy, const ResourceResponse&);

Expand All @@ -64,7 +65,7 @@ class CrossOriginPreflightResultCacheItem {
};

class CrossOriginPreflightResultCache {
WTF_MAKE_NONCOPYABLE(CrossOriginPreflightResultCache); WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_NONCOPYABLE(CrossOriginPreflightResultCache); WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
WEBCORE_EXPORT static CrossOriginPreflightResultCache& singleton();
WEBCORE_EXPORT void appendEntry(PAL::SessionID, const String& origin, const URL&, std::unique_ptr<CrossOriginPreflightResultCacheItem>);
Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/loader/DocumentThreadableLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include "ContentSecurityPolicy.h"
#include "CrossOriginPreflightChecker.h"
#include "LoaderMalloc.h"
#include "ResourceLoaderIdentifier.h"
#include "ResourceResponse.h"
#include "SecurityOrigin.h"
Expand All @@ -46,7 +47,7 @@ namespace WebCore {
class ThreadableLoaderClient;

class DocumentThreadableLoader : public RefCounted<DocumentThreadableLoader>, public ThreadableLoader, public CachedRawResourceClient {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
static void loadResourceSynchronously(Document&, ResourceRequest&&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, RefPtr<SecurityOrigin>&&, std::unique_ptr<ContentSecurityPolicy>&&, std::optional<CrossOriginEmbedderPolicy>&&);
static void loadResourceSynchronously(Document&, ResourceRequest&&, ThreadableLoaderClient&, const ThreadableLoaderOptions&);
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/loader/FrameLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ struct ForbidSynchronousLoadsScope : public PageLevelForbidScope {
};

class FrameLoader::FrameProgressTracker {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
explicit FrameProgressTracker(LocalFrame& frame)
: m_frame(frame)
Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/loader/FrameLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "FrameLoaderStateMachine.h"
#include "FrameLoaderTypes.h"
#include "LayoutMilestone.h"
#include "LoaderMalloc.h"
#include "PageIdentifier.h"
#include "PrivateClickMeasurement.h"
#include "ReferrerPolicy.h"
Expand Down Expand Up @@ -97,7 +98,7 @@ WEBCORE_EXPORT bool isReload(FrameLoadType);
using ContentPolicyDecisionFunction = Function<void(PolicyAction, PolicyCheckIdentifier)>;

class FrameLoader final {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
WTF_MAKE_NONCOPYABLE(FrameLoader);
public:
FrameLoader(LocalFrame&, UniqueRef<LocalFrameLoaderClient>&&);
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/loader/HistoryController.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct StringWithDirection;

class FrameLoader::HistoryController {
WTF_MAKE_NONCOPYABLE(HistoryController);
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
enum HistoryUpdateType { UpdateAll, UpdateAllExceptBackForwardList };

Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/loader/ImageLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "CachedImageClient.h"
#include "CachedResourceHandle.h"
#include "Element.h"
#include "LoaderMalloc.h"
#include "Timer.h"
#include <wtf/Vector.h>
#include <wtf/text/AtomString.h>
Expand All @@ -44,7 +45,7 @@ enum class RelevantMutation : bool { No, Yes };
enum class LazyImageLoadState : uint8_t { None, Deferred, LoadImmediately, FullImage };

class ImageLoader : public CachedImageClient {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
virtual ~ImageLoader();

Expand Down
10 changes: 5 additions & 5 deletions Source/WebCore/loader/LinkPreloadResourceClients.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class LinkPreloadResourceClient {
};

class LinkPreloadDefaultResourceClient : public LinkPreloadResourceClient, CachedResourceClient {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
LinkPreloadDefaultResourceClient(LinkLoader& loader, CachedResource& resource)
: LinkPreloadResourceClient(loader, resource)
Expand All @@ -92,7 +92,7 @@ class LinkPreloadDefaultResourceClient : public LinkPreloadResourceClient, Cache
};

class LinkPreloadStyleResourceClient : public LinkPreloadResourceClient, public CachedStyleSheetClient {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
LinkPreloadStyleResourceClient(LinkLoader& loader, CachedCSSStyleSheet& resource)
: LinkPreloadResourceClient(loader, resource)
Expand All @@ -113,7 +113,7 @@ class LinkPreloadStyleResourceClient : public LinkPreloadResourceClient, public
};

class LinkPreloadImageResourceClient : public LinkPreloadResourceClient, public CachedImageClient {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
LinkPreloadImageResourceClient(LinkLoader& loader, CachedImage& resource)
: LinkPreloadResourceClient(loader, resource)
Expand All @@ -128,7 +128,7 @@ class LinkPreloadImageResourceClient : public LinkPreloadResourceClient, public
};

class LinkPreloadFontResourceClient : public LinkPreloadResourceClient, public CachedFontClient {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
LinkPreloadFontResourceClient(LinkLoader& loader, CachedFont& resource)
: LinkPreloadResourceClient(loader, resource)
Expand All @@ -148,7 +148,7 @@ class LinkPreloadFontResourceClient : public LinkPreloadResourceClient, public C
};

class LinkPreloadRawResourceClient : public LinkPreloadResourceClient, public CachedRawResourceClient {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
LinkPreloadRawResourceClient(LinkLoader& loader, CachedRawResource& resource)
: LinkPreloadResourceClient(loader, resource)
Expand Down
31 changes: 31 additions & 0 deletions Source/WebCore/loader/LoaderMalloc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (C) 2023 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "config.h"
#include "LoaderMalloc.h"

namespace WebCore {
DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(Loader);
}
32 changes: 32 additions & 0 deletions Source/WebCore/loader/LoaderMalloc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright (C) 2023 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#pragma once

#include <wtf/FastMalloc.h>

namespace WebCore {
DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(Loader);
}
3 changes: 2 additions & 1 deletion Source/WebCore/loader/LocalFrameLoaderClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "FrameLoaderClient.h"
#include "LayoutMilestone.h"
#include "LinkIcon.h"
#include "LoaderMalloc.h"
#include "RegistrableDomain.h"
#include "ResourceLoaderIdentifier.h"
#include <wtf/Expected.h>
Expand Down Expand Up @@ -102,7 +103,7 @@ enum class WasPrivateRelayed : bool;
struct StringWithDirection;

class WEBCORE_EXPORT LocalFrameLoaderClient : public FrameLoaderClient {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
// An inline function cannot be the first non-abstract virtual function declared
// in the class as it results in the vtable being generated as a weak symbol.
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/loader/NavigationDisabler.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
namespace WebCore {

class NavigationDisabler {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
NavigationDisabler(LocalFrame* frame)
: m_frame(frame)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/loader/NavigationScheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace WebCore {
unsigned NavigationDisabler::s_globalNavigationDisableCount = 0;

class ScheduledNavigation {
WTF_MAKE_NONCOPYABLE(ScheduledNavigation); WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_NONCOPYABLE(ScheduledNavigation); WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
ScheduledNavigation(double delay, LockHistory lockHistory, LockBackForwardList lockBackForwardList, bool wasDuringLoad, bool isLocationChange)
: m_delay(delay)
Expand Down
3 changes: 2 additions & 1 deletion Source/WebCore/loader/NavigationScheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#pragma once

#include "FrameLoaderTypes.h"
#include "LoaderMalloc.h"
#include "Timer.h"
#include <wtf/CompletionHandler.h>
#include <wtf/Forward.h>
Expand All @@ -47,7 +48,7 @@ class SecurityOrigin;
enum class NewLoadInProgress : bool { No, Yes };

class NavigationScheduler {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
explicit NavigationScheduler(Frame&);
~NavigationScheduler();
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/loader/PolicyChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ enum class PolicyDecisionMode { Synchronous, Asynchronous };

class FrameLoader::PolicyChecker : public CanMakeWeakPtr<FrameLoader::PolicyChecker> {
WTF_MAKE_NONCOPYABLE(PolicyChecker);
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
explicit PolicyChecker(LocalFrame&);

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/loader/ProgressTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static const unsigned minumumBytesPerHeartbeatForProgress = 1024;
static const Seconds progressNotificationTimeInterval { 200_ms };

struct ProgressItem {
WTF_MAKE_NONCOPYABLE(ProgressItem); WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_NONCOPYABLE(ProgressItem); WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
explicit ProgressItem(long long length)
: bytesReceived(0)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/loader/ProgressTracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct ProgressItem;

class ProgressTracker {
WTF_MAKE_NONCOPYABLE(ProgressTracker);
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
explicit ProgressTracker(Page&, UniqueRef<ProgressTrackerClient>&&);
~ProgressTracker();
Expand Down
4 changes: 3 additions & 1 deletion Source/WebCore/loader/ProgressTrackerClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@

#pragma once

#include "LoaderMalloc.h"

namespace WebCore {

class LocalFrame;

class ProgressTrackerClient {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_FAST_ALLOCATED_WITH_HEAP_IDENTIFIER(Loader);
public:
virtual ~ProgressTrackerClient() = default;

Expand Down
Loading

0 comments on commit 66b6285

Please sign in to comment.