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

Issue 2200493002: using ulp to improve TranslateManager GetTargetLanguage() and InitiateTranslation() (Closed)

Created:
4 years, 4 months ago by ftang
Modified:
4 years, 1 month ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

using ulp to improve TranslateManager GetTargetLanguage() and InitiateTranslation() Design doc http://go/ulp_chrome_translate BUG=632897 Committed: https://crrev.com/9658047b62714181886bd2fed9f8246e635b70f3 Cr-Commit-Position: refs/heads/master@{#410939}

Patch Set 1 #

Patch Set 2 : add unit test for translate_prefs.cc #

Patch Set 3 : Make the TranslateManager change test friendly #

Patch Set 4 : add unit tests #

Patch Set 5 : fix windows test breakage #

Patch Set 6 : fix chromeos breakage #

Patch Set 7 : add unit tests #

Total comments: 60

Patch Set 8 : address review comments #

Patch Set 9 : Change based on 8/3 design review and simplified the use of ULP #

Total comments: 20

Patch Set 10 : address review comments #

Patch Set 11 : merge #

Patch Set 12 : attempt to fix iOS #

Patch Set 13 : fix global state problem in unittests #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+584 lines, -25 lines) Patch
M components/translate/core/browser/translate_browser_metrics.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/translate/core/browser/translate_manager.h View 1 2 3 4 5 6 7 8 9 4 chunks +20 lines, -0 lines 1 comment Download
M components/translate/core/browser/translate_manager.cc View 1 2 3 4 5 6 7 8 9 9 chunks +126 lines, -8 lines 3 comments Download
M components/translate/core/browser/translate_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +229 lines, -4 lines 0 comments Download
M components/translate/core/browser/translate_prefs.h View 1 2 3 4 5 6 7 8 9 2 chunks +12 lines, -0 lines 1 comment Download
M components/translate/core/browser/translate_prefs.cc View 1 2 3 4 5 6 7 8 9 4 chunks +65 lines, -0 lines 0 comments Download
M components/translate/core/browser/translate_prefs_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +131 lines, -7 lines 1 comment Download
M components/translate/core/browser/translate_ui_delegate_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +0 lines, -6 lines 0 comments Download

Messages

