[PA] Move Metadata outside of GigaCage (2/5)

Remove MetadataKind from SuperPageExtentEntry, DirectMapExtentEntry and
PartitionPageMetadata. Make SlotSpanMetadata<MetadataKind> an alias of
SlotSpanMetadataBase.

DesignDoc:
https://docs.google.com/document/d/1Mn-qRAWuDhS_gRL_OG2TYL-EW5D8yljaCyM40S0ocVc/edit?tab=t.0

Bug: crbug.com/40238514
Change-Id: I4c0dc91fc7d9bc1751427041724db60103267762
Validate-Test-Flakiness: skip
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6758536
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Cr-Commit-Position: refs/heads/main@{#1488691}
NOKEYCHECK=True
GitOrigin-RevId: 1f1efda4e2c325753c786acbb77ee7b9d9f6e6ec
diff --git a/partition_allocator/pa_dump_heap.cc b/partition_allocator/pa_dump_heap.cc
index ee5b00e..ccf3698 100644
--- a/partition_allocator/pa_dump_heap.cc
+++ b/partition_allocator/pa_dump_heap.cc
@@ -38,14 +38,9 @@
 namespace partition_alloc::tools {
 
 using partition_alloc::internal::kSuperPageSize;
-using partition_alloc::internal::MetadataKind;
+using partition_alloc::internal::PartitionPageMetadata;
 using partition_alloc::internal::PartitionPageSize;
-template <MetadataKind kind>
-using PartitionPageMetadata =
-    partition_alloc::internal::PartitionPageMetadata<kind>;
-template <MetadataKind kind>
-using PartitionSuperPageExtentEntry =
-    partition_alloc::internal::PartitionSuperPageExtentEntry<kind>;
+using partition_alloc::internal::PartitionSuperPageExtentEntry;
 using partition_alloc::internal::SystemPageSize;
 
 // See https://www.kernel.org/doc/Documentation/vm/pagemap.txt.
@@ -135,12 +130,10 @@
         reinterpret_cast<uintptr_t>(root_.get()->first_extent);
     while (extent_address) {
       auto extent =
-          RawBuffer<PartitionSuperPageExtentEntry<MetadataKind::kReadOnly>>::
-              ReadFromProcessMemory(reader_, extent_address);
+          RawBuffer<PartitionSuperPageExtentEntry>::ReadFromProcessMemory(
+              reader_, extent_address);
       uintptr_t first_super_page_address = SuperPagesBeginFromExtent(
-          reinterpret_cast<
-              PartitionSuperPageExtentEntry<MetadataKind::kReadOnly>*>(
-              extent_address));
+          reinterpret_cast<PartitionSuperPageExtentEntry*>(extent_address));
       for (uintptr_t super_page = first_super_page_address;
            super_page < first_super_page_address +
                             extent->get()->number_of_consecutive_super_pages *
@@ -181,9 +174,8 @@
       ret.Set("type", value);
 
       if (value != "metadata" && value != "guard") {
-        const auto* page_metadata =
-            PartitionPageMetadata<MetadataKind::kReadOnly>::FromAddr(
-                reinterpret_cast<uintptr_t>(data + offset));
+        const auto* page_metadata = PartitionPageMetadata::FromAddr(
+            reinterpret_cast<uintptr_t>(data + offset));
         ret.Set("page_index_in_span", page_metadata->slot_span_metadata_offset);
         if (page_metadata->slot_span_metadata_offset == 0 &&
             page_metadata->slot_span_metadata.bucket) {