summaryrefslogtreecommitdiff
path: root/core/include/fxcrt/fx_basic.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-01-26 16:59:09 -0800
committerTom Sepez <tsepez@chromium.org>2015-01-26 16:59:09 -0800
commite80685c12c3620c178a2286e00dd03c7886f8785 (patch)
treeb33f78a6f516b7483e689a2f9138a35b328d565e /core/include/fxcrt/fx_basic.h
parentf290eed6f2d0c59e89db1374f9e6b254b51a2356 (diff)
downloadpdfium-e80685c12c3620c178a2286e00dd03c7886f8785.tar.xz
Merge to XFA: Fix infinite recursion in CPDF_Parser::ParseIndirectObjectAt().
Orignal Review URL: https://codereview.chromium.org/875263002 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/880753002
Diffstat (limited to 'core/include/fxcrt/fx_basic.h')
-rw-r--r--core/include/fxcrt/fx_basic.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index 1c828cea48..b63327c9c2 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -1414,6 +1414,21 @@ protected:
CFX_DataFilter* m_pDestFilter;
};
+
+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* m_Location;
+ T m_OldValue;
+};
+
template <class T>
class CFX_SmartPointer
{