summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-01 16:41:23 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-01 16:41:23 +0000
commit3018c1c7323a1aa9fd89c7de5420ed925b5b6611 (patch)
tree23fdf52f752690c9012c8781e3a3fd0dc0645238 /fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
parent180656569acbb93fd1ba4ff9b9264e4b41ca17b2 (diff)
downloadpdfium-3018c1c7323a1aa9fd89c7de5420ed925b5b6611.tar.xz
Return unique_ptr from CPDFXFA_Context::GetTimerMgr()
Proves ownership by avoiding a std::unique_ptr::reset() call. Change-Id: Ia6e11920d84dda49699736ef3189e58d240d409e Reviewed-on: https://pdfium-review.googlesource.com/33230 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_context.cpp')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_context.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
index 36d86650b7..446a77ea96 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_context.cpp
@@ -341,9 +341,8 @@ bool CPDFXFA_Context::PutRequestURL(const WideString& wsURL,
m_pFormFillEnv->PutRequestURL(wsURL, wsData, wsEncode);
}
-IFWL_AdapterTimerMgr* CPDFXFA_Context::GetTimerMgr() {
- CXFA_FWLAdapterTimerMgr* pAdapter = nullptr;
- if (m_pFormFillEnv)
- pAdapter = new CXFA_FWLAdapterTimerMgr(m_pFormFillEnv.Get());
- return pAdapter;
+std::unique_ptr<IFWL_AdapterTimerMgr> CPDFXFA_Context::GetTimerMgr() {
+ if (!m_pFormFillEnv)
+ return nullptr;
+ return pdfium::MakeUnique<CXFA_FWLAdapterTimerMgr>(m_pFormFillEnv.Get());
}