diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-09-21 14:51:57 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-21 19:16:29 +0000 |
commit | b89669975f6156fce4ced5c8998125a845f8e7dc (patch) | |
tree | 185c2badc52530ec1baddb854824bc5891e476a1 /core/fxcrt | |
parent | db0312e6acd7cc15fef0f64e05bd463cb74c70e4 (diff) | |
download | pdfium-b89669975f6156fce4ced5c8998125a845f8e7dc.tar.xz |
Move CFX_AutoRestorer to fxcrt::AutoRestorer
This CL renames CFX_AutoRestorer to just AutoRestorer and places in the
fxcrt namespace.
Bug: pdfium:898
Change-Id: Id9f36df94e95f3b2a55054bc198ca1bfd249ee3d
Reviewed-on: https://pdfium-review.googlesource.com/14450
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcrt')
-rw-r--r-- | core/fxcrt/autorestorer.h (renamed from core/fxcrt/cfx_autorestorer.h) | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/core/fxcrt/cfx_autorestorer.h b/core/fxcrt/autorestorer.h index a8c5125c4e..745a56fff2 100644 --- a/core/fxcrt/cfx_autorestorer.h +++ b/core/fxcrt/autorestorer.h @@ -2,19 +2,25 @@ // 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_ +#ifndef CORE_FXCRT_AUTORESTORER_H_ +#define CORE_FXCRT_AUTORESTORER_H_ + +namespace fxcrt { template <typename T> -class CFX_AutoRestorer { +class AutoRestorer { public: - explicit CFX_AutoRestorer(T* location) + explicit AutoRestorer(T* location) : m_Location(location), m_OldValue(*location) {} - ~CFX_AutoRestorer() { *m_Location = m_OldValue; } + ~AutoRestorer() { *m_Location = m_OldValue; } private: T* const m_Location; const T m_OldValue; }; -#endif // CORE_FXCRT_CFX_AUTORESTORER_H_ +} // namespace fxcrt + +using fxcrt::AutoRestorer; + +#endif // CORE_FXCRT_AUTORESTORER_H_ |