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>
diff --git a/BUILD.gn b/BUILD.gn
index aad97e9..f95da71 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -805,9 +805,9 @@
 
 static_library("fxcrt") {
   sources = [
+    "core/fxcrt/autorestorer.h",
     "core/fxcrt/bytestring.cpp",
     "core/fxcrt/bytestring.h",
-    "core/fxcrt/cfx_autorestorer.h",
     "core/fxcrt/cfx_binarybuf.cpp",
     "core/fxcrt/cfx_binarybuf.h",
     "core/fxcrt/cfx_bitstream.cpp",
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
index 4412105..4556dc9 100644
--- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
@@ -25,7 +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/autorestorer.h"
 #include "core/fxcrt/cfx_binarybuf.h"
 #include "core/fxcrt/fx_extension.h"
 #include "third_party/base/numerics/safe_math.h"
@@ -55,7 +55,7 @@
 }
 
 bool CPDF_SyntaxParser::GetCharAt(FX_FILESIZE pos, uint8_t& ch) {
-  CFX_AutoRestorer<FX_FILESIZE> save_pos(&m_Pos);
+  AutoRestorer<FX_FILESIZE> save_pos(&m_Pos);
   m_Pos = pos;
   return GetNextChar(ch);
 }
@@ -352,7 +352,7 @@
 }
 
 ByteString CPDF_SyntaxParser::PeekNextWord(bool* bIsNumber) {
-  const CFX_AutoRestorer<FX_FILESIZE> save_pos(&m_Pos);
+  AutoRestorer<FX_FILESIZE> save_pos(&m_Pos);
   return GetNextWord(bIsNumber);
 }
 
