Commit 3f6b6de6 authored by Jungshik Shin's avatar Jungshik Shin Committed by Commit Bot

Roll ICU to 172d331 and use icu tz in wtf

This roll has just one change to fix the timezone
detection on Japanese/Korean and other non-English
Windows.

  https://chromium-review.googlesource.com/1094322

In addition, switch to ICU to convert UTC to local time
in blink. This is to deal with a cryptic failure of
external/wpt/html/dom/doc*/resource*/document-lastModified-01.html

parens.

Bug: 849724
Test: Set the timezone to Tokyo on Japanese Windows
Test: In JS console, 'new Date()' outputs 'Japan Standard Time' in
Test: Layout test external/wpt/html/dom/doc*/resource*/document-lastModified-01.html
Change-Id: I3037252ff9044a114ae831de2b151df7c652603c
Reviewed-on: https://chromium-review.googlesource.com/1100739Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569262}
parent 6f05d6ee
...@@ -684,7 +684,7 @@ deps = { ...@@ -684,7 +684,7 @@ deps = {
Var('chromium_git') + '/chromium/deps/hunspell_dictionaries.git' + '@' + 'a9bac57ce6c9d390a52ebaad3259f5fdb871210e', Var('chromium_git') + '/chromium/deps/hunspell_dictionaries.git' + '@' + 'a9bac57ce6c9d390a52ebaad3259f5fdb871210e',
'src/third_party/icu': 'src/third_party/icu':
Var('chromium_git') + '/chromium/deps/icu.git' + '@' + 'f61e46dbee9d539a32551493e3bcc1dea92f83ec', Var('chromium_git') + '/chromium/deps/icu.git' + '@' + '172d33141cd16df9d027cfd49bfe940b1dc66f1a',
'src/third_party/icu4j': { 'src/third_party/icu4j': {
'packages': [ 'packages': [
......
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
#include <time.h> #include <time.h>
#include <algorithm> #include <algorithm>
#include <limits> #include <limits>
#include <memory>
#include "build/build_config.h" #include "build/build_config.h"
#include "third_party/blink/renderer/platform/wtf/ascii_ctype.h" #include "third_party/blink/renderer/platform/wtf/ascii_ctype.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h" #include "third_party/blink/renderer/platform/wtf/assertions.h"
...@@ -86,6 +87,8 @@ ...@@ -86,6 +87,8 @@
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h" #include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/time.h" #include "third_party/blink/renderer/platform/wtf/time.h"
#include <unicode/timezone.h>
#if defined(OS_WIN) #if defined(OS_WIN)
#include <windows.h> #include <windows.h>
#else #else
...@@ -835,9 +838,11 @@ String MakeRFC2822DateString(const Time date, int utc_offset) { ...@@ -835,9 +838,11 @@ String MakeRFC2822DateString(const Time date, int utc_offset) {
} }
double ConvertToLocalTime(double ms) { double ConvertToLocalTime(double ms) {
double utc_offset = CalculateUTCOffset(); std::unique_ptr<icu::TimeZone> timezone(icu::TimeZone::createDefault());
double dst_offset = CalculateDSTOffset(ms, utc_offset); int32_t raw_offset, dst_offset;
return (ms + utc_offset + dst_offset); UErrorCode status = U_ZERO_ERROR;
timezone->getOffset(ms, false, raw_offset, dst_offset, status);
return (ms + static_cast<double>(raw_offset + dst_offset));
} }
} // namespace WTF } // namespace WTF
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment