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

Issue 6766004: Create a ProfileDependencyManager to order ProfileKeyedService destruction. (Closed)

Created:
9 years, 9 months ago by Elliot Glaysher
Modified:
9 years, 7 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Create a ProfileDependencyManager to order ProfileKeyedService destruction. Since ProfileKeyedServices need to be able to specify complex graphs representing their dependencies on other ProfileKeyedServices, add a simple ::DependsOn() method to explicitly state these dependencies and a singleton manager in the background that does a topological sort to get a safe destruction ordering. This changes ThemeServiceFactory to use this new system, which also revealed a bunch of unsafe casting of Source<> pointers and NotificationCenter misuse between incompatible types. (Source<> uses void* underneath and therefore can't increment/decrement the pointer during casting.) BUG=77155 TEST=compiles, new ProfileDependencyManagerUnittests.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=80093

Patch Set 1 #

Total comments: 9

Patch Set 2 : Remove NotificationService usage to fix unit tests. #

Patch Set 3 : Rebase to ToT #

Patch Set 4 : Fix improper usage of static_cast<> in existing mac code. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+661 lines, -95 lines) Patch
M chrome/browser/profiles/profile.cc View 1 2 chunks +4 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_dependency_manager.h View 1 1 chunk +65 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_dependency_manager.cc View 1 1 chunk +122 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_dependency_manager_unittest.cc View 1 1 chunk +185 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_impl.cc View 1 2 chunks +3 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_keyed_service.h View 1 1 chunk +26 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_keyed_service_factory.h View 1 1 chunk +86 lines, -0 lines 0 comments Download
A chrome/browser/profiles/profile_keyed_service_factory.cc View 1 1 chunk +80 lines, -0 lines 0 comments Download
M chrome/browser/themes/theme_service.h View 4 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/themes/theme_service.cc View 2 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/themes/theme_service_factory.h View 3 chunks +6 lines, -13 lines 0 comments Download
M chrome/browser/themes/theme_service_factory.cc View 1 3 chunks +23 lines, -69 lines 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/download/download_item_controller.mm View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/gtk/gtk_theme_service.h View 2 chunks +2 lines, -3 lines 0 comments Download
M chrome/browser/ui/gtk/gtk_theme_service.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/gtk/reload_button_gtk.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/testing_profile.h View 1 2 3 chunks +8 lines, -1 line 0 comments Download
M chrome/test/testing_profile.cc View 1 2 4 chunks +12 lines, -2 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
Elliot Glaysher
9 years, 9 months ago (2011-03-29 00:22:44 UTC) #1
Elliot Glaysher
Unit test failures repro locally.
9 years, 9 months ago (2011-03-29 00:59:55 UTC) #2
Miranda Callahan
On 2011/03/29 00:59:55, Elliot Glaysher wrote: > Unit test failures repro locally. Should I wait ...
9 years, 9 months ago (2011-03-29 14:06:21 UTC) #3
Elliot Glaysher
Feel free to review now. The tests look like it'll be a one liner to ...
9 years, 9 months ago (2011-03-29 17:22:28 UTC) #4
Miranda Callahan
On 2011/03/29 17:22:28, Elliot Glaysher wrote: > Feel free to review now. The tests look ...
9 years, 9 months ago (2011-03-29 17:30:01 UTC) #5
Miranda Callahan
Hmm -- I've spent the last hour going through this code, drawing pictures of the ...
9 years, 9 months ago (2011-03-29 19:07:04 UTC) #6
Paweł Hajdan Jr.
Drive-by with a tiny testing nit. No need to wait for me, and if you ...
9 years, 9 months ago (2011-03-29 19:10:25 UTC) #7
Elliot Glaysher
Update. I can reproduce the unit test failures with: ./out/Debug/unit_tests --gtest_filter=ProfileSyncServiceSessionTest.*:ThemeUtilTest.* but not with: ./out/Debug/unit_tests ...
9 years, 9 months ago (2011-03-29 20:33:59 UTC) #8
Elliot Glaysher
I've removed the dependency on NotificationSerivce to fix the unit tests (the NotificationService can change ...
9 years, 9 months ago (2011-03-29 22:18:29 UTC) #9
Elliot Glaysher
Aaaannnd...the mac failures look legitimate and repeatable. :(
9 years, 9 months ago (2011-03-30 00:55:48 UTC) #10
Elliot Glaysher
On 2011/03/30 00:55:48, Elliot Glaysher wrote: > Aaaannnd...the mac failures look legitimate and repeatable. :( ...
9 years, 8 months ago (2011-03-31 21:17:00 UTC) #11
Miranda Callahan
9 years, 8 months ago (2011-03-31 21:18:55 UTC) #12
On 2011/03/31 21:17:00, Elliot Glaysher wrote:
> On 2011/03/30 00:55:48, Elliot Glaysher wrote:
> > Aaaannnd...the mac failures look legitimate and repeatable. :(
> 
> Miranda, can I get a final LGTM? The trybots have passed the previous mac
> failures.

yes indeed -- LGTM!

Powered by Google App Engine
This is Rietveld 408576698