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

Side by Side Diff: chrome/browser/profiles/profile_dependency_manager.cc

Issue 7967024: Profile shouldn't own PersonalDataManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addresses isherman #11 Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/profiles/profile.h ('k') | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profile_dependency_manager.h" 5 #include "chrome/browser/profiles/profile_dependency_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <iterator> 9 #include <iterator>
10 10
11 #include "chrome/browser/autofill/personal_data_manager_factory.h"
11 #include "chrome/browser/background/background_contents_service_factory.h" 12 #include "chrome/browser/background/background_contents_service_factory.h"
12 #include "chrome/browser/plugin_prefs.h" 13 #include "chrome/browser/plugin_prefs.h"
13 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" 14 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h"
14 #include "chrome/browser/profiles/profile_keyed_service.h" 15 #include "chrome/browser/profiles/profile_keyed_service.h"
15 #include "chrome/browser/profiles/profile_keyed_service_factory.h" 16 #include "chrome/browser/profiles/profile_keyed_service_factory.h"
16 #include "chrome/browser/search_engines/template_url_service_factory.h" 17 #include "chrome/browser/search_engines/template_url_service_factory.h"
17 #include "chrome/browser/sessions/session_service_factory.h" 18 #include "chrome/browser/sessions/session_service_factory.h"
18 #include "chrome/browser/sessions/tab_restore_service_factory.h" 19 #include "chrome/browser/sessions/tab_restore_service_factory.h"
19 #include "content/common/notification_service.h" 20 #include "content/common/notification_service.h"
20 21
21 class Profile; 22 class Profile;
22 23
23 namespace { 24 namespace {
24 25
25 bool g_initialized = false; 26 bool g_initialized = false;
26 27
27 // This method gets the instance of each ServiceFactory. We do this so that 28 // This method gets the instance of each ServiceFactory. We do this so that
28 // each ServiceFactory initializes iteslf and registers its dependencies with 29 // each ServiceFactory initializes iteslf and registers its dependencies with
29 // the global PreferenceDependencyManager. We need to have a complete 30 // the global PreferenceDependencyManager. We need to have a complete
30 // dependency graph when we create a profile so we can dispatch the profile 31 // dependency graph when we create a profile so we can dispatch the profile
31 // creation message to the services that want to create their services at 32 // creation message to the services that want to create their services at
32 // profile creation time. 33 // profile creation time.
33 // 34 //
34 // TODO(erg): This needs to be something else. I don't think putting every 35 // TODO(erg): This needs to be something else. I don't think putting every
35 // FooServiceFactory here will scale or is desireable long term. 36 // FooServiceFactory here will scale or is desireable long term.
36 void AssertFactoriesBuilt() { 37 void AssertFactoriesBuilt() {
37 if (!g_initialized) { 38 if (!g_initialized) {
38 BackgroundContentsServiceFactory::GetInstance(); 39 BackgroundContentsServiceFactory::GetInstance();
39 CloudPrintProxyServiceFactory::GetInstance(); 40 CloudPrintProxyServiceFactory::GetInstance();
41 PersonalDataManagerFactory::GetInstance();
40 PluginPrefs::Initialize(); 42 PluginPrefs::Initialize();
41 SessionServiceFactory::GetInstance(); 43 SessionServiceFactory::GetInstance();
42 TabRestoreServiceFactory::GetInstance(); 44 TabRestoreServiceFactory::GetInstance();
43 TemplateURLServiceFactory::GetInstance(); 45 TemplateURLServiceFactory::GetInstance();
44 46
45 g_initialized = true; 47 g_initialized = true;
46 } 48 }
47 } 49 }
48 50
49 } // namespace 51 } // namespace
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 193 }
192 } 194 }
193 195
194 if (edges.size()) { 196 if (edges.size()) {
195 NOTREACHED() << "Dependency graph has a cycle. We are doomed."; 197 NOTREACHED() << "Dependency graph has a cycle. We are doomed.";
196 } 198 }
197 199
198 std::reverse(output.begin(), output.end()); 200 std::reverse(output.begin(), output.end());
199 destruction_order_ = output; 201 destruction_order_ = output;
200 } 202 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile.h ('k') | chrome/browser/profiles/profile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698