summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_editpage.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2018-08-10 19:03:47 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-10 19:03:47 +0000
commitf36a4644b828bd9ad214a42511af91b4a1073eea (patch)
tree05231ac87adbac430efcb2b53a97c5886df15047 /fpdfsdk/fpdf_editpage.cpp
parent70cca3663a0ea6c290b55c290ba5eb1f1c9db572 (diff)
downloadpdfium-f36a4644b828bd9ad214a42511af91b4a1073eea.tar.xz
Remove direct calls to timechromium/3519
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 <thestig@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_editpage.cpp')
-rw-r--r--fpdfsdk/fpdf_editpage.cpp9
1 files changed, 2 insertions, 7 deletions
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 <time.h>
-#else
-#include <ctime>
-#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(&currentTime) != -1) {
+ if (FXSYS_time(&currentTime) != -1) {
tm* pTM = localtime(&currentTime);
if (pTM) {
DateStr = ByteString::Format(