summaryrefslogtreecommitdiff
path: root/core/fxcrt
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-08-30 15:37:47 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-30 19:47:58 +0000
commit674bbfe24ded465a4d27b268ca84f75976d556da (patch)
treed01575d7d0a7320af6011162f3955b9f9a45c459 /core/fxcrt
parentccd5be05f61c85754daf5c8155f4932f6d35a55a (diff)
downloadpdfium-674bbfe24ded465a4d27b268ca84f75976d556da.tar.xz
Split auto restorer from fx_basic
This CL moves CFX_AutoRestorer into its own file, separate from fx_basic.h. Change-Id: I415cb9207416bd4744b8ac8e2d7466852db53f0a Reviewed-on: https://pdfium-review.googlesource.com/12390 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcrt')
-rw-r--r--core/fxcrt/cfx_autorestorer.h20
-rw-r--r--core/fxcrt/fx_basic.h12
2 files changed, 20 insertions, 12 deletions
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_