From 67609817815cf7bbc18e60b2a8590090168df184 Mon Sep 17 00:00:00 2001 From: fang fengrong Date: Thu, 2 Mar 2023 16:34:51 +0800 Subject: [PATCH] [M108 Migration][VD] Support set time and time zone offset It is required for HbbTV to run Ligada tests. However Ligada tests rely on stream time that can be old, like 2011. Ligada tests compare time offset via Javascript codes(new Date()). So the time offset has to be applied on render process side. Ligada tests also use the time offset for certificates expiration validating. ICS app also calls the APIs. References: https://review.tizen.org/gerrit/#/c/282681 Change-Id: I1f03d6fde935a28c7eaa114fb22bbcf29c5bddfe Signed-off-by: fang fengrong --- base/time/time.cc | 17 +++ base/time/time.h | 7 ++ base/time/time_exploded_posix.cc | 3 + base/time/time_now_posix.cc | 7 ++ content/common/zygote/zygote_commands_linux.h | 3 + .../common/zygote/zygote_communication_linux.cc | 14 +++ content/common/zygote/zygote_communication_linux.h | 4 + content/zygote/zygote_linux.cc | 18 +++ content/zygote/zygote_linux.h | 4 + net/cookies/canonical_cookie.cc | 10 ++ services/device/device_service.cc | 6 + services/device/device_service.h | 4 + services/device/public/mojom/BUILD.gn | 4 + services/device/public/mojom/device_service.mojom | 4 + .../device/time_zone_monitor/time_zone_monitor.cc | 7 ++ .../device/time_zone_monitor/time_zone_monitor.h | 4 + .../ewk/efl_integration/browser_context_efl.cc | 121 +++++++++++++++++++++ .../ewk/efl_integration/browser_context_efl.h | 11 ++ .../efl_integration/common/content_switches_efl.cc | 2 + .../efl_integration/common/content_switches_efl.h | 2 + .../efl_integration/common/render_messages_ewk.h | 1 + .../efl_integration/content_browser_client_efl.cc | 8 ++ tizen_src/ewk/efl_integration/eweb_context.cc | 9 ++ tizen_src/ewk/efl_integration/eweb_context.h | 2 + .../efl_integration/private/ewk_context_private.cc | 9 ++ .../efl_integration/private/ewk_context_private.h | 4 + .../ewk/efl_integration/public/ewk_context.cc | 23 +++- .../renderer/render_thread_observer_efl.cc | 28 ++++- .../renderer/render_thread_observer_efl.h | 8 +- 29 files changed, 339 insertions(+), 5 deletions(-) diff --git a/base/time/time.cc b/base/time/time.cc index 50ae8df..a03d13c 100644 --- a/base/time/time.cc +++ b/base/time/time.cc @@ -18,6 +18,12 @@ #include "build/build_config.h" #include "third_party/abseil-cpp/absl/types/optional.h" +#if BUILDFLAG(IS_TIZEN_TV) +namespace { +double time_offset_ = 0.0; +} // namespace +#endif + namespace base { namespace { @@ -417,4 +423,15 @@ std::string TimeFormatHTTP(base::Time time) { exploded.hour, exploded.minute, exploded.second); } +#if BUILDFLAG(IS_TIZEN_TV) +// Static +double Time::TimeOffset() { + return time_offset_; +} + +// Static +void Time::SetTimeOffset(double time_offset) { + time_offset_ = time_offset; +} +#endif } // namespace base diff --git a/base/time/time.h b/base/time/time.h index 4d46222..5b6c333 100644 --- a/base/time/time.h +++ b/base/time/time.h @@ -788,6 +788,13 @@ class BASE_EXPORT Time : public time_internal::TimeBase