summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-24 00:41:43 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-24 00:41:43 +0000
commit4f6944c63cd597ea42968a03e1a54623a2b914c3 (patch)
tree8fdfd6c5021bc8f3e76184a36a3cfcb9625d70bf
parentf069e841e7f515bde48bb5f5c9203db4cad3b6d6 (diff)
downloadchromium_src-4f6944c63cd597ea42968a03e1a54623a2b914c3.zip
chromium_src-4f6944c63cd597ea42968a03e1a54623a2b914c3.tar.gz
chromium_src-4f6944c63cd597ea42968a03e1a54623a2b914c3.tar.bz2
Profiles: Add a --dump-profile-graph option when !NDEBUG.
--dump-profile-graph will create a text file in the profile directory in graphviz format. The graph is the dumped dependency graph. BUG=none R=mirandac TBR=jhawkins,sky,abodenha,tim Review URL: http://codereview.chromium.org/9200017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118765 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/autocomplete/network_action_predictor_factory.cc5
-rw-r--r--chrome/browser/autofill/personal_data_manager_factory.cc5
-rw-r--r--chrome/browser/background/background_contents_service_factory.cc5
-rw-r--r--chrome/browser/content_settings/cookie_settings.cc5
-rw-r--r--chrome/browser/download/download_service_factory.cc6
-rw-r--r--chrome/browser/intents/web_intents_registry_factory.cc5
-rw-r--r--chrome/browser/notifications/desktop_notification_service_factory.cc5
-rw-r--r--chrome/browser/plugin_prefs_factory.cc5
-rw-r--r--chrome/browser/prerender/prerender_manager_factory.cc5
-rw-r--r--chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc6
-rw-r--r--chrome/browser/profiles/profile_dependency_manager.cc71
-rw-r--r--chrome/browser/profiles/profile_dependency_manager.h8
-rw-r--r--chrome/browser/profiles/profile_dependency_manager_unittest.cc4
-rw-r--r--chrome/browser/profiles/profile_keyed_service_factory.cc8
-rw-r--r--chrome/browser/profiles/profile_keyed_service_factory.h16
-rw-r--r--chrome/browser/protector/protector_service_factory.cc3
-rw-r--r--chrome/browser/search_engines/template_url_service_factory.cc6
-rw-r--r--chrome/browser/sessions/session_service_factory.cc6
-rw-r--r--chrome/browser/sessions/tab_restore_service_factory.cc6
-rw-r--r--chrome/browser/signin/signin_manager_factory.cc3
-rw-r--r--chrome/browser/speech/speech_input_extension_manager.cc5
-rw-r--r--chrome/browser/sync/profile_sync_service_factory.cc3
-rw-r--r--chrome/browser/tabs/pinned_tab_service_factory.cc5
-rw-r--r--chrome/browser/themes/theme_service_factory.cc6
-rw-r--r--chrome/browser/ui/global_error_service_factory.cc5
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc6
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
28 files changed, 163 insertions, 55 deletions
diff --git a/chrome/browser/autocomplete/network_action_predictor_factory.cc b/chrome/browser/autocomplete/network_action_predictor_factory.cc
index 0f0611a..252e920 100644
--- a/chrome/browser/autocomplete/network_action_predictor_factory.cc
+++ b/chrome/browser/autocomplete/network_action_predictor_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -21,7 +21,8 @@ NetworkActionPredictorFactory* NetworkActionPredictorFactory::GetInstance() {
}
NetworkActionPredictorFactory::NetworkActionPredictorFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("NetworkActionPredictor",
+ ProfileDependencyManager::GetInstance()) {
// TODO(erg): When HistoryService is PKSFized, uncomment this.
// DependsOn(HistoryServiceFactory::GetInstance());
}
diff --git a/chrome/browser/autofill/personal_data_manager_factory.cc b/chrome/browser/autofill/personal_data_manager_factory.cc
index 1b91b44..6ea4ded 100644
--- a/chrome/browser/autofill/personal_data_manager_factory.cc
+++ b/chrome/browser/autofill/personal_data_manager_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -22,7 +22,8 @@ PersonalDataManagerFactory* PersonalDataManagerFactory::GetInstance() {
}
PersonalDataManagerFactory::PersonalDataManagerFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("PersonalDataManager",
+ ProfileDependencyManager::GetInstance()) {
// TODO(erg): For Shutdown() order, we need to:
// DependsOn(WebDataServiceFactory::GetInstance());
}
diff --git a/chrome/browser/background/background_contents_service_factory.cc b/chrome/browser/background/background_contents_service_factory.cc
index 026f6c3..9157af6 100644
--- a/chrome/browser/background/background_contents_service_factory.cc
+++ b/chrome/browser/background/background_contents_service_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -25,7 +25,8 @@ BackgroundContentsServiceFactory* BackgroundContentsServiceFactory::
}
BackgroundContentsServiceFactory::BackgroundContentsServiceFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("BackgroundContentsService",
+ ProfileDependencyManager::GetInstance()) {
}
BackgroundContentsServiceFactory::~BackgroundContentsServiceFactory() {
diff --git a/chrome/browser/content_settings/cookie_settings.cc b/chrome/browser/content_settings/cookie_settings.cc
index 5d929ce..6a18498 100644
--- a/chrome/browser/content_settings/cookie_settings.cc
+++ b/chrome/browser/content_settings/cookie_settings.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -74,7 +74,8 @@ CookieSettingsWrapper* CookieSettings::Factory::GetWrapperForProfile(
}
CookieSettings::Factory::Factory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("CookieSettings",
+ ProfileDependencyManager::GetInstance()) {
}
ProfileKeyedService* CookieSettings::Factory::BuildServiceInstanceFor(
diff --git a/chrome/browser/download/download_service_factory.cc b/chrome/browser/download/download_service_factory.cc
index 473597c..c011fca 100644
--- a/chrome/browser/download/download_service_factory.cc
+++ b/chrome/browser/download/download_service_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -20,8 +20,8 @@ DownloadServiceFactory* DownloadServiceFactory::GetInstance() {
}
DownloadServiceFactory::DownloadServiceFactory()
- : ProfileKeyedServiceFactory(
- ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("DownloadService",
+ ProfileDependencyManager::GetInstance()) {
// TODO(rdsmith): For Shutdown() order we need to:
// DependsOn(HistoryServiceDataFactory::GetInstance());
}
diff --git a/chrome/browser/intents/web_intents_registry_factory.cc b/chrome/browser/intents/web_intents_registry_factory.cc
index f582842..2b22286 100644
--- a/chrome/browser/intents/web_intents_registry_factory.cc
+++ b/chrome/browser/intents/web_intents_registry_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,7 +14,8 @@ WebIntentsRegistry* WebIntentsRegistryFactory::GetForProfile(Profile* profile) {
}
WebIntentsRegistryFactory::WebIntentsRegistryFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("WebIntentsRegistry",
+ ProfileDependencyManager::GetInstance()) {
// TODO(erg): For Shutdown() order, we need to:
// DependsOn(WebDataServiceFactory::GetInstance());
// DependsOn(ExtensionServiceFactory::GetInstance());
diff --git a/chrome/browser/notifications/desktop_notification_service_factory.cc b/chrome/browser/notifications/desktop_notification_service_factory.cc
index f4402ab..f3d0b3b 100644
--- a/chrome/browser/notifications/desktop_notification_service_factory.cc
+++ b/chrome/browser/notifications/desktop_notification_service_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -27,7 +27,8 @@ DesktopNotificationServiceFactory* DesktopNotificationServiceFactory::
}
DesktopNotificationServiceFactory::DesktopNotificationServiceFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("DesktopNotificationService",
+ ProfileDependencyManager::GetInstance()) {
}
DesktopNotificationServiceFactory::~DesktopNotificationServiceFactory() {
diff --git a/chrome/browser/plugin_prefs_factory.cc b/chrome/browser/plugin_prefs_factory.cc
index f43d261..588f974 100644
--- a/chrome/browser/plugin_prefs_factory.cc
+++ b/chrome/browser/plugin_prefs_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -48,7 +48,8 @@ void PluginPrefsFactory::ForceRegisterPrefsForTest(PrefService* prefs) {
}
PluginPrefsFactory::PluginPrefsFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("PluginPrefs",
+ ProfileDependencyManager::GetInstance()) {
}
PluginPrefsFactory::~PluginPrefsFactory() {}
diff --git a/chrome/browser/prerender/prerender_manager_factory.cc b/chrome/browser/prerender/prerender_manager_factory.cc
index d759df4..8f0c6f3 100644
--- a/chrome/browser/prerender/prerender_manager_factory.cc
+++ b/chrome/browser/prerender/prerender_manager_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -30,7 +30,8 @@ PrerenderManagerFactory* PrerenderManagerFactory::GetInstance() {
}
PrerenderManagerFactory::PrerenderManagerFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("PrerenderManager",
+ ProfileDependencyManager::GetInstance()) {
}
PrerenderManagerFactory::~PrerenderManagerFactory() {
diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc
index fe8126f..5934c59 100644
--- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc
+++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,8 +19,8 @@ CloudPrintProxyServiceFactory* CloudPrintProxyServiceFactory::GetInstance() {
}
CloudPrintProxyServiceFactory::CloudPrintProxyServiceFactory()
- : ProfileKeyedServiceFactory(
- ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("CloudPrintProxyService",
+ ProfileDependencyManager::GetInstance()) {
}
CloudPrintProxyServiceFactory::~CloudPrintProxyServiceFactory() {
diff --git a/chrome/browser/profiles/profile_dependency_manager.cc b/chrome/browser/profiles/profile_dependency_manager.cc
index d6617e5..0d53c7b 100644
--- a/chrome/browser/profiles/profile_dependency_manager.cc
+++ b/chrome/browser/profiles/profile_dependency_manager.cc
@@ -32,6 +32,12 @@
#include "chrome/browser/ui/global_error_service_factory.h"
#include "chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h"
+#ifndef NDEBUG
+#include "base/command_line.h"
+#include "base/file_util.h"
+#include "chrome/common/chrome_switches.h"
+#endif
+
class Profile;
void ProfileDependencyManager::AddComponent(
@@ -78,7 +84,7 @@ void ProfileDependencyManager::CreateProfileServices(Profile* profile,
AssertFactoriesBuilt();
if (destruction_order_.empty())
- BuildDestructionOrder();
+ BuildDestructionOrder(profile);
// Iterate in reverse destruction order for creation.
for (std::vector<ProfileKeyedServiceFactory*>::reverse_iterator rit =
@@ -101,7 +107,7 @@ void ProfileDependencyManager::CreateProfileServices(Profile* profile,
void ProfileDependencyManager::DestroyProfileServices(Profile* profile) {
if (destruction_order_.empty())
- BuildDestructionOrder();
+ BuildDestructionOrder(profile);
for (std::vector<ProfileKeyedServiceFactory*>::const_iterator it =
destruction_order_.begin(); it != destruction_order_.end(); ++it) {
@@ -182,7 +188,19 @@ void ProfileDependencyManager::AssertFactoriesBuilt() {
built_factories_ = true;
}
-void ProfileDependencyManager::BuildDestructionOrder() {
+void ProfileDependencyManager::BuildDestructionOrder(Profile* profile) {
+#if !defined(NDEBUG)
+ // Whenever we try to build a destruction ordering, we should also dump a
+ // dependency graph to "/path/to/profile/profile-dependencies.dot".
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDumpProfileDependencyGraph)) {
+ FilePath dot_file =
+ profile->GetPath().AppendASCII("profile-dependencies.dot");
+ std::string contents = DumpGraphvizDependency();
+ file_util::WriteFile(dot_file, contents.c_str(), contents.size());
+ }
+#endif
+
// Step 1: Build a set of nodes with no incoming edges.
std::deque<ProfileKeyedServiceFactory*> queue;
std::copy(all_components_.begin(),
@@ -233,3 +251,50 @@ void ProfileDependencyManager::BuildDestructionOrder() {
std::reverse(output.begin(), output.end());
destruction_order_ = output;
}
+
+#if !defined(NDEBUG)
+
+std::string ProfileDependencyManager::DumpGraphvizDependency() {
+ std::string result("digraph {\n");
+
+ // Make a copy of all components.
+ std::deque<ProfileKeyedServiceFactory*> components;
+ std::copy(all_components_.begin(),
+ all_components_.end(),
+ std::back_inserter(components));
+
+ // State all dependencies and remove |second| so we don't generate an
+ // implicit dependency on the Profile hard coded node.
+ std::deque<ProfileKeyedServiceFactory*>::iterator components_end =
+ components.end();
+ result.append(" /* Dependencies */\n");
+ for (EdgeMap::const_iterator it = edges_.begin(); it != edges_.end(); ++it) {
+ result.append(" ");
+ result.append(it->second->name());
+ result.append(" -> ");
+ result.append(it->first->name());
+ result.append(";\n");
+
+ components_end = std::remove(components.begin(), components_end,
+ it->second);
+ }
+ components.erase(components_end, components.end());
+
+ // Every node that doesn't depend on anything else will implicitly depend on
+ // the Profile.
+ result.append("\n /* Toplevel attachments */\n");
+ for (std::deque<ProfileKeyedServiceFactory*>::const_iterator it =
+ components.begin(); it != components.end(); ++it) {
+ result.append(" ");
+ result.append((*it)->name());
+ result.append(" -> Profile;\n");
+ }
+
+ result.append("\n /* Toplevel profile */\n");
+ result.append(" Profile [shape=box];\n");
+
+ result.append("}\n");
+ return result;
+}
+
+#endif
diff --git a/chrome/browser/profiles/profile_dependency_manager.h b/chrome/browser/profiles/profile_dependency_manager.h
index b0b3ec9..3ad0634 100644
--- a/chrome/browser/profiles/profile_dependency_manager.h
+++ b/chrome/browser/profiles/profile_dependency_manager.h
@@ -12,6 +12,7 @@
#ifndef NDEBUG
#include <set>
+#include <string>
#endif
class Profile;
@@ -75,7 +76,12 @@ class ProfileDependencyManager {
// Using the dependency graph defined in |edges_|, fills |destruction_order_|
// so that Observe() can notify each ProfileKeyedServiceFactory in order.
- void BuildDestructionOrder();
+ void BuildDestructionOrder(Profile* profile);
+
+#ifndef NDEBUG
+ // Creates a dot file with our dependency information.
+ std::string DumpGraphvizDependency();
+#endif
std::vector<ProfileKeyedServiceFactory*> all_components_;
diff --git a/chrome/browser/profiles/profile_dependency_manager_unittest.cc b/chrome/browser/profiles/profile_dependency_manager_unittest.cc
index 3b99963..3a113ea 100644
--- a/chrome/browser/profiles/profile_dependency_manager_unittest.cc
+++ b/chrome/browser/profiles/profile_dependency_manager_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -36,7 +36,7 @@ class TestService : public ProfileKeyedServiceFactory {
TestService(const std::string& name,
std::vector<std::string>* fill_on_shutdown,
ProfileDependencyManager* manager)
- : ProfileKeyedServiceFactory(manager),
+ : ProfileKeyedServiceFactory("TestService", manager),
name_(name),
fill_on_shutdown_(fill_on_shutdown) {
}
diff --git a/chrome/browser/profiles/profile_keyed_service_factory.cc b/chrome/browser/profiles/profile_keyed_service_factory.cc
index 886308d..88b187e 100644
--- a/chrome/browser/profiles/profile_keyed_service_factory.cc
+++ b/chrome/browser/profiles/profile_keyed_service_factory.cc
@@ -72,8 +72,12 @@ void ProfileKeyedServiceFactory::RegisterUserPrefsOnProfile(Profile* profile) {
}
ProfileKeyedServiceFactory::ProfileKeyedServiceFactory(
- ProfileDependencyManager* manager)
- : dependency_manager_(manager) {
+ const char* name, ProfileDependencyManager* manager)
+ : dependency_manager_(manager)
+#ifndef NDEBUG
+ , service_name_(name)
+#endif
+{
dependency_manager_->AddComponent(this);
}
diff --git a/chrome/browser/profiles/profile_keyed_service_factory.h b/chrome/browser/profiles/profile_keyed_service_factory.h
index ab5eceb..30c99c1 100644
--- a/chrome/browser/profiles/profile_keyed_service_factory.h
+++ b/chrome/browser/profiles/profile_keyed_service_factory.h
@@ -46,6 +46,11 @@ class ProfileKeyedServiceFactory {
// attached to a single |profile|.
void RegisterUserPrefsOnProfile(Profile* profile);
+#ifndef NDEBUG
+ // Returns our name. We don't keep track of this in release mode.
+ const char* name() const { return service_name_; }
+#endif
+
protected:
// ProfileKeyedServiceFactories must communicate with a
// ProfileDependencyManager. For all non-test code, write your subclass
@@ -53,9 +58,11 @@ class ProfileKeyedServiceFactory {
//
// MyServiceFactory::MyServiceFactory()
// : ProfileKeyedServiceFactory(
+ // "MyService",
// ProfileDependencyManager::GetInstance())
// {}
- explicit ProfileKeyedServiceFactory(ProfileDependencyManager* manager);
+ explicit ProfileKeyedServiceFactory(const char* name,
+ ProfileDependencyManager* manager);
virtual ~ProfileKeyedServiceFactory();
// Common implementation that maps |profile| to some service object. Deals
@@ -132,6 +139,13 @@ class ProfileKeyedServiceFactory {
// this will always be ProfileDependencyManager::GetInstance(), but unit
// tests will want to use their own copy.
ProfileDependencyManager* dependency_manager_;
+
+#if !defined(NDEBUG)
+ // A static string passed in to our constructor. Should be unique across all
+ // services. This is used only for debugging in debug mode. (We can print
+ // pretty graphs with GraphViz with this information.)
+ const char* service_name_;
+#endif
};
#endif // CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_FACTORY_H_
diff --git a/chrome/browser/protector/protector_service_factory.cc b/chrome/browser/protector/protector_service_factory.cc
index c11cbdc..504673c 100644
--- a/chrome/browser/protector/protector_service_factory.cc
+++ b/chrome/browser/protector/protector_service_factory.cc
@@ -23,7 +23,8 @@ ProtectorServiceFactory* ProtectorServiceFactory::GetInstance() {
}
ProtectorServiceFactory::ProtectorServiceFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("ProtectorService",
+ ProfileDependencyManager::GetInstance()) {
DependsOn(GlobalErrorServiceFactory::GetInstance());
DependsOn(TemplateURLServiceFactory::GetInstance());
}
diff --git a/chrome/browser/search_engines/template_url_service_factory.cc b/chrome/browser/search_engines/template_url_service_factory.cc
index 6733c39..cd5a4f7 100644
--- a/chrome/browser/search_engines/template_url_service_factory.cc
+++ b/chrome/browser/search_engines/template_url_service_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,8 +19,8 @@ TemplateURLServiceFactory* TemplateURLServiceFactory::GetInstance() {
}
TemplateURLServiceFactory::TemplateURLServiceFactory()
- : ProfileKeyedServiceFactory(
- ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("TemplateURLServiceFactory",
+ ProfileDependencyManager::GetInstance()) {
// TODO(erg): For Shutdown() order, we need to:
// DependsOn(WebDataServiceFactory::GetInstance());
// DependsOn(HistoryService::GetInstance());
diff --git a/chrome/browser/sessions/session_service_factory.cc b/chrome/browser/sessions/session_service_factory.cc
index 8f1ba30..3705d93 100644
--- a/chrome/browser/sessions/session_service_factory.cc
+++ b/chrome/browser/sessions/session_service_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -40,8 +40,8 @@ SessionServiceFactory* SessionServiceFactory::GetInstance() {
}
SessionServiceFactory::SessionServiceFactory()
- : ProfileKeyedServiceFactory(
- ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("SessionService",
+ ProfileDependencyManager::GetInstance()) {
}
SessionServiceFactory::~SessionServiceFactory() {
diff --git a/chrome/browser/sessions/tab_restore_service_factory.cc b/chrome/browser/sessions/tab_restore_service_factory.cc
index b35ffab..e0fea58 100644
--- a/chrome/browser/sessions/tab_restore_service_factory.cc
+++ b/chrome/browser/sessions/tab_restore_service_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -25,8 +25,8 @@ TabRestoreServiceFactory* TabRestoreServiceFactory::GetInstance() {
}
TabRestoreServiceFactory::TabRestoreServiceFactory()
- : ProfileKeyedServiceFactory(
- ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("TabRestoreService",
+ ProfileDependencyManager::GetInstance()) {
}
TabRestoreServiceFactory::~TabRestoreServiceFactory() {
diff --git a/chrome/browser/signin/signin_manager_factory.cc b/chrome/browser/signin/signin_manager_factory.cc
index c32ba9f..0ded6ee 100644
--- a/chrome/browser/signin/signin_manager_factory.cc
+++ b/chrome/browser/signin/signin_manager_factory.cc
@@ -10,7 +10,8 @@
#include "chrome/common/pref_names.h"
SigninManagerFactory::SigninManagerFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("SigninManager",
+ ProfileDependencyManager::GetInstance()) {
// TODO(atwilson): SigninManager depends on TokenService - when this is
// converted to the ProfileKeyedService framework, uncomment this dependency.
// DependsOn(TokenServiceFactory::GetInstance());
diff --git a/chrome/browser/speech/speech_input_extension_manager.cc b/chrome/browser/speech/speech_input_extension_manager.cc
index 146d2993..ec1aebc 100644
--- a/chrome/browser/speech/speech_input_extension_manager.cc
+++ b/chrome/browser/speech/speech_input_extension_manager.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -118,7 +118,8 @@ SpeechInputExtensionManagerWrapper*
}
SpeechInputExtensionManager::Factory::Factory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("SpeechInputExtensionManager",
+ ProfileDependencyManager::GetInstance()) {
}
SpeechInputExtensionManager::Factory::~Factory() {
diff --git a/chrome/browser/sync/profile_sync_service_factory.cc b/chrome/browser/sync/profile_sync_service_factory.cc
index 451aedc..fa225a0 100644
--- a/chrome/browser/sync/profile_sync_service_factory.cc
+++ b/chrome/browser/sync/profile_sync_service_factory.cc
@@ -37,7 +37,8 @@ ProfileSyncService* ProfileSyncServiceFactory::GetForProfile(
}
ProfileSyncServiceFactory::ProfileSyncServiceFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("ProfileSyncService",
+ ProfileDependencyManager::GetInstance()) {
// The ProfileSyncService depends on various SyncableServices being around
// when it is shut down. Specify those dependencies here to build the proper
diff --git a/chrome/browser/tabs/pinned_tab_service_factory.cc b/chrome/browser/tabs/pinned_tab_service_factory.cc
index 70407ad..e8e8daa 100644
--- a/chrome/browser/tabs/pinned_tab_service_factory.cc
+++ b/chrome/browser/tabs/pinned_tab_service_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,7 +19,8 @@ void PinnedTabServiceFactory::InitForProfile(Profile* profile) {
}
PinnedTabServiceFactory::PinnedTabServiceFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("PinnedTabService",
+ ProfileDependencyManager::GetInstance()) {
}
PinnedTabServiceFactory::~PinnedTabServiceFactory() {
diff --git a/chrome/browser/themes/theme_service_factory.cc b/chrome/browser/themes/theme_service_factory.cc
index 965eede..5c73a05 100644
--- a/chrome/browser/themes/theme_service_factory.cc
+++ b/chrome/browser/themes/theme_service_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -35,8 +35,8 @@ ThemeServiceFactory* ThemeServiceFactory::GetInstance() {
}
ThemeServiceFactory::ThemeServiceFactory()
- : ProfileKeyedServiceFactory(
- ProfileDependencyManager::GetInstance())
+ : ProfileKeyedServiceFactory("ThemeService",
+ ProfileDependencyManager::GetInstance())
{}
ThemeServiceFactory::~ThemeServiceFactory() {}
diff --git a/chrome/browser/ui/global_error_service_factory.cc b/chrome/browser/ui/global_error_service_factory.cc
index e2c69a5..fc7fb57 100644
--- a/chrome/browser/ui/global_error_service_factory.cc
+++ b/chrome/browser/ui/global_error_service_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,7 +19,8 @@ GlobalErrorServiceFactory* GlobalErrorServiceFactory::GetInstance() {
}
GlobalErrorServiceFactory::GlobalErrorServiceFactory()
- : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
+ : ProfileKeyedServiceFactory("GlobalErrorService",
+ ProfileDependencyManager::GetInstance()) {
}
GlobalErrorServiceFactory::~GlobalErrorServiceFactory() {
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc
index d7d047c..ac1a25a 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -20,8 +20,8 @@ NTPResourceCacheFactory* NTPResourceCacheFactory::GetInstance() {
}
NTPResourceCacheFactory::NTPResourceCacheFactory()
- : ProfileKeyedServiceFactory(
- ProfileDependencyManager::GetInstance())
+ : ProfileKeyedServiceFactory("NTPResourceCache",
+ ProfileDependencyManager::GetInstance())
{}
NTPResourceCacheFactory::~NTPResourceCacheFactory() {}
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 63988f8..c61f073 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -1348,6 +1348,10 @@ const char kWebSocketLiveExperimentHost[] = "websocket-live-experiment-host";
// Enables overriding the path of file manager extension.
const char kFileManagerExtensionPath[] = "filemgr-ext-path";
+
+// Dumps dependency information about our profile services into a dot file in
+// the profile directory.
+const char kDumpProfileDependencyGraph[] = "dump-profile-graph";
#endif // NDEBUG
// Controls print preview in the browser process.
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index efd81cb..f061f02 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -385,6 +385,7 @@ extern const char kTouchDevices[];
extern const char kOAuthHostUrl[];
extern const char kWebSocketLiveExperimentHost[];
extern const char kFileManagerExtensionPath[];
+extern const char kDumpProfileDependencyGraph[];
#endif
#if defined(GOOGLE_CHROME_BUILD)