@@ -379,7 +379,7 @@
     uint32_t gennum,
     bool bDecrypt,
     ParseType parse_type) {
-  CFX_AutoRestorer<int> restorer(&s_CurrentRecursionDepth);
+  AutoRestorer<int> restorer(&s_CurrentRecursionDepth);
   if (++s_CurrentRecursionDepth > kParserMaxRecursionDepth)
     return nullptr;
 
@@ -485,7 +485,7 @@
     // contents to the un-decrypted form.
     if (m_pCryptoHandler && bDecrypt && pDict->IsSignatureDict() &&
         dwSignValuePos) {
-      CFX_AutoRestorer<FX_FILESIZE> save_pos(&m_Pos);
+      AutoRestorer<FX_FILESIZE> save_pos(&m_Pos);
       m_Pos = dwSignValuePos;
       pDict->SetFor("Contents", GetObject(pObjList, objnum, gennum, false));
     }
diff --git a/core/fpdfapi/render/cpdf_renderstatus.cpp b/core/fpdfapi/render/cpdf_renderstatus.cpp
index 6d7e7f1..26eed11 100644
--- a/core/fpdfapi/render/cpdf_renderstatus.cpp
+++ b/core/fpdfapi/render/cpdf_renderstatus.cpp
@@ -45,7 +45,7 @@
 #include "core/fpdfapi/render/cpdf_transferfunc.h"
 #include "core/fpdfapi/render/cpdf_type3cache.h"
 #include "core/fpdfdoc/cpdf_occontext.h"
-#include "core/fxcrt/cfx_autorestorer.h"
+#include "core/fxcrt/autorestorer.h"
 #include "core/fxcrt/cfx_fixedbufgrow.h"
 #include "core/fxcrt/cfx_maybe_owned.h"
 #include "core/fxcrt/fx_safe_types.h"
@@ -1079,7 +1079,7 @@
 #if defined _SKIA_SUPPORT_
   DebugVerifyDeviceIsPreMultiplied();
 #endif
-  CFX_AutoRestorer<int> restorer(&s_CurrentRecursionDepth);
+  AutoRestorer<int> restorer(&s_CurrentRecursionDepth);
   if (++s_CurrentRecursionDepth > kRenderMaxRecursionDepth) {
     return;
   }
diff --git a/core/fxcrt/autorestorer.h b/core/fxcrt/autorestorer.h
new file mode 100644
index 0000000..745a56f
--- /dev/null
+++ b/core/fxcrt/autorestorer.h
@@ -0,0 +1,26 @@
+// 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_AUTORESTORER_H_
+#define CORE_FXCRT_AUTORESTORER_H_
+
+namespace fxcrt {
+
+template <typename T>
+class AutoRestorer {
+ public:
+  explicit AutoRestorer(T* location)
+      : m_Location(location), m_OldValue(*location) {}
+  ~AutoRestorer() { *m_Location = m_OldValue; }
+
+ private:
+  T* const m_Location;
+  const T m_OldValue;
+};
+
+}  // namespace fxcrt
+
+using fxcrt::AutoRestorer;
+
+#endif  // CORE_FXCRT_AUTORESTORER_H_
diff --git a/core/fxcrt/cfx_autorestorer.h b/core/fxcrt/cfx_autorestorer.h
deleted file mode 100644
index a8c5125..0000000
--- a/core/fxcrt/cfx_autorestorer.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// 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/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index f22d575..a8dc88c 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -13,7 +13,7 @@
 #include "core/fpdfapi/render/cpdf_renderoptions.h"
 #include "core/fpdfdoc/cpdf_annotlist.h"
 #include "core/fpdfdoc/cpdf_interform.h"
-#include "core/fxcrt/cfx_autorestorer.h"
+#include "core/fxcrt/autorestorer.h"
 #include "fpdfsdk/cpdfsdk_annot.h"
 #include "fpdfsdk/cpdfsdk_annotiteration.h"
 #include "fpdfsdk/cpdfsdk_formfillenvironment.h"
@@ -422,7 +422,7 @@
   CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr =
       m_pFormFillEnv->GetAnnotHandlerMgr();
 
-  CFX_AutoRestorer<bool> lock(&m_bLocked);
+  AutoRestorer<bool> lock(&m_bLocked);
   m_bLocked = true;
 
 #ifdef PDF_ENABLE_XFA
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index 3625e9d..70d3990 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -8,7 +8,7 @@
 
 #include "core/fpdfapi/page/cpdf_page.h"
 #include "core/fpdfapi/parser/cpdf_document.h"
-#include "core/fxcrt/cfx_autorestorer.h"
+#include "core/fxcrt/autorestorer.h"
 #include "core/fxge/cfx_graphstatedata.h"
 #include "core/fxge/cfx_pathdata.h"
 #include "core/fxge/cfx_renderdevice.h"
@@ -880,7 +880,7 @@
     return {true, false};
   }
 
-  CFX_AutoRestorer<bool> restorer(&m_bNotifying);
+  AutoRestorer<bool> restorer(&m_bNotifying);
   m_bNotifying = true;
 
   uint32_t nAge = privateData.pWidget->GetAppearanceAge();
diff --git a/fpdfsdk/javascript/cjs_event_context.cpp b/fpdfsdk/javascript/cjs_event_context.cpp
index b820bc3..bf6b337 100644
--- a/fpdfsdk/javascript/cjs_event_context.cpp
+++ b/fpdfsdk/javascript/cjs_event_context.cpp
@@ -6,7 +6,7 @@
 
 #include "fpdfsdk/javascript/cjs_event_context.h"
 
-#include "core/fxcrt/cfx_autorestorer.h"
+#include "core/fxcrt/autorestorer.h"
 #include "fpdfsdk/javascript/JS_EventHandler.h"
 #include "fpdfsdk/javascript/cjs_runtime.h"
 #include "fpdfsdk/javascript/resource.h"
@@ -35,7 +35,7 @@
     return false;
   }
 
-  CFX_AutoRestorer<bool> restorer(&m_bBusy);
+  AutoRestorer<bool> restorer(&m_bBusy);
   m_bBusy = true;
 
   ASSERT(m_pEventHandler->IsValid());
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index c651999..89b19de 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -22,7 +22,7 @@
 #include "core/fpdfdoc/cpvt_section.h"
 #include "core/fpdfdoc/cpvt_word.h"
 #include "core/fpdfdoc/ipvt_fontmap.h"
