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

Issue 1428973003: Utilize ProfileInfoCache to support data type counts in profile deletion flow (Closed)

Created:
5 years, 1 month ago by lwchkg
Modified:
4 years, 11 months ago
CC:
chromium-reviews, dzhioev+watch_chromium.org, achuith+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

profile_statistics.*: When a statistic query in is successful, it is saved to ProfileInfoCache automatically. If nullptr is passed to tracker, the default tracker inside the class is used. (Tasks cannot be cancelled this way.) Added convenience method StoreProfileStatisticsToCache, which calls GetProfileStatistics(profile, no_op, nullptr). Reworked bookmark counting that using BookmarkModel before other bookmark consumers do not result in a seg fault. user_pod_row.js, user_manager_screen_handler.cc: Able to reads statistics from ProfileInfoCache. Bug fixes. (a.: Statistics are unnecessarily queried for desktop legacy supervised users. b.: chrome.send('logRemoveUserWarningShown') is called more than once when the deletion warning is shown.) profile_manager.cc Store statistics to ProfileInfoCache during profile close and profile open (if not normal shutdown). BUG=501916, 502346 Note: it is a good idea to use a JSON formatter (e.g. http://www.jsoneditoronline.org/ ) to pretiffy "Local State" during testing. TEST=Back up the file "Local State" before starting. You need to restore this file at the beginning of each test. The "Local State" file should not contain the string "stats_settings". If it contains the string, then you can manually delete the keys below (remember to validate the changed file using a JSON formatter): "stats_bookmarks": 15, "stats_browsing_history": 4, "stats_passwords": 0, "stats_settings": 121, Note that the numbers can be different, only the keys should be the same. TEST=Restore "Local State". Start Chromium. Then close Chromium. Inspect the new "Local State" file for the keys listed above. If possible check that the keys is under the correct profile. TEST=Restore "Local State". Start Chromium. Then kill the Chromium process. Inspect the new "Local State" file for the keys listed above. TEST=Restore "Local State". Start Chromium. Open two or more profiles. Close Chromium. Start Chromium again. Go to the user switching dialog by selecting the name in the right side of the title bar, press "Switch Person". Now click the top-right corner of a profile and press "Remove Person". The statistics of the profile should appear if and only if: (1) The user is not a supervised user, and (2) The profile has been open when you start Chromium in the first time. Note that the statistics can be displayed in a few different ways, as stated in bug 501916. TEST=Restore "Local State". Start Chromium. Then shut down the computer without Chromium closed. The statistics should not have been written in Local State yet. Now start Chromium again, wait for a minute, and reboot again. Now the statistics key should be in Local State. (You may get Local State updated after the second start of Chromium but before the reboot. This is also passing the test.) Note: Do not shut down Chromium normally or just trying to kill Chromium process. These way will cause statistics to be written in Local State resulting in false passes. Anyway, if Local State gets the statistical keys before the second start of Chromium, you should consider that the test is not carried out correctly and restart the test. Committed: https://crrev.com/8e1e1231e10afbfe816effeceeb4f10075e6ea09 Cr-Commit-Position: refs/heads/master@{#367568}

Patch Set 1 : Incomplete draft #

Patch Set 2 : user_pod_row.js done, statistics now saved when the last window of a profile is closed. #

Total comments: 18

Patch Set 3 : Respond to comments #

Patch Set 4 : Respond to comments #

Patch Set 5 : Added storing to ProfileInfoCache at startup after a non-normal shutdown #

Total comments: 4

Patch Set 6 : Fixed crash in bookmark counting #

Patch Set 7 : Rebased and updated related code. #

Total comments: 22

Patch Set 8 : Respond to comments #

Total comments: 1

Patch Set 9 : Respond to comments #

Patch Set 10 : Fixed 2 bugs #

Total comments: 1

Patch Set 11 : Fix: do not attempt to create statistics of incognito profiles #

Total comments: 10

Patch Set 12 : Bug fix and respond to comments #

Patch Set 13 : Rebased #

Total comments: 2

Patch Set 14 : Respond to comments, minor edits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+290 lines, -115 lines) Patch
M chrome/browser/profiles/profile_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +24 lines, -6 lines 0 comments Download
M chrome/browser/profiles/profile_statistics.h View 1 2 3 4 5 6 7 8 1 chunk +10 lines, -7 lines 0 comments Download
M chrome/browser/profiles/profile_statistics.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 11 chunks +129 lines, -42 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 12 6 chunks +45 lines, -5 lines 0 comments Download
M ui/login/account_picker/user_pod_row.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 8 chunks +82 lines, -55 lines 0 comments Download

