From f36a4644b828bd9ad214a42511af91b4a1073eea Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Fri, 10 Aug 2018 19:03:47 +0000 Subject: Remove direct calls to time Replaces them with calles to the proxy function, FXSYS_time, so that tests may use a stable time value instead of the wall clock value. BUG=pdfium:1104 Change-Id: I4743c4634f56d4a6cba1f1130c4562a35cee1887 Reviewed-on: https://pdfium-review.googlesource.com/39853 Reviewed-by: Lei Zhang Commit-Queue: Ryan Harrison --- fpdfsdk/fpdf_editpage.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'fpdfsdk/fpdf_editpage.cpp') diff --git a/fpdfsdk/fpdf_editpage.cpp b/fpdfsdk/fpdf_editpage.cpp index f1dbf70192..438a0624f3 100644 --- a/fpdfsdk/fpdf_editpage.cpp +++ b/fpdfsdk/fpdf_editpage.cpp @@ -26,6 +26,7 @@ #include "core/fpdfapi/parser/cpdf_string.h" #include "core/fpdfdoc/cpdf_annot.h" #include "core/fpdfdoc/cpdf_annotlist.h" +#include "core/fxcrt/fx_extension.h" #include "fpdfsdk/cpdfsdk_helpers.h" #include "public/fpdf_formfill.h" #include "third_party/base/logging.h" @@ -36,12 +37,6 @@ #include "fpdfsdk/fpdfxfa/cpdfxfa_page.h" #endif // PDF_ENABLE_XFA -#if _FX_OS_ == _FX_OS_ANDROID_ -#include -#else -#include -#endif - namespace { static_assert(FPDF_PAGEOBJ_TEXT == CPDF_PageObject::TEXT, @@ -166,7 +161,7 @@ FPDF_EXPORT FPDF_DOCUMENT FPDF_CALLCONV FPDF_CreateNewDocument() { time_t currentTime; ByteString DateStr; if (FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS)) { - if (time(¤tTime) != -1) { + if (FXSYS_time(¤tTime) != -1) { tm* pTM = localtime(¤tTime); if (pTM) { DateStr = ByteString::Format( -- cgit v1.2.3