-#include "core/fxcrt/cfx_autorestorer.h"
+#include "core/fxcrt/autorestorer.h"
 #include "core/fxcrt/fx_codepage.h"
 #include "core/fxge/cfx_graphstatedata.h"
 #include "core/fxge/cfx_pathdata.h"
@@ -1012,7 +1012,7 @@
   if (m_bNotifyFlag)
     return;
 
-  CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag);
+  AutoRestorer<bool> restorer(&m_bNotifyFlag);
   m_bNotifyFlag = true;
 
   PWL_SCROLL_INFO Info;
@@ -1047,7 +1047,7 @@
 
       if (m_pNotify) {
         if (!m_bNotifyFlag) {
-          CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag);
+          AutoRestorer<bool> restorer(&m_bNotifyFlag);
           m_bNotifyFlag = true;
           m_pNotify->SetScrollPosition(fy);
         }
@@ -1157,7 +1157,7 @@
 
     if (m_pNotify) {
       if (!m_bNotifyFlag) {
-        CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag);
+        AutoRestorer<bool> restorer(&m_bNotifyFlag);
         m_bNotifyFlag = true;
         if (const CPWL_EditImpl_RectArray* pRects =
                 m_Refresh.GetRefreshRects()) {
@@ -1227,7 +1227,7 @@
 
       if (m_pNotify) {
         if (!m_bNotifyFlag) {
-          CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag);
+          AutoRestorer<bool> restorer(&m_bNotifyFlag);
           m_bNotifyFlag = true;
           CFX_FloatRect rcRefresh = VTToEdit(rcWord);
           m_pNotify->InvalidateRect(&rcRefresh);
@@ -1241,7 +1241,7 @@
 
       if (m_pNotify) {
         if (!m_bNotifyFlag) {
-          CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag);
+          AutoRestorer<bool> restorer(&m_bNotifyFlag);
           m_bNotifyFlag = true;
           CFX_FloatRect rcRefresh = VTToEdit(rcLine);
           m_pNotify->InvalidateRect(&rcRefresh);
@@ -1280,7 +1280,7 @@
         ptFoot.y = line.ptLine.y + line.fLineDescent;
       }
 
-      CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag);
+      AutoRestorer<bool> restorer(&m_bNotifyFlag);
       m_bNotifyFlag = true;
       m_pNotify->SetCaret(m_SelState.IsEmpty(), VTToEdit(ptHead),
                           VTToEdit(ptFoot));
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.cpp b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
index dde9943..644fdf2 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
@@ -10,7 +10,7 @@
 #include <utility>
 #include <vector>
 
-#include "core/fxcrt/cfx_autorestorer.h"
+#include "core/fxcrt/autorestorer.h"
 #include "third_party/base/ptr_util.h"
 
 namespace {
@@ -64,7 +64,7 @@
 
 std::vector<std::unique_ptr<CXFA_FMExpression>>
 CXFA_FMParser::ParseTopExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return std::vector<std::unique_ptr<CXFA_FMExpression>>();
 
@@ -88,7 +88,7 @@
 }
 
 std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseFunction() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -151,7 +151,7 @@
 }
 
 std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -204,7 +204,7 @@
 }
 
 std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseVarExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -261,7 +261,7 @@
 }
 
 std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseExpExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -274,7 +274,7 @@
 
 std::unique_ptr<CXFA_FMSimpleExpression>
 CXFA_FMParser::ParseLogicalOrExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -309,7 +309,7 @@
 
 std::unique_ptr<CXFA_FMSimpleExpression>
 CXFA_FMParser::ParseLogicalAndExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -343,7 +343,7 @@
 
 std::unique_ptr<CXFA_FMSimpleExpression>
 CXFA_FMParser::ParseEqualityExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -388,7 +388,7 @@
 
 std::unique_ptr<CXFA_FMSimpleExpression>
 CXFA_FMParser::ParseRelationalExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -458,7 +458,7 @@
 
 std::unique_ptr<CXFA_FMSimpleExpression>
 CXFA_FMParser::ParseAddtiveExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -502,7 +502,7 @@
 
 std::unique_ptr<CXFA_FMSimpleExpression>
 CXFA_FMParser::ParseMultiplicativeExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -545,7 +545,7 @@
 }
 
 std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseUnaryExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -593,7 +593,7 @@
 
 std::unique_ptr<CXFA_FMSimpleExpression>
 CXFA_FMParser::ParsePrimaryExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -661,7 +661,7 @@
 
 std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParsePostExpression(
     std::unique_ptr<CXFA_FMSimpleExpression> expr) {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -855,7 +855,7 @@
 }
 
 std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseIndexExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -898,7 +898,7 @@
 }
 
 std::unique_ptr<CXFA_FMSimpleExpression> CXFA_FMParser::ParseParenExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -937,7 +937,7 @@
 }
 
 std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseBlockExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -981,7 +981,7 @@
 }
 
 std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseIfExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -1052,7 +1052,7 @@
 }
 
 std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseWhileExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -1073,7 +1073,7 @@
 
 std::unique_ptr<CXFA_FMSimpleExpression>
 CXFA_FMParser::ParseSubassignmentInForExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -1091,7 +1091,7 @@
 }
 
 std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseForExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -1160,7 +1160,7 @@
 }
 
 std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseForeachExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
