<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>287775</bug_id>
          
          <creation_ts>2025-02-16 11:53:06 -0800</creation_ts>
          <short_desc>Reduce size of WebCore::HistoryController by 8 bytes (72 to 64 bytes)</short_desc>
          <delta_ts>2025-02-17 10:26:09 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>History</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2095059</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2025-02-16 11:53:06 -0800</bug_when>
    <thetext>Summary:
Reduce size of WebCore::HistoryController by 8 bytes (72 to 64 bytes).

Before:

$ xcrun python3 ./Tools/Scripts/dump-class-layout -b WebKitBuild -c Release -a arm64e WebCore WebCore::HistoryController
  +0 &lt; 72&gt; WebCore::HistoryController
  +0 &lt;  8&gt;     WTF::CanMakeWeakPtr&lt;HistoryController&gt; WTF::CanMakeWeakPtr&lt;HistoryController&gt;
  +0 &lt;  8&gt;         WTF::WeakPtrFactory&lt;WebCore::HistoryController, WTF::DefaultWeakPtrImpl&gt; m_weakPtrFactory
  +0 &lt;  8&gt;             WTF::RefPtr&lt;WTF::DefaultWeakPtrImpl, WTF::RawPtrTraits&lt;WTF::DefaultWeakPtrImpl&gt;, WTF::DefaultRefDerefTraits&lt;WTF::DefaultWeakPtrImpl&gt; &gt; m_impl
  +0 &lt;  8&gt;                 WTF::RawPtrTraits&lt;WTF::DefaultWeakPtrImpl&gt;::StorageType m_ptr
  +8 &lt;  8&gt;     WTF::WeakRef&lt;WebCore::LocalFrame, WTF::DefaultWeakPtrImpl&gt; m_frame
  +8 &lt;  8&gt;         WTF::Ref&lt;WTF::DefaultWeakPtrImpl, WTF::RawPtrTraits&lt;WTF::DefaultWeakPtrImpl&gt;, WTF::DefaultRefDerefTraits&lt;WTF::DefaultWeakPtrImpl&gt; &gt; m_impl
  +8 &lt;  8&gt;             WTF::RawPtrTraits&lt;WTF::DefaultWeakPtrImpl&gt;::StorageType m_ptr
 +16 &lt;  8&gt;     WTF::RefPtr&lt;WebCore::HistoryItem, WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::HistoryItem&gt; &gt; m_currentItem
 +16 &lt;  8&gt;         WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;::StorageType m_ptr
 +24 &lt;  8&gt;     WTF::RefPtr&lt;WebCore::HistoryItem, WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::HistoryItem&gt; &gt; m_previousItem
 +24 &lt;  8&gt;         WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;::StorageType m_ptr
 +32 &lt;  8&gt;     WTF::RefPtr&lt;WebCore::HistoryItem, WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::HistoryItem&gt; &gt; m_provisionalItem
 +32 &lt;  8&gt;         WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;::StorageType m_ptr
 +40 &lt;  8&gt;     WTF::RefPtr&lt;WebCore::HistoryItem, WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::HistoryItem&gt; &gt; m_policyItem
 +40 &lt;  8&gt;         WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;::StorageType m_ptr
 +48 &lt;  1&gt;     bool m_frameLoadComplete
 +49 &lt;  1&gt;     bool m_defersLoading
 +50 &lt;  6&gt;     &lt;PADDING: 6 bytes&gt;
 +56 &lt;  8&gt;     WTF::RefPtr&lt;WebCore::HistoryItem, WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::HistoryItem&gt; &gt; m_deferredItem
 +56 &lt;  8&gt;         WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;::StorageType m_ptr
 +64 &lt;  1&gt;     WebCore::FrameLoadType m_deferredFrameLoadType
 +65 &lt;  7&gt;     &lt;PADDING: 7 bytes&gt;
Total byte size: 72
Total pad bytes: 13
Padding percentage: 18.06 %