Total messages: 71 (44 generated)
ftang
add unit test for translate_prefs.cc
4 years, 4 months ago (2016-07-30 01:44:39 UTC) #1
ftang
Make the TranslateManager change test friendly
4 years, 4 months ago (2016-07-30 05:11:48 UTC) #6
ftang
add unit tests
4 years, 4 months ago (2016-07-30 07:52:03 UTC) #7
ftang
fix windows breakage due to uninitialized ptr
4 years, 4 months ago (2016-07-30 08:13:17 UTC) #8
ftang
fix chromeos brekage
4 years, 4 months ago (2016-07-30 13:03:48 UTC) #13
ftang
add unit tests
4 years, 4 months ago (2016-08-01 07:25:39 UTC) #18
ftang
See design doc in http://go/ulp_chrome_translate
4 years, 4 months ago (2016-08-01 22:36:44 UTC) #24
groby-ooo-7-16
Sorry, a whole bunch of comments - the design doc must have slipped out of ...
4 years, 4 months ago (2016-08-02 00:38:21 UTC) #25
ftang
address review comments
4 years, 4 months ago (2016-08-03 01:14:19 UTC) #26
ftang
PTAL . Also I change some part in the design doc to reflect it. http://go/ulp_chrome_translate ...
4 years, 4 months ago (2016-08-03 02:01:18 UTC) #30
ftang
groby- please HOLD your review on this. We have some discussion in the design review ...
4 years, 4 months ago (2016-08-03 19:35:43 UTC) #33
ftang
change based on 8/3 design review to simplified the use of ULP
4 years, 4 months ago (2016-08-04 01:32:25 UTC) #34
groby-ooo-7-16
Thanks for the quick changes! https://codereview.chromium.org/2200493002/diff/110001/components/translate/core/browser/translate_browser_metrics_unittest.cc File components/translate/core/browser/translate_browser_metrics_unittest.cc (right): https://codereview.chromium.org/2200493002/diff/110001/components/translate/core/browser/translate_browser_metrics_unittest.cc#newcode176 components/translate/core/browser/translate_browser_metrics_unittest.cc:176: translate::TranslateBrowserMetrics::ReportInitiationStatus( On 2016/08/03 02:01:17, ...
4 years, 4 months ago (2016-08-04 02:33:43 UTC) #39
ftang
address review comments
4 years, 4 months ago (2016-08-05 03:17:22 UTC) #40
ftang
PTAL https://codereview.chromium.org/2200493002/diff/150001/components/translate/core/browser/translate_manager.cc File components/translate/core/browser/translate_manager.cc (right): https://codereview.chromium.org/2200493002/diff/150001/components/translate/core/browser/translate_manager.cc#newcode81 components/translate/core/browser/translate_manager.cc:81: const double kDefaultTargetLanguageULPProbabilityThreshold = 0.55; On 2016/08/04 02:33:42, ...
4 years, 4 months ago (2016-08-05 04:45:28 UTC) #45
groby-ooo-7-16
lgtm
4 years, 4 months ago (2016-08-09 16:13:22 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2200493002/170001
4 years, 4 months ago (2016-08-09 17:06:37 UTC) #48
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/48672) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, ...
4 years, 4 months ago (2016-08-09 17:08:58 UTC) #50
ftang
merge
4 years, 4 months ago (2016-08-09 19:21:27 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2200493002/190001
4 years, 4 months ago (2016-08-09 19:22:19 UTC) #54
commit-bot: I haz the power
Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/builds/48937)
4 years, 4 months ago (2016-08-09 19:43:02 UTC) #56
ftang
attempt to fix iOS
4 years, 4 months ago (2016-08-10 01:04:29 UTC) #61
ftang
fix global state problem in unittests
4 years, 4 months ago (2016-08-10 02:11:23 UTC) #62
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2200493002/230001
4 years, 4 months ago (2016-08-10 02:12:15 UTC) #65
commit-bot: I haz the power
Committed patchset #13 (id:230001)
4 years, 4 months ago (2016-08-10 03:14:16 UTC) #67
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/9658047b62714181886bd2fed9f8246e635b70f3 Cr-Commit-Position: refs/heads/master@{#410939}
4 years, 4 months ago (2016-08-10 03:16:27 UTC) #69
Lei Zhang
4 years, 1 month ago (2016-11-17 07:03:29 UTC) #71
Message was sent while issue was closed.
(Drive by) Some generic coding improvement suggestions.

https://codereview.chromium.org/2200493002/diff/230001/components/translate/c...
File components/translate/core/browser/translate_manager.cc (right):

https://codereview.chromium.org/2200493002/diff/230001/components/translate/c...
components/translate/core/browser/translate_manager.cc:108: double
GetDoubleFromMap(std::map<std::string, std::string>& map,
So "git cl lint" noticed this is being passed by non-const reference... map[key]
will actually created a new entry with the key |key| if it did not exist before.
Is that intentional? Not sure if this matters.

https://codereview.chromium.org/2200493002/diff/230001/components/translate/c...
components/translate/core/browser/translate_manager.cc:296: if
(translate_client_->GetTranslatePrefs()->GetReadingFromUserLanguageProfile(
nit: "if (eval) return true; return false" -> return eval;

https://codereview.chromium.org/2200493002/diff/230001/components/translate/c...
components/translate/core/browser/translate_manager.cc:489: if (reading.size() >
0 &&
nit: !reading.empty() is a wee bit shorter

https://codereview.chromium.org/2200493002/diff/230001/components/translate/c...
File components/translate/core/browser/translate_manager.h (right):

https://codereview.chromium.org/2200493002/diff/230001/components/translate/c...
components/translate/core/browser/translate_manager.h:15: #include
"base/gtest_prod_util.h"
Not needed, but I imagine it's here because you wanted to use
FRIEND_TEST_ALL_PREFIXES at some point earlier, and then forgot to remove it?

https://codereview.chromium.org/2200493002/diff/230001/components/translate/c...
File components/translate/core/browser/translate_prefs.h (right):

https://codereview.chromium.org/2200493002/diff/230001/components/translate/c...
components/translate/core/browser/translate_prefs.h:170: typedef
std::pair<std::string, double> LanguageAndProbability;
nit: using LanguageAndProbability = std::pair... is preferred.

https://codereview.chromium.org/2200493002/diff/230001/components/translate/c...
File components/translate/core/browser/translate_prefs_unittest.cc (right):

https://codereview.chromium.org/2200493002/diff/230001/components/translate/c...
components/translate/core/browser/translate_prefs_unittest.cc:246:
EXPECT_EQ(2UL, list.size());
This should be an ASSERT_EQ(), otherwise if this fails the next |list| access
can cause the entire unit tests binary to crash. Ditto below on lines 294 and
331.

Powered by Google App Engine
This is Rietveld 408576698