@@ -1209,7 +1209,7 @@
 }
 
 std::unique_ptr<CXFA_FMExpression> CXFA_FMParser::ParseDoExpression() {
-  CFX_AutoRestorer<unsigned long> restorer(&m_parse_depth);
+  AutoRestorer<unsigned long> restorer(&m_parse_depth);
   if (HasError() || !IncrementParseDepthAndCheck())
     return nullptr;
 
diff --git a/xfa/fxfa/parser/cxfa_scriptcontext.cpp b/xfa/fxfa/parser/cxfa_scriptcontext.cpp
index 38d5039..4e78f46 100644
--- a/xfa/fxfa/parser/cxfa_scriptcontext.cpp
+++ b/xfa/fxfa/parser/cxfa_scriptcontext.cpp
@@ -8,7 +8,7 @@
 
 #include <utility>
 
-#include "core/fxcrt/cfx_autorestorer.h"
+#include "core/fxcrt/autorestorer.h"
 #include "core/fxcrt/cfx_widetextbuf.h"
 #include "core/fxcrt/fx_extension.h"
 #include "fxjs/cfxjse_arguments.h"
@@ -150,7 +150,7 @@
                                    CFXJSE_Value* hRetValue,
                                    CXFA_Object* pThisObject) {
   ByteString btScript;
-  CFX_AutoRestorer<XFA_SCRIPTLANGTYPE> typeRestorer(&m_eScriptType);
+  AutoRestorer<XFA_SCRIPTLANGTYPE> typeRestorer(&m_eScriptType);
   m_eScriptType = eScriptType;
   if (eScriptType == XFA_SCRIPTLANGTYPE_Formcalc) {
     if (!m_FM2JSContext) {
@@ -166,7 +166,7 @@
   } else {
     btScript = FX_UTF8Encode(wsScript);
   }
-  CFX_AutoRestorer<CXFA_Object*> nodeRestorer(&m_pThisObject);
+  AutoRestorer<CXFA_Object*> nodeRestorer(&m_pThisObject);
   m_pThisObject = pThisObject;
   CFXJSE_Value* pValue = pThisObject ? GetJSValueFromMap(pThisObject) : nullptr;
   return m_JsContext->ExecuteScript(btScript.c_str(), hRetValue, pValue);
@@ -498,7 +498,7 @@
   CXFA_Node* pThisObject = pParent->GetNodeItem(XFA_NODEITEM_Parent);
   CFXJSE_Context* pVariablesContext =
       CreateVariablesContext(pScriptNode, pThisObject);
-  CFX_AutoRestorer<CXFA_Object*> nodeRestorer(&m_pThisObject);
+  AutoRestorer<CXFA_Object*> nodeRestorer(&m_pThisObject);
   m_pThisObject = pThisObject;
   return pVariablesContext->ExecuteScript(btScript.c_str(), hRetValue.get());
 }