Move third_party/base/ptr_util.h into third_party/base/memory/

Sync the location of ptr_util.h with the header in Chromium. Chromium
always had it in //base/memory.

Change-Id: I7e78093cf38d96d6c1495666dc27a1461bbc3ae8
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/110810
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/parser/cpdf_linearized_header.cpp b/core/fpdfapi/parser/cpdf_linearized_header.cpp
index f4de7d7..b093578 100644
--- a/core/fpdfapi/parser/cpdf_linearized_header.cpp
+++ b/core/fpdfapi/parser/cpdf_linearized_header.cpp
@@ -17,7 +17,7 @@
 #include "core/fpdfapi/parser/cpdf_syntax_parser.h"
 #include "core/fxcrt/fx_safe_types.h"
 #include "third_party/base/check.h"
-#include "third_party/base/ptr_util.h"
+#include "third_party/base/memory/ptr_util.h"
 
 namespace {
 
diff --git a/core/fpdfapi/parser/cpdf_object_stream.cpp b/core/fpdfapi/parser/cpdf_object_stream.cpp
index 1c5a7b7..19294da 100644
--- a/core/fpdfapi/parser/cpdf_object_stream.cpp
+++ b/core/fpdfapi/parser/cpdf_object_stream.cpp
@@ -17,7 +17,7 @@
 #include "core/fxcrt/cfx_read_only_span_stream.h"
 #include "core/fxcrt/fx_safe_types.h"
 #include "third_party/base/check.h"
-#include "third_party/base/ptr_util.h"
+#include "third_party/base/memory/ptr_util.h"
 
 namespace {
 
diff --git a/core/fpdfdoc/cpdf_nametree.cpp b/core/fpdfdoc/cpdf_nametree.cpp
index 3b60fab..95d540f 100644
--- a/core/fpdfdoc/cpdf_nametree.cpp
+++ b/core/fpdfdoc/cpdf_nametree.cpp
@@ -18,7 +18,7 @@
 #include "core/fpdfapi/parser/fpdf_parser_decode.h"
 #include "core/fxcrt/stl_util.h"
 #include "third_party/base/check.h"
-#include "third_party/base/ptr_util.h"
+#include "third_party/base/memory/ptr_util.h"
 
 namespace {
 
diff --git a/core/fpdftext/cpdf_textpagefind.cpp b/core/fpdftext/cpdf_textpagefind.cpp
index 3f4ed4a..4191748 100644
--- a/core/fpdftext/cpdf_textpagefind.cpp
+++ b/core/fpdftext/cpdf_textpagefind.cpp
@@ -17,7 +17,7 @@
 #include "core/fxcrt/fx_unicode.h"
 #include "core/fxcrt/stl_util.h"
 #include "third_party/base/check.h"
-#include "third_party/base/ptr_util.h"
+#include "third_party/base/memory/ptr_util.h"
 
 namespace {
 
diff --git a/core/fxcodec/gif/lzw_decompressor.cpp b/core/fxcodec/gif/lzw_decompressor.cpp
index b13932b..dbfa0b9 100644
--- a/core/fxcodec/gif/lzw_decompressor.cpp
+++ b/core/fxcodec/gif/lzw_decompressor.cpp
@@ -13,8 +13,8 @@
 #include <utility>
 
 #include "core/fxcrt/fx_safe_types.h"
+#include "third_party/base/memory/ptr_util.h"
 #include "third_party/base/numerics/safe_math.h"
-#include "third_party/base/ptr_util.h"
 
 namespace fxcodec {
 
diff --git a/core/fxcodec/icc/icc_transform.cpp b/core/fxcodec/icc/icc_transform.cpp
index 613d721..485988d 100644
--- a/core/fxcodec/icc/icc_transform.cpp
+++ b/core/fxcodec/icc/icc_transform.cpp
@@ -12,9 +12,9 @@
 #include <memory>
 
 #include "core/fxcrt/data_vector.h"
+#include "third_party/base/memory/ptr_util.h"
 #include "third_party/base/notreached.h"
 #include "third_party/base/numerics/safe_conversions.h"
-#include "third_party/base/ptr_util.h"
 
 namespace fxcodec {
 
diff --git a/core/fxcodec/jbig2/JBig2_Context.cpp b/core/fxcodec/jbig2/JBig2_Context.cpp
index 31b6f72..0d9028e 100644
--- a/core/fxcodec/jbig2/JBig2_Context.cpp
+++ b/core/fxcodec/jbig2/JBig2_Context.cpp
@@ -26,7 +26,7 @@
 #include "core/fxcrt/fx_safe_types.h"
 #include "core/fxcrt/pauseindicator_iface.h"
 #include "third_party/base/check.h"
-#include "third_party/base/ptr_util.h"
+#include "third_party/base/memory/ptr_util.h"
 
 namespace {
 
diff --git a/core/fxcodec/jpeg/jpeg_progressive_decoder.cpp b/core/fxcodec/jpeg/jpeg_progressive_decoder.cpp
index c662f14..1f1a7c3 100644
--- a/core/fxcodec/jpeg/jpeg_progressive_decoder.cpp
+++ b/core/fxcodec/jpeg/jpeg_progressive_decoder.cpp
@@ -17,7 +17,7 @@
 #include "core/fxge/dib/fx_dib.h"
 #include "third_party/abseil-cpp/absl/types/optional.h"
 #include "third_party/base/check.h"
-#include "third_party/base/ptr_util.h"
+#include "third_party/base/memory/ptr_util.h"
 
 class CJpegContext final : public ProgressiveDecoderIface::Context {
  public:
diff --git a/core/fxcodec/jpx/cjpx_decoder.cpp b/core/fxcodec/jpx/cjpx_decoder.cpp
index c0fcc83..2e7a72a 100644
--- a/core/fxcodec/jpx/cjpx_decoder.cpp
+++ b/core/fxcodec/jpx/cjpx_decoder.cpp
@@ -18,7 +18,7 @@
 #include "core/fxcrt/span_util.h"
 #include "core/fxge/calculate_pitch.h"
 #include "third_party/abseil-cpp/absl/types/optional.h"
-#include "third_party/base/ptr_util.h"
+#include "third_party/base/memory/ptr_util.h"
 
 #if !defined(USE_SYSTEM_LIBOPENJPEG2)
 #include "third_party/libopenjpeg/opj_malloc.h"
diff --git a/core/fxcrt/fx_folder_posix.cpp b/core/fxcrt/fx_folder_posix.cpp
index b4cf9f9..fb873be 100644
--- a/core/fxcrt/fx_folder_posix.cpp
+++ b/core/fxcrt/fx_folder_posix.cpp
@@ -10,7 +10,7 @@
 
 #include "build/build_config.h"
 #include "core/fxcrt/unowned_ptr.h"
-#include "third_party/base/ptr_util.h"
+#include "third_party/base/memory/ptr_util.h"
 
 #if BUILDFLAG(IS_WIN)
 #error "built on wrong platform"
diff --git a/core/fxcrt/fx_folder_windows.cpp b/core/fxcrt/fx_folder_windows.cpp
index 500c733..6b19dde 100644
--- a/core/fxcrt/fx_folder_windows.cpp
+++ b/core/fxcrt/fx_folder_windows.cpp
@@ -9,7 +9,7 @@
 #include <memory>
 
 #include "build/build_config.h"
-#include "third_party/base/ptr_util.h"
+#include "third_party/base/memory/ptr_util.h"
 
 #if !BUILDFLAG(IS_WIN)
 #error "built on wrong platform"
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index 5770b4f..6bff316 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -48,9 +48,9 @@
 #include "third_party/base/check.h"
 #include "third_party/base/check_op.h"
 #include "third_party/base/containers/span.h"
+#include "third_party/base/memory/ptr_util.h"
 #include "third_party/base/notreached.h"
 #include "third_party/base/numerics/safe_conversions.h"
-#include "third_party/base/ptr_util.h"
 #include "third_party/skia/include/core/SkBlendMode.h"
 #include "third_party/skia/include/core/SkCanvas.h"
 #include "third_party/skia/include/core/SkClipOp.h"
diff --git a/fpdfsdk/formfiller/cffl_perwindowdata.cpp b/fpdfsdk/formfiller/cffl_perwindowdata.cpp
index 70dc696..85f6d03 100644
--- a/fpdfsdk/formfiller/cffl_perwindowdata.cpp
+++ b/fpdfsdk/formfiller/cffl_perwindowdata.cpp
@@ -7,7 +7,7 @@
 #include "fpdfsdk/formfiller/cffl_perwindowdata.h"
 
 #include "fpdfsdk/cpdfsdk_widget.h"
-#include "third_party/base/ptr_util.h"
+#include "third_party/base/memory/ptr_util.h"
 
 CFFL_PerWindowData::CFFL_PerWindowData(CPDFSDK_Widget* pWidget,
                                        const CPDFSDK_PageView* pPageView,
diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
index 7c7d420..cb7c96d 100644
--- a/fpdfsdk/fpdf_annot.cpp
+++ b/fpdfsdk/fpdf_annot.cpp
@@ -39,8 +39,8 @@
 #include "fpdfsdk/cpdfsdk_interactiveform.h"
 #include "third_party/base/check.h"
 #include "third_party/base/containers/contains.h"
+#include "third_party/base/memory/ptr_util.h"
 #include "third_party/base/numerics/safe_conversions.h"
-#include "third_party/base/ptr_util.h"
 
 namespace {
 
diff --git a/fpdfsdk/fpdf_view.cpp b/fpdfsdk/fpdf_view.cpp
index 453f998..f93561c 100644
--- a/fpdfsdk/fpdf_view.cpp
+++ b/fpdfsdk/fpdf_view.cpp
@@ -50,8 +50,8 @@
 #include "public/fpdf_formfill.h"
 #include "third_party/base/check_op.h"
 #include "third_party/base/containers/span.h"
+#include "third_party/base/memory/ptr_util.h"
 #include "third_party/base/numerics/safe_conversions.h"
-#include "third_party/base/ptr_util.h"
 
 #ifdef PDF_ENABLE_V8
 #include "fxjs/cfx_v8_array_buffer_allocator.h"
diff --git a/fxbarcode/cfx_barcode.cpp b/fxbarcode/cfx_barcode.cpp
index cc7fab2..5b2c134 100644
--- a/fxbarcode/cfx_barcode.cpp
+++ b/fxbarcode/cfx_barcode.cpp
@@ -18,8 +18,8 @@
 #include "fxbarcode/cbc_pdf417i.h"
 #include "fxbarcode/cbc_qrcode.h"
 #include "fxbarcode/cbc_upca.h"
+#include "third_party/base/memory/ptr_util.h"
 #include "third_party/base/notreached.h"
-#include "third_party/base/ptr_util.h"
 
 namespace {
 
diff --git a/fxjs/xfa/cfxjse_context.cpp b/fxjs/xfa/cfxjse_context.cpp
index 970cb3d..337b443 100644
--- a/fxjs/xfa/cfxjse_context.cpp
+++ b/fxjs/xfa/cfxjse_context.cpp
@@ -17,7 +17,7 @@
 #include "fxjs/xfa/cjx_object.h"
 #include "third_party/base/check.h"
 #include "third_party/base/check_op.h"
-#include "third_party/base/ptr_util.h"
+#include "third_party/base/memory/ptr_util.h"
 #include "v8/include/v8-exception.h"
 #include "v8/include/v8-function.h"
 #include "v8/include/v8-message.h"
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
index 778b131..3683ab8 100644
--- a/third_party/BUILD.gn
+++ b/third_party/BUILD.gn
@@ -554,6 +554,7 @@
     "base/immediate_crash.h",
     "base/memory/aligned_memory.cc",
     "base/memory/aligned_memory.h",
+    "base/memory/ptr_util.h",
     "base/no_destructor.h",
     "base/notreached.h",
     "base/numerics/checked_math.h",
diff --git a/third_party/base/ptr_util.h b/third_party/base/memory/ptr_util.h
similarity index 79%
rename from third_party/base/ptr_util.h
rename to third_party/base/memory/ptr_util.h
index 3be55b4..c9df831 100644
--- a/third_party/base/ptr_util.h
+++ b/third_party/base/memory/ptr_util.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef THIRD_PARTY_BASE_PTR_UTIL_H_
-#define THIRD_PARTY_BASE_PTR_UTIL_H_
+#ifndef THIRD_PARTY_BASE_MEMORY_PTR_UTIL_H_
+#define THIRD_PARTY_BASE_MEMORY_PTR_UTIL_H_
 
 #include <memory>
 
@@ -19,4 +19,4 @@
 
 }  // namespace pdfium
 
-#endif  // THIRD_PARTY_BASE_PTR_UTIL_H_
+#endif  // THIRD_PARTY_BASE_MEMORY_PTR_UTIL_H_