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

Issue 1579433002: Make profile statistics tasks inspectable by tests (Closed)

Created:
4 years, 11 months ago by lwchkg
Modified:
4 years, 9 months 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

ProfileStatisticsAggregator in profile_statistics.cc was added in previous CLs without tests except for the accessors of ProfileInfoCache. Now the necessary tests are added. Some classes are refactored to improve testability. Previous CLs: 1248613003, 1415223002, 1428973003 BUG=501916 Committed: https://crrev.com/db92ff9fb8ee68d3d77c3f4f77bd62f7b41fd747 Cr-Commit-Position: refs/heads/master@{#382202}

Patch Set 1 #

Total comments: 13

Patch Set 2 : Respond to comments #

Total comments: 15

Patch Set 3 : Make ProfileStatisticsAggregator tasks trackable #

Total comments: 4

Patch Set 4 : Refactor ProfileStatistics into profile KeyedService #

Patch Set 5 : Updated browser tests #

Patch Set 6 : Changed gyp/gn files, also a few small changes #

Total comments: 14

Patch Set 7 : Respond to comments, fix bugs #

Patch Set 8 : Fixed bugs #

Patch Set 9 : Removed a DCHECK which caused unit tests to crash #

Patch Set 10 : Used a WeakPtr in DeregisterAggregator callback to address lifetime issue #

Patch Set 11 : Added out-of-line destructor in ProfileStatistics #

Patch Set 12 : Renamed ProfileAttributesStorage related functions in profile_statistics.* #

