Mark AutoRestorer<>/AutoNuller<> as stack-only.
Justifies leaving pointers as raw type, not UnownedPtr<>.
Change-Id: I4fdf21c65291cedf36ec6c80d47e919d3a24904e
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/89211
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fxcrt/autonuller.h b/core/fxcrt/autonuller.h
index 3a9bbdf..ed51b58 100644
--- a/core/fxcrt/autonuller.h
+++ b/core/fxcrt/autonuller.h
@@ -5,11 +5,15 @@
#ifndef CORE_FXCRT_AUTONULLER_H_
#define CORE_FXCRT_AUTONULLER_H_
+#include "core/fxcrt/fx_memory.h"
+
namespace fxcrt {
template <typename T>
class AutoNuller {
public:
+ FX_STACK_ALLOCATED();
+
explicit AutoNuller(T* location) : m_Location(location) {}
~AutoNuller() {
if (m_Location)
diff --git a/core/fxcrt/autorestorer.h b/core/fxcrt/autorestorer.h
index cafa075..8d1c16a 100644
--- a/core/fxcrt/autorestorer.h
+++ b/core/fxcrt/autorestorer.h
@@ -5,11 +5,15 @@
#ifndef CORE_FXCRT_AUTORESTORER_H_
#define CORE_FXCRT_AUTORESTORER_H_
+#include "core/fxcrt/fx_memory.h"
+
namespace fxcrt {
template <typename T>
class AutoRestorer {
public:
+ FX_STACK_ALLOCATED();
+
explicit AutoRestorer(T* location)
: m_Location(location), m_OldValue(*location) {}
~AutoRestorer() {