Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(708)

Issue 1725283002: Top-level domain-based default encoding (Closed)

Created:
4 years, 10 months ago by Jinsuk Kim
Modified:
4 years, 9 months ago
CC:
blink-reviews, chromium-reviews, gavinp+loader_chromium.org, Nate Chapin, loading-reviews_chromium.org, tyoshino+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Top-level domain-based default encoding Default text encoding is determined based on the top level domain (*.jp, *.uk, etc) for the pages missing encoding information. Used Chromium's resource (components/strings/components_locale_settings_*.xtb) and Android system locale list for { TLD : encoding } mapping. Mapping for countries whose legacy, default encoding is not obvious (ge-Georgian, id-Indonesian, etc) are not included. They are likely to be UTF-8, handled by UTF-8 detector to be introduced soon. BUG=583564 Committed: https://crrev.com/5146788484915fc4e364a330d3a948ed7c03cd8f Cr-Commit-Position: refs/heads/master@{#382963}

Patch Set 1 #

Total comments: 14

Patch Set 2 : addressed comments #

Patch Set 3 : fixed component build error #

Total comments: 2

Patch Set 4 : addressed comments #

Total comments: 2

Patch Set 5 : #

Patch Set 6 : added the test back #

Patch Set 7 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -3 lines) Patch
M third_party/WebKit/Source/core/core.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp View 1 2 3 4 2 chunks +77 lines, -2 lines 0 comments Download
A third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp View 1 2 3 5 1 chunk +33 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (7 generated)
Jinsuk Kim
4 years, 10 months ago (2016-02-24 07:17:33 UTC) #2
aelias_OOO_until_Jul13
https://codereview.chromium.org/1725283002/diff/1/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp File third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp (right): https://codereview.chromium.org/1725283002/diff/1/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp#newcode50 third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp:50: map = new WTF::HashMap<String, WTF::TextEncoding>(); Hmm, in Chromium we ...
4 years, 9 months ago (2016-02-26 09:07:24 UTC) #3
esprehn
I think you want std::lower_bound instead. https://codereview.chromium.org/1725283002/diff/1/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp File third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp (right): https://codereview.chromium.org/1725283002/diff/1/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp#newcode46 third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp:46: static WTF::HashMap<String, WTF::TextEncoding>* ...
4 years, 9 months ago (2016-02-26 09:43:14 UTC) #4
Jinsuk Kim
https://codereview.chromium.org/1725283002/diff/1/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp File third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp (right): https://codereview.chromium.org/1725283002/diff/1/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp#newcode46 third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp:46: static WTF::HashMap<String, WTF::TextEncoding>* getEncodingMap() On 2016/02/26 09:43:13, esprehn wrote: ...
4 years, 9 months ago (2016-03-02 03:46:08 UTC) #5
Jinsuk Kim
- Used Vector methods more suitable for the job: s/v.size() > 0/v.isEmpty()/ s/v[v.size() - 1]/v.last()/ ...
4 years, 9 months ago (2016-03-04 05:54:09 UTC) #6
aelias_OOO_until_Jul13
non-owner lgtm modulo comment https://codereview.chromium.org/1725283002/diff/40001/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp File third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp (right): https://codereview.chromium.org/1725283002/diff/40001/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp#newcode30 third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp:30: EXPECT_EQ(WTF::Latin1Encoding(), defaultEncodingForURL("http://www.itojun.org/paper/keio-doctor97.html")); Since this real ...
4 years, 9 months ago (2016-03-04 06:53:12 UTC) #7
Jinsuk Kim
https://codereview.chromium.org/1725283002/diff/40001/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp File third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp (right): https://codereview.chromium.org/1725283002/diff/40001/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp#newcode30 third_party/WebKit/Source/core/loader/TextResourceDecoderBuilderTest.cpp:30: EXPECT_EQ(WTF::Latin1Encoding(), defaultEncodingForURL("http://www.itojun.org/paper/keio-doctor97.html")); On 2016/03/04 06:53:12, aelias wrote: > Since ...
4 years, 9 months ago (2016-03-07 01:28:00 UTC) #8
esprehn
lgtm, but I'd rather you used a struct instead of math on the char* array. ...
4 years, 9 months ago (2016-03-21 22:56:25 UTC) #9
Jinsuk Kim
https://codereview.chromium.org/1725283002/diff/60001/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp File third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp (right): https://codereview.chromium.org/1725283002/diff/60001/third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp#newcode45 third_party/WebKit/Source/core/loader/TextResourceDecoderBuilder.cpp:45: static const char* legacyEncodings[] = { On 2016/03/21 22:56:25, ...
4 years, 9 months ago (2016-03-22 21:51:53 UTC) #13
esprehn
lgtm
4 years, 9 months ago (2016-03-22 23:04:20 UTC) #14
esprehn
btw where are the tests?
4 years, 9 months ago (2016-03-22 23:04:36 UTC) #15
Jinsuk Kim
On 2016/03/22 23:04:36, esprehn wrote: > btw where are the tests? Added it back.
4 years, 9 months ago (2016-03-22 23:07:51 UTC) #16
Jinsuk Kim
On 2016/03/22 23:07:51, Jinsuk wrote: > On 2016/03/22 23:04:36, esprehn wrote: > > btw where ...
4 years, 9 months ago (2016-03-22 23:09:13 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1725283002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1725283002/120001
4 years, 9 months ago (2016-03-23 23:01:51 UTC) #20
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 9 months ago (2016-03-23 23:08:55 UTC) #21
commit-bot: I haz the power
4 years, 9 months ago (2016-03-23 23:10:19 UTC) #23
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/5146788484915fc4e364a330d3a948ed7c03cd8f
Cr-Commit-Position: refs/heads/master@{#382963}

Powered by Google App Engine
This is Rietveld 408576698