summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-22 19:34:53 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-22 19:34:53 +0000
commit706e187ed8be44eb50bdf7024674930a4e10fa45 (patch)
tree9157a2c483b35d8e2ac11f655c29322594ad8d0b /public
parent2f62d36bfac781428f3896b443177e033be4c554 (diff)
downloadpdfium-706e187ed8be44eb50bdf7024674930a4e10fa45.tar.xz
Fix timezone inconsistency in document methods test.
We do this by adding an override that forces GM time on everyone when run from the test harness. Generalize presubmit warnings so that the new function passes. De-duplicate lambda capture in place of static function. Change-Id: I15b34bea558baf1763476b36f0bca76614984107 Reviewed-on: https://pdfium-review.googlesource.com/c/44390 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'public')
-rw-r--r--public/fpdf_ext.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/public/fpdf_ext.h b/public/fpdf_ext.h
index a531f1407e..b1784dd66f 100644
--- a/public/fpdf_ext.h
+++ b/public/fpdf_ext.h
@@ -69,14 +69,25 @@ typedef struct _UNSUPPORT_INFO {
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info);
-// Sets generator function for calls to time.
+// Set replacement function for calls to time().
//
// This API is intended to be used only for testing, thus may cause PDFium to
// behave poorly in production environments.
//
-// func - Function pointer to alternate implementation of time.
+// func - Function pointer to alternate implementation of time(), or
+// NULL to restore to actual time() call itself.
FPDF_EXPORT void FPDF_CALLCONV FSDK_SetTimeFunction(time_t (*func)());
+// Set replacement function for calls to localtime().
+//
+// This API is intended to be used only for testing, thus may cause PDFium to
+// behave poorly in production environments.
+//
+// func - Function pointer to alternate implementation of localtime(), or
+// NULL to restore to actual localtime() call itself.
+FPDF_EXPORT void FPDF_CALLCONV
+FSDK_SetLocaltimeFunction(struct tm* (*func)(const time_t*));
+
// Unknown page mode.
#define PAGEMODE_UNKNOWN -1
// Document outline, and thumbnails hidden.