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

Issue 2905903002: Delete the PreferenceMACs on profile deletion. (Closed)

Created:
3 years, 7 months ago by proberge
Modified:
3 years, 4 months ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, rginda+watch_chromium.org, darin (slow to review)
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Delete the PreferenceMACs on profile deletion. On Windows, the tracked preference logic writes some data to the registry. It is currently not cleared when the profile is deleted. Alternatives considered: extending ProfileAttributesStorage::Observer and listening for OnProfileWasRemoved or OnProfileWillBeRemoved. However, the tracked pref code is componentized to avoid any reference to Chrome. Known issue: the PreferenceMACs in the registry will not be deleted if Chrome crashes during profile deletion. There's logic in chrome_browser_main which cleans up the profile folders when this happens (https://cs.chromium.org/chromium/src/chrome/browser/chrome_browser_main.cc?dr=CSs&l=1279) However, I couldn't find a clean way to clean up the registry when the profile no longer exists. BUG=723834 Review-Url: https://codereview.chromium.org/2905903002 Cr-Commit-Position: refs/heads/master@{#494955} Committed: https://chromium.googlesource.com/chromium/src/+/45e347284efb236e79bc3a1ff4c68640dafe9b3d

Patch Set 1 #

Total comments: 4

Patch Set 2 : Alternate solution: layering violation to call static method from NukeProfileFromDisk #

Patch Set 3 : Bring back plumbing solution, address review comments #

Total comments: 2

Patch Set 4 : Rebase #

Patch Set 5 : Try loading unloaded profiles before calling OnStoreDeletionFromDisk #

Total comments: 8

Patch Set 6 : Address review comments on #5 #

Patch Set 7 : Rebase #

Patch Set 8 : Make services_unittests compile #

Patch Set 9 : Fix to get OSX-only ActiveProfileDeletedNextProfileDeletedToo test to pass #

Total comments: 4

Patch Set 10 : Rebase #

