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

Issue 1650303002: Move DOM-inspecting language detection logic to Blink. (Closed)

Created:
4 years, 10 months ago by dglazkov
Modified:
3 years, 9 months ago
Reviewers:
esprehn
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, eae+blinkwatch, jam, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, rwlbuis, sof
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move DOM-inspecting language detection logic to Blink. This is a rewrite of the functionality, along with the tests, not a straight-up move. BUG=521166

Patch Set 1 #

Patch Set 2 : Fixed webkit_unit_tests compile. #

Patch Set 3 : Fixed PDF tests. #

Patch Set 4 : Removed wishful-thinking assertion. #

Patch Set 5 : Wrote tests. #

Total comments: 3

Patch Set 6 : Rebased. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+254 lines, -163 lines) Patch
M chrome/renderer/chrome_render_frame_observer.cc View 1 2 3 4 3 chunks +14 lines, -9 lines 0 comments Download
M components/translate/content/renderer/translate_helper.h View 6 chunks +11 lines, -8 lines 0 comments Download
M components/translate/content/renderer/translate_helper.cc View 6 chunks +26 lines, -77 lines 0 comments Download
M third_party/WebKit/Source/core/dom/DocumentStatisticsCollector.h View 1 chunk +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/DocumentStatisticsCollector.cpp View 1 2 3 4 5 5 chunks +115 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/dom/DocumentStatisticsCollectorTest.cpp View 1 2 3 4 7 chunks +42 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/web/WebDocument.cpp View 1 2 3 4 2 chunks +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.cpp View 1 2 3 4 3 chunks +2 lines, -59 lines 0 comments Download
M third_party/WebKit/public/blink_headers.gypi View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A third_party/WebKit/public/platform/WebLanguageDetectionDetails.h View 1 chunk +27 lines, -0 lines 0 comments Download
M third_party/WebKit/public/web/WebDocument.h View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (13 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1650303002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1650303002/1
4 years, 10 months ago (2016-01-30 00:53:22 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_compile_dbg_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_ng/builds/43370) linux_chromium_gn_chromeos_rel on ...
4 years, 10 months ago (2016-01-30 01:11:17 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1650303002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1650303002/20001
4 years, 10 months ago (2016-01-30 04:58:22 UTC) #6
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/159677)
4 years, 10 months ago (2016-01-30 05:39:43 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1650303002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1650303002/40001
4 years, 10 months ago (2016-01-30 05:51:28 UTC) #10
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/166840)
4 years, 10 months ago (2016-01-30 07:14:23 UTC) #12
dglazkov
Removed wishful-thinking assertion.
4 years, 10 months ago (2016-01-31 05:22:06 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1650303002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1650303002/60001
4 years, 10 months ago (2016-01-31 05:22:15 UTC) #15
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-01-31 06:33:34 UTC) #17
dglazkov
Wrote tests.
4 years, 10 months ago (2016-02-05 21:36:39 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1650303002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1650303002/80001
4 years, 10 months ago (2016-02-05 21:37:28 UTC) #20
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/18256) android_chromium_gn_compile_rel on ...
4 years, 10 months ago (2016-02-05 21:42:08 UTC) #22
dglazkov
Rebased.
4 years, 10 months ago (2016-02-05 22:32:47 UTC) #24
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1650303002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1650303002/100001
4 years, 10 months ago (2016-02-05 22:36:34 UTC) #25
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/112508)
4 years, 10 months ago (2016-02-05 23:47:30 UTC) #27
esprehn
4 years, 10 months ago (2016-02-06 01:44:36 UTC) #29
I've been trying to decide if I want services to be accessible by way of
something like FooService::Get(document or frame or thing), or if they should
just be all static and you access them by creating one on a stack. Hmm..

https://codereview.chromium.org/1650303002/diff/80001/third_party/WebKit/Sour...
File third_party/WebKit/Source/core/dom/DocumentStatisticsCollector.cpp (right):

https://codereview.chromium.org/1650303002/diff/80001/third_party/WebKit/Sour...
third_party/WebKit/Source/core/dom/DocumentStatisticsCollector.cpp:318: inline
static bool hasNoTranslateMeta(Document& document)
I doubt you want this inline

https://codereview.chromium.org/1650303002/diff/80001/third_party/WebKit/publ...
File third_party/WebKit/public/platform/WebLanguageDetectionDetails.h (right):

https://codereview.chromium.org/1650303002/diff/80001/third_party/WebKit/publ...
third_party/WebKit/public/platform/WebLanguageDetectionDetails.h:21: bool
hasNoTranslateMeta;
I think you can actually just write = false; here and remove the constructor

https://codereview.chromium.org/1650303002/diff/80001/third_party/WebKit/publ...
File third_party/WebKit/public/web/WebDocument.h (right):

https://codereview.chromium.org/1650303002/diff/80001/third_party/WebKit/publ...
third_party/WebKit/public/web/WebDocument.h:140: BLINK_EXPORT
WebLanguageDetectionDetails languageDetectionDetails();
I think maybe we want a DocumentFeatureService that takes a WebDocument as an
argument and has the methods for vending this data.

I'm not sure how to enforce that services are ephemeral yet.

Powered by Google App Engine
This is Rietveld 408576698