Unified diffs Side-by-side diffs Delta from patch set Stats (+955 lines, -417 lines) Patch
M chrome/browser/profiles/profile_manager.cc View 1 2 3 4 5 4 chunks +16 lines, -6 lines 0 comments Download
M chrome/browser/profiles/profile_statistics.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +43 lines, -44 lines 0 comments Download
M chrome/browser/profiles/profile_statistics.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +55 lines, -345 lines 0 comments Download
A chrome/browser/profiles/profile_statistics_aggregator.h View 1 2 3 4 5 6 1 chunk +164 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_statistics_aggregator.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +238 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_statistics_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +276 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_statistics_common.h View 1 2 3 4 5 6 1 chunk +38 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_statistics_common.cc View 1 2 3 4 5 6 1 chunk +13 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_statistics_factory.h View 1 2 3 4 5 1 chunk +37 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_statistics_factory.cc View 1 2 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_statistics_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +13 lines, -12 lines 0 comments Download
M chrome/browser/ui/webui/signin/user_manager_screen_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +7 lines, -6 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 2 chunks +8 lines, -2 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 2 chunks +1 line, -1 line 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 2 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 67 (27 generated)
lwchkg
Dear all, Please comment. I'll try to add all the tests as described in the ...
4 years, 11 months ago (2016-01-11 16:57:10 UTC) #3
Mike Lerman
A few initial comments. https://codereview.chromium.org/1579433002/diff/1/chrome/browser/profiles/profile_statistics_browsertest.cc File chrome/browser/profiles/profile_statistics_browsertest.cc (right): https://codereview.chromium.org/1579433002/diff/1/chrome/browser/profiles/profile_statistics_browsertest.cc#newcode28 chrome/browser/profiles/profile_statistics_browsertest.cc:28: bool operator<(const ProfileCategoryStat& a, const ...
4 years, 11 months ago (2016-01-11 18:12:20 UTC) #4
lwchkg
Thanks for the comment. Anyway I didn't recon that putting "private" function in anywhere out ...
4 years, 11 months ago (2016-01-13 12:58:47 UTC) #5
lwchkg
New patch uploaded. https://codereview.chromium.org/1579433002/diff/40001/chrome/browser/profiles/profile_statistics_browsertest.cc File chrome/browser/profiles/profile_statistics_browsertest.cc (right): https://codereview.chromium.org/1579433002/diff/40001/chrome/browser/profiles/profile_statistics_browsertest.cc#newcode27 chrome/browser/profiles/profile_statistics_browsertest.cc:27: Do you know why this empty ...
4 years, 11 months ago (2016-01-13 17:21:55 UTC) #7
Mike Lerman
Really interesting approach! Cool stuff :) https://codereview.chromium.org/1579433002/diff/1/chrome/browser/profiles/profile_statistics_browsertest.cc File chrome/browser/profiles/profile_statistics_browsertest.cc (right): https://codereview.chromium.org/1579433002/diff/1/chrome/browser/profiles/profile_statistics_browsertest.cc#newcode33 chrome/browser/profiles/profile_statistics_browsertest.cc:33: void PrintTo(const ProfileCategoryStat& ...
4 years, 11 months ago (2016-01-14 15:21:53 UTC) #8
lwchkg
Thanks for comment. Making profile statistics trackable is definitely a good idea. I need to ...
4 years, 11 months ago (2016-01-16 18:07:51 UTC) #9
anthonyvd
https://codereview.chromium.org/1579433002/diff/40001/chrome/browser/profiles/profile_statistics_browsertest.cc File chrome/browser/profiles/profile_statistics_browsertest.cc (right): https://codereview.chromium.org/1579433002/diff/40001/chrome/browser/profiles/profile_statistics_browsertest.cc#newcode68 chrome/browser/profiles/profile_statistics_browsertest.cc:68: bool match_failed = actual_count != expected_count; On 2016/01/16 18:07:51, ...
4 years, 11 months ago (2016-01-18 15:47:08 UTC) #10
lwchkg
Just some replies. https://codereview.chromium.org/1579433002/diff/40001/chrome/browser/profiles/profile_statistics_browsertest.cc File chrome/browser/profiles/profile_statistics_browsertest.cc (right): https://codereview.chromium.org/1579433002/diff/40001/chrome/browser/profiles/profile_statistics_browsertest.cc#newcode68 chrome/browser/profiles/profile_statistics_browsertest.cc:68: bool match_failed = actual_count != expected_count; ...
4 years, 11 months ago (2016-01-18 18:01:19 UTC) #11
lwchkg
Now in the middle of the edits. So I've changed the subject of the CL. ...
4 years, 11 months ago (2016-01-25 21:35:53 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1579433002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1579433002/60001
4 years, 10 months ago (2016-02-01 16:39:40 UTC) #14
Mike Lerman
I'm slightly confused about the platforms comment, e.g. that this code is only used on ...
4 years, 10 months ago (2016-02-01 16:42:01 UTC) #15
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/152462) linux_chromium_rel_ng on ...
4 years, 10 months ago (2016-02-01 16:50:05 UTC) #17
lwchkg
On 2016/02/01 16:42:01, Mike Lerman wrote: > I'm slightly confused about the platforms comment, e.g. ...
4 years, 10 months ago (2016-02-01 23:05:03 UTC) #18
lwchkg
On 2016/02/01 16:42:01, Mike Lerman wrote: > I'm slightly confused about the platforms comment, e.g. ...
4 years, 10 months ago (2016-02-01 23:05:06 UTC) #19
lwchkg
On 2016/02/01 16:42:01, Mike Lerman wrote: > I'm slightly confused about the platforms comment, e.g. ...
4 years, 10 months ago (2016-02-01 23:05:09 UTC) #20
Mike Lerman
On 2016/02/01 23:05:09, lwchkg wrote: > On 2016/02/01 16:42:01, Mike Lerman wrote: > > I'm ...
4 years, 10 months ago (2016-02-02 01:18:03 UTC) #21
lwchkg
Finished the refactoring, and updated tests according to the comments. I didn't add the ifndefs ...
4 years, 10 months ago (2016-02-11 17:13:09 UTC) #23
lwchkg
Dear all, PTAL and thanks. Here are the files you need to review: Scott: all ...
4 years, 9 months ago (2016-03-15 18:18:50 UTC) #27
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1579433002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1579433002/160001
4 years, 9 months ago (2016-03-15 18:40:05 UTC) #29
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/64297) mac_chromium_gn_rel on ...
4 years, 9 months ago (2016-03-15 18:46:21 UTC) #31
Mike Lerman
https://codereview.chromium.org/1579433002/diff/160001/chrome/browser/profiles/profile_statistics.cc File chrome/browser/profiles/profile_statistics.cc (right): https://codereview.chromium.org/1579433002/diff/160001/chrome/browser/profiles/profile_statistics.cc#newcode1 chrome/browser/profiles/profile_statistics.cc:1: // Copyright 2016 The Chromium Authors. All rights reserved. ...
4 years, 9 months ago (2016-03-15 18:54:22 UTC) #32
sky
LGTM
4 years, 9 months ago (2016-03-15 20:39:30 UTC) #33
lwchkg
Uploaded another patch. Anyway you may want to wait until the trybots are green before ...
4 years, 9 months ago (2016-03-16 13:28:02 UTC) #34
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1579433002/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1579433002/180001
4 years, 9 months ago (2016-03-16 13:28:45 UTC) #36
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/173895)
4 years, 9 months ago (2016-03-16 13:44:56 UTC) #38
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1579433002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1579433002/220001
4 years, 9 months ago (2016-03-16 14:53:21 UTC) #41
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/131595)
4 years, 9 months ago (2016-03-16 15:44:12 UTC) #43
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1579433002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1579433002/240001
4 years, 9 months ago (2016-03-16 17:20:59 UTC) #45
lwchkg
+avi@ Avi: Can you please check the comment (see below) regarding content::MessageLoopRunner? (Anyway, there is ...
4 years, 9 months ago (2016-03-16 17:26:03 UTC) #47
Avi (use Gerrit)
https://codereview.chromium.org/1579433002/diff/160001/chrome/browser/profiles/profile_statistics_browsertest.cc File chrome/browser/profiles/profile_statistics_browsertest.cc (right): https://codereview.chromium.org/1579433002/diff/160001/chrome/browser/profiles/profile_statistics_browsertest.cc#newcode219 chrome/browser/profiles/profile_statistics_browsertest.cc:219: scoped_refptr<content::MessageLoopRunner> loop1a = On 2016/03/16 17:26:03, lwchkg wrote: > ...
4 years, 9 months ago (2016-03-16 17:39:04 UTC) #48
lwchkg
Mike: The bots are finally green now. PTAL. https://codereview.chromium.org/1579433002/diff/160001/chrome/browser/profiles/profile_statistics_browsertest.cc File chrome/browser/profiles/profile_statistics_browsertest.cc (right): https://codereview.chromium.org/1579433002/diff/160001/chrome/browser/profiles/profile_statistics_browsertest.cc#newcode219 chrome/browser/profiles/profile_statistics_browsertest.cc:219: scoped_refptr<content::MessageLoopRunner> ...
4 years, 9 months ago (2016-03-16 18:36:41 UTC) #49
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/131710)
4 years, 9 months ago (2016-03-16 18:50:56 UTC) #51
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1579433002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1579433002/260001
4 years, 9 months ago (2016-03-17 14:22:27 UTC) #53
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/65279) linux_chromium_rel_ng on ...
4 years, 9 months ago (2016-03-17 14:38:21 UTC) #55
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1579433002/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1579433002/280001
4 years, 9 months ago (2016-03-17 15:02:04 UTC) #57
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-17 16:14:33 UTC) #59
Mike Lerman
I like! LGTM
4 years, 9 months ago (2016-03-17 17:26:25 UTC) #60
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1579433002/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1579433002/300001
4 years, 9 months ago (2016-03-19 16:17:53 UTC) #63
commit-bot: I haz the power
Committed patchset #12 (id:300001)
4 years, 9 months ago (2016-03-19 17:02:00 UTC) #65
commit-bot: I haz the power
4 years, 9 months ago (2016-03-19 17:03:50 UTC) #67
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/db92ff9fb8ee68d3d77c3f4f77bd62f7b41fd747
Cr-Commit-Position: refs/heads/master@{#382202}

Powered by Google App Engine
This is Rietveld 408576698