Patch Set 11 : Update comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -17 lines) Patch
M chrome/browser/profiles/profile_manager.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_manager.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +28 lines, -15 lines 0 comments Download
M components/prefs/in_memory_pref_store.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M components/prefs/json_pref_store.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M components/prefs/json_pref_store.cc View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M components/prefs/json_pref_store_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M components/prefs/overlay_user_pref_store.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M components/prefs/overlay_user_pref_store.cc View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M components/prefs/persistent_pref_store.h View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M components/prefs/pref_filter.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M components/prefs/pref_service.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M components/prefs/pref_service.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M components/prefs/testing_pref_store.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M components/prefs/testing_pref_store.cc View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M services/preferences/persistent_pref_store_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M services/preferences/persistent_pref_store_impl.cc View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -0 lines 0 comments Download
M services/preferences/pref_store_consistency_unittest.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M services/preferences/public/cpp/persistent_pref_store_client.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M services/preferences/public/cpp/persistent_pref_store_client.cc View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
M services/preferences/public/cpp/tests/persistent_pref_store_client_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M services/preferences/public/interfaces/preferences.mojom View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M services/preferences/tracked/interceptable_pref_filter.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M services/preferences/tracked/interceptable_pref_filter.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M services/preferences/tracked/pref_hash_filter.h View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M services/preferences/tracked/pref_hash_filter.cc View 1 2 3 4 5 6 1 chunk +11 lines, -0 lines 0 comments Download
M services/preferences/tracked/segregated_pref_store.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M services/preferences/tracked/segregated_pref_store.cc View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 53 (24 generated)
proberge
Hi Gab, PTAL. Any suggestions on where to put a unit test for this logic?
3 years, 7 months ago (2017-05-25 19:50:19 UTC) #5
gab
On 2017/05/25 19:50:19, proberge wrote: > Hi Gab, PTAL. > > Any suggestions on where ...
3 years, 7 months ago (2017-05-26 18:15:31 UTC) #8
proberge
Added an alternate solution that uses NukeProfileFromDisk. PTAL and let me know which of the ...
3 years, 6 months ago (2017-06-05 14:45:52 UTC) #9
gab
Looking at this further, I don't think we have a choice but to go with ...
3 years, 6 months ago (2017-06-05 17:28:57 UTC) #10
proberge
https://codereview.chromium.org/2905903002/diff/1/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/2905903002/diff/1/chrome/browser/profiles/profile_manager.cc#newcode1496 chrome/browser/profiles/profile_manager.cc:1496: profile->GetPrefs()->CleanupForProfileDeletion(); On 2017/06/05 17:28:57, gab wrote: > Why is ...
3 years, 6 months ago (2017-06-05 21:22:11 UTC) #11
gab
https://codereview.chromium.org/2905903002/diff/40001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/2905903002/diff/40001/chrome/browser/profiles/profile_manager.cc#newcode1517 chrome/browser/profiles/profile_manager.cc:1517: // It is safe to delete a not yet ...
3 years, 6 months ago (2017-06-06 14:48:26 UTC) #12
proberge
https://codereview.chromium.org/2905903002/diff/40001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/2905903002/diff/40001/chrome/browser/profiles/profile_manager.cc#newcode1517 chrome/browser/profiles/profile_manager.cc:1517: // It is safe to delete a not yet ...
3 years, 6 months ago (2017-06-07 19:22:50 UTC) #15
gab
On 2017/06/07 19:22:50, proberge wrote: > https://codereview.chromium.org/2905903002/diff/40001/chrome/browser/profiles/profile_manager.cc > File chrome/browser/profiles/profile_manager.cc (right): > > https://codereview.chromium.org/2905903002/diff/40001/chrome/browser/profiles/profile_manager.cc#newcode1517 > ...
3 years, 6 months ago (2017-06-08 13:13:21 UTC) #17
gab
Other than that, prefs lgtm when profiles/ owners are happy with approach there. https://codereview.chromium.org/2905903002/diff/120001/components/prefs/persistent_pref_store.h File ...
3 years, 6 months ago (2017-06-08 16:14:28 UTC) #18
proberge
https://codereview.chromium.org/2905903002/diff/120001/components/prefs/persistent_pref_store.h File components/prefs/persistent_pref_store.h (right): https://codereview.chromium.org/2905903002/diff/120001/components/prefs/persistent_pref_store.h#newcode76 components/prefs/persistent_pref_store.h:76: // Cleans data stored outside of the profile directory. ...
3 years, 6 months ago (2017-06-08 18:33:00 UTC) #19
gab
On 2017/06/08 13:13:21, gab wrote: > On 2017/06/07 19:22:50, proberge wrote: > > > https://codereview.chromium.org/2905903002/diff/40001/chrome/browser/profiles/profile_manager.cc ...
3 years, 6 months ago (2017-06-20 21:38:27 UTC) #20
Mr4D (OOO till 08-26)
lgtm for Profiles.
3 years, 6 months ago (2017-06-20 22:57:21 UTC) #21
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/2905903002/140001
3 years, 6 months ago (2017-06-21 19:10:51 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/470138)
3 years, 6 months ago (2017-06-21 19:21:07 UTC) #26
proberge
++samc for services/preferences approval
3 years, 6 months ago (2017-06-21 19:23:42 UTC) #28
Sam McNally
lgtm
3 years, 6 months ago (2017-06-21 23:39:46 UTC) #29
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/2905903002/200001
3 years, 6 months ago (2017-06-22 14:12:03 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/470975)
3 years, 6 months ago (2017-06-22 14:18:56 UTC) #35
proberge
++kenrb for .mojom file changes approval
3 years, 6 months ago (2017-06-22 14:22:43 UTC) #37
kenrb
mojom lgtm
3 years, 6 months ago (2017-06-22 14:57:12 UTC) #38
proberge
@gab PTAL
3 years, 5 months ago (2017-06-29 18:44:04 UTC) #39
gab
On 2017/06/29 18:44:04, proberge wrote: > @gab PTAL Not sure what specifically you wanted me ...
3 years, 5 months ago (2017-07-05 23:44:31 UTC) #40
proberge
On 2017/07/05 23:44:31, gab (in-out til july17) wrote: > On 2017/06/29 18:44:04, proberge wrote: > ...
3 years, 5 months ago (2017-07-06 00:23:15 UTC) #41
gab
On 2017/07/06 00:23:15, proberge wrote: > On 2017/07/05 23:44:31, gab (in-out til july17) wrote: > ...
3 years, 5 months ago (2017-07-06 00:33:12 UTC) #42
proberge
On 2017/07/06 00:33:12, gab (in-out til july17) wrote: > On 2017/07/06 00:23:15, proberge wrote: > ...
3 years, 5 months ago (2017-07-06 13:50:41 UTC) #43
Mr4D (OOO till 08-26)
https://codereview.chromium.org/2905903002/diff/220001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/2905903002/diff/220001/chrome/browser/profiles/profile_manager.cc#newcode1509 chrome/browser/profiles/profile_manager.cc:1509: // Clean-up pref data that won't be cleaned up ...
3 years, 4 months ago (2017-08-16 14:38:55 UTC) #44
proberge
Thanks Mr4D! https://codereview.chromium.org/2905903002/diff/220001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/2905903002/diff/220001/chrome/browser/profiles/profile_manager.cc#newcode1509 chrome/browser/profiles/profile_manager.cc:1509: // Clean-up pref data that won't be ...
3 years, 4 months ago (2017-08-16 19:49:55 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/2905903002/280001
3 years, 4 months ago (2017-08-16 19:50:10 UTC) #49
commit-bot: I haz the power
3 years, 4 months ago (2017-08-16 21:24:56 UTC) #53
Message was sent while issue was closed.
Committed patchset #11 (id:280001) as
https://chromium.googlesource.com/chromium/src/+/45e347284efb236e79bc3a1ff4c6...

Powered by Google App Engine
This is Rietveld 408576698