Messages

Total messages: 72 (30 generated)
lwchkg
Dear Anthony and Mike, PTAL. This is an unfinished draft, and the purpose is just ...
5 years, 1 month ago (2015-10-30 18:33:46 UTC) #3
lwchkg
+Roger, +achuithb, +Peter Kasting Dear all, This CL is a follow-up to utilize ProfileInfoCache to ...
5 years, 1 month ago (2015-11-01 18:28:42 UTC) #9
Peter Kasting
When you list multiple reviewers, please say precisely what you would like each to look ...
5 years, 1 month ago (2015-11-02 03:33:24 UTC) #10
Mike Lerman
On 2015/11/02 03:33:24, Peter Kasting wrote: > When you list multiple reviewers, please say precisely ...
5 years, 1 month ago (2015-11-02 15:38:42 UTC) #11
lwchkg
On 2015/11/02 15:38:42, Mike Lerman wrote: > On 2015/11/02 03:33:24, Peter Kasting wrote: > > ...
5 years, 1 month ago (2015-11-02 17:37:18 UTC) #12
Mike Lerman
On 2015/11/02 17:37:18, lwchkg wrote: > On 2015/11/02 15:38:42, Mike Lerman wrote: > > On ...
5 years, 1 month ago (2015-11-03 13:49:25 UTC) #13
Mike Lerman
Hi, A few comments here on the interactions with the ProfileInfoCache. Comments about the implementation ...
5 years, 1 month ago (2015-11-03 20:50:42 UTC) #14
lwchkg
Mike: thanks for your feedback. I'll make another patch tonight (but feel free to comment ...
5 years, 1 month ago (2015-11-04 00:11:07 UTC) #15
lwchkg
Respond to comments. (New patch uploaded, but no change to browser_impl.cc yet.) https://codereview.chromium.org/1428973003/diff/20001/chrome/browser/profiles/profile_statistics.cc File chrome/browser/profiles/profile_statistics.cc ...
5 years, 1 month ago (2015-11-05 22:21:30 UTC) #16
lwchkg
> Anyway, I've figured out what should be happening with > BrowserProcessImpl::EndSession(). > https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/browser_process_impl.cc&sq=package:chromium&type=cs&l=479&rcl=1446568068 > ...
5 years, 1 month ago (2015-11-05 23:32:19 UTC) #17
lwchkg
Patch #4 and #5 uploaded. https://codereview.chromium.org/1428973003/diff/80001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/1428973003/diff/80001/chrome/browser/profiles/profile_manager.cc#newcode1060 chrome/browser/profiles/profile_manager.cc:1060: profiles::StoreProfileStatisticsToCache(profile); This is causing ...
5 years, 1 month ago (2015-11-08 15:45:58 UTC) #20
lwchkg
https://codereview.chromium.org/1428973003/diff/80001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/1428973003/diff/80001/chrome/browser/profiles/profile_manager.cc#newcode1060 chrome/browser/profiles/profile_manager.cc:1060: profiles::StoreProfileStatisticsToCache(profile); Found the reason of crash: attempting to access ...
5 years, 1 month ago (2015-11-09 21:00:09 UTC) #21
Mike Lerman
Sorry, was out sick for a few days. https://codereview.chromium.org/1428973003/diff/20001/chrome/browser/profiles/profile_statistics.cc File chrome/browser/profiles/profile_statistics.cc (right): https://codereview.chromium.org/1428973003/diff/20001/chrome/browser/profiles/profile_statistics.cc#newcode192 chrome/browser/profiles/profile_statistics.cc:192: ProfileInfoCache& ...
5 years, 1 month ago (2015-11-10 15:45:44 UTC) #23
lwchkg
Thanks for your help. A new patch will be coming in minutes. (Needs compiling and ...
5 years, 1 month ago (2015-11-10 18:11:07 UTC) #24
lwchkg
Mike: take care! It's very inconvenient to be sick in front of your baby! New ...
5 years, 1 month ago (2015-11-10 19:14:41 UTC) #27
lwchkg
Dear all, New patch uploaded. PTAL! Regards, WC Leung.
5 years, 1 month ago (2015-11-22 05:23:31 UTC) #28
Mike Lerman
https://codereview.chromium.org/1428973003/diff/120001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/1428973003/diff/120001/chrome/browser/profiles/profile_manager.cc#newcode1060 chrome/browser/profiles/profile_manager.cc:1060: // Record statistics to ProfileInfoCache if not a normal ...
5 years ago (2015-11-26 15:06:25 UTC) #29
lwchkg
Here's my reply, and I'll prepare another patch today. https://codereview.chromium.org/1428973003/diff/120001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/1428973003/diff/120001/chrome/browser/profiles/profile_manager.cc#newcode1060 chrome/browser/profiles/profile_manager.cc:1060: ...
5 years ago (2015-12-02 15:33:35 UTC) #30
lwchkg
Here's my reply, and I'll prepare another patch today.
5 years ago (2015-12-02 15:35:41 UTC) #31
lwchkg
New patch uploaded. PTAL.
5 years ago (2015-12-02 17:17:12 UTC) #32
Mike Lerman
https://codereview.chromium.org/1428973003/diff/120001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/1428973003/diff/120001/chrome/browser/profiles/profile_manager.cc#newcode1063 chrome/browser/profiles/profile_manager.cc:1063: profile->GetLastSessionExitType() != Profile::EXIT_NORMAL) On 2015/12/02 15:33:34, lwchkg wrote: > ...
5 years ago (2015-12-07 16:21:21 UTC) #33
lwchkg
Please see another patch loaded. BTW, I have something to ask outside of the patches. ...
5 years ago (2015-12-09 03:39:41 UTC) #34
Mike Lerman
On 2015/12/09 03:39:41, lwchkg wrote: > Please see another patch loaded. > > BTW, I ...
5 years ago (2015-12-14 16:22:19 UTC) #35
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428973003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428973003/160001
5 years ago (2015-12-14 18:27:24 UTC) #37
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/155724) win_chromium_rel_ng on ...
5 years ago (2015-12-14 19:00:56 UTC) #39
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428973003/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428973003/180001
5 years ago (2015-12-22 08:18:52 UTC) #41
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/131130)
5 years ago (2015-12-22 08:26:14 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/1428973003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428973003/200001
5 years ago (2015-12-22 11:23:03 UTC) #45
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years ago (2015-12-22 12:12:11 UTC) #47
lwchkg
Dear all, I've fixed a few bugs in the newest patch, and therefore needs your ...
5 years ago (2015-12-22 13:26:00 UTC) #48
Mike Lerman
https://codereview.chromium.org/1428973003/diff/200001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/1428973003/diff/200001/chrome/browser/profiles/profile_manager.cc#newcode1485 chrome/browser/profiles/profile_manager.cc:1485: if (!profile->IsOffTheRecord()) { On 2015/12/22 13:26:00, lwchkg wrote: > ...
5 years ago (2015-12-23 20:25:50 UTC) #49
lwchkg
Thanks Mike. It's likely to be two hidden bugs, so I'll investigate them. Anyway, I'll ...
4 years, 12 months ago (2015-12-24 07:14:32 UTC) #50
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428973003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428973003/220001
4 years, 12 months ago (2015-12-28 15:13:44 UTC) #55
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ninja/builds/153154) mac_chromium_compile_dbg_ng on ...
4 years, 12 months ago (2015-12-28 15:14:57 UTC) #57
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428973003/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428973003/240001
4 years, 12 months ago (2015-12-28 16:24:37 UTC) #59
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 12 months ago (2015-12-28 17:14:43 UTC) #61
lwchkg
Uploaded a new patch. This should be the last patch if no more nits are ...
4 years, 12 months ago (2015-12-29 04:51:43 UTC) #63
achuithb
user_pod_row.js lgtm https://codereview.chromium.org/1428973003/diff/240001/ui/login/account_picker/user_pod_row.js File ui/login/account_picker/user_pod_row.js (right): https://codereview.chromium.org/1428973003/diff/240001/ui/login/account_picker/user_pod_row.js#newcode979 ui/login/account_picker/user_pod_row.js:979: * Get the elements used for statistics ...
4 years, 11 months ago (2016-01-04 18:45:29 UTC) #64
lwchkg
Thanks everyone. Will commit now (and send the draft comment). Browser tests will be added ...
4 years, 11 months ago (2016-01-05 16:57:21 UTC) #65
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1428973003/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1428973003/260001
4 years, 11 months ago (2016-01-05 16:58:03 UTC) #68
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 11 months ago (2016-01-05 17:54:12 UTC) #70
commit-bot: I haz the power
4 years, 11 months ago (2016-01-05 17:55:21 UTC) #72
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/8e1e1231e10afbfe816effeceeb4f10075e6ea09
Cr-Commit-Position: refs/heads/master@{#367568}

Powered by Google App Engine
This is Rietveld 408576698