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

Issue 504051: Relanding the language detection. (Closed)

Created:
11 years ago by jcampan
Modified:
9 years, 7 months ago
Reviewers:
brettw
CC:
chromium-reviews_googlegroups.com, brettw+cc_chromium.org, ben+cc_chromium.org, Erik does not do reviews, jam, Aaron Boodman, pam+watch_chromium.org, Paweł Hajdan Jr., darin (slow to review)
Visibility:
Public.

Description

Relanding the language detection code. The code would crash if multiple PageContents notifications were received rapidly. The CLDHelper now notifies the TabContents directly and the TabContents ensures only one language detection can be performed at a time. Added unit-tests to validate these cases in web_contents_unittest.cc. Note that patch set 1 is the original patch, patch set 2 contains the new changes. Original review: http://codereview.chromium.org/492024/show BUG=30662 TEST=Run the unit-tests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=35735

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 6

Patch Set 3 : '' #

Total comments: 1

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+473 lines, -129 lines) Patch
M chrome/browser/browser.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/browser_browsertest.cc View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/browser/cld_helper.h View 1 2 1 chunk +72 lines, -0 lines 0 comments Download
A chrome/browser/cld_helper.cc View 1 2 3 1 chunk +70 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_tabs_module.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_tabs_module.cc View 1 2 3 2 chunks +25 lines, -9 lines 0 comments Download
M chrome/browser/renderer_host/browser_render_process_host.h View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/renderer_host/browser_render_process_host.cc View 1 2 3 3 chunks +2 lines, -15 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.h View 1 2 3 4 chunks +8 lines, -12 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 1 2 3 6 chunks +11 lines, -24 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host_delegate.h View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/navigation_entry.h View 1 2 3 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.h View 1 2 3 5 chunks +11 lines, -3 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 1 2 3 4 chunks +53 lines, -4 lines 0 comments Download
M chrome/browser/tab_contents/web_contents_unittest.cc View 2 3 4 chunks +103 lines, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/notification_type.h View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 3 4 chunks +8 lines, -14 lines 0 comments Download
M chrome/renderer/render_view.h View 1 2 3 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 3 5 chunks +5 lines, -38 lines 0 comments Download
A chrome/test/data/english_page.html View 1 chunk +6 lines, -0 lines 0 comments Download
A chrome/test/data/french_page.html View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/test/ui_test_utils.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/test/ui_test_utils.cc View 1 2 3 2 chunks +32 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
jcampan
There are still bugs in the actual CLD toolbar library that were triggered by the ...
11 years ago (2009-12-18 22:34:00 UTC) #1
brettw
http://codereview.chromium.org/504051/diff/2016/3013 File chrome/browser/cld_helper.cc (right): http://codereview.chromium.org/504051/diff/2016/3013#newcode38 chrome/browser/cld_helper.cc:38: void CLDHelper::DoDetectLanguage() { What do you think about checking ...
11 years ago (2009-12-21 18:55:00 UTC) #2
jcampan
http://codereview.chromium.org/504051/diff/2016/3013 File chrome/browser/cld_helper.cc (right): http://codereview.chromium.org/504051/diff/2016/3013#newcode38 chrome/browser/cld_helper.cc:38: void CLDHelper::DoDetectLanguage() { On 2009/12/21 18:55:00, brettw wrote: > ...
11 years ago (2009-12-21 19:48:21 UTC) #3
brettw
11 years ago (2009-12-22 23:42:43 UTC) #4
LGTM with minor change.

http://codereview.chromium.org/504051/diff/3040/3049
File chrome/browser/tab_contents/tab_contents.h (right):

http://codereview.chromium.org/504051/diff/3040/3049#newcode293
chrome/browser/tab_contents/tab_contents.h:293: void PageLanguageDetected(int
page_id, const std::string& language);
It doesn't look like you use the args anymore, and just ask the CLD helper for
the IDs and the language. I think you can just delete them. Don't forget to
update the comment above the decl in the header.

Powered by Google App Engine
This is Rietveld 408576698