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

Issue 2911483002: Check env-version upon component load (Closed)

Created:
3 years, 7 months ago by xiaochu
Modified:
3 years, 6 months ago
Reviewers:
waffles
CC:
chromium-reviews, adlr, ketakid1
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Check env-version upon component load In Traits::ComponentReady, it fetches env-version from a macro configuration. Then compare with min-env-version extracted from manifest for compatibility. If compatible, component name is saved in a member vector in g_browser_process->platform_part(). When it checks the compatibility of env-version (x.y) and min-env-version (a.b): If (x.y) and (a.b) are valid and x==a and y>=b, then its compatible; otherwise incompatible. code refactor: 1) reorder definition to be same sequence with declaration. 2) add new InstallCrOSComponent function for easy mocking. 3) more unit test. 4) remove dead code. 5) return void instead of bool in InstallCrOSComponent for consistency. 6) rename parameters for consistency 7) remove unnecessary DVLOG/VLOG and condense comments. BUG=chromium:690521 TEST=1) unittest, 2) successfully install&load compatible component, 3) fail to load old incompatible component on HD when chrome is updated. Review-Url: https://codereview.chromium.org/2911483002 Cr-Commit-Position: refs/heads/master@{#477307} Committed: https://chromium.googlesource.com/chromium/src/+/fd9d71980637bf89994f61476acd7760da72612d

Patch Set 1 #

Patch Set 2 : Check env-version upon component load #

Patch Set 3 : Check env-version upon component load #

Patch Set 4 : Check env-version upon component load #

Patch Set 5 : Check env-version upon component load #

Patch Set 6 : Check env-version upon component load #

Patch Set 7 : Check env-version upon component load #

Patch Set 8 : Check env-version upon component load #

Patch Set 9 : Check env-version upon component load #

Patch Set 10 : Check env-version upon component load #

Patch Set 11 : Check env-version upon component load #

Patch Set 12 : rebase #

Patch Set 13 : Check env-version upon component load #

Patch Set 14 : remove DVLOGs #

Total comments: 20

Patch Set 15 : address comments from waffles #

Patch Set 16 : fix unit test. #

Patch Set 17 : fix test #

Patch Set 18 : fix memory leaks #

Patch Set 19 : fix test #

Patch Set 20 : 2.0 -> 2.1 #

Patch Set 21 : fix test #

Patch Set 22 : fix test #

Patch Set 23 : fix test #

Patch Set 24 : fix test #

Patch Set 25 : fix test #

Patch Set 26 : Check env-version upon component load #

Patch Set 27 : test finally fixed. #

Patch Set 28 : Check env-version upon component load #

Patch Set 29 : rebase #

Total comments: 8

Patch Set 30 : address comments from waffles #

Patch Set 31 : rename functions & change comments. #

Patch Set 32 : fix test & reorder functions #

Patch Set 33 : reorder functions #

Patch Set 34 : code refactor #

Patch Set 35 : fix test #

Patch Set 36 : fix comments #

Patch Set 37 : fix comment #

Total comments: 11

Patch Set 38 : address comments from waffles. #

Patch Set 39 : address comments from waffles #

Total comments: 6

Patch Set 40 : address comments from waffles #

Total comments: 4

Patch Set 41 : address comments from waffles #

Unified diffs Side-by-side diffs Delta from patch set Stats (+186 lines, -163 lines) Patch
M chrome/browser/component_updater/cros_component_installer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 4 chunks +37 lines, -51 lines 0 comments Download
M chrome/browser/component_updater/cros_component_installer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 4 chunks +93 lines, -65 lines 0 comments Download
M chrome/browser/component_updater/cros_component_installer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 2 chunks +56 lines, -47 lines 0 comments Download

Messages