After:

$ xcrun python3 ./Tools/Scripts/dump-class-layout -b WebKitBuild -c Release -a arm64e WebCore WebCore::HistoryController
  +0 &lt; 64&gt; WebCore::HistoryController
  +0 &lt;  8&gt;     WTF::CanMakeWeakPtr&lt;HistoryController&gt; WTF::CanMakeWeakPtr&lt;HistoryController&gt;
  +0 &lt;  8&gt;         WTF::WeakPtrFactory&lt;WebCore::HistoryController, WTF::DefaultWeakPtrImpl&gt; m_weakPtrFactory
  +0 &lt;  8&gt;             WTF::RefPtr&lt;WTF::DefaultWeakPtrImpl, WTF::RawPtrTraits&lt;WTF::DefaultWeakPtrImpl&gt;, WTF::DefaultRefDerefTraits&lt;WTF::DefaultWeakPtrImpl&gt; &gt; m_impl
  +0 &lt;  8&gt;                 WTF::RawPtrTraits&lt;WTF::DefaultWeakPtrImpl&gt;::StorageType m_ptr
  +8 &lt;  8&gt;     WTF::WeakRef&lt;WebCore::LocalFrame, WTF::DefaultWeakPtrImpl&gt; m_frame
  +8 &lt;  8&gt;         WTF::Ref&lt;WTF::DefaultWeakPtrImpl, WTF::RawPtrTraits&lt;WTF::DefaultWeakPtrImpl&gt;, WTF::DefaultRefDerefTraits&lt;WTF::DefaultWeakPtrImpl&gt; &gt; m_impl
  +8 &lt;  8&gt;             WTF::RawPtrTraits&lt;WTF::DefaultWeakPtrImpl&gt;::StorageType m_ptr
 +16 &lt;  8&gt;     WTF::RefPtr&lt;WebCore::HistoryItem, WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::HistoryItem&gt; &gt; m_currentItem
 +16 &lt;  8&gt;         WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;::StorageType m_ptr
 +24 &lt;  8&gt;     WTF::RefPtr&lt;WebCore::HistoryItem, WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::HistoryItem&gt; &gt; m_previousItem
 +24 &lt;  8&gt;         WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;::StorageType m_ptr
 +32 &lt;  8&gt;     WTF::RefPtr&lt;WebCore::HistoryItem, WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::HistoryItem&gt; &gt; m_provisionalItem
 +32 &lt;  8&gt;         WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;::StorageType m_ptr
 +40 &lt;  8&gt;     WTF::RefPtr&lt;WebCore::HistoryItem, WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::HistoryItem&gt; &gt; m_policyItem
 +40 &lt;  8&gt;         WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;::StorageType m_ptr
 +48 &lt;  1&gt;     bool m_frameLoadComplete
 +49 &lt;  1&gt;     bool m_defersLoading
 +50 &lt;  1&gt;     WebCore::FrameLoadType m_deferredFrameLoadType
 +51 &lt;  5&gt;     &lt;PADDING: 5 bytes&gt;
 +56 &lt;  8&gt;     WTF::RefPtr&lt;WebCore::HistoryItem, WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;, WTF::DefaultRefDerefTraits&lt;WebCore::HistoryItem&gt; &gt; m_deferredItem
 +56 &lt;  8&gt;         WTF::RawPtrTraits&lt;WebCore::HistoryItem&gt;::StorageType m_ptr
Total byte size: 64
Total pad bytes: 5
Padding percentage: 7.81 %</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095060</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-02-16 11:53:21 -0800</bug_when>
    <thetext>&lt;rdar://problem/144950604&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095061</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2025-02-16 11:57:11 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/40690</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2095186</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2025-02-17 10:26:07 -0800</bug_when>
    <thetext>Committed 290487@main (7575b0f8b3c9): &lt;https://commits.webkit.org/290487@main&gt;

Reviewed commits have been landed. Closing PR #40690 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>