|  | 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
      Total comments: 9
      
     
  
   
  
   
  
   
    
  
  
    
      |  | 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 |  
    Total messages: 12 (0 generated)
     |