Total messages: 74 (54 generated)
xiaochu
Can you please take a look?
3 years, 7 months ago (2017-05-26 16:46:12 UTC) #13
waffles
https://codereview.chromium.org/2911483002/diff/260001/chrome/browser/component_updater/cros_component_installer.cc File chrome/browser/component_updater/cros_component_installer.cc (right): https://codereview.chromium.org/2911483002/diff/260001/chrome/browser/component_updater/cros_component_installer.cc#newcode161 chrome/browser/component_updater/cros_component_installer.cc:161: } empty line between function definitions https://codereview.chromium.org/2911483002/diff/260001/chrome/browser/component_updater/cros_component_installer.cc#newcode165 chrome/browser/component_updater/cros_component_installer.cc:165: // ...
3 years, 7 months ago (2017-05-26 17:28:26 UTC) #14
xiaochu
https://codereview.chromium.org/2911483002/diff/260001/chrome/browser/component_updater/cros_component_installer.cc File chrome/browser/component_updater/cros_component_installer.cc (right): https://codereview.chromium.org/2911483002/diff/260001/chrome/browser/component_updater/cros_component_installer.cc#newcode161 chrome/browser/component_updater/cros_component_installer.cc:161: } On 2017/05/26 17:28:26, waffles wrote: > empty line ...
3 years, 6 months ago (2017-05-26 19:44:02 UTC) #15
xiaochu
On 2017/05/26 19:44:02, xiaochu wrote: > https://codereview.chromium.org/2911483002/diff/260001/chrome/browser/component_updater/cros_component_installer.cc > File chrome/browser/component_updater/cros_component_installer.cc (right): > > https://codereview.chromium.org/2911483002/diff/260001/chrome/browser/component_updater/cros_component_installer.cc#newcode161 > ...
3 years, 6 months ago (2017-05-30 21:23:28 UTC) #25
waffles
https://codereview.chromium.org/2911483002/diff/540001/chrome/browser/component_updater/cros_component_installer.cc File chrome/browser/component_updater/cros_component_installer.cc (right): https://codereview.chromium.org/2911483002/diff/540001/chrome/browser/component_updater/cros_component_installer.cc#newcode151 chrome/browser/component_updater/cros_component_installer.cc:151: env_version.components()[1] >= min_env_version.components()[1]) { You can replace the == ...
3 years, 6 months ago (2017-05-30 22:12:17 UTC) #26
xiaochu
Thanks! I left only Load API and fixed the order and logic of the functions ...
3 years, 6 months ago (2017-05-31 15:40:11 UTC) #31
xiaochu
Can you please take a look?
3 years, 6 months ago (2017-05-31 23:45:07 UTC) #35
waffles
https://codereview.chromium.org/2911483002/diff/700001/chrome/browser/component_updater/cros_component_installer.cc File chrome/browser/component_updater/cros_component_installer.cc (right): https://codereview.chromium.org/2911483002/diff/700001/chrome/browser/component_updater/cros_component_installer.cc#newcode155 chrome/browser/component_updater/cros_component_installer.cc:155: InstallComponent(name, load_callback); Seems simpler to just call the three-argument ...
3 years, 6 months ago (2017-06-01 00:08:14 UTC) #36
xiaochu
Thanks! I have some questions asked inline. https://codereview.chromium.org/2911483002/diff/700001/chrome/browser/component_updater/cros_component_installer.cc File chrome/browser/component_updater/cros_component_installer.cc (right): https://codereview.chromium.org/2911483002/diff/700001/chrome/browser/component_updater/cros_component_installer.cc#newcode155 chrome/browser/component_updater/cros_component_installer.cc:155: InstallComponent(name, load_callback); ...
3 years, 6 months ago (2017-06-01 02:58:10 UTC) #39
xiaochu
Missed one in last reply. https://codereview.chromium.org/2911483002/diff/700001/chrome/browser/component_updater/cros_component_installer.cc File chrome/browser/component_updater/cros_component_installer.cc (right): https://codereview.chromium.org/2911483002/diff/700001/chrome/browser/component_updater/cros_component_installer.cc#newcode218 chrome/browser/component_updater/cros_component_installer.cc:218: if (g_browser_process->platform_part()->IsCompatibleCrOSComponent(name)) { On ...
3 years, 6 months ago (2017-06-01 16:26:50 UTC) #42
waffles
https://codereview.chromium.org/2911483002/diff/700001/chrome/browser/component_updater/cros_component_installer.h File chrome/browser/component_updater/cros_component_installer.h (right): https://codereview.chromium.org/2911483002/diff/700001/chrome/browser/component_updater/cros_component_installer.h#newcode87 chrome/browser/component_updater/cros_component_installer.h:87: class CrOSComponent { On 2017/06/01 02:58:10, xiaochu wrote: > ...
3 years, 6 months ago (2017-06-01 22:42:41 UTC) #47
xiaochu
Thanks! One question is inlined. https://codereview.chromium.org/2911483002/diff/700001/chrome/browser/component_updater/cros_component_installer.h File chrome/browser/component_updater/cros_component_installer.h (right): https://codereview.chromium.org/2911483002/diff/700001/chrome/browser/component_updater/cros_component_installer.h#newcode87 chrome/browser/component_updater/cros_component_installer.h:87: class CrOSComponent { On ...
3 years, 6 months ago (2017-06-02 04:42:15 UTC) #50
xiaochu
Can you please take a look? thanks!
3 years, 6 months ago (2017-06-05 18:24:00 UTC) #53
waffles
lgtm https://codereview.chromium.org/2911483002/diff/760001/chrome/browser/component_updater/cros_component_installer.cc File chrome/browser/component_updater/cros_component_installer.cc (right): https://codereview.chromium.org/2911483002/diff/760001/chrome/browser/component_updater/cros_component_installer.cc#newcode147 chrome/browser/component_updater/cros_component_installer.cc:147: env_version >= min_env_version; I thought you still needed ...
3 years, 6 months ago (2017-06-05 18:43:44 UTC) #54
xiaochu
On 2017/06/05 18:43:44, waffles wrote: > lgtm > > https://codereview.chromium.org/2911483002/diff/760001/chrome/browser/component_updater/cros_component_installer.cc > File chrome/browser/component_updater/cros_component_installer.cc (right): > ...
3 years, 6 months ago (2017-06-05 19:09:29 UTC) #55
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/2911483002/760001
3 years, 6 months ago (2017-06-05 19:09:58 UTC) #57
waffles
On 2017/06/05 19:09:58, commit-bot: I haz the power wrote: > CQ is trying da patch. ...
3 years, 6 months ago (2017-06-05 19:28:08 UTC) #59
xiaochu
I apologize for that. My phone hides the detailed comments from me... https://codereview.chromium.org/2911483002/diff/760001/chrome/browser/component_updater/cros_component_installer.cc File chrome/browser/component_updater/cros_component_installer.cc ...
3 years, 6 months ago (2017-06-05 19:34:58 UTC) #60
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/2911483002/780001
3 years, 6 months ago (2017-06-06 16:13:57 UTC) #71
commit-bot: I haz the power
3 years, 6 months ago (2017-06-06 16:18:44 UTC) #74
Message was sent while issue was closed.
Committed patchset #41 (id:780001) as
https://chromium.googlesource.com/chromium/src/+/fd9d71980637bf89994f61476acd...

Powered by Google App Engine
This is Rietveld 408576698