Roll base/allocator/partition_allocator/ b22ccba48..2f4afa63f (42 commits)

This resolve two breaking change created by:
- 2023-09-28 bartekn Zero raw_ptr when constructing or moving
- 2023-10-03 arthursonzogni Move partition_alloc into a "partition_alloc" dir.

Note: We are still using the full pathname for partition_alloc files. In
a follow-up, after PartitionAlloc declare its include_dir, we will
shorten them.

Bug:chromium:1467773
Change-Id: Ib589e7a3e2b32c44d48a25701f4c467303ceb813
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/112210
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 3ab1ec6..07a5b93 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -46,9 +46,6 @@
   if (pdf_use_partition_alloc) {
     defines += [ "PDF_USE_PARTITION_ALLOC" ]
   }
-  if (pdf_use_partition_alloc_new_location) {
-    defines += [ "PDF_USE_PARTITION_ALLOC_NEW_LOCATION" ]
-  }
 
   if (is_win) {
     # Assume UTF-8 by default to avoid code page dependencies.
diff --git a/DEPS b/DEPS
index 57bc38a..81567dc 100644
--- a/DEPS
+++ b/DEPS
@@ -152,7 +152,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling partition_allocator
   # and whatever else without interference from each other.
-  'partition_allocator_revision': 'b22ccba489fc93b1ef64553996e022380c2025b8',
+  'partition_allocator_revision': '2f4afa63f170deda326c8a1a25b6f8f2bfa9b8b8',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling pdfium_tests
   # and whatever else without interference from each other.
diff --git a/build_overrides/partition_alloc.gni b/build_overrides/partition_alloc.gni
index 05bcab3..b56acae 100644
--- a/build_overrides/partition_alloc.gni
+++ b/build_overrides/partition_alloc.gni
@@ -20,3 +20,6 @@
 put_ref_count_in_previous_slot_default = false
 enable_backup_ref_ptr_slow_checks_default = false
 enable_dangling_raw_ptr_checks_default = false
+raw_ptr_zero_on_construct_default = true
+raw_ptr_zero_on_move_default = true
+raw_ptr_zero_on_destruct_default = false
diff --git a/core/fxcrt/BUILD.gn b/core/fxcrt/BUILD.gn
index ea428af..e8b6aa8 100644
--- a/core/fxcrt/BUILD.gn
+++ b/core/fxcrt/BUILD.gn
@@ -11,17 +11,10 @@
   deps = [ "../../third_party:pdfium_compiler_specific" ]
   configs += [ "../../:pdfium_strict_config" ]
   if (pdf_use_partition_alloc) {
-    if (pdf_use_partition_alloc_new_location) {
-      public_deps = [
-        "//base/allocator/partition_allocator/src/partition_alloc:partition_alloc_buildflags",
-        "//base/allocator/partition_allocator/src/partition_alloc:raw_ptr",
-      ]
-    } else {
-      public_deps = [
-        "//base/allocator/partition_allocator:partition_alloc_buildflags",
-        "//base/allocator/partition_allocator:raw_ptr",
-      ]
-    }
+    public_deps = [
+      "//base/allocator/partition_allocator/src/partition_alloc:partition_alloc_buildflags",
+      "//base/allocator/partition_allocator/src/partition_alloc:raw_ptr",
+    ]
   }
 }
 
@@ -149,19 +142,11 @@
   ]
   if (pdf_use_partition_alloc) {
     sources += [ "fx_memory_pa.cpp" ]
-    if (pdf_use_partition_alloc_new_location) {
-      deps += [
-        "//base/allocator/partition_allocator/src/partition_alloc",
-        "//base/allocator/partition_allocator/src/partition_alloc:partition_alloc_buildflags",
-        "//base/allocator/partition_allocator/src/partition_alloc:raw_ptr",
-      ]
-    } else {
-      deps += [
-        "//base/allocator/partition_allocator:partition_alloc",
-        "//base/allocator/partition_allocator:partition_alloc_buildflags",
-        "//base/allocator/partition_allocator:raw_ptr",
-      ]
-    }
+    deps += [
+      "//base/allocator/partition_allocator/src/partition_alloc",
+      "//base/allocator/partition_allocator/src/partition_alloc:partition_alloc_buildflags",
+      "//base/allocator/partition_allocator/src/partition_alloc:raw_ptr",
+    ]
   } else {
     sources += [ "fx_memory_malloc.cpp" ]
   }
