summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/parser/cpdf_syntax_parser.cpp1
-rw-r--r--core/fpdfapi/render/cpdf_renderstatus.cpp1
-rw-r--r--core/fxcrt/cfx_autorestorer.h20
-rw-r--r--core/fxcrt/fx_basic.h12
4 files changed, 22 insertions, 12 deletions
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
index 7592438258..c0d21217a5 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
@@ -25,6 +25,7 @@
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfapi/parser/fpdf_parser_decode.h"
#include "core/fpdfapi/parser/fpdf_parser_utility.h"
+#include "core/fxcrt/cfx_autorestorer.h"
#include "core/fxcrt/fx_extension.h"
#include "third_party/base/numerics/safe_math.h"
#include "third_party/base/ptr_util.h"
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 01deab0bea..1f949fb440 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -46,6 +46,7 @@
#include "core/fpdfapi/render/cpdf_type3cache.h"
#include "core/fpdfdoc/cpdf_occontext.h"
#include "core/fxcodec/fx_codec.h"
+#include "core/fxcrt/cfx_autorestorer.h"
#include "core/fxcrt/cfx_maybe_owned.h"
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxge/cfx_defaultrenderdevice.h"
diff --git a/core/fxcrt/cfx_autorestorer.h b/core/fxcrt/cfx_autorestorer.h
new file mode 100644
index 0000000000..a8c5125c4e
--- /dev/null
+++ b/core/fxcrt/cfx_autorestorer.h
@@ -0,0 +1,20 @@
+// Copyright 2017 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CORE_FXCRT_CFX_AUTORESTORER_H_
+#define CORE_FXCRT_CFX_AUTORESTORER_H_
+
+template <typename T>
+class CFX_AutoRestorer {
+ public:
+ explicit CFX_AutoRestorer(T* location)
+ : m_Location(location), m_OldValue(*location) {}
+ ~CFX_AutoRestorer() { *m_Location = m_OldValue; }
+
+ private:
+ T* const m_Location;
+ const T m_OldValue;
+};
+
+#endif // CORE_FXCRT_CFX_AUTORESTORER_H_
diff --git a/core/fxcrt/fx_basic.h b/core/fxcrt/fx_basic.h
index 167ef5ce70..8e3312d365 100644
--- a/core/fxcrt/fx_basic.h
+++ b/core/fxcrt/fx_basic.h
@@ -142,18 +142,6 @@ class IFX_Pause {
virtual bool NeedToPauseNow() = 0;
};
-template <typename T>
-class CFX_AutoRestorer {
- public:
- explicit CFX_AutoRestorer(T* location)
- : m_Location(location), m_OldValue(*location) {}
- ~CFX_AutoRestorer() { *m_Location = m_OldValue; }
-
- private:
- T* const m_Location;
- const T m_OldValue;
-};
-
uint32_t GetBits32(const uint8_t* pData, int bitpos, int nbits);
#endif // CORE_FXCRT_FX_BASIC_H_