@@ -262,11 +247,7 @@
   deps = [ ":unit_test_support" ]
   pdfium_root_dir = "../../"
   if (pdf_use_partition_alloc) {
-    if (pdf_use_partition_alloc_new_location) {
-      deps += [ "//base/allocator/partition_allocator/src/partition_alloc" ]
-    } else {
-      deps += [ "//base/allocator/partition_allocator:partition_alloc" ]
-    }
+    deps += [ "//base/allocator/partition_allocator/src/partition_alloc" ]
   }
   if (pdf_enable_xfa) {
     sources += [ "cfx_memorystream_unittest.cpp" ]
diff --git a/core/fxcrt/fx_memory_pa.cpp b/core/fxcrt/fx_memory_pa.cpp
index 3d75b3e..3c9f34b 100644
--- a/core/fxcrt/fx_memory_pa.cpp
+++ b/core/fxcrt/fx_memory_pa.cpp
@@ -6,11 +6,7 @@
 
 #include "core/fxcrt/fx_memory.h"
 
-#if defined(PDF_USE_PARTITION_ALLOC_NEW_LOCATION)
 #include "base/allocator/partition_allocator/src/partition_alloc/partition_alloc.h"
-#else
-#include "base/allocator/partition_allocator/partition_alloc.h"
-#endif
 #include "core/fxcrt/fx_safe_types.h"
 #include "third_party/base/no_destructor.h"
 
diff --git a/core/fxcrt/fx_memory_unittest.cpp b/core/fxcrt/fx_memory_unittest.cpp
index 7f6a7ac..db6d8f6 100644
--- a/core/fxcrt/fx_memory_unittest.cpp
+++ b/core/fxcrt/fx_memory_unittest.cpp
@@ -11,11 +11,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 
 #if defined(PDF_USE_PARTITION_ALLOC)
-#if defined(PDF_USE_PARTITION_ALLOC_NEW_LOCATION)
 #include "base/allocator/partition_allocator/src/partition_alloc/partition_address_space.h"
-#else
-#include "base/allocator/partition_allocator/partition_address_space.h"
-#endif
 #endif
 
 namespace {
diff --git a/core/fxcrt/unowned_ptr.h b/core/fxcrt/unowned_ptr.h
index d642483..38f5188 100644
--- a/core/fxcrt/unowned_ptr.h
+++ b/core/fxcrt/unowned_ptr.h
@@ -39,11 +39,7 @@
 #include "build/build_config.h"
 
 #if defined(PDF_USE_PARTITION_ALLOC)
-#if defined(PDF_USE_PARTITION_ALLOC_NEW_LOCATION)
 #include "base/allocator/partition_allocator/src/partition_alloc/partition_alloc_buildflags.h"
-#else
-#include "base/allocator/partition_allocator/partition_alloc_buildflags.h"
-#endif
 
 // Can only use base::raw_ptr<> impls that force nullptr initialization.
 #if BUILDFLAG(ENABLE_BACKUP_REF_PTR_SUPPORT) || BUILDFLAG(USE_ASAN_UNOWNED_PTR)
@@ -56,11 +52,7 @@
 #endif  // PDF_USE_PARTITION_ALLOC
 
 #if defined(UNOWNED_PTR_IS_BASE_RAW_PTR)
-#if defined(PDF_USE_PARTITION_ALLOC_NEW_LOCATION)
 #include "base/allocator/partition_allocator/src/partition_alloc/pointers/raw_ptr.h"
-#else
-#include "base/allocator/partition_allocator/pointers/raw_ptr.h"
-#endif
 
 template <typename T>
 using UnownedPtr = raw_ptr<T>;
diff --git a/core/fxcrt/unowned_ptr_unittest.cpp b/core/fxcrt/unowned_ptr_unittest.cpp
index 99b2892..626e84b 100644
--- a/core/fxcrt/unowned_ptr_unittest.cpp
+++ b/core/fxcrt/unowned_ptr_unittest.cpp
@@ -14,11 +14,7 @@
 #include "third_party/base/containers/contains.h"
 
 #if defined(PDF_USE_PARTITION_ALLOC)
-#if defined(PDF_USE_PARTITION_ALLOC_NEW_LOCATION)
 #include "base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim_default_dispatch_to_partition_alloc.h"
-#else
-#include "base/allocator/partition_allocator/shim/allocator_shim_default_dispatch_to_partition_alloc.h"
-#endif
 #endif
 
 namespace fxcrt {
diff --git a/pdfium.gni b/pdfium.gni
index f349a26..ffa740a 100644
--- a/pdfium.gni
+++ b/pdfium.gni
@@ -48,10 +48,6 @@
   # malloc is controlled by args in build_overrides/partition_alloc.gni.
   pdf_use_partition_alloc = pdf_use_partition_alloc_override
 
-  # Temporary config allowing chromium to switch its location of the
-  # partition_alloc library. https://crbug.com/1467773
-  pdf_use_partition_alloc_new_location = false
-
   # Build PDFium to use Skia (experimental) for all PDFium graphics.
   # If enabled, coexists in build with AGG graphics and the default
   # renderer is selectable at runtime.
diff --git a/samples/BUILD.gn b/samples/BUILD.gn
index 000cfb6..981750b 100644
--- a/samples/BUILD.gn
+++ b/samples/BUILD.gn
@@ -24,9 +24,6 @@
   if (pdf_use_partition_alloc) {
     defines += [ "PDF_USE_PARTITION_ALLOC" ]
   }
-  if (pdf_use_partition_alloc_new_location) {
-    defines += [ "PDF_USE_PARTITION_ALLOC_NEW_LOCATION" ]
-  }
   if (enable_callgrind) {
     defines += [ "ENABLE_CALLGRIND" ]
   }
diff --git a/testing/BUILD.gn b/testing/BUILD.gn
index 4044dec..dbb11a9 100644
--- a/testing/BUILD.gn
+++ b/testing/BUILD.gn
@@ -56,11 +56,7 @@
       "allocator_shim_config.cpp",
       "allocator_shim_config.h",
     ]
-    if (pdf_use_partition_alloc_new_location) {
-      deps += [ "//base/allocator/partition_allocator/src/partition_alloc" ]
-    } else {
-      deps += [ "//base/allocator/partition_allocator:partition_alloc" ]
-    }
+    deps += [ "//base/allocator/partition_allocator/src/partition_alloc" ]
   }
   if (pdf_enable_v8) {
     sources += [
diff --git a/testing/allocator_shim_config.cpp b/testing/allocator_shim_config.cpp
index 232e735..97a4a20 100644
--- a/testing/allocator_shim_config.cpp
+++ b/testing/allocator_shim_config.cpp
@@ -4,13 +4,8 @@
 
 #include "testing/allocator_shim_config.h"
 
-#if defined(PDF_USE_PARTITION_ALLOC_NEW_LOCATION)
 #include "base/allocator/partition_allocator/src/partition_alloc/partition_alloc_buildflags.h"
 #include "base/allocator/partition_allocator/src/partition_alloc/shim/allocator_shim.h"
-#else
-#include "base/allocator/partition_allocator/partition_alloc_buildflags.h"
-#include "base/allocator/partition_allocator/shim/allocator_shim.h"
-#endif
 
 namespace pdfium {