From 0dd6f20318b09983933fa8aab1573eb057cc1088 Mon Sep 17 00:00:00 2001 From: "phajdan.jr@chromium.org" Date: Mon, 20 May 2013 23:33:40 +0000 Subject: Move ProfileKeyedService infrastructure to a component Renames of the classes and methods will follow in separate patch(es). BUG=227219 R=erg@chromium.org, joi@chromium.org Review URL: https://codereview.chromium.org/14743010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201167 0039d316-1c4b-4281-b951-d872f2087c98 --- apps/DEPS | 1 + apps/app_restore_service.h | 2 +- apps/app_restore_service_factory.cc | 2 +- apps/app_restore_service_factory.h | 2 +- apps/shell_window_geometry_cache.cc | 2 +- apps/shell_window_geometry_cache.h | 4 +- apps/shortcut_manager.h | 2 +- apps/shortcut_manager_factory.cc | 2 +- apps/shortcut_manager_factory.h | 2 +- chrome/browser/DEPS | 1 + .../browser/autocomplete/autocomplete_classifier.h | 2 +- .../autocomplete_classifier_factory.cc | 2 +- .../autocomplete/autocomplete_classifier_factory.h | 2 +- .../autocheckout_whitelist_manager_factory.cc | 2 +- .../autocheckout_whitelist_manager_factory.h | 4 +- .../autofill/personal_data_manager_factory.cc | 2 +- .../autofill/personal_data_manager_factory.h | 4 +- .../background/background_contents_service.h | 2 +- .../background_contents_service_factory.cc | 2 +- .../background_contents_service_factory.h | 2 +- .../browser/background/background_mode_manager.h | 2 +- chrome/browser/bookmarks/bookmark_model.h | 2 +- chrome/browser/bookmarks/bookmark_model_factory.cc | 2 +- chrome/browser/bookmarks/bookmark_model_factory.h | 2 +- .../captive_portal/captive_portal_service.h | 2 +- .../captive_portal_service_factory.cc | 2 +- .../captive_portal_service_factory.h | 2 +- chrome/browser/chrome_to_mobile_service.h | 2 +- chrome/browser/chrome_to_mobile_service_factory.cc | 2 +- chrome/browser/chrome_to_mobile_service_factory.h | 2 +- .../chromeos/app_mode/kiosk_app_update_service.cc | 2 +- .../chromeos/app_mode/kiosk_app_update_service.h | 4 +- .../browser/chromeos/drive/drive_system_service.cc | 2 +- .../browser/chromeos/drive/drive_system_service.h | 4 +- .../file_manager/file_browser_private_api.h | 2 +- .../file_browser_private_api_factory.cc | 2 +- .../file_browser_private_api_factory.h | 2 +- .../browser/chromeos/extensions/install_limiter.h | 2 +- .../chromeos/extensions/install_limiter_factory.cc | 2 +- .../chromeos/extensions/install_limiter_factory.h | 2 +- .../chromeos/extensions/networking_private_api.h | 2 +- .../extensions/networking_private_event_router.cc | 2 +- .../extensions/networking_private_event_router.h | 2 +- .../networking_private_event_router_factory.cc | 2 +- .../networking_private_event_router_factory.h | 2 +- .../policy/user_cloud_policy_manager_chromeos.h | 2 +- .../user_cloud_policy_manager_factory_chromeos.cc | 2 +- .../user_cloud_policy_manager_factory_chromeos.h | 2 +- .../policy/user_cloud_policy_token_forwarder.h | 2 +- .../user_cloud_policy_token_forwarder_factory.cc | 2 +- .../user_cloud_policy_token_forwarder_factory.h | 2 +- chrome/browser/content_settings/cookie_settings.cc | 4 +- chrome/browser/content_settings/cookie_settings.h | 4 +- .../custom_handlers/protocol_handler_registry.h | 2 +- .../protocol_handler_registry_factory.cc | 2 +- .../protocol_handler_registry_factory.h | 2 +- chrome/browser/download/download_service.h | 2 +- .../browser/download/download_service_factory.cc | 2 +- chrome/browser/download/download_service_factory.h | 2 +- .../browser/extensions/activity_log/activity_log.h | 6 +- .../browser/extensions/api/api_resource_manager.h | 2 +- .../api/autotest_private/autotest_private_api.h | 2 +- .../autotest_private_api_factory.cc | 2 +- .../autotest_private_api_factory.h | 2 +- .../extensions/api/bluetooth/bluetooth_api.h | 2 +- .../api/bluetooth/bluetooth_api_factory.cc | 2 +- .../api/bluetooth/bluetooth_api_factory.h | 2 +- .../api/developer_private/developer_private_api.h | 2 +- .../developer_private_api_factory.cc | 2 +- .../developer_private_api_factory.h | 2 +- chrome/browser/extensions/api/dial/dial_api.h | 2 +- .../extensions/api/dial/dial_api_factory.cc | 2 +- .../browser/extensions/api/dial/dial_api_factory.h | 2 +- .../api/discovery/suggested_links_registry.h | 2 +- .../discovery/suggested_links_registry_factory.cc | 2 +- .../discovery/suggested_links_registry_factory.h | 2 +- chrome/browser/extensions/api/idle/idle_manager.h | 2 +- .../extensions/api/idle/idle_manager_factory.cc | 2 +- .../extensions/api/idle/idle_manager_factory.h | 2 +- .../extensions/api/input_ime/input_ime_api.h | 2 +- .../extensions/api/management/management_api.h | 2 +- .../extensions/api/processes/processes_api.h | 2 +- .../extensions/api/profile_keyed_api_factory.h | 6 +- .../api/streams_private/streams_private_api.h | 2 +- .../extension_sync_event_observer.h | 2 +- .../extension_sync_event_observer_factory.cc | 2 +- .../extension_sync_event_observer_factory.h | 2 +- .../system_indicator/system_indicator_manager.h | 2 +- .../system_indicator_manager_factory.cc | 2 +- .../system_indicator_manager_factory.h | 2 +- .../api/tab_capture/tab_capture_registry.cc | 4 +- .../api/tab_capture/tab_capture_registry.h | 2 +- .../tab_capture/tab_capture_registry_factory.cc | 4 +- .../api/tab_capture/tab_capture_registry_factory.h | 2 +- .../browser/extensions/api/tabs/tabs_windows_api.h | 2 +- .../browser/extensions/extension_action_manager.cc | 4 +- .../browser/extensions/extension_action_manager.h | 2 +- .../browser/extensions/extension_pref_value_map.h | 2 +- .../extensions/extension_pref_value_map_factory.cc | 2 +- .../extensions/extension_pref_value_map_factory.h | 2 +- chrome/browser/extensions/extension_prefs.h | 2 +- .../browser/extensions/extension_prefs_factory.cc | 2 +- .../browser/extensions/extension_prefs_factory.h | 2 +- chrome/browser/extensions/extension_system.h | 2 +- .../browser/extensions/extension_system_factory.cc | 2 +- .../browser/extensions/extension_system_factory.h | 2 +- chrome/browser/extensions/image_loader.h | 2 +- chrome/browser/extensions/image_loader_factory.cc | 2 +- chrome/browser/extensions/image_loader_factory.h | 2 +- chrome/browser/extensions/install_tracker.h | 2 +- .../browser/extensions/install_tracker_factory.cc | 2 +- .../browser/extensions/install_tracker_factory.h | 2 +- chrome/browser/extensions/shell_window_registry.cc | 2 +- chrome/browser/extensions/shell_window_registry.h | 4 +- .../extensions/token_cache/token_cache_service.h | 2 +- .../token_cache/token_cache_service_factory.cc | 2 +- .../token_cache/token_cache_service_factory.h | 2 +- chrome/browser/favicon/favicon_service.h | 2 +- chrome/browser/favicon/favicon_service_factory.cc | 2 +- chrome/browser/favicon/favicon_service_factory.h | 2 +- ...hrome_geolocation_permission_context_factory.cc | 2 +- ...chrome_geolocation_permission_context_factory.h | 2 +- chrome/browser/google/google_url_tracker.h | 2 +- .../browser/google/google_url_tracker_factory.cc | 2 +- chrome/browser/google/google_url_tracker_factory.h | 2 +- .../google_apis/drive_notification_manager.h | 2 +- .../drive_notification_manager_factory.cc | 2 +- .../drive_notification_manager_factory.h | 2 +- chrome/browser/history/history_service.h | 2 +- chrome/browser/history/history_service_factory.cc | 2 +- chrome/browser/history/history_service_factory.h | 2 +- chrome/browser/history/shortcuts_backend.h | 2 +- .../browser/history/shortcuts_backend_factory.cc | 2 +- chrome/browser/history/shortcuts_backend_factory.h | 2 +- chrome/browser/history/web_history_service.h | 2 +- .../browser/history/web_history_service_factory.cc | 2 +- .../browser/history/web_history_service_factory.h | 2 +- .../invalidation/invalidation_service_android.h | 2 +- .../invalidation/invalidation_service_factory.cc | 2 +- .../invalidation/invalidation_service_factory.h | 2 +- .../invalidation/p2p_invalidation_service.h | 2 +- .../invalidation/ticl_invalidation_service.h | 2 +- .../managed_user_registration_service.h | 2 +- .../managed_user_registration_service_factory.cc | 2 +- .../managed_user_registration_service_factory.h | 2 +- chrome/browser/managed_mode/managed_user_service.h | 2 +- .../managed_mode/managed_user_service_factory.cc | 2 +- .../managed_mode/managed_user_service_factory.h | 2 +- .../media_galleries/media_galleries_preferences.h | 2 +- .../media_galleries_preferences_factory.cc | 2 +- .../media_galleries_preferences_factory.h | 2 +- .../notifications/desktop_notification_service.h | 2 +- .../desktop_notification_service_factory.cc | 2 +- .../desktop_notification_service_factory.h | 2 +- .../sync_notifier/chrome_notifier_service.h | 2 +- .../chrome_notifier_service_factory.cc | 2 +- .../chrome_notifier_service_factory.h | 2 +- chrome/browser/password_manager/password_store.h | 2 +- .../password_manager/password_store_factory.cc | 2 +- .../password_manager/password_store_factory.h | 2 +- chrome/browser/plugins/plugin_prefs.cc | 4 +- chrome/browser/plugins/plugin_prefs.h | 2 +- chrome/browser/plugins/plugin_prefs_factory.cc | 4 +- chrome/browser/plugins/plugin_prefs_factory.h | 2 +- .../policy/cloud/user_cloud_policy_manager.h | 2 +- .../cloud/user_cloud_policy_manager_factory.cc | 2 +- .../cloud/user_cloud_policy_manager_factory.h | 2 +- .../policy/cloud/user_policy_signin_service.h | 2 +- .../cloud/user_policy_signin_service_factory.cc | 2 +- .../cloud/user_policy_signin_service_factory.h | 2 +- chrome/browser/policy/profile_policy_connector.h | 2 +- .../policy/profile_policy_connector_factory.cc | 2 +- .../policy/profile_policy_connector_factory.h | 2 +- .../predictors/autocomplete_action_predictor.h | 2 +- .../autocomplete_action_predictor_factory.cc | 2 +- .../autocomplete_action_predictor_factory.h | 2 +- chrome/browser/predictors/predictor_database.h | 2 +- .../predictors/predictor_database_factory.cc | 2 +- .../predictors/predictor_database_factory.h | 2 +- .../predictors/resource_prefetch_predictor.h | 4 +- .../resource_prefetch_predictor_factory.cc | 2 +- .../resource_prefetch_predictor_factory.h | 2 +- chrome/browser/prerender/prerender_link_manager.h | 2 +- .../prerender/prerender_link_manager_factory.cc | 2 +- .../prerender/prerender_link_manager_factory.h | 2 +- chrome/browser/prerender/prerender_manager.h | 2 +- .../browser/prerender/prerender_manager_factory.cc | 2 +- .../browser/prerender/prerender_manager_factory.h | 2 +- .../cloud_print/cloud_print_proxy_service.h | 2 +- .../cloud_print_proxy_service_factory.cc | 2 +- .../cloud_print_proxy_service_factory.h | 2 +- .../test/cloud_print_proxy_process_browsertest.cc | 2 +- chrome/browser/profiles/dependency_graph.cc | 166 -------------------- chrome/browser/profiles/dependency_graph.h | 67 -------- .../browser/profiles/dependency_graph_unittest.cc | 161 ------------------- chrome/browser/profiles/dependency_node.h | 16 -- chrome/browser/profiles/gaia_info_update_service.h | 2 +- .../profiles/gaia_info_update_service_factory.cc | 2 +- .../profiles/gaia_info_update_service_factory.h | 2 +- .../profiles/off_the_record_profile_impl.cc | 2 +- .../off_the_record_profile_impl_unittest.cc | 2 +- .../browser/profiles/profile_dependency_manager.cc | 149 ------------------ .../browser/profiles/profile_dependency_manager.h | 86 ---------- .../profile_dependency_manager_unittest.cc | 173 --------------------- chrome/browser/profiles/profile_impl.cc | 2 +- .../browser/profiles/profile_keyed_base_factory.cc | 110 ------------- .../browser/profiles/profile_keyed_base_factory.h | 133 ---------------- chrome/browser/profiles/profile_keyed_service.h | 30 ---- .../profiles/profile_keyed_service_factory.cc | 126 --------------- .../profiles/profile_keyed_service_factory.h | 115 -------------- .../profiles/refcounted_profile_keyed_service.cc | 34 ---- .../profiles/refcounted_profile_keyed_service.h | 70 --------- .../refcounted_profile_keyed_service_factory.cc | 127 --------------- .../refcounted_profile_keyed_service_factory.h | 88 ----------- .../browser/profiles/startup_task_runner_service.h | 2 +- .../startup_task_runner_service_factory.cc | 2 +- .../profiles/startup_task_runner_service_factory.h | 2 +- chrome/browser/search/instant_service.h | 2 +- chrome/browser/search/instant_service_factory.cc | 2 +- chrome/browser/search/instant_service_factory.h | 2 +- .../browser/search_engines/template_url_fetcher.h | 2 +- .../search_engines/template_url_fetcher_factory.cc | 2 +- .../search_engines/template_url_fetcher_factory.h | 2 +- .../browser/search_engines/template_url_service.h | 2 +- .../search_engines/template_url_service_factory.cc | 2 +- .../search_engines/template_url_service_factory.h | 2 +- chrome/browser/sessions/session_service.h | 2 +- chrome/browser/sessions/session_service_factory.cc | 2 +- chrome/browser/sessions/session_service_factory.h | 2 +- chrome/browser/sessions/tab_restore_service.h | 2 +- .../sessions/tab_restore_service_factory.cc | 2 +- .../browser/sessions/tab_restore_service_factory.h | 2 +- chrome/browser/signin/about_signin_internals.h | 2 +- .../signin/about_signin_internals_factory.cc | 2 +- .../signin/about_signin_internals_factory.h | 2 +- .../browser/signin/profile_oauth2_token_service.h | 2 +- .../signin/profile_oauth2_token_service_factory.cc | 2 +- .../signin/profile_oauth2_token_service_factory.h | 2 +- chrome/browser/signin/signin_manager.h | 2 +- chrome/browser/signin/signin_manager_base.h | 2 +- chrome/browser/signin/signin_manager_factory.cc | 2 +- chrome/browser/signin/signin_manager_factory.h | 2 +- chrome/browser/signin/token_service.h | 2 +- chrome/browser/signin/token_service_factory.cc | 2 +- chrome/browser/signin/token_service_factory.h | 2 +- .../chrome_speech_recognition_preferences.cc | 2 +- .../speech/chrome_speech_recognition_preferences.h | 4 +- .../speech/tts_extension_loader_chromeos.cc | 6 +- .../browser/speech/tts_extension_loader_chromeos.h | 2 +- chrome/browser/spellchecker/spellcheck_factory.cc | 2 +- chrome/browser/spellchecker/spellcheck_factory.h | 2 +- chrome/browser/spellchecker/spellcheck_service.h | 2 +- .../glue/bookmark_data_type_controller_unittest.cc | 2 +- chrome/browser/sync/profile_sync_service.h | 2 +- .../browser/sync/profile_sync_service_factory.cc | 2 +- chrome/browser/sync/profile_sync_service_factory.h | 2 +- .../profile_sync_service_typed_url_unittest.cc | 2 +- .../sync_file_system/sync_file_system_service.cc | 2 +- .../sync_file_system/sync_file_system_service.h | 2 +- .../sync_file_system_service_factory.cc | 2 +- .../sync_file_system_service_factory.h | 2 +- chrome/browser/themes/theme_service.h | 2 +- chrome/browser/themes/theme_service_factory.cc | 2 +- chrome/browser/themes/theme_service_factory.h | 2 +- chrome/browser/thumbnails/thumbnail_service.h | 2 +- .../thumbnails/thumbnail_service_factory.cc | 2 +- .../browser/thumbnails/thumbnail_service_factory.h | 2 +- chrome/browser/ui/ash/app_sync_ui_state.h | 2 +- chrome/browser/ui/ash/app_sync_ui_state_factory.cc | 2 +- chrome/browser/ui/ash/app_sync_ui_state_factory.h | 2 +- chrome/browser/ui/find_bar/find_bar_state.h | 2 +- .../browser/ui/find_bar/find_bar_state_factory.cc | 2 +- .../browser/ui/find_bar/find_bar_state_factory.h | 2 +- .../ui/gesture_prefs_observer_factory_aura.cc | 2 +- .../ui/gesture_prefs_observer_factory_aura.h | 2 +- .../browser/ui/global_error/global_error_service.h | 2 +- .../global_error/global_error_service_factory.cc | 2 +- .../ui/global_error/global_error_service_factory.h | 2 +- chrome/browser/ui/tabs/pinned_tab_service.h | 2 +- .../browser/ui/tabs/pinned_tab_service_factory.cc | 2 +- .../browser/ui/tabs/pinned_tab_service_factory.h | 2 +- .../ui/webui/ntp/app_resource_cache_factory.cc | 2 +- .../ui/webui/ntp/app_resource_cache_factory.h | 2 +- chrome/browser/ui/webui/ntp/ntp_resource_cache.h | 2 +- .../ui/webui/ntp/ntp_resource_cache_factory.cc | 2 +- .../ui/webui/ntp/ntp_resource_cache_factory.h | 2 +- chrome/browser/ui/webui/signin/login_ui_service.h | 2 +- .../ui/webui/signin/login_ui_service_factory.cc | 2 +- .../ui/webui/signin/login_ui_service_factory.h | 2 +- chrome/browser/usb/usb_service.h | 2 +- chrome/browser/usb/usb_service_factory.cc | 2 +- chrome/browser/usb/usb_service_factory.h | 2 +- chrome/browser/user_style_sheet_watcher.h | 2 +- chrome/browser/user_style_sheet_watcher_factory.cc | 2 +- chrome/browser/user_style_sheet_watcher_factory.h | 2 +- chrome/browser/webdata/web_data_service_factory.cc | 2 +- chrome/browser/webdata/web_data_service_factory.h | 4 +- chrome/chrome_browser.gypi | 15 +- chrome/chrome_tests_unit.gypi | 2 - chrome/common/chrome_switches.cc | 4 - chrome/common/chrome_switches.h | 1 - chrome/test/base/testing_profile.cc | 2 +- components/browser_context_keyed_service.gypi | 38 +++++ components/browser_context_keyed_service/DEPS | 3 + .../browser_context_dependency_manager.cc | 149 ++++++++++++++++++ .../browser_context_dependency_manager.h | 86 ++++++++++ .../browser_context_dependency_manager_unittest.cc | 173 +++++++++++++++++++++ .../browser_context_keyed_base_factory.cc | 110 +++++++++++++ .../browser_context_keyed_base_factory.h | 133 ++++++++++++++++ .../browser_context_keyed_service.h | 30 ++++ .../browser_context_keyed_service_factory.cc | 126 +++++++++++++++ .../browser_context_keyed_service_factory.h | 115 ++++++++++++++ .../dependency_graph.cc | 166 ++++++++++++++++++++ .../dependency_graph.h | 67 ++++++++ .../dependency_graph_unittest.cc | 161 +++++++++++++++++++ .../dependency_node.h | 16 ++ .../refcounted_browser_context_keyed_service.cc | 34 ++++ .../refcounted_browser_context_keyed_service.h | 70 +++++++++ ...ounted_browser_context_keyed_service_factory.cc | 127 +++++++++++++++ ...counted_browser_context_keyed_service_factory.h | 88 +++++++++++ components/components.gyp | 1 + components/components_tests.gypi | 5 + content/public/common/content_switches.cc | 6 + content/public/common/content_switches.h | 4 + 324 files changed, 2013 insertions(+), 1974 deletions(-) delete mode 100644 chrome/browser/profiles/dependency_graph.cc delete mode 100644 chrome/browser/profiles/dependency_graph.h delete mode 100644 chrome/browser/profiles/dependency_graph_unittest.cc delete mode 100644 chrome/browser/profiles/dependency_node.h delete mode 100644 chrome/browser/profiles/profile_dependency_manager.cc delete mode 100644 chrome/browser/profiles/profile_dependency_manager.h delete mode 100644 chrome/browser/profiles/profile_dependency_manager_unittest.cc delete mode 100644 chrome/browser/profiles/profile_keyed_base_factory.cc delete mode 100644 chrome/browser/profiles/profile_keyed_base_factory.h delete mode 100644 chrome/browser/profiles/profile_keyed_service.h delete mode 100644 chrome/browser/profiles/profile_keyed_service_factory.cc delete mode 100644 chrome/browser/profiles/profile_keyed_service_factory.h delete mode 100644 chrome/browser/profiles/refcounted_profile_keyed_service.cc delete mode 100644 chrome/browser/profiles/refcounted_profile_keyed_service.h delete mode 100644 chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc delete mode 100644 chrome/browser/profiles/refcounted_profile_keyed_service_factory.h create mode 100644 components/browser_context_keyed_service.gypi create mode 100644 components/browser_context_keyed_service/DEPS create mode 100644 components/browser_context_keyed_service/browser_context_dependency_manager.cc create mode 100644 components/browser_context_keyed_service/browser_context_dependency_manager.h create mode 100644 components/browser_context_keyed_service/browser_context_dependency_manager_unittest.cc create mode 100644 components/browser_context_keyed_service/browser_context_keyed_base_factory.cc create mode 100644 components/browser_context_keyed_service/browser_context_keyed_base_factory.h create mode 100644 components/browser_context_keyed_service/browser_context_keyed_service.h create mode 100644 components/browser_context_keyed_service/browser_context_keyed_service_factory.cc create mode 100644 components/browser_context_keyed_service/browser_context_keyed_service_factory.h create mode 100644 components/browser_context_keyed_service/dependency_graph.cc create mode 100644 components/browser_context_keyed_service/dependency_graph.h create mode 100644 components/browser_context_keyed_service/dependency_graph_unittest.cc create mode 100644 components/browser_context_keyed_service/dependency_node.h create mode 100644 components/browser_context_keyed_service/refcounted_browser_context_keyed_service.cc create mode 100644 components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h create mode 100644 components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.cc create mode 100644 components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h diff --git a/apps/DEPS b/apps/DEPS index fb10d13..b7951f8 100644 --- a/apps/DEPS +++ b/apps/DEPS @@ -1,6 +1,7 @@ include_rules = [ "+base", "+content", + "+components/browser_context_keyed_service", "+ui", "+win8", # Temporary allowed includes. diff --git a/apps/app_restore_service.h b/apps/app_restore_service.h index 16d0910..32c5738 100644 --- a/apps/app_restore_service.h +++ b/apps/app_restore_service.h @@ -9,7 +9,7 @@ #include #include "chrome/browser/extensions/shell_window_registry.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/apps/app_restore_service_factory.cc b/apps/app_restore_service_factory.cc index 091487e..4086c7a 100644 --- a/apps/app_restore_service_factory.cc +++ b/apps/app_restore_service_factory.cc @@ -7,7 +7,7 @@ #include "apps/app_restore_service.h" #include "chrome/browser/extensions/shell_window_registry.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace apps { diff --git a/apps/app_restore_service_factory.h b/apps/app_restore_service_factory.h index b84c585..5076753 100644 --- a/apps/app_restore_service_factory.h +++ b/apps/app_restore_service_factory.h @@ -6,7 +6,7 @@ #define APPS_APP_RESTORE_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/apps/shell_window_geometry_cache.cc b/apps/shell_window_geometry_cache.cc index 8a785b8..9b2a4f5 100644 --- a/apps/shell_window_geometry_cache.cc +++ b/apps/shell_window_geometry_cache.cc @@ -11,9 +11,9 @@ #include "chrome/browser/extensions/extension_prefs_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_types.h" diff --git a/apps/shell_window_geometry_cache.h b/apps/shell_window_geometry_cache.h index 5b5bb1d..c66edd6 100644 --- a/apps/shell_window_geometry_cache.h +++ b/apps/shell_window_geometry_cache.h @@ -14,8 +14,8 @@ #include "base/time.h" #include "base/timer.h" #include "base/values.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "ui/base/ui_base_types.h" diff --git a/apps/shortcut_manager.h b/apps/shortcut_manager.h index a1efa01..2573f45 100644 --- a/apps/shortcut_manager.h +++ b/apps/shortcut_manager.h @@ -6,8 +6,8 @@ #define APPS_SHORTCUT_MANAGER_H_ #include "base/memory/weak_ptr.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/extensions/extension.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/apps/shortcut_manager_factory.cc b/apps/shortcut_manager_factory.cc index b76b16d..4d2b513 100644 --- a/apps/shortcut_manager_factory.cc +++ b/apps/shortcut_manager_factory.cc @@ -6,7 +6,7 @@ #include "apps/shortcut_manager.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace apps { diff --git a/apps/shortcut_manager_factory.h b/apps/shortcut_manager_factory.h index 001bb61..7f928e3 100644 --- a/apps/shortcut_manager_factory.h +++ b/apps/shortcut_manager_factory.h @@ -5,7 +5,7 @@ #ifndef APPS_SHORTCUT_MANAGER_FACTORY_H_ #define APPS_SHORTCUT_MANAGER_FACTORY_H_ -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" template struct DefaultSingletonTraits; diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index 2a0e8a7..d75b5db 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS @@ -9,6 +9,7 @@ include_rules = [ "+components/autofill/common", "+components/auto_login_parser", "+components/autofill/common", + "+components/browser_context_keyed_service", "+components/navigation_interception", "+components/user_prefs", "+components/visitedlink/browser", diff --git a/chrome/browser/autocomplete/autocomplete_classifier.h b/chrome/browser/autocomplete/autocomplete_classifier.h index 15ed70c..d0bffe7 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier.h +++ b/chrome/browser/autocomplete/autocomplete_classifier.h @@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/string16.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class AutocompleteController; struct AutocompleteMatch; diff --git a/chrome/browser/autocomplete/autocomplete_classifier_factory.cc b/chrome/browser/autocomplete/autocomplete_classifier_factory.cc index 9297101..df23f6bf 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier_factory.cc +++ b/chrome/browser/autocomplete/autocomplete_classifier_factory.cc @@ -9,8 +9,8 @@ #include "chrome/browser/history/shortcuts_backend_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/search_engines/template_url_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static diff --git a/chrome/browser/autocomplete/autocomplete_classifier_factory.h b/chrome/browser/autocomplete/autocomplete_classifier_factory.h index 0fb74b0..dcee47a 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier_factory.h +++ b/chrome/browser/autocomplete/autocomplete_classifier_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class AutocompleteClassifier; class Profile; diff --git a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc index 0d874bc..180bc8e 100644 --- a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc +++ b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc @@ -8,8 +8,8 @@ #include "base/memory/singleton.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "components/autofill/browser/autocheckout/whitelist_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace autofill { namespace autocheckout { diff --git a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h index 00f6443..5b42fb1 100644 --- a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h +++ b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_AUTOFILL_AUTOCHECKOUT_WHITELIST_MANAGER_FACTORY_H_ #include "base/compiler_specific.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" template struct DefaultSingletonTraits; class Profile; diff --git a/chrome/browser/autofill/personal_data_manager_factory.cc b/chrome/browser/autofill/personal_data_manager_factory.cc index c5c56b8..c688f54 100644 --- a/chrome/browser/autofill/personal_data_manager_factory.cc +++ b/chrome/browser/autofill/personal_data_manager_factory.cc @@ -9,9 +9,9 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/webdata/web_data_service_factory.h" #include "components/autofill/browser/personal_data_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace autofill { namespace { diff --git a/chrome/browser/autofill/personal_data_manager_factory.h b/chrome/browser/autofill/personal_data_manager_factory.h index ca8ce83..881eb53 100644 --- a/chrome/browser/autofill/personal_data_manager_factory.h +++ b/chrome/browser/autofill/personal_data_manager_factory.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_AUTOFILL_PERSONAL_DATA_MANAGER_FACTORY_H_ #include "base/compiler_specific.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" template struct DefaultSingletonTraits; class Profile; diff --git a/chrome/browser/background/background_contents_service.h b/chrome/browser/background/background_contents_service.h index cbded45..5b5f2e3 100644 --- a/chrome/browser/background/background_contents_service.h +++ b/chrome/browser/background/background_contents_service.h @@ -11,8 +11,8 @@ #include "base/gtest_prod_util.h" #include "base/memory/ref_counted.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/tab_contents/background_contents.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/common/window_container_type.h" diff --git a/chrome/browser/background/background_contents_service_factory.cc b/chrome/browser/background/background_contents_service_factory.cc index 84ccaa8..44287bc 100644 --- a/chrome/browser/background/background_contents_service_factory.cc +++ b/chrome/browser/background/background_contents_service_factory.cc @@ -9,8 +9,8 @@ #include "chrome/browser/background/background_contents_service.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" // static diff --git a/chrome/browser/background/background_contents_service_factory.h b/chrome/browser/background/background_contents_service_factory.h index ba4d9b4..f99edbf 100644 --- a/chrome/browser/background/background_contents_service_factory.h +++ b/chrome/browser/background/background_contents_service_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class BackgroundContentsService; class Profile; diff --git a/chrome/browser/background/background_mode_manager.h b/chrome/browser/background/background_mode_manager.h index fcb3497..82ec77f 100644 --- a/chrome/browser/background/background_mode_manager.h +++ b/chrome/browser/background/background_mode_manager.h @@ -11,8 +11,8 @@ #include "base/prefs/pref_change_registrar.h" #include "chrome/browser/background/background_application_list_model.h" #include "chrome/browser/profiles/profile_info_cache_observer.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/status_icons/status_icon.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "ui/base/models/simple_menu_model.h" diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index 95191d5..736cf08 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -17,8 +17,8 @@ #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" #include "chrome/browser/bookmarks/bookmark_service.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/cancelable_task_tracker.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/bookmarks/bookmark_model_factory.cc b/chrome/browser/bookmarks/bookmark_model_factory.cc index bef791d..dd2c637 100644 --- a/chrome/browser/bookmarks/bookmark_model_factory.cc +++ b/chrome/browser/bookmarks/bookmark_model_factory.cc @@ -10,10 +10,10 @@ #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/profiles/startup_task_runner_service.h" #include "chrome/browser/profiles/startup_task_runner_service_factory.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" // static diff --git a/chrome/browser/bookmarks/bookmark_model_factory.h b/chrome/browser/bookmarks/bookmark_model_factory.h index a64deed..2ad76a4 100644 --- a/chrome/browser/bookmarks/bookmark_model_factory.h +++ b/chrome/browser/bookmarks/bookmark_model_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" template struct DefaultSingletonTraits; diff --git a/chrome/browser/captive_portal/captive_portal_service.h b/chrome/browser/captive_portal/captive_portal_service.h index b6f5541..02c989e 100644 --- a/chrome/browser/captive_portal/captive_portal_service.h +++ b/chrome/browser/captive_portal/captive_portal_service.h @@ -12,7 +12,7 @@ #include "base/time.h" #include "base/timer.h" #include "chrome/browser/captive_portal/captive_portal_detector.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "googleurl/src/gurl.h" #include "net/base/backoff_entry.h" diff --git a/chrome/browser/captive_portal/captive_portal_service_factory.cc b/chrome/browser/captive_portal/captive_portal_service_factory.cc index 1ea031d..c677e72 100644 --- a/chrome/browser/captive_portal/captive_portal_service_factory.cc +++ b/chrome/browser/captive_portal/captive_portal_service_factory.cc @@ -7,7 +7,7 @@ #include "chrome/browser/captive_portal/captive_portal_service.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace captive_portal { diff --git a/chrome/browser/captive_portal/captive_portal_service_factory.h b/chrome/browser/captive_portal/captive_portal_service_factory.h index 30d38a6..4838d3d 100644 --- a/chrome/browser/captive_portal/captive_portal_service_factory.h +++ b/chrome/browser/captive_portal/captive_portal_service_factory.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/chrome_to_mobile_service.h b/chrome/browser/chrome_to_mobile_service.h index ce37a3c..22a4b4a 100644 --- a/chrome/browser/chrome_to_mobile_service.h +++ b/chrome/browser/chrome_to_mobile_service.h @@ -18,8 +18,8 @@ #include "base/string16.h" #include "base/timer.h" #include "base/values.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/sessions/session_id.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "google_apis/gaia/oauth2_access_token_consumer.h" diff --git a/chrome/browser/chrome_to_mobile_service_factory.cc b/chrome/browser/chrome_to_mobile_service_factory.cc index 413106d..a467ca2 100644 --- a/chrome/browser/chrome_to_mobile_service_factory.cc +++ b/chrome/browser/chrome_to_mobile_service_factory.cc @@ -6,9 +6,9 @@ #include "chrome/browser/chrome_to_mobile_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/signin/token_service_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static ChromeToMobileServiceFactory* ChromeToMobileServiceFactory::GetInstance() { diff --git a/chrome/browser/chrome_to_mobile_service_factory.h b/chrome/browser/chrome_to_mobile_service_factory.h index 12168a1..7a128a4 100644 --- a/chrome/browser/chrome_to_mobile_service_factory.h +++ b/chrome/browser/chrome_to_mobile_service_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class ChromeToMobileService; class Profile; diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc index 1e742cb..1f9424d 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc @@ -11,7 +11,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace chromeos { diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h index bd0601f..1fd9dd1 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h +++ b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h @@ -12,8 +12,8 @@ #include "base/memory/singleton.h" #include "base/timer.h" #include "chrome/browser/extensions/update_observer.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/chromeos/drive/drive_system_service.cc b/chrome/browser/chromeos/drive/drive_system_service.cc index 300bc6c..b647b05 100644 --- a/chrome/browser/chromeos/drive/drive_system_service.cc +++ b/chrome/browser/chromeos/drive/drive_system_service.cc @@ -30,11 +30,11 @@ #include "chrome/browser/google_apis/gdata_wapi_service.h" #include "chrome/browser/google_apis/gdata_wapi_url_generator.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" diff --git a/chrome/browser/chromeos/drive/drive_system_service.h b/chrome/browser/chromeos/drive/drive_system_service.h index 48baacf..4f35f42 100644 --- a/chrome/browser/chromeos/drive/drive_system_service.h +++ b/chrome/browser/chromeos/drive/drive_system_service.h @@ -17,8 +17,8 @@ #include "chrome/browser/chromeos/drive/file_system_util.h" #include "chrome/browser/chromeos/drive/job_scheduler.h" #include "chrome/browser/google_apis/drive_notification_observer.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" namespace base { class FilePath; diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.h b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.h index d51889e..9050565 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.h +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api.h @@ -18,7 +18,7 @@ #include "chrome/browser/chromeos/extensions/file_manager/file_manager_event_router.h" #include "chrome/browser/chromeos/extensions/file_manager/zip_file_creator.h" #include "chrome/browser/extensions/extension_function.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "googleurl/src/url_util.h" class GURL; diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc index fba99de..cf6dda2 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc @@ -9,7 +9,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static FileBrowserPrivateAPI* diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h index 09c8599..1fb3345 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_PRIVATE_API_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class FileBrowserPrivateAPI; class Profile; diff --git a/chrome/browser/chromeos/extensions/install_limiter.h b/chrome/browser/chromeos/extensions/install_limiter.h index 1a470e5..a72093f 100644 --- a/chrome/browser/chromeos/extensions/install_limiter.h +++ b/chrome/browser/chromeos/extensions/install_limiter.h @@ -15,7 +15,7 @@ #include "base/memory/weak_ptr.h" #include "base/timer.h" #include "chrome/browser/extensions/crx_installer.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/chromeos/extensions/install_limiter_factory.cc b/chrome/browser/chromeos/extensions/install_limiter_factory.cc index 3cb25c8..bea0eca 100644 --- a/chrome/browser/chromeos/extensions/install_limiter_factory.cc +++ b/chrome/browser/chromeos/extensions/install_limiter_factory.cc @@ -7,7 +7,7 @@ #include "chrome/browser/chromeos/extensions/install_limiter.h" #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/chromeos/extensions/install_limiter_factory.h b/chrome/browser/chromeos/extensions/install_limiter_factory.h index af43fe6..615a32c 100644 --- a/chrome/browser/chromeos/extensions/install_limiter_factory.h +++ b/chrome/browser/chromeos/extensions/install_limiter_factory.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/chromeos/extensions/networking_private_api.h b/chrome/browser/chromeos/extensions/networking_private_api.h index f014e9d..d7232a3 100644 --- a/chrome/browser/chromeos/extensions/networking_private_api.h +++ b/chrome/browser/chromeos/extensions/networking_private_api.h @@ -13,8 +13,8 @@ #include "base/memory/ref_counted.h" #include "base/values.h" #include "chrome/browser/extensions/extension_function.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chromeos/dbus/dbus_method_call_status.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" // Implements the chrome.networkingPrivate.getProperties method. class NetworkingPrivateGetPropertiesFunction : public AsyncExtensionFunction { diff --git a/chrome/browser/chromeos/extensions/networking_private_event_router.cc b/chrome/browser/chromeos/extensions/networking_private_event_router.cc index cc42f7b..d6af5d1 100644 --- a/chrome/browser/chromeos/extensions/networking_private_event_router.cc +++ b/chrome/browser/chromeos/extensions/networking_private_event_router.cc @@ -12,13 +12,13 @@ #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/extensions/api/networking_private.h" #include "chromeos/network/network_state.h" #include "chromeos/network/network_state_handler.h" #include "chromeos/network/onc/onc_constants.h" #include "chromeos/network/onc/onc_signature.h" #include "chromeos/network/onc/onc_translator.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "third_party/cros_system_api/dbus/service_constants.h" using extensions::event_names::kOnNetworkListChanged; diff --git a/chrome/browser/chromeos/extensions/networking_private_event_router.h b/chrome/browser/chromeos/extensions/networking_private_event_router.h index b80c2c1..40b9353 100644 --- a/chrome/browser/chromeos/extensions/networking_private_event_router.h +++ b/chrome/browser/chromeos/extensions/networking_private_event_router.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_EVENT_ROUTER_H_ #include "chrome/browser/extensions/event_router.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chromeos/network/network_state_handler_observer.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class Profile; diff --git a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc index 31f7ee3..993a448 100644 --- a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc +++ b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc @@ -8,7 +8,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace chromeos { diff --git a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h index b43e290..93eba04 100644 --- a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h +++ b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_NETWORKING_PRIVATE_EVENT_ROUTER_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h index a233cc6..142ac62 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h @@ -16,7 +16,7 @@ #include "chrome/browser/policy/cloud/cloud_policy_manager.h" #include "chrome/browser/policy/cloud/cloud_policy_service.h" #include "chrome/browser/policy/cloud/component_cloud_policy_service.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "google_apis/gaia/gaia_auth_consumer.h" class PrefService; diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc index c382088..603c558 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.cc @@ -18,11 +18,11 @@ #include "chrome/browser/policy/cloud/device_management_service.h" #include "chrome/browser/policy/cloud/resource_cache.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/chrome_switches.h" #include "chromeos/chromeos_paths.h" #include "chromeos/chromeos_switches.h" #include "chromeos/dbus/dbus_thread_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "net/url_request/url_request_context_getter.h" namespace policy { diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h index 99f4768..c44a9fc 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h @@ -9,7 +9,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_base_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_base_factory.h" class Profile; diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h index 05557f3..70cc91e 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h +++ b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h @@ -8,7 +8,7 @@ #include #include "base/basictypes.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.cc b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.cc index ac0755e..4869713 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.cc @@ -8,9 +8,9 @@ #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chromeos.h" #include "chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/signin/token_service.h" #include "chrome/browser/signin/token_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace policy { diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.h b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.h index b0999bd..8bdd62f 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.h +++ b/chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" namespace content { class BrowserContext; diff --git a/chrome/browser/content_settings/cookie_settings.cc b/chrome/browser/content_settings/cookie_settings.cc index a9d3558..e6eed22 100644 --- a/chrome/browser/content_settings/cookie_settings.cc +++ b/chrome/browser/content_settings/cookie_settings.cc @@ -10,12 +10,12 @@ #include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/content_settings_pattern.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "components/user_prefs/pref_registry_syncable.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" diff --git a/chrome/browser/content_settings/cookie_settings.h b/chrome/browser/content_settings/cookie_settings.h index 4fd4452..9b85434 100644 --- a/chrome/browser/content_settings/cookie_settings.h +++ b/chrome/browser/content_settings/cookie_settings.h @@ -13,9 +13,9 @@ #include "base/prefs/pref_change_registrar.h" #include "base/synchronization/lock.h" #include "chrome/browser/content_settings/host_content_settings_map.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" #include "chrome/common/content_settings.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h" class ContentSettingsPattern; class CookieSettingsWrapper; diff --git a/chrome/browser/custom_handlers/protocol_handler_registry.h b/chrome/browser/custom_handlers/protocol_handler_registry.h index 73a5202..84b1ecf 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry.h +++ b/chrome/browser/custom_handlers/protocol_handler_registry.h @@ -15,9 +15,9 @@ #include "base/sequenced_task_runner_helpers.h" #include "base/values.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/shell_integration.h" #include "chrome/common/custom_handlers/protocol_handler.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "net/url_request/url_request.h" diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc b/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc index 658f1a0..5e21cfc 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc +++ b/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc @@ -9,7 +9,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static ProtocolHandlerRegistryFactory* ProtocolHandlerRegistryFactory::GetInstance() { diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_factory.h b/chrome/browser/custom_handlers/protocol_handler_registry_factory.h index ee13d4b..05cd6c9 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_factory.h +++ b/chrome/browser/custom_handlers/protocol_handler_registry_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; class ProtocolHandlerRegistry; diff --git a/chrome/browser/download/download_service.h b/chrome/browser/download/download_service.h index 742d576..e993f14 100644 --- a/chrome/browser/download/download_service.h +++ b/chrome/browser/download/download_service.h @@ -11,7 +11,7 @@ #include "base/callback_forward.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class ChromeDownloadManagerDelegate; class DownloadHistory; diff --git a/chrome/browser/download/download_service_factory.cc b/chrome/browser/download/download_service_factory.cc index 342b2c7..dc5ab53 100644 --- a/chrome/browser/download/download_service_factory.cc +++ b/chrome/browser/download/download_service_factory.cc @@ -7,7 +7,7 @@ #include "chrome/browser/download/download_service.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static DownloadService* DownloadServiceFactory::GetForProfile( diff --git a/chrome/browser/download/download_service_factory.h b/chrome/browser/download/download_service_factory.h index 7fe53e9..fee17c0 100644 --- a/chrome/browser/download/download_service_factory.h +++ b/chrome/browser/download/download_service_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class DownloadService; class Profile; diff --git a/chrome/browser/extensions/activity_log/activity_log.h b/chrome/browser/extensions/activity_log/activity_log.h index 58ed6f2..b934d97 100644 --- a/chrome/browser/extensions/activity_log/activity_log.h +++ b/chrome/browser/extensions/activity_log/activity_log.h @@ -21,9 +21,9 @@ #include "chrome/browser/extensions/activity_log/activity_database.h" #include "chrome/browser/extensions/tab_helper.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" #include "content/public/browser/browser_thread.h" class Profile; diff --git a/chrome/browser/extensions/api/api_resource_manager.h b/chrome/browser/extensions/api/api_resource_manager.h index 2ed4985..14e3e01 100644 --- a/chrome/browser/extensions/api/api_resource_manager.h +++ b/chrome/browser/extensions/api/api_resource_manager.h @@ -9,9 +9,9 @@ #include "base/memory/linked_ptr.h" #include "base/threading/non_thread_safe.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/extensions/api/autotest_private/autotest_private_api.h b/chrome/browser/extensions/api/autotest_private/autotest_private_api.h index 8b9858c..d55955c 100644 --- a/chrome/browser/extensions/api/autotest_private/autotest_private_api.h +++ b/chrome/browser/extensions/api/autotest_private/autotest_private_api.h @@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "chrome/browser/extensions/extension_function.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" namespace extensions { diff --git a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc index 378cf77..e2f1883 100644 --- a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc +++ b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc @@ -8,7 +8,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h index cc6dfda..9c3cf28 100644 --- a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h +++ b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_FACTORY_H__ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h index afe37d36..d80a39f 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api.h +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api.h @@ -12,7 +12,7 @@ #include "chrome/browser/extensions/api/api_function.h" #include "chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h" #include "chrome/browser/extensions/event_router.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "device/bluetooth/bluetooth_device.h" #include "device/bluetooth/bluetooth_profile.h" diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc index 037b2fb..00f0cf6 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc @@ -8,7 +8,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h index cac8587..6181224 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_BLUETOOTH_BLUETOOTH_API_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.h b/chrome/browser/extensions/api/developer_private/developer_private_api.h index 2a937a8..dd1687a 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api.h +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.h @@ -13,7 +13,7 @@ #include "chrome/browser/extensions/extension_uninstall_dialog.h" #include "chrome/browser/extensions/pack_extension_job.h" #include "chrome/browser/extensions/requirements_checker.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/render_view_host.h" diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc index 7d124c5..fd12543 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc @@ -8,7 +8,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h index 2aff89f..dfe4044 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h +++ b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_DEVELOPER_PRIVATE_DEVELOPER_PRIVATE_API_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/extensions/api/dial/dial_api.h b/chrome/browser/extensions/api/dial/dial_api.h index a1b4453..8a36044 100644 --- a/chrome/browser/extensions/api/dial/dial_api.h +++ b/chrome/browser/extensions/api/dial/dial_api.h @@ -11,7 +11,7 @@ #include "chrome/browser/extensions/api/dial/dial_device_data.h" #include "chrome/browser/extensions/api/dial/dial_registry.h" #include "chrome/browser/extensions/event_router.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" namespace extensions { diff --git a/chrome/browser/extensions/api/dial/dial_api_factory.cc b/chrome/browser/extensions/api/dial/dial_api_factory.cc index 1451b7b0..33dc740 100644 --- a/chrome/browser/extensions/api/dial/dial_api_factory.cc +++ b/chrome/browser/extensions/api/dial/dial_api_factory.cc @@ -6,7 +6,7 @@ #include "chrome/browser/extensions/api/dial/dial_api.h" #include "chrome/browser/extensions/extension_system_factory.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/api/dial/dial_api_factory.h b/chrome/browser/extensions/api/dial/dial_api_factory.h index 18ac04a..ecce597 100644 --- a/chrome/browser/extensions/api/dial/dial_api_factory.h +++ b/chrome/browser/extensions/api/dial/dial_api_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_DIAL_DIAL_API_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h" namespace extensions { diff --git a/chrome/browser/extensions/api/discovery/suggested_links_registry.h b/chrome/browser/extensions/api/discovery/suggested_links_registry.h index 245b23f..89b119d 100644 --- a/chrome/browser/extensions/api/discovery/suggested_links_registry.h +++ b/chrome/browser/extensions/api/discovery/suggested_links_registry.h @@ -9,7 +9,7 @@ #include "base/memory/scoped_ptr.h" #include "chrome/browser/extensions/api/discovery/suggested_link.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" namespace extensions { diff --git a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc index d244d14..33ae3da 100644 --- a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc +++ b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc @@ -8,7 +8,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h index 5160d5b..3ec5413 100644 --- a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h +++ b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_DISCOVERY_SUGGESTED_LINKS_REGISTRY_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/extensions/api/idle/idle_manager.h b/chrome/browser/extensions/api/idle/idle_manager.h index 6d61fda..dbfcee4 100644 --- a/chrome/browser/extensions/api/idle/idle_manager.h +++ b/chrome/browser/extensions/api/idle/idle_manager.h @@ -15,7 +15,7 @@ #include "base/timer.h" #include "chrome/browser/extensions/event_router.h" #include "chrome/browser/idle.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/extensions/api/idle/idle_manager_factory.cc b/chrome/browser/extensions/api/idle/idle_manager_factory.cc index 68ed533..96e2c35 100644 --- a/chrome/browser/extensions/api/idle/idle_manager_factory.cc +++ b/chrome/browser/extensions/api/idle/idle_manager_factory.cc @@ -8,7 +8,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/api/idle/idle_manager_factory.h b/chrome/browser/extensions/api/idle/idle_manager_factory.h index 95d1750..c9946be 100644 --- a/chrome/browser/extensions/api/idle/idle_manager_factory.h +++ b/chrome/browser/extensions/api/idle/idle_manager_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_IDLE_IDLE_MANAGER_FACTORY_H__ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.h b/chrome/browser/extensions/api/input_ime/input_ime_api.h index 8ffb3df..aee6111 100644 --- a/chrome/browser/extensions/api/input_ime/input_ime_api.h +++ b/chrome/browser/extensions/api/input_ime/input_ime_api.h @@ -14,8 +14,8 @@ #include "chrome/browser/chromeos/input_method/input_method_engine.h" #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" #include "chrome/browser/extensions/extension_function.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/extensions/extension.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/extensions/api/management/management_api.h b/chrome/browser/extensions/api/management/management_api.h index 96e66cb..815ff6a 100644 --- a/chrome/browser/extensions/api/management/management_api.h +++ b/chrome/browser/extensions/api/management/management_api.h @@ -11,7 +11,7 @@ #include "chrome/browser/extensions/extension_function.h" #include "chrome/browser/extensions/extension_install_prompt.h" #include "chrome/browser/extensions/extension_uninstall_dialog.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/extensions/api/processes/processes_api.h b/chrome/browser/extensions/api/processes/processes_api.h index 8e96688..224b9cc 100644 --- a/chrome/browser/extensions/api/processes/processes_api.h +++ b/chrome/browser/extensions/api/processes/processes_api.h @@ -12,8 +12,8 @@ #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" #include "chrome/browser/extensions/event_router.h" #include "chrome/browser/extensions/extension_function.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/task_manager/task_manager.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_widget_host.h" diff --git a/chrome/browser/extensions/api/profile_keyed_api_factory.h b/chrome/browser/extensions/api/profile_keyed_api_factory.h index fd8e0ec..d6267de2 100644 --- a/chrome/browser/extensions/api/profile_keyed_api_factory.h +++ b/chrome/browser/extensions/api/profile_keyed_api_factory.h @@ -8,9 +8,9 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" namespace extensions { diff --git a/chrome/browser/extensions/api/streams_private/streams_private_api.h b/chrome/browser/extensions/api/streams_private/streams_private_api.h index 3d0119a..fb5901e 100644 --- a/chrome/browser/extensions/api/streams_private/streams_private_api.h +++ b/chrome/browser/extensions/api/streams_private/streams_private_api.h @@ -12,8 +12,8 @@ #include "base/values.h" #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" #include "chrome/browser/extensions/extension_function.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/extensions/extension.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h index 99e38b4..aeb09d1 100644 --- a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h +++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h @@ -9,8 +9,8 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/values.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/sync_file_system/sync_event_observer.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class Profile; diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc index b349336..9b9030e 100644 --- a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc +++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc @@ -7,8 +7,8 @@ #include "chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h" #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sync_file_system/sync_file_system_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h index fe771ad..eb9a407 100644 --- a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h +++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_SYNC_FILE_SYSTEM_EXTENSION_SYNC_EVENT_OBSERVER_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h index d3b4b00..47da265 100644 --- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h +++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager.h @@ -12,7 +12,7 @@ #include "base/threading/thread_checker.h" #include "chrome/browser/extensions/event_router.h" #include "chrome/browser/extensions/extension_action_icon_factory.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc index a21ee53..cf3fcc5 100644 --- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc +++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc @@ -8,7 +8,7 @@ #include "chrome/browser/extensions/api/system_indicator/system_indicator_manager.h" #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h index 89f359c..01e417d 100644 --- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h +++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INDICATOR_SYSTEM_INDICATOR_MANAGER_FACTORY_H__ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc index adf0e00..105a093 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc @@ -6,14 +6,14 @@ #include -#include "content/public/browser/browser_thread.h" #include "chrome/browser/extensions/event_names.h" #include "chrome/browser/extensions/event_router.h" #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h index 8b09161..e245aa1 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry.h @@ -9,8 +9,8 @@ #include "base/memory/scoped_vector.h" #include "chrome/browser/media/media_capture_devices_dispatcher.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/extensions/api/tab_capture.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/media_request_state.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc index 5ba94a8..6e46fee 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc @@ -4,12 +4,12 @@ #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h" -#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" #include "chrome/browser/extensions/api/discovery/suggested_links_registry.h" +#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h index 56c9283..8411720 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_TAB_CAPTURE_TAB_CAPTURE_REGISTRY_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/extensions/api/tabs/tabs_windows_api.h b/chrome/browser/extensions/api/tabs/tabs_windows_api.h index 088a91a..d4372ef 100644 --- a/chrome/browser/extensions/api/tabs/tabs_windows_api.h +++ b/chrome/browser/extensions/api/tabs/tabs_windows_api.h @@ -8,7 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" #include "chrome/browser/extensions/event_router.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" namespace extensions { class WindowsEventRouter; diff --git a/chrome/browser/extensions/extension_action_manager.cc b/chrome/browser/extensions/extension_action_manager.cc index 8273c13..21e0db7 100644 --- a/chrome/browser/extensions/extension_action_manager.cc +++ b/chrome/browser/extensions/extension_action_manager.cc @@ -10,14 +10,14 @@ #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/api/extension_action/action_info.h" #include "chrome/common/extensions/api/extension_action/page_action_handler.h" #include "chrome/common/extensions/api/extension_action/script_badge_handler.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/feature_switch.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/notification_source.h" diff --git a/chrome/browser/extensions/extension_action_manager.h b/chrome/browser/extensions/extension_action_manager.h index b9ac2ec..d314d2c 100644 --- a/chrome/browser/extensions/extension_action_manager.h +++ b/chrome/browser/extensions/extension_action_manager.h @@ -9,7 +9,7 @@ #include #include "base/memory/linked_ptr.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/extensions/extension_pref_value_map.h b/chrome/browser/extensions/extension_pref_value_map.h index e14738d..bd60db9 100644 --- a/chrome/browser/extensions/extension_pref_value_map.h +++ b/chrome/browser/extensions/extension_pref_value_map.h @@ -14,7 +14,7 @@ #include "base/time.h" #include "base/values.h" #include "chrome/browser/extensions/extension_prefs_scope.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" // Non-persistent data container that is shared by ExtensionPrefStores. All // extension pref values (incognito and regular) are stored herein and diff --git a/chrome/browser/extensions/extension_pref_value_map_factory.cc b/chrome/browser/extensions/extension_pref_value_map_factory.cc index 3220307..9356b8c 100644 --- a/chrome/browser/extensions/extension_pref_value_map_factory.cc +++ b/chrome/browser/extensions/extension_pref_value_map_factory.cc @@ -6,7 +6,7 @@ #include "chrome/browser/extensions/extension_pref_value_map.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" ExtensionPrefValueMapFactory::ExtensionPrefValueMapFactory() : ProfileKeyedServiceFactory( diff --git a/chrome/browser/extensions/extension_pref_value_map_factory.h b/chrome/browser/extensions/extension_pref_value_map_factory.h index efb0641..96c21f0 100644 --- a/chrome/browser/extensions/extension_pref_value_map_factory.h +++ b/chrome/browser/extensions/extension_pref_value_map_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class ExtensionPrefValueMap; class Profile; diff --git a/chrome/browser/extensions/extension_prefs.h b/chrome/browser/extensions/extension_prefs.h index 4bd3267..1a70158 100644 --- a/chrome/browser/extensions/extension_prefs.h +++ b/chrome/browser/extensions/extension_prefs.h @@ -17,8 +17,8 @@ #include "chrome/browser/extensions/extension_prefs_scope.h" #include "chrome/browser/extensions/extension_scoped_prefs.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/extensions/extension.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "extensions/common/url_pattern_set.h" #include "sync/api/string_ordinal.h" diff --git a/chrome/browser/extensions/extension_prefs_factory.cc b/chrome/browser/extensions/extension_prefs_factory.cc index 4c0a34f..64eb11b 100644 --- a/chrome/browser/extensions/extension_prefs_factory.cc +++ b/chrome/browser/extensions/extension_prefs_factory.cc @@ -11,9 +11,9 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "extensions/common/constants.h" namespace extensions { diff --git a/chrome/browser/extensions/extension_prefs_factory.h b/chrome/browser/extensions/extension_prefs_factory.h index d9edba5..3d8600b 100644 --- a/chrome/browser/extensions/extension_prefs_factory.h +++ b/chrome/browser/extensions/extension_prefs_factory.h @@ -7,7 +7,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" namespace extensions { diff --git a/chrome/browser/extensions/extension_system.h b/chrome/browser/extensions/extension_system.h index 5b663b5..c5f084c 100644 --- a/chrome/browser/extensions/extension_system.h +++ b/chrome/browser/extensions/extension_system.h @@ -13,8 +13,8 @@ #include "chrome/browser/extensions/api/serial/serial_connection.h" #include "chrome/browser/extensions/api/socket/socket.h" #include "chrome/browser/extensions/api/usb/usb_device_resource.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/extensions/extension_constants.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "extensions/common/one_shot_event.h" class ExtensionInfoMap; diff --git a/chrome/browser/extensions/extension_system_factory.cc b/chrome/browser/extensions/extension_system_factory.cc index 444ba62..a29c969 100644 --- a/chrome/browser/extensions/extension_system_factory.cc +++ b/chrome/browser/extensions/extension_system_factory.cc @@ -9,9 +9,9 @@ #include "chrome/browser/policy/profile_policy_connector_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/global_error/global_error_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/extension_system_factory.h b/chrome/browser/extensions/extension_system_factory.h index 9e876c2..048df12 100644 --- a/chrome/browser/extensions/extension_system_factory.h +++ b/chrome/browser/extensions/extension_system_factory.h @@ -7,7 +7,7 @@ #include "base/memory/singleton.h" #include "chrome/browser/extensions/extension_system.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; class ProfileKeyedService; diff --git a/chrome/browser/extensions/image_loader.h b/chrome/browser/extensions/image_loader.h index 75a9113..2932f46 100644 --- a/chrome/browser/extensions/image_loader.h +++ b/chrome/browser/extensions/image_loader.h @@ -11,7 +11,7 @@ #include "base/callback_forward.h" #include "base/gtest_prod_util.h" #include "base/memory/weak_ptr.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "extensions/common/extension_resource.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/layout.h" diff --git a/chrome/browser/extensions/image_loader_factory.cc b/chrome/browser/extensions/image_loader_factory.cc index 952c97d..ea60e0d 100644 --- a/chrome/browser/extensions/image_loader_factory.cc +++ b/chrome/browser/extensions/image_loader_factory.cc @@ -7,7 +7,7 @@ #include "chrome/browser/extensions/image_loader.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/image_loader_factory.h b/chrome/browser/extensions/image_loader_factory.h index a3f4ec8..5fa7e50 100644 --- a/chrome/browser/extensions/image_loader_factory.h +++ b/chrome/browser/extensions/image_loader_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_IMAGE_LOADER_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/extensions/install_tracker.h b/chrome/browser/extensions/install_tracker.h index e53347a..d3e94a4 100644 --- a/chrome/browser/extensions/install_tracker.h +++ b/chrome/browser/extensions/install_tracker.h @@ -8,7 +8,7 @@ #include "base/observer_list.h" #include "base/prefs/pref_change_registrar.h" #include "chrome/browser/extensions/install_observer.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/extensions/install_tracker_factory.cc b/chrome/browser/extensions/install_tracker_factory.cc index f84d756..d824925 100644 --- a/chrome/browser/extensions/install_tracker_factory.cc +++ b/chrome/browser/extensions/install_tracker_factory.cc @@ -11,7 +11,7 @@ #include "chrome/browser/extensions/install_tracker.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace extensions { diff --git a/chrome/browser/extensions/install_tracker_factory.h b/chrome/browser/extensions/install_tracker_factory.h index 8da8ef2..1ec3bc3 100644 --- a/chrome/browser/extensions/install_tracker_factory.h +++ b/chrome/browser/extensions/install_tracker_factory.h @@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_FACTORY_H_ #define CHROME_BROWSER_EXTENSIONS_INSTALL_TRACKER_FACTORY_H_ -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" template struct DefaultSingletonTraits; diff --git a/chrome/browser/extensions/shell_window_registry.cc b/chrome/browser/extensions/shell_window_registry.cc index 0f03e16..950f314 100644 --- a/chrome/browser/extensions/shell_window_registry.cc +++ b/chrome/browser/extensions/shell_window_registry.cc @@ -5,11 +5,11 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/shell_window_registry.h" #include "chrome/browser/profiles/incognito_helpers.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/ui/extensions/native_app_window.h" #include "chrome/browser/ui/extensions/shell_window.h" #include "chrome/common/extensions/extension.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/devtools_manager.h" #include "content/public/browser/render_process_host.h" diff --git a/chrome/browser/extensions/shell_window_registry.h b/chrome/browser/extensions/shell_window_registry.h index dca2105..07a0ccc 100644 --- a/chrome/browser/extensions/shell_window_registry.h +++ b/chrome/browser/extensions/shell_window_registry.h @@ -11,8 +11,8 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" #include "base/observer_list.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" #include "ui/gfx/native_widget_types.h" class Profile; diff --git a/chrome/browser/extensions/token_cache/token_cache_service.h b/chrome/browser/extensions/token_cache/token_cache_service.h index ef0b841..fab1be4 100644 --- a/chrome/browser/extensions/token_cache/token_cache_service.h +++ b/chrome/browser/extensions/token_cache/token_cache_service.h @@ -11,7 +11,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/time.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/extensions/token_cache/token_cache_service_factory.cc b/chrome/browser/extensions/token_cache/token_cache_service_factory.cc index 5fbe132..a68c879 100644 --- a/chrome/browser/extensions/token_cache/token_cache_service_factory.cc +++ b/chrome/browser/extensions/token_cache/token_cache_service_factory.cc @@ -7,7 +7,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/token_cache/token_cache_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static extensions::TokenCacheService* diff --git a/chrome/browser/extensions/token_cache/token_cache_service_factory.h b/chrome/browser/extensions/token_cache/token_cache_service_factory.h index 2a99359..c1beeda 100644 --- a/chrome/browser/extensions/token_cache/token_cache_service_factory.h +++ b/chrome/browser/extensions/token_cache/token_cache_service_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/favicon/favicon_service.h b/chrome/browser/favicon/favicon_service.h index c95461a..5705ab2 100644 --- a/chrome/browser/favicon/favicon_service.h +++ b/chrome/browser/favicon/favicon_service.h @@ -12,9 +12,9 @@ #include "base/memory/ref_counted.h" #include "chrome/browser/common/cancelable_request.h" #include "chrome/browser/favicon/favicon_types.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/cancelable_task_tracker.h" #include "chrome/common/ref_counted_util.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "ui/base/layout.h" class GURL; diff --git a/chrome/browser/favicon/favicon_service_factory.cc b/chrome/browser/favicon/favicon_service_factory.cc index e59733f..6b3702f 100644 --- a/chrome/browser/favicon/favicon_service_factory.cc +++ b/chrome/browser/favicon/favicon_service_factory.cc @@ -9,8 +9,8 @@ #include "chrome/browser/favicon/favicon_service.h" #include "chrome/browser/history/history_service.h" #include "chrome/browser/history/history_service_factory.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static FaviconService* FaviconServiceFactory::GetForProfile( diff --git a/chrome/browser/favicon/favicon_service_factory.h b/chrome/browser/favicon/favicon_service_factory.h index 7755b35..f2d63c1 100644 --- a/chrome/browser/favicon/favicon_service_factory.h +++ b/chrome/browser/favicon/favicon_service_factory.h @@ -7,7 +7,7 @@ #include "base/memory/singleton.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" template struct DefaultSingletonTraits; diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc index 04d1db3..48ec458 100644 --- a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc +++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc @@ -6,8 +6,8 @@ #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" #if defined(OS_ANDROID) #include "chrome/browser/geolocation/chrome_geolocation_permission_context_android.h" diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h index 1c85a22..a8d3bb9 100644 --- a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h +++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h @@ -8,7 +8,7 @@ #include "base/memory/singleton.h" #include "base/prefs/pref_service.h" #include "base/values.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class ChromeGeolocationPermissionContext; class PrefRegistrySyncable; diff --git a/chrome/browser/google/google_url_tracker.h b/chrome/browser/google/google_url_tracker.h index c51dd7a..9b7d43b 100644 --- a/chrome/browser/google/google_url_tracker.h +++ b/chrome/browser/google/google_url_tracker.h @@ -14,7 +14,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "chrome/browser/google/google_url_tracker_map_entry.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "googleurl/src/gurl.h" #include "net/base/network_change_notifier.h" #include "net/url_request/url_fetcher.h" diff --git a/chrome/browser/google/google_url_tracker_factory.cc b/chrome/browser/google/google_url_tracker_factory.cc index 03880cb..3854344 100644 --- a/chrome/browser/google/google_url_tracker_factory.cc +++ b/chrome/browser/google/google_url_tracker_factory.cc @@ -9,8 +9,8 @@ #include "chrome/browser/google/google_url_tracker_navigation_helper_impl.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" diff --git a/chrome/browser/google/google_url_tracker_factory.h b/chrome/browser/google/google_url_tracker_factory.h index 31cd0a1..7a87dd6 100644 --- a/chrome/browser/google/google_url_tracker_factory.h +++ b/chrome/browser/google/google_url_tracker_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class GoogleURLTracker; class Profile; diff --git a/chrome/browser/google_apis/drive_notification_manager.h b/chrome/browser/google_apis/drive_notification_manager.h index ad01a9d..da63aeb 100644 --- a/chrome/browser/google_apis/drive_notification_manager.h +++ b/chrome/browser/google_apis/drive_notification_manager.h @@ -9,7 +9,7 @@ #include "base/observer_list.h" #include "base/timer.h" #include "chrome/browser/google_apis/drive_notification_observer.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "sync/notifier/invalidation_handler.h" class Profile; diff --git a/chrome/browser/google_apis/drive_notification_manager_factory.cc b/chrome/browser/google_apis/drive_notification_manager_factory.cc index 71c85f0..0d77ea7 100644 --- a/chrome/browser/google_apis/drive_notification_manager_factory.cc +++ b/chrome/browser/google_apis/drive_notification_manager_factory.cc @@ -6,9 +6,9 @@ #include "chrome/browser/google_apis/drive_notification_manager.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace google_apis { diff --git a/chrome/browser/google_apis/drive_notification_manager_factory.h b/chrome/browser/google_apis/drive_notification_manager_factory.h index 177c27b..76f2c72 100644 --- a/chrome/browser/google_apis/drive_notification_manager_factory.h +++ b/chrome/browser/google_apis/drive_notification_manager_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_NOTIFICATION_MANAGER_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/history/history_service.h b/chrome/browser/history/history_service.h index 4e1ceda..2e25677 100644 --- a/chrome/browser/history/history_service.h +++ b/chrome/browser/history/history_service.h @@ -25,10 +25,10 @@ #include "chrome/browser/history/delete_directive_handler.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/history/typed_url_syncable_service.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/search_engines/template_url_id.h" #include "chrome/common/cancelable_task_tracker.h" #include "chrome/common/ref_counted_util.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "components/visitedlink/browser/visitedlink_delegate.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/history/history_service_factory.cc b/chrome/browser/history/history_service_factory.cc index ecf4646..615457a 100644 --- a/chrome/browser/history/history_service_factory.cc +++ b/chrome/browser/history/history_service_factory.cc @@ -9,8 +9,8 @@ #include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/history/history_service.h" #include "chrome/browser/profiles/incognito_helpers.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static HistoryService* HistoryServiceFactory::GetForProfile( diff --git a/chrome/browser/history/history_service_factory.h b/chrome/browser/history/history_service_factory.h index 84e8bc2..c66a02b 100644 --- a/chrome/browser/history/history_service_factory.h +++ b/chrome/browser/history/history_service_factory.h @@ -7,7 +7,7 @@ #include "base/memory/singleton.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class HistoryService; diff --git a/chrome/browser/history/shortcuts_backend.h b/chrome/browser/history/shortcuts_backend.h index 2f7eccc..7e46ace 100644 --- a/chrome/browser/history/shortcuts_backend.h +++ b/chrome/browser/history/shortcuts_backend.h @@ -18,7 +18,7 @@ #include "base/synchronization/lock.h" #include "base/time.h" #include "chrome/browser/autocomplete/autocomplete_match.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/history/shortcuts_backend_factory.cc b/chrome/browser/history/shortcuts_backend_factory.cc index dbfdf53..6496224 100644 --- a/chrome/browser/history/shortcuts_backend_factory.cc +++ b/chrome/browser/history/shortcuts_backend_factory.cc @@ -7,8 +7,8 @@ #include "base/prefs/pref_service.h" #include "chrome/browser/history/shortcuts_backend.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" using history::ShortcutsBackend; diff --git a/chrome/browser/history/shortcuts_backend_factory.h b/chrome/browser/history/shortcuts_backend_factory.h index b15f57c..78ee888 100644 --- a/chrome/browser/history/shortcuts_backend_factory.h +++ b/chrome/browser/history/shortcuts_backend_factory.h @@ -7,7 +7,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/history/web_history_service.h b/chrome/browser/history/web_history_service.h index 3a931a7..55d0e99fca 100644 --- a/chrome/browser/history/web_history_service.h +++ b/chrome/browser/history/web_history_service.h @@ -7,7 +7,7 @@ #include "chrome/browser/history/history_types.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" namespace base { class DictionaryValue; diff --git a/chrome/browser/history/web_history_service_factory.cc b/chrome/browser/history/web_history_service_factory.cc index f962c73..397d6ea 100644 --- a/chrome/browser/history/web_history_service_factory.cc +++ b/chrome/browser/history/web_history_service_factory.cc @@ -7,11 +7,11 @@ #include "base/command_line.h" #include "chrome/browser/content_settings/cookie_settings.h" #include "chrome/browser/history/web_history_service.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/signin/token_service_factory.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/common/chrome_switches.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace { // Returns true if the user is signed in and full history sync is enabled, diff --git a/chrome/browser/history/web_history_service_factory.h b/chrome/browser/history/web_history_service_factory.h index 00e1084..64fb30a 100644 --- a/chrome/browser/history/web_history_service_factory.h +++ b/chrome/browser/history/web_history_service_factory.h @@ -7,7 +7,7 @@ #include "base/memory/singleton.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" namespace history { class WebHistoryService; diff --git a/chrome/browser/invalidation/invalidation_service_android.h b/chrome/browser/invalidation/invalidation_service_android.h index 8f51b13..f7452ef 100644 --- a/chrome/browser/invalidation/invalidation_service_android.h +++ b/chrome/browser/invalidation/invalidation_service_android.h @@ -9,7 +9,7 @@ #include "base/compiler_specific.h" #include "base/threading/non_thread_safe.h" #include "chrome/browser/invalidation/invalidation_frontend.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "sync/notifier/invalidator_registrar.h" diff --git a/chrome/browser/invalidation/invalidation_service_factory.cc b/chrome/browser/invalidation/invalidation_service_factory.cc index f79badc..d5d3b17 100644 --- a/chrome/browser/invalidation/invalidation_service_factory.cc +++ b/chrome/browser/invalidation/invalidation_service_factory.cc @@ -9,10 +9,10 @@ #include "chrome/browser/invalidation/p2p_invalidation_service.h" #include "chrome/browser/invalidation/ticl_invalidation_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/signin/signin_manager.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/signin/token_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" class TokenService; diff --git a/chrome/browser/invalidation/invalidation_service_factory.h b/chrome/browser/invalidation/invalidation_service_factory.h index 79644f6..0b86143 100644 --- a/chrome/browser/invalidation/invalidation_service_factory.h +++ b/chrome/browser/invalidation/invalidation_service_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" namespace syncer { class Invalidator; diff --git a/chrome/browser/invalidation/p2p_invalidation_service.h b/chrome/browser/invalidation/p2p_invalidation_service.h index 6692e9b..8ec1fa2 100644 --- a/chrome/browser/invalidation/p2p_invalidation_service.h +++ b/chrome/browser/invalidation/p2p_invalidation_service.h @@ -4,7 +4,7 @@ #include "base/threading/non_thread_safe.h" #include "chrome/browser/invalidation/invalidation_frontend.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "sync/notifier/object_id_invalidation_map.h" #ifndef CHROME_BROWSER_INVALIDATION_P2P_INVALIDATION_SERVICE_H_ diff --git a/chrome/browser/invalidation/ticl_invalidation_service.h b/chrome/browser/invalidation/ticl_invalidation_service.h index 673634a..137198a 100644 --- a/chrome/browser/invalidation/ticl_invalidation_service.h +++ b/chrome/browser/invalidation/ticl_invalidation_service.h @@ -9,8 +9,8 @@ #include "base/threading/non_thread_safe.h" #include "chrome/browser/invalidation/invalidation_frontend.h" #include "chrome/browser/invalidation/invalidator_storage.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/signin/signin_global_error.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "sync/notifier/invalidation_handler.h" diff --git a/chrome/browser/managed_mode/managed_user_registration_service.h b/chrome/browser/managed_mode/managed_user_registration_service.h index cbf733f..81f041f 100644 --- a/chrome/browser/managed_mode/managed_user_registration_service.h +++ b/chrome/browser/managed_mode/managed_user_registration_service.h @@ -10,8 +10,8 @@ #include "base/callback.h" #include "base/memory/scoped_ptr.h" #include "base/string16.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/profiles/profile_manager.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class GoogleServiceAuthError; diff --git a/chrome/browser/managed_mode/managed_user_registration_service_factory.cc b/chrome/browser/managed_mode/managed_user_registration_service_factory.cc index 810e208..6142194 100644 --- a/chrome/browser/managed_mode/managed_user_registration_service_factory.cc +++ b/chrome/browser/managed_mode/managed_user_registration_service_factory.cc @@ -5,7 +5,7 @@ #include "chrome/browser/managed_mode/managed_user_registration_service_factory.h" #include "chrome/browser/managed_mode/managed_user_registration_service.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static ManagedUserRegistrationService* diff --git a/chrome/browser/managed_mode/managed_user_registration_service_factory.h b/chrome/browser/managed_mode/managed_user_registration_service_factory.h index 693cae7..6bbb07a 100644 --- a/chrome/browser/managed_mode/managed_user_registration_service_factory.h +++ b/chrome/browser/managed_mode/managed_user_registration_service_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_REGISTRATION_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class ManagedUserRegistrationService; class Profile; diff --git a/chrome/browser/managed_mode/managed_user_service.h b/chrome/browser/managed_mode/managed_user_service.h index 3b391b8..fc25e8e 100644 --- a/chrome/browser/managed_mode/managed_user_service.h +++ b/chrome/browser/managed_mode/managed_user_service.h @@ -13,8 +13,8 @@ #include "base/string16.h" #include "chrome/browser/extensions/management_policy.h" #include "chrome/browser/managed_mode/managed_mode_url_filter.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/ui/webui/managed_user_passphrase_dialog.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/web_contents.h" diff --git a/chrome/browser/managed_mode/managed_user_service_factory.cc b/chrome/browser/managed_mode/managed_user_service_factory.cc index 4e83933..2f401fa 100644 --- a/chrome/browser/managed_mode/managed_user_service_factory.cc +++ b/chrome/browser/managed_mode/managed_user_service_factory.cc @@ -8,7 +8,7 @@ #include "chrome/browser/managed_mode/managed_user_service.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static ManagedUserService* ManagedUserServiceFactory::GetForProfile(Profile* profile) { diff --git a/chrome/browser/managed_mode/managed_user_service_factory.h b/chrome/browser/managed_mode/managed_user_service_factory.h index 1dfb81d..f29d01d 100644 --- a/chrome/browser/managed_mode/managed_user_service_factory.h +++ b/chrome/browser/managed_mode/managed_user_service_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class ManagedUserService; class Profile; diff --git a/chrome/browser/media_galleries/media_galleries_preferences.h b/chrome/browser/media_galleries/media_galleries_preferences.h index 6ece27d..8f42320 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences.h +++ b/chrome/browser/media_galleries/media_galleries_preferences.h @@ -15,8 +15,8 @@ #include "base/observer_list.h" #include "base/string16.h" #include "base/time.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/storage_monitor/removable_storage_observer.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class Profile; diff --git a/chrome/browser/media_galleries/media_galleries_preferences_factory.cc b/chrome/browser/media_galleries/media_galleries_preferences_factory.cc index 10b4cc1..389cb8d 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_factory.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences_factory.cc @@ -7,7 +7,7 @@ #include "chrome/browser/media_galleries/media_galleries_preferences.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" // static diff --git a/chrome/browser/media_galleries/media_galleries_preferences_factory.h b/chrome/browser/media_galleries/media_galleries_preferences_factory.h index dc411d4..ff85d1f 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_factory.h +++ b/chrome/browser/media_galleries/media_galleries_preferences_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/notifications/desktop_notification_service.h b/chrome/browser/notifications/desktop_notification_service.h index 51aef63..75fa9ae 100644 --- a/chrome/browser/notifications/desktop_notification_service.h +++ b/chrome/browser/notifications/desktop_notification_service.h @@ -14,8 +14,8 @@ #include "base/prefs/pref_member.h" #include "base/string16.h" #include "chrome/browser/content_settings/content_settings_provider.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/content_settings.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/notifications/desktop_notification_service_factory.cc b/chrome/browser/notifications/desktop_notification_service_factory.cc index 56d542b2..acf6b51 100644 --- a/chrome/browser/notifications/desktop_notification_service_factory.cc +++ b/chrome/browser/notifications/desktop_notification_service_factory.cc @@ -8,7 +8,7 @@ #include "chrome/browser/notifications/desktop_notification_service.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "content/public/browser/browser_thread.h" using content::BrowserThread; diff --git a/chrome/browser/notifications/desktop_notification_service_factory.h b/chrome/browser/notifications/desktop_notification_service_factory.h index 42f7035..10a6c09 100644 --- a/chrome/browser/notifications/desktop_notification_service_factory.h +++ b/chrome/browser/notifications/desktop_notification_service_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class DesktopNotificationService; class Profile; diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h index d2809a0..f99cd7a 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h @@ -11,7 +11,7 @@ #include "base/memory/scoped_vector.h" #include "base/threading/non_thread_safe.h" #include "chrome/browser/notifications/sync_notifier/synced_notification.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "sync/api/syncable_service.h" class NotificationUIManager; diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc index 8452b83..812a71b 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc @@ -6,7 +6,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace notifier { diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h index 9e75cce..2fe308f 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h @@ -7,7 +7,7 @@ #include "base/memory/singleton.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" namespace notifier { diff --git a/chrome/browser/password_manager/password_store.h b/chrome/browser/password_manager/password_store.h index 96618cc..26e36d9 100644 --- a/chrome/browser/password_manager/password_store.h +++ b/chrome/browser/password_manager/password_store.h @@ -13,8 +13,8 @@ #include "base/threading/thread.h" #include "base/time.h" #include "chrome/browser/common/cancelable_request.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" #include "chrome/common/cancelable_task_tracker.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" class PasswordStore; class PasswordStoreConsumer; diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc index 083ca2d..d66a6bc 100644 --- a/chrome/browser/password_manager/password_store_factory.cc +++ b/chrome/browser/password_manager/password_store_factory.cc @@ -11,12 +11,12 @@ #include "chrome/browser/password_manager/password_store.h" #include "chrome/browser/password_manager/password_store_default.h" #include "chrome/browser/profiles/incognito_helpers.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/webdata/web_data_service.h" #include "chrome/browser/webdata/web_data_service_factory.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" #if defined(OS_WIN) diff --git a/chrome/browser/password_manager/password_store_factory.h b/chrome/browser/password_manager/password_store_factory.h index 9012616..631fc7a 100644 --- a/chrome/browser/password_manager/password_store_factory.h +++ b/chrome/browser/password_manager/password_store_factory.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h" class PasswordStore; class Profile; diff --git a/chrome/browser/plugins/plugin_prefs.cc b/chrome/browser/plugins/plugin_prefs.cc index a22a597..56e33e2 100644 --- a/chrome/browser/plugins/plugin_prefs.cc +++ b/chrome/browser/plugins/plugin_prefs.cc @@ -15,19 +15,19 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "build/build_config.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/plugins/plugin_installer.h" #include "chrome/browser/plugins/plugin_metadata.h" #include "chrome/browser/plugins/plugin_prefs_factory.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_content_client.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/plugin_service.h" diff --git a/chrome/browser/plugins/plugin_prefs.h b/chrome/browser/plugins/plugin_prefs.h index 96f62db..c4d0f04 100644 --- a/chrome/browser/plugins/plugin_prefs.h +++ b/chrome/browser/plugins/plugin_prefs.h @@ -15,7 +15,7 @@ #include "base/prefs/pref_service.h" #include "base/synchronization/lock.h" #include "chrome/browser/plugins/plugin_finder.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" class Profile; diff --git a/chrome/browser/plugins/plugin_prefs_factory.cc b/chrome/browser/plugins/plugin_prefs_factory.cc index 17adf82..ab60dc1 100644 --- a/chrome/browser/plugins/plugin_prefs_factory.cc +++ b/chrome/browser/plugins/plugin_prefs_factory.cc @@ -9,10 +9,10 @@ #include "chrome/browser/plugins/plugin_prefs.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "components/user_prefs/pref_registry_syncable.h" // static diff --git a/chrome/browser/plugins/plugin_prefs_factory.h b/chrome/browser/plugins/plugin_prefs_factory.h index 89a6561..9087935 100644 --- a/chrome/browser/plugins/plugin_prefs_factory.h +++ b/chrome/browser/plugins/plugin_prefs_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h" class PluginPrefs; class Profile; diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager.h b/chrome/browser/policy/cloud/user_cloud_policy_manager.h index 8ade1db..48db8ef 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager.h +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager.h @@ -11,7 +11,7 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/policy/cloud/cloud_policy_manager.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class PrefService; class Profile; diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc index 128dc7e..e8c850a 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc @@ -9,8 +9,8 @@ #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" #include "chrome/browser/policy/cloud/user_cloud_policy_store.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/chrome_switches.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace policy { diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h index d3aca42..0f7c0a8 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h @@ -9,7 +9,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_base_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_base_factory.h" class Profile; diff --git a/chrome/browser/policy/cloud/user_policy_signin_service.h b/chrome/browser/policy/cloud/user_policy_signin_service.h index cae456b..5c640bb 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service.h +++ b/chrome/browser/policy/cloud/user_policy_signin_service.h @@ -11,7 +11,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/policy/cloud/cloud_policy_service.h" #include "chrome/browser/policy/cloud/user_info_fetcher.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc b/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc index a4db669..5d90542 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc +++ b/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc @@ -8,10 +8,10 @@ #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" #include "chrome/browser/policy/cloud/user_policy_signin_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/signin/token_service_factory.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" namespace policy { diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_factory.h b/chrome/browser/policy/cloud/user_policy_signin_service_factory.h index a105ebe..0a75dd5 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service_factory.h +++ b/chrome/browser/policy/cloud/user_policy_signin_service_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_POLICY_CLOUD_USER_POLICY_SIGNIN_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/policy/profile_policy_connector.h b/chrome/browser/policy/profile_policy_connector.h index b14fe8c..5d84153 100644 --- a/chrome/browser/policy/profile_policy_connector.h +++ b/chrome/browser/policy/profile_policy_connector.h @@ -10,7 +10,7 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #if defined(OS_CHROMEOS) #include "chromeos/dbus/dbus_method_call_status.h" diff --git a/chrome/browser/policy/profile_policy_connector_factory.cc b/chrome/browser/policy/profile_policy_connector_factory.cc index 0a478fb..ad609b5 100644 --- a/chrome/browser/policy/profile_policy_connector_factory.cc +++ b/chrome/browser/policy/profile_policy_connector_factory.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "chrome/browser/policy/profile_policy_connector.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #if defined(ENABLE_CONFIGURATION_POLICY) #if defined(OS_CHROMEOS) diff --git a/chrome/browser/policy/profile_policy_connector_factory.h b/chrome/browser/policy/profile_policy_connector_factory.h index 6d1c659..399b8f2 100644 --- a/chrome/browser/policy/profile_policy_connector_factory.h +++ b/chrome/browser/policy/profile_policy_connector_factory.h @@ -10,7 +10,7 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_base_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_base_factory.h" class Profile; diff --git a/chrome/browser/predictors/autocomplete_action_predictor.h b/chrome/browser/predictors/autocomplete_action_predictor.h index 3c02603..e115e71 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor.h +++ b/chrome/browser/predictors/autocomplete_action_predictor.h @@ -14,7 +14,7 @@ #include "base/string16.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/predictors/autocomplete_action_predictor_table.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/predictors/autocomplete_action_predictor_factory.cc b/chrome/browser/predictors/autocomplete_action_predictor_factory.cc index b5361c1..ee29b53 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_factory.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor_factory.cc @@ -9,7 +9,7 @@ #include "chrome/browser/predictors/predictor_database_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace predictors { diff --git a/chrome/browser/predictors/autocomplete_action_predictor_factory.h b/chrome/browser/predictors/autocomplete_action_predictor_factory.h index 3e30f6a..45493bf 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_factory.h +++ b/chrome/browser/predictors/autocomplete_action_predictor_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/predictors/predictor_database.h b/chrome/browser/predictors/predictor_database.h index fcdfd4d..362c23c 100644 --- a/chrome/browser/predictors/predictor_database.h +++ b/chrome/browser/predictors/predictor_database.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_PREDICTORS_PREDICTOR_DATABASE_H_ #include "base/memory/ref_counted.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class Profile; diff --git a/chrome/browser/predictors/predictor_database_factory.cc b/chrome/browser/predictors/predictor_database_factory.cc index e8128a3..b3bec2ab 100644 --- a/chrome/browser/predictors/predictor_database_factory.cc +++ b/chrome/browser/predictors/predictor_database_factory.cc @@ -7,7 +7,7 @@ #include "base/bind.h" #include "chrome/browser/predictors/predictor_database.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace predictors { diff --git a/chrome/browser/predictors/predictor_database_factory.h b/chrome/browser/predictors/predictor_database_factory.h index e08cdbd..b5a71be 100644 --- a/chrome/browser/predictors/predictor_database_factory.h +++ b/chrome/browser/predictors/predictor_database_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h index 3d3d59f..24261ae 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor.h +++ b/chrome/browser/predictors/resource_prefetch_predictor.h @@ -16,10 +16,10 @@ #include "base/time.h" #include "chrome/browser/common/cancelable_request.h" #include "chrome/browser/history/history_types.h" -#include "chrome/browser/predictors/resource_prefetcher.h" #include "chrome/browser/predictors/resource_prefetch_common.h" #include "chrome/browser/predictors/resource_prefetch_predictor_tables.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "chrome/browser/predictors/resource_prefetcher.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/predictors/resource_prefetch_predictor_factory.cc b/chrome/browser/predictors/resource_prefetch_predictor_factory.cc index 415cbf5..ef15daf 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_factory.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor_factory.cc @@ -9,7 +9,7 @@ #include "chrome/browser/predictors/resource_prefetch_common.h" #include "chrome/browser/predictors/resource_prefetch_predictor.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace predictors { diff --git a/chrome/browser/predictors/resource_prefetch_predictor_factory.h b/chrome/browser/predictors/resource_prefetch_predictor_factory.h index 147a21c..24e0379 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_factory.h +++ b/chrome/browser/predictors/resource_prefetch_predictor_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/prerender/prerender_link_manager.h b/chrome/browser/prerender/prerender_link_manager.h index 97d0377..9511fb9 100644 --- a/chrome/browser/prerender/prerender_link_manager.h +++ b/chrome/browser/prerender/prerender_link_manager.h @@ -11,7 +11,7 @@ #include "base/gtest_prod_util.h" #include "base/time.h" #include "chrome/browser/prerender/prerender_handle.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "googleurl/src/gurl.h" class Profile; diff --git a/chrome/browser/prerender/prerender_link_manager_factory.cc b/chrome/browser/prerender/prerender_link_manager_factory.cc index 7aacc07..f6871fc 100644 --- a/chrome/browser/prerender/prerender_link_manager_factory.cc +++ b/chrome/browser/prerender/prerender_link_manager_factory.cc @@ -9,7 +9,7 @@ #include "chrome/browser/prerender/prerender_manager_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" namespace prerender { diff --git a/chrome/browser/prerender/prerender_link_manager_factory.h b/chrome/browser/prerender/prerender_link_manager_factory.h index c09992a..735ca00 100644 --- a/chrome/browser/prerender/prerender_link_manager_factory.h +++ b/chrome/browser/prerender/prerender_link_manager_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/prerender/prerender_manager.h b/chrome/browser/prerender/prerender_manager.h index 24e275a..74d28c9 100644 --- a/chrome/browser/prerender/prerender_manager.h +++ b/chrome/browser/prerender/prerender_manager.h @@ -24,7 +24,7 @@ #include "chrome/browser/prerender/prerender_contents.h" #include "chrome/browser/prerender/prerender_final_status.h" #include "chrome/browser/prerender/prerender_origin.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/prerender/prerender_manager_factory.cc b/chrome/browser/prerender/prerender_manager_factory.cc index 5d160df..171054a 100644 --- a/chrome/browser/prerender/prerender_manager_factory.cc +++ b/chrome/browser/prerender/prerender_manager_factory.cc @@ -11,7 +11,7 @@ #include "chrome/browser/prerender/prerender_manager.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/cros/cros_library.h" diff --git a/chrome/browser/prerender/prerender_manager_factory.h b/chrome/browser/prerender/prerender_manager_factory.h index 5da45f5..9c6221c 100644 --- a/chrome/browser/prerender/prerender_manager_factory.h +++ b/chrome/browser/prerender/prerender_manager_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h index 2fcc3b3..49dd7d4 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.h @@ -14,7 +14,7 @@ #include "base/observer_list.h" #include "base/prefs/pref_change_registrar.h" #include "chrome/browser/printing/cloud_print/cloud_print_setup_handler.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class Profile; class ServiceProcessControl; 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 dd092c2..c33c939 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 @@ -6,7 +6,7 @@ #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static CloudPrintProxyService* CloudPrintProxyServiceFactory::GetForProfile( diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h index 104c314..b320b48 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class CloudPrintProxyService; class Profile; diff --git a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc index 960ccf2..5658776 100644 --- a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc +++ b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc @@ -16,7 +16,6 @@ #include "base/time.h" #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/service/service_process_control.h" #include "chrome/browser/ui/startup/startup_browser_creator.h" #include "chrome/common/chrome_switches.h" @@ -31,6 +30,7 @@ #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_service.h" #include "content/public/test/test_browser_thread.h" #include "ipc/ipc_descriptors.h" diff --git a/chrome/browser/profiles/dependency_graph.cc b/chrome/browser/profiles/dependency_graph.cc deleted file mode 100644 index a3f2297..0000000 --- a/chrome/browser/profiles/dependency_graph.cc +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright 2013 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. - -#include "chrome/browser/profiles/dependency_graph.h" - -#include -#include -#include - -DependencyGraph::DependencyGraph() { -} - -DependencyGraph::~DependencyGraph() { -} - -void DependencyGraph::AddNode(DependencyNode* node) { - all_nodes_.push_back(node); - construction_order_.clear(); -} - -void DependencyGraph::RemoveNode(DependencyNode* node) { - all_nodes_.erase(std::remove(all_nodes_.begin(), - all_nodes_.end(), - node), - all_nodes_.end()); - - // Remove all dependency edges that contain this node. - EdgeMap::iterator it = edges_.begin(); - while (it != edges_.end()) { - EdgeMap::iterator temp = it; - ++it; - - if (temp->first == node || temp->second == node) - edges_.erase(temp); - } - - construction_order_.clear(); -} - -void DependencyGraph::AddEdge(DependencyNode* depended, - DependencyNode* dependee) { - edges_.insert(std::make_pair(depended, dependee)); - construction_order_.clear(); -} - -bool DependencyGraph::GetConstructionOrder( - std::vector* order) { - if (construction_order_.empty() && !BuildConstructionOrder()) - return false; - - *order = construction_order_; - return true; -} - -bool DependencyGraph::GetDestructionOrder( - std::vector* order) { - if (construction_order_.empty() && !BuildConstructionOrder()) - return false; - - *order = construction_order_; - - // Destroy nodes in reverse order. - std::reverse(order->begin(), order->end()); - - return true; -} - -bool DependencyGraph::BuildConstructionOrder() { - // Step 1: Build a set of nodes with no incoming edges. - std::deque queue; - std::copy(all_nodes_.begin(), - all_nodes_.end(), - std::back_inserter(queue)); - - std::deque::iterator queue_end = queue.end(); - for (EdgeMap::const_iterator it = edges_.begin(); - it != edges_.end(); ++it) { - queue_end = std::remove(queue.begin(), queue_end, it->second); - } - queue.erase(queue_end, queue.end()); - - // Step 2: Do the Kahn topological sort. - std::vector output; - EdgeMap edges(edges_); - while (!queue.empty()) { - DependencyNode* node = queue.front(); - queue.pop_front(); - output.push_back(node); - - std::pair range = - edges.equal_range(node); - EdgeMap::iterator it = range.first; - while (it != range.second) { - DependencyNode* dest = it->second; - EdgeMap::iterator temp = it; - it++; - edges.erase(temp); - - bool has_incoming_edges = false; - for (EdgeMap::iterator jt = edges.begin(); jt != edges.end(); ++jt) { - if (jt->second == dest) { - has_incoming_edges = true; - break; - } - } - - if (!has_incoming_edges) - queue.push_back(dest); - } - } - - if (!edges.empty()) { - // Dependency graph has a cycle. - return false; - } - - construction_order_ = output; - return true; -} - -std::string DependencyGraph::DumpAsGraphviz( - const std::string& toplevel_name, - const base::Callback& - node_name_callback) const { - std::string result("digraph {\n"); - - // Make a copy of all nodes. - std::deque nodes; - std::copy(all_nodes_.begin(), all_nodes_.end(), std::back_inserter(nodes)); - - // State all dependencies and remove |second| so we don't generate an - // implicit dependency on the top level node. - std::deque::iterator nodes_end(nodes.end()); - result.append(" /* Dependencies */\n"); - for (EdgeMap::const_iterator it = edges_.begin(); it != edges_.end(); ++it) { - result.append(" "); - result.append(node_name_callback.Run(it->second)); - result.append(" -> "); - result.append(node_name_callback.Run(it->first)); - result.append(";\n"); - - nodes_end = std::remove(nodes.begin(), nodes_end, it->second); - } - nodes.erase(nodes_end, nodes.end()); - - // Every node that doesn't depend on anything else will implicitly depend on - // the top level node. - result.append("\n /* Toplevel attachments */\n"); - for (std::deque::const_iterator it = - nodes.begin(); it != nodes.end(); ++it) { - result.append(" "); - result.append(node_name_callback.Run(*it)); - result.append(" -> "); - result.append(toplevel_name); - result.append(";\n"); - } - - result.append("\n /* Toplevel node */\n"); - result.append(" "); - result.append(toplevel_name); - result.append(" [shape=box];\n"); - - result.append("}\n"); - return result; -} diff --git a/chrome/browser/profiles/dependency_graph.h b/chrome/browser/profiles/dependency_graph.h deleted file mode 100644 index cd98f17..0000000 --- a/chrome/browser/profiles/dependency_graph.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2013 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. - -#ifndef CHROME_BROWSER_PROFILES_DEPENDENCY_GRAPH_H_ -#define CHROME_BROWSER_PROFILES_DEPENDENCY_GRAPH_H_ - -#include -#include -#include - -#include "base/callback.h" -#include "base/compiler_specific.h" - -class DependencyNode; - -// Dynamic graph of dependencies between nodes. -class DependencyGraph { - public: - DependencyGraph(); - ~DependencyGraph(); - - // Adds/Removes a node from our list of live nodes. Removing will - // also remove live dependency links. - void AddNode(DependencyNode* node); - void RemoveNode(DependencyNode* node); - - // Adds a dependency between two nodes. - void AddEdge(DependencyNode* depended, DependencyNode* dependee); - - // Topologically sorts nodes to produce a safe construction order - // (all nodes after their dependees). - bool GetConstructionOrder( - std::vector* order) WARN_UNUSED_RESULT; - - // Topologically sorts nodes to produce a safe destruction order - // (all nodes before their dependees). - bool GetDestructionOrder( - std::vector* order) WARN_UNUSED_RESULT; - - // Returns representation of the dependency graph in graphviz format. - std::string DumpAsGraphviz( - const std::string& toplevel_name, - const base::Callback& - node_name_callback) const; - - private: - typedef std::multimap EdgeMap; - - // Populates |construction_order_| with computed construction order. - // Returns true on success. - bool BuildConstructionOrder() WARN_UNUSED_RESULT; - - // Keeps track of all live nodes (see AddNode, RemoveNode). - std::vector all_nodes_; - - // Keeps track of edges of the dependency graph. - EdgeMap edges_; - - // Cached construction order (needs rebuild with BuildConstructionOrder - // when empty). - std::vector construction_order_; - - DISALLOW_COPY_AND_ASSIGN(DependencyGraph); -}; - -#endif // CHROME_BROWSER_PROFILES_DEPENDENCY_GRAPH_H_ diff --git a/chrome/browser/profiles/dependency_graph_unittest.cc b/chrome/browser/profiles/dependency_graph_unittest.cc deleted file mode 100644 index 719ea2c..0000000 --- a/chrome/browser/profiles/dependency_graph_unittest.cc +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2013 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. - -#include "chrome/browser/profiles/dependency_graph.h" -#include "chrome/browser/profiles/dependency_node.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace { - -class DependencyGraphTest : public testing::Test { -}; - -class DummyNode : public DependencyNode { - public: - explicit DummyNode(DependencyGraph* graph) : dependency_graph_(graph) { - dependency_graph_->AddNode(this); - } - - ~DummyNode() { - dependency_graph_->RemoveNode(this); - } - - private: - DependencyGraph* dependency_graph_; - - DISALLOW_COPY_AND_ASSIGN(DummyNode); -}; - -// Tests that we can deal with a single component. -TEST_F(DependencyGraphTest, SingleCase) { - DependencyGraph graph; - DummyNode node(&graph); - - std::vector construction_order; - EXPECT_TRUE(graph.GetConstructionOrder(&construction_order)); - ASSERT_EQ(1U, construction_order.size()); - EXPECT_EQ(&node, construction_order[0]); - - std::vector destruction_order; - EXPECT_TRUE(graph.GetDestructionOrder(&destruction_order)); - ASSERT_EQ(1U, destruction_order.size()); - EXPECT_EQ(&node, destruction_order[0]); -} - -// Tests that we get a simple one component depends on the other case. -TEST_F(DependencyGraphTest, SimpleDependency) { - DependencyGraph graph; - DummyNode parent(&graph); - DummyNode child(&graph); - - graph.AddEdge(&parent, &child); - - std::vector construction_order; - EXPECT_TRUE(graph.GetConstructionOrder(&construction_order)); - ASSERT_EQ(2U, construction_order.size()); - EXPECT_EQ(&parent, construction_order[0]); - EXPECT_EQ(&child, construction_order[1]); - - std::vector destruction_order; - EXPECT_TRUE(graph.GetDestructionOrder(&destruction_order)); - ASSERT_EQ(2U, destruction_order.size()); - EXPECT_EQ(&child, destruction_order[0]); - EXPECT_EQ(&parent, destruction_order[1]); -} - -// Tests two children, one parent. -TEST_F(DependencyGraphTest, TwoChildrenOneParent) { - DependencyGraph graph; - DummyNode parent(&graph); - DummyNode child1(&graph); - DummyNode child2(&graph); - - graph.AddEdge(&parent, &child1); - graph.AddEdge(&parent, &child2); - - std::vector construction_order; - EXPECT_TRUE(graph.GetConstructionOrder(&construction_order)); - ASSERT_EQ(3U, construction_order.size()); - EXPECT_EQ(&parent, construction_order[0]); - EXPECT_EQ(&child1, construction_order[1]); - EXPECT_EQ(&child2, construction_order[2]); - - std::vector destruction_order; - EXPECT_TRUE(graph.GetDestructionOrder(&destruction_order)); - ASSERT_EQ(3U, destruction_order.size()); - EXPECT_EQ(&child2, destruction_order[0]); - EXPECT_EQ(&child1, destruction_order[1]); - EXPECT_EQ(&parent, destruction_order[2]); -} - -// Tests an M configuration. -TEST_F(DependencyGraphTest, MConfiguration) { - DependencyGraph graph; - - DummyNode parent1(&graph); - DummyNode parent2(&graph); - - DummyNode child_of_1(&graph); - graph.AddEdge(&parent1, &child_of_1); - - DummyNode child_of_12(&graph); - graph.AddEdge(&parent1, &child_of_12); - graph.AddEdge(&parent2, &child_of_12); - - DummyNode child_of_2(&graph); - graph.AddEdge(&parent2, &child_of_2); - - std::vector construction_order; - EXPECT_TRUE(graph.GetConstructionOrder(&construction_order)); - ASSERT_EQ(5U, construction_order.size()); - EXPECT_EQ(&parent1, construction_order[0]); - EXPECT_EQ(&parent2, construction_order[1]); - EXPECT_EQ(&child_of_1, construction_order[2]); - EXPECT_EQ(&child_of_12, construction_order[3]); - EXPECT_EQ(&child_of_2, construction_order[4]); - - std::vector destruction_order; - EXPECT_TRUE(graph.GetDestructionOrder(&destruction_order)); - ASSERT_EQ(5U, destruction_order.size()); - EXPECT_EQ(&child_of_2, destruction_order[0]); - EXPECT_EQ(&child_of_12, destruction_order[1]); - EXPECT_EQ(&child_of_1, destruction_order[2]); - EXPECT_EQ(&parent2, destruction_order[3]); - EXPECT_EQ(&parent1, destruction_order[4]); -} - -// Tests that it can deal with a simple diamond. -TEST_F(DependencyGraphTest, DiamondConfiguration) { - DependencyGraph graph; - - DummyNode parent(&graph); - - DummyNode middle1(&graph); - graph.AddEdge(&parent, &middle1); - - DummyNode middle2(&graph); - graph.AddEdge(&parent, &middle2); - - DummyNode bottom(&graph); - graph.AddEdge(&middle1, &bottom); - graph.AddEdge(&middle2, &bottom); - - std::vector construction_order; - EXPECT_TRUE(graph.GetConstructionOrder(&construction_order)); - ASSERT_EQ(4U, construction_order.size()); - EXPECT_EQ(&parent, construction_order[0]); - EXPECT_EQ(&middle1, construction_order[1]); - EXPECT_EQ(&middle2, construction_order[2]); - EXPECT_EQ(&bottom, construction_order[3]); - - std::vector destruction_order; - EXPECT_TRUE(graph.GetDestructionOrder(&destruction_order)); - ASSERT_EQ(4U, destruction_order.size()); - EXPECT_EQ(&bottom, destruction_order[0]); - EXPECT_EQ(&middle2, destruction_order[1]); - EXPECT_EQ(&middle1, destruction_order[2]); - EXPECT_EQ(&parent, destruction_order[3]); -} - -} // namespace diff --git a/chrome/browser/profiles/dependency_node.h b/chrome/browser/profiles/dependency_node.h deleted file mode 100644 index e1ed082..0000000 --- a/chrome/browser/profiles/dependency_node.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2013 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. - -#ifndef CHROME_BROWSER_PROFILES_DEPENDENCY_NODE_H_ -#define CHROME_BROWSER_PROFILES_DEPENDENCY_NODE_H_ - -// Base class representing a node in a DependencyGraph. -class DependencyNode { - protected: - // This is intended to be used by the subclasses, not directly. - DependencyNode() {} - ~DependencyNode() {} -}; - -#endif // CHROME_BROWSER_PROFILES_DEPENDENCY_NODE_H_ diff --git a/chrome/browser/profiles/gaia_info_update_service.h b/chrome/browser/profiles/gaia_info_update_service.h index 2ae5eae..d7694ed 100644 --- a/chrome/browser/profiles/gaia_info_update_service.h +++ b/chrome/browser/profiles/gaia_info_update_service.h @@ -12,7 +12,7 @@ #include "base/timer.h" #include "chrome/browser/profiles/profile_downloader.h" #include "chrome/browser/profiles/profile_downloader_delegate.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class Profile; class ProfileDownloader; diff --git a/chrome/browser/profiles/gaia_info_update_service_factory.cc b/chrome/browser/profiles/gaia_info_update_service_factory.cc index 1d519e3..72ea806 100644 --- a/chrome/browser/profiles/gaia_info_update_service_factory.cc +++ b/chrome/browser/profiles/gaia_info_update_service_factory.cc @@ -6,8 +6,8 @@ #include "chrome/browser/profiles/gaia_info_update_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" GAIAInfoUpdateServiceFactory::GAIAInfoUpdateServiceFactory() diff --git a/chrome/browser/profiles/gaia_info_update_service_factory.h b/chrome/browser/profiles/gaia_info_update_service_factory.h index 129495a..e7df4d7 100644 --- a/chrome/browser/profiles/gaia_info_update_service_factory.h +++ b/chrome/browser/profiles/gaia_info_update_service_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class GAIAInfoUpdateService; class Profile; diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc index eee208e..12371a9 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl.cc +++ b/chrome/browser/profiles/off_the_record_profile_impl.cc @@ -33,7 +33,6 @@ #include "chrome/browser/plugins/plugin_prefs.h" #include "chrome/browser/prefs/incognito_mode_prefs.h" #include "chrome/browser/prefs/pref_service_syncable.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" #include "chrome/common/chrome_constants.h" @@ -42,6 +41,7 @@ #include "chrome/common/extensions/extension.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/user_prefs.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/host_zoom_map.h" diff --git a/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc b/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc index 18493c2..3c245c6 100644 --- a/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc +++ b/chrome/browser/profiles/off_the_record_profile_impl_unittest.cc @@ -9,12 +9,12 @@ #include "chrome/browser/net/ssl_config_service_manager.h" #include "chrome/browser/prefs/browser_prefs.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/browser_with_test_window_test.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_pref_service_syncable.h" #include "chrome/test/base/testing_profile.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "content/public/browser/host_zoom_map.h" using content::HostZoomMap; diff --git a/chrome/browser/profiles/profile_dependency_manager.cc b/chrome/browser/profiles/profile_dependency_manager.cc deleted file mode 100644 index 8b9a1fa..0000000 --- a/chrome/browser/profiles/profile_dependency_manager.cc +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) 2013 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. - -#include "chrome/browser/profiles/profile_dependency_manager.h" - -#include -#include -#include - -#include "base/bind.h" -#include "chrome/browser/profiles/profile_keyed_base_factory.h" -#include "content/public/browser/browser_context.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( - ProfileKeyedBaseFactory* component) { - dependency_graph_.AddNode(component); -} - -void ProfileDependencyManager::RemoveComponent( - ProfileKeyedBaseFactory* component) { - dependency_graph_.RemoveNode(component); -} - -void ProfileDependencyManager::AddEdge(ProfileKeyedBaseFactory* depended, - ProfileKeyedBaseFactory* dependee) { - dependency_graph_.AddEdge(depended, dependee); -} - -void ProfileDependencyManager::CreateProfileServices( - content::BrowserContext* profile, bool is_testing_profile) { -#ifndef NDEBUG - // Unmark |profile| as dead. This exists because of unit tests, which will - // often have similar stack structures. 0xWhatever might be created, go out - // of scope, and then a new Profile object might be created at 0xWhatever. - dead_profile_pointers_.erase(profile); -#endif - - std::vector construction_order; - if (!dependency_graph_.GetConstructionOrder(&construction_order)) { - NOTREACHED(); - } - -#ifndef NDEBUG - DumpProfileDependencies(profile); -#endif - - for (size_t i = 0; i < construction_order.size(); i++) { - ProfileKeyedBaseFactory* factory = - static_cast(construction_order[i]); - - if (!profile->IsOffTheRecord()) { - // We only register preferences on normal profiles because the incognito - // profile shares the pref service with the normal one. - factory->RegisterUserPrefsOnProfile(profile); - } - - if (is_testing_profile && factory->ServiceIsNULLWhileTesting()) { - factory->SetEmptyTestingFactory(profile); - } else if (factory->ServiceIsCreatedWithProfile()) { - // Create the service. - factory->CreateServiceNow(profile); - } - } -} - -void ProfileDependencyManager::DestroyProfileServices( - content::BrowserContext* profile) { - std::vector destruction_order; - if (!dependency_graph_.GetDestructionOrder(&destruction_order)) { - NOTREACHED(); - } - -#ifndef NDEBUG - DumpProfileDependencies(profile); -#endif - - for (size_t i = 0; i < destruction_order.size(); i++) { - ProfileKeyedBaseFactory* factory = - static_cast(destruction_order[i]); - factory->ProfileShutdown(profile); - } - -#ifndef NDEBUG - // The profile is now dead to the rest of the program. - dead_profile_pointers_.insert(profile); -#endif - - for (size_t i = 0; i < destruction_order.size(); i++) { - ProfileKeyedBaseFactory* factory = - static_cast(destruction_order[i]); - factory->ProfileDestroyed(profile); - } -} - -#ifndef NDEBUG -void ProfileDependencyManager::AssertProfileWasntDestroyed( - content::BrowserContext* profile) { - if (dead_profile_pointers_.find(profile) != dead_profile_pointers_.end()) { - NOTREACHED() << "Attempted to access a Profile that was ShutDown(). This " - << "is most likely a heap smasher in progress. After " - << "ProfileKeyedService::Shutdown() completes, your service " - << "MUST NOT refer to depended Profile services again."; - } -} -#endif - -// static -ProfileDependencyManager* ProfileDependencyManager::GetInstance() { - return Singleton::get(); -} - -ProfileDependencyManager::ProfileDependencyManager() { -} - -ProfileDependencyManager::~ProfileDependencyManager() { -} - -#ifndef NDEBUG -namespace { - -std::string ProfileKeyedBaseFactoryGetNodeName(DependencyNode* node) { - return static_cast(node)->name(); -} - -} // namespace - -void ProfileDependencyManager::DumpProfileDependencies( - content::BrowserContext* profile) { - // 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)) { - base::FilePath dot_file = - profile->GetPath().AppendASCII("profile-dependencies.dot"); - std::string contents = dependency_graph_.DumpAsGraphviz( - "Profile", base::Bind(&ProfileKeyedBaseFactoryGetNodeName)); - file_util::WriteFile(dot_file, contents.c_str(), contents.size()); - } -} -#endif // NDEBUG diff --git a/chrome/browser/profiles/profile_dependency_manager.h b/chrome/browser/profiles/profile_dependency_manager.h deleted file mode 100644 index 8c216d1..0000000 --- a/chrome/browser/profiles/profile_dependency_manager.h +++ /dev/null @@ -1,86 +0,0 @@ -// 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. - -#ifndef CHROME_BROWSER_PROFILES_PROFILE_DEPENDENCY_MANAGER_H_ -#define CHROME_BROWSER_PROFILES_PROFILE_DEPENDENCY_MANAGER_H_ - -#include "base/memory/singleton.h" -#include "chrome/browser/profiles/dependency_graph.h" - -#ifndef NDEBUG -#include -#endif - -class ProfileKeyedBaseFactory; - -namespace content { -class BrowserContext; -} - -// A singleton that listens for profile destruction notifications and -// rebroadcasts them to each ProfileKeyedBaseFactory in a safe order based -// on the stated dependencies by each service. -class ProfileDependencyManager { - public: - // Adds/Removes a component from our list of live components. Removing will - // also remove live dependency links. - void AddComponent(ProfileKeyedBaseFactory* component); - void RemoveComponent(ProfileKeyedBaseFactory* component); - - // Adds a dependency between two factories. - void AddEdge(ProfileKeyedBaseFactory* depended, - ProfileKeyedBaseFactory* dependee); - - // Called by each Profile to alert us of its creation. Several services want - // to be started when a profile is created. Testing configuration is also - // done at this time. (If you want your ProfileKeyedService to be started - // with the Profile, override ProfileKeyedBaseFactory:: - // ServiceIsCreatedWithProfile() to return true.) - void CreateProfileServices(content::BrowserContext* profile, - bool is_testing_profile); - - // Called by each Profile to alert us that we should destroy services - // associated with it. - // - // Why not use the existing PROFILE_DESTROYED notification? - // - // - Because we need to do everything here after the application has handled - // being notified about PROFILE_DESTROYED. - // - Because this class is a singleton and Singletons can't rely on - // NotificationService in unit tests because NotificationService is - // replaced in many tests. - void DestroyProfileServices(content::BrowserContext* profile); - -#ifndef NDEBUG - // Debugging assertion called as part of GetServiceForProfile in debug - // mode. This will NOTREACHED() whenever the user is trying to access a stale - // Profile*. - void AssertProfileWasntDestroyed(content::BrowserContext* profile); -#endif - - static ProfileDependencyManager* GetInstance(); - - private: - friend class ProfileDependencyManagerUnittests; - friend struct DefaultSingletonTraits; - - ProfileDependencyManager(); - virtual ~ProfileDependencyManager(); - -#ifndef NDEBUG - void DumpProfileDependencies(content::BrowserContext* profile); -#endif - - DependencyGraph dependency_graph_; - -#ifndef NDEBUG - // A list of profile objects that have gone through the Shutdown() - // phase. These pointers are most likely invalid, but we keep track of their - // locations in memory so we can nicely assert if we're asked to do anything - // with them. - std::set dead_profile_pointers_; -#endif -}; - -#endif // CHROME_BROWSER_PROFILES_PROFILE_DEPENDENCY_MANAGER_H_ diff --git a/chrome/browser/profiles/profile_dependency_manager_unittest.cc b/chrome/browser/profiles/profile_dependency_manager_unittest.cc deleted file mode 100644 index 1dab5fe..0000000 --- a/chrome/browser/profiles/profile_dependency_manager_unittest.cc +++ /dev/null @@ -1,173 +0,0 @@ -// 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. - -#include "testing/gtest/include/gtest/gtest.h" - -#include "chrome/browser/profiles/profile_dependency_manager.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" - -class ProfileDependencyManagerUnittests : public ::testing::Test { - protected: - // To get around class access: - void DependOn(ProfileKeyedServiceFactory* child, - ProfileKeyedServiceFactory* parent) { - child->DependsOn(parent); - } - - ProfileDependencyManager* manager() { return &dependency_manager_; } - - std::vector* shutdown_order() { return &shutdown_order_; } - - private: - ProfileDependencyManager dependency_manager_; - - std::vector shutdown_order_; -}; - -class TestService : public ProfileKeyedServiceFactory { - public: - TestService(const std::string& name, - std::vector* fill_on_shutdown, - ProfileDependencyManager* manager) - : ProfileKeyedServiceFactory("TestService", manager), - name_(name), - fill_on_shutdown_(fill_on_shutdown) { - } - - virtual ProfileKeyedService* BuildServiceInstanceFor( - content::BrowserContext* profile) const OVERRIDE { - ADD_FAILURE() << "This isn't part of the tests!"; - return NULL; - } - - virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE { - fill_on_shutdown_->push_back(name_); - } - - private: - const std::string name_; - std::vector* fill_on_shutdown_; -}; - -// Tests that we can deal with a single component. -TEST_F(ProfileDependencyManagerUnittests, SingleCase) { - TestService service("service", shutdown_order(), manager()); - - manager()->DestroyProfileServices(NULL); - - ASSERT_EQ(1U, shutdown_order()->size()); - EXPECT_STREQ("service", (*shutdown_order())[0].c_str()); -} - -// Tests that we get a simple one component depends on the other case. -TEST_F(ProfileDependencyManagerUnittests, SimpleDependency) { - TestService parent("parent", shutdown_order(), manager()); - TestService child("child", shutdown_order(), manager()); - DependOn(&child, &parent); - - manager()->DestroyProfileServices(NULL); - - ASSERT_EQ(2U, shutdown_order()->size()); - EXPECT_STREQ("child", (*shutdown_order())[0].c_str()); - EXPECT_STREQ("parent", (*shutdown_order())[1].c_str()); -} - -// Tests two children, one parent -TEST_F(ProfileDependencyManagerUnittests, TwoChildrenOneParent) { - TestService parent("parent", shutdown_order(), manager()); - TestService child1("child1", shutdown_order(), manager()); - TestService child2("child2", shutdown_order(), manager()); - DependOn(&child1, &parent); - DependOn(&child2, &parent); - - manager()->DestroyProfileServices(NULL); - - ASSERT_EQ(3U, shutdown_order()->size()); - EXPECT_STREQ("child2", (*shutdown_order())[0].c_str()); - EXPECT_STREQ("child1", (*shutdown_order())[1].c_str()); - EXPECT_STREQ("parent", (*shutdown_order())[2].c_str()); -} - -// Tests an M configuration -TEST_F(ProfileDependencyManagerUnittests, MConfiguration) { - TestService parent1("parent1", shutdown_order(), manager()); - TestService parent2("parent2", shutdown_order(), manager()); - - TestService child_of_1("child_of_1", shutdown_order(), manager()); - DependOn(&child_of_1, &parent1); - - TestService child_of_12("child_of_12", shutdown_order(), manager()); - DependOn(&child_of_12, &parent1); - DependOn(&child_of_12, &parent2); - - TestService child_of_2("child_of_2", shutdown_order(), manager()); - DependOn(&child_of_2, &parent2); - - manager()->DestroyProfileServices(NULL); - - ASSERT_EQ(5U, shutdown_order()->size()); - EXPECT_STREQ("child_of_2", (*shutdown_order())[0].c_str()); - EXPECT_STREQ("child_of_12", (*shutdown_order())[1].c_str()); - EXPECT_STREQ("child_of_1", (*shutdown_order())[2].c_str()); - EXPECT_STREQ("parent2", (*shutdown_order())[3].c_str()); - EXPECT_STREQ("parent1", (*shutdown_order())[4].c_str()); -} - -// Tests that it can deal with a simple diamond. -TEST_F(ProfileDependencyManagerUnittests, DiamondConfiguration) { - TestService parent("parent", shutdown_order(), manager()); - - TestService middle_row_1("middle_row_1", shutdown_order(), manager()); - DependOn(&middle_row_1, &parent); - - TestService middle_row_2("middle_row_2", shutdown_order(), manager()); - DependOn(&middle_row_2, &parent); - - TestService bottom("bottom", shutdown_order(), manager()); - DependOn(&bottom, &middle_row_1); - DependOn(&bottom, &middle_row_2); - - manager()->DestroyProfileServices(NULL); - - ASSERT_EQ(4U, shutdown_order()->size()); - EXPECT_STREQ("bottom", (*shutdown_order())[0].c_str()); - EXPECT_STREQ("middle_row_2", (*shutdown_order())[1].c_str()); - EXPECT_STREQ("middle_row_1", (*shutdown_order())[2].c_str()); - EXPECT_STREQ("parent", (*shutdown_order())[3].c_str()); -} - -// A final test that works with a more complex graph. -TEST_F(ProfileDependencyManagerUnittests, ComplexGraph) { - TestService everything_depends_on_me("everything_depends_on_me", - shutdown_order(), manager()); - - TestService intermediary_service("intermediary_service", - shutdown_order(), manager()); - DependOn(&intermediary_service, &everything_depends_on_me); - - TestService specialized_service("specialized_service", - shutdown_order(), manager()); - DependOn(&specialized_service, &everything_depends_on_me); - DependOn(&specialized_service, &intermediary_service); - - TestService other_root("other_root", shutdown_order(), manager()); - - TestService other_intermediary("other_intermediary", - shutdown_order(), manager()); - DependOn(&other_intermediary, &other_root); - - TestService bottom("bottom", shutdown_order(), manager()); - DependOn(&bottom, &specialized_service); - DependOn(&bottom, &other_intermediary); - - manager()->DestroyProfileServices(NULL); - - ASSERT_EQ(6U, shutdown_order()->size()); - EXPECT_STREQ("bottom", (*shutdown_order())[0].c_str()); - EXPECT_STREQ("specialized_service", (*shutdown_order())[1].c_str()); - EXPECT_STREQ("other_intermediary", (*shutdown_order())[2].c_str()); - EXPECT_STREQ("intermediary_service", (*shutdown_order())[3].c_str()); - EXPECT_STREQ("other_root", (*shutdown_order())[4].c_str()); - EXPECT_STREQ("everything_depends_on_me", (*shutdown_order())[5].c_str()); -} diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index 53c77ff..b7a34a4 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -61,7 +61,6 @@ #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" #include "chrome/browser/profiles/chrome_version_service.h" #include "chrome/browser/profiles/gaia_info_update_service_factory.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/profiles/profile_destroyer.h" #include "chrome/browser/profiles/profile_info_cache.h" #include "chrome/browser/profiles/profile_manager.h" @@ -80,6 +79,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/startup_metric_utils.h" #include "chrome/common/url_constants.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" #include "components/user_prefs/user_prefs.h" #include "content/public/browser/browser_thread.h" diff --git a/chrome/browser/profiles/profile_keyed_base_factory.cc b/chrome/browser/profiles/profile_keyed_base_factory.cc deleted file mode 100644 index cf98c94..0000000 --- a/chrome/browser/profiles/profile_keyed_base_factory.cc +++ /dev/null @@ -1,110 +0,0 @@ -// 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. - -#include "chrome/browser/profiles/profile_keyed_base_factory.h" - -#include "base/prefs/pref_service.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" -#include "components/user_prefs/pref_registry_syncable.h" -#include "components/user_prefs/user_prefs.h" -#include "content/public/browser/browser_context.h" - -ProfileKeyedBaseFactory::ProfileKeyedBaseFactory( - const char* name, ProfileDependencyManager* manager) - : dependency_manager_(manager) -#ifndef NDEBUG - , service_name_(name) -#endif -{ - dependency_manager_->AddComponent(this); -} - -ProfileKeyedBaseFactory::~ProfileKeyedBaseFactory() { - dependency_manager_->RemoveComponent(this); -} - -void ProfileKeyedBaseFactory::DependsOn(ProfileKeyedBaseFactory* rhs) { - dependency_manager_->AddEdge(rhs, this); -} - -content::BrowserContext* ProfileKeyedBaseFactory::GetBrowserContextToUse( - content::BrowserContext* context) const { - DCHECK(CalledOnValidThread()); - -#ifndef NDEBUG - dependency_manager_->AssertProfileWasntDestroyed(context); -#endif - - // Safe default for the Incognito mode: no service. - if (context->IsOffTheRecord()) - return NULL; - - return context; -} - -void ProfileKeyedBaseFactory::RegisterUserPrefsOnProfile( - content::BrowserContext* profile) { - // Safe timing for pref registration is hard. Previously, we made Profile - // responsible for all pref registration on every service that used - // Profile. Now we don't and there are timing issues. - // - // With normal profiles, prefs can simply be registered at - // ProfileDependencyManager::CreateProfileServices time. With incognito - // profiles, we just never register since incognito profiles share the same - // pref services with their parent profiles. - // - // TestingProfiles throw a wrench into the mix, in that some tests will - // swap out the PrefService after we've registered user prefs on the original - // PrefService. Test code that does this is responsible for either manually - // invoking RegisterUserPrefs() on the appropriate ProfileKeyedServiceFactory - // associated with the prefs they need, or they can use SetTestingFactory() - // and create a service (since service creation with a factory method causes - // registration to happen at service creation time). - // - // Now that services are responsible for declaring their preferences, we have - // to enforce a uniquenes check here because some tests create one profile and - // multiple services of the same type attached to that profile (serially, not - // parallel) and we don't want to register multiple times on the same profile. - DCHECK(!profile->IsOffTheRecord()); - - std::set::iterator it = - registered_preferences_.find(profile); - if (it == registered_preferences_.end()) { - PrefService* prefs = components::UserPrefs::Get(profile); - user_prefs::PrefRegistrySyncable* registry = - static_cast( - prefs->DeprecatedGetPrefRegistry()); - RegisterUserPrefs(registry); - registered_preferences_.insert(profile); - } -} - -bool ProfileKeyedBaseFactory::ServiceIsCreatedWithProfile() const { - return false; -} - -bool ProfileKeyedBaseFactory::ServiceIsNULLWhileTesting() const { - return false; -} - -void ProfileKeyedBaseFactory::ProfileDestroyed( - content::BrowserContext* profile) { - // While object destruction can be customized in ways where the object is - // only dereferenced, this still must run on the UI thread. - DCHECK(CalledOnValidThread()); - - registered_preferences_.erase(profile); -} - -bool ProfileKeyedBaseFactory::ArePreferencesSetOn( - content::BrowserContext* profile) const { - return registered_preferences_.find(profile) != - registered_preferences_.end(); -} - -void ProfileKeyedBaseFactory::MarkPreferencesSetOn( - content::BrowserContext* profile) { - DCHECK(!ArePreferencesSetOn(profile)); - registered_preferences_.insert(profile); -} diff --git a/chrome/browser/profiles/profile_keyed_base_factory.h b/chrome/browser/profiles/profile_keyed_base_factory.h deleted file mode 100644 index 25e090e..0000000 --- a/chrome/browser/profiles/profile_keyed_base_factory.h +++ /dev/null @@ -1,133 +0,0 @@ -// 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. - -#ifndef CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_ -#define CHROME_BROWSER_PROFILES_PROFILE_KEYED_BASE_FACTORY_H_ - -#include - -#include "base/threading/non_thread_safe.h" -#include "chrome/browser/profiles/dependency_node.h" - -class PrefService; -class ProfileDependencyManager; - -namespace content { -class BrowserContext; -} - -namespace user_prefs { -class PrefRegistrySyncable; -} -// Base class for Factories that take a Profile object and return some service. -// -// Unless you're trying to make a new type of Factory, you probably don't want -// this class, but its subclasses: ProfileKeyedServiceFactory and -// RefcountedProfileKeyedServiceFactory. This object describes general -// dependency management between Factories; subclasses react to lifecycle -// events and implement memory management. -class ProfileKeyedBaseFactory : public base::NonThreadSafe, - public DependencyNode { - public: - // Registers preferences used in this service on the pref service of - // |profile|. This is the public interface and is safe to be called multiple - // times because testing code can have multiple services of the same type - // attached to a single |profile|. - void RegisterUserPrefsOnProfile(content::BrowserContext* 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: - ProfileKeyedBaseFactory(const char* name, - ProfileDependencyManager* manager); - virtual ~ProfileKeyedBaseFactory(); - - // The main public interface for declaring dependencies between services - // created by factories. - void DependsOn(ProfileKeyedBaseFactory* rhs); - - // Interface for people building a concrete FooServiceFactory: -------------- - - // Finds which browser context (if any) to use. - virtual content::BrowserContext* GetBrowserContextToUse( - content::BrowserContext* context) const; - - // Register any user preferences on this service. This is called during - // CreateProfileService() since preferences are registered on a per Profile - // basis. - virtual void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry) {} - - // By default, we create instances of a service lazily and wait until - // GetForProfile() is called on our subclass. Some services need to be - // created as soon as the Profile has been brought up. - virtual bool ServiceIsCreatedWithProfile() const; - - // By default, TestingProfiles will be treated like normal profiles. You can - // override this so that by default, the service associated with the - // TestingProfile is NULL. (This is just a shortcut around - // SetTestingFactory() to make sure our profiles don't directly refer to the - // services they use.) - virtual bool ServiceIsNULLWhileTesting() const; - - // Interface for people building a type of ProfileKeyedFactory: ------------- - - // A helper object actually listens for notifications about Profile - // destruction, calculates the order in which things are destroyed and then - // does a two pass shutdown. - // - // It is up to the individual factory types to determine what this two pass - // shutdown means. The general framework guarantees the following: - // - // - Each ProfileShutdown() is called in dependency order (and you may reach - // out to other services during this phase). - // - // - Each ProfileDestroyed() is called in dependency order. We will - // NOTREACHED() if you attempt to GetForProfile() any other service. You - // should delete/deref/do other final memory management things during this - // phase. You must also call the base class method as the last thing you - // do. - virtual void ProfileShutdown(content::BrowserContext* profile) = 0; - virtual void ProfileDestroyed(content::BrowserContext* profile); - - // Returns whether we've registered the preferences on this profile. - bool ArePreferencesSetOn(content::BrowserContext* profile) const; - - // Mark profile as Preferences set. - void MarkPreferencesSetOn(content::BrowserContext* profile); - - private: - friend class ProfileDependencyManager; - friend class ProfileDependencyManagerUnittests; - - // These two methods are for tight integration with the - // ProfileDependencyManager. - - // Because of ServiceIsNULLWhileTesting(), we need a way to tell different - // subclasses that they should disable testing. - virtual void SetEmptyTestingFactory(content::BrowserContext* profile) = 0; - - // We also need a generalized, non-returning method that generates the object - // now for when we're creating the profile. - virtual void CreateServiceNow(content::BrowserContext* profile) = 0; - - // Which ProfileDependencyManager we should communicate with. In real code, - // this will always be ProfileDependencyManager::GetInstance(), but unit - // tests will want to use their own copy. - ProfileDependencyManager* dependency_manager_; - - // Profiles that have this service's preferences registered on them. - std::set registered_preferences_; - -#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_BASE_FACTORY_H_ diff --git a/chrome/browser/profiles/profile_keyed_service.h b/chrome/browser/profiles/profile_keyed_service.h deleted file mode 100644 index ce7baf2..0000000 --- a/chrome/browser/profiles/profile_keyed_service.h +++ /dev/null @@ -1,30 +0,0 @@ -// 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. - -#ifndef CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ -#define CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ - -class ProfileKeyedServiceFactory; - -// Base class for all ProfileKeyedServices to allow for correct destruction -// order. -// -// Many services that hang off Profile have a two-pass shutdown. Many -// subsystems need a first pass shutdown phase where they drop references. Not -// all services will need this, so there's a default implementation. Only once -// every system has been given a chance to drop references do we start deleting -// objects. -class ProfileKeyedService { - public: - // The first pass is to call Shutdown on a ProfileKeyedService. - virtual void Shutdown() {} - - protected: - friend class ProfileKeyedServiceFactory; - - // The second pass is the actual deletion of each object. - virtual ~ProfileKeyedService() {} -}; - -#endif // CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ diff --git a/chrome/browser/profiles/profile_keyed_service_factory.cc b/chrome/browser/profiles/profile_keyed_service_factory.cc deleted file mode 100644 index eab250e..0000000 --- a/chrome/browser/profiles/profile_keyed_service_factory.cc +++ /dev/null @@ -1,126 +0,0 @@ -// 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. - -#include "chrome/browser/profiles/profile_keyed_service_factory.h" - -#include - -#include "base/logging.h" -#include "base/stl_util.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "content/public/browser/browser_context.h" - -void ProfileKeyedServiceFactory::SetTestingFactory( - content::BrowserContext* profile, FactoryFunction factory) { - // Destroying the profile may cause us to lose data about whether |profile| - // has our preferences registered on it (since the profile object itself - // isn't dead). See if we need to readd it once we've gone through normal - // destruction. - bool add_profile = ArePreferencesSetOn(profile); - - // We have to go through the shutdown and destroy mechanisms because there - // are unit tests that create a service on a profile and then change the - // testing service mid-test. - ProfileShutdown(profile); - ProfileDestroyed(profile); - - if (add_profile) - MarkPreferencesSetOn(profile); - - factories_[profile] = factory; -} - -ProfileKeyedService* ProfileKeyedServiceFactory::SetTestingFactoryAndUse( - content::BrowserContext* profile, - FactoryFunction factory) { - DCHECK(factory); - SetTestingFactory(profile, factory); - return GetServiceForProfile(profile, true); -} - -ProfileKeyedServiceFactory::ProfileKeyedServiceFactory( - const char* name, ProfileDependencyManager* manager) - : ProfileKeyedBaseFactory(name, manager) { -} - -ProfileKeyedServiceFactory::~ProfileKeyedServiceFactory() { - DCHECK(mapping_.empty()); -} - -ProfileKeyedService* ProfileKeyedServiceFactory::GetServiceForProfile( - content::BrowserContext* profile, - bool create) { - profile = GetBrowserContextToUse(profile); - if (!profile) - return NULL; - - // NOTE: If you modify any of the logic below, make sure to update the - // refcounted version in refcounted_profile_keyed_service_factory.cc! - ProfileKeyedServices::const_iterator it = mapping_.find(profile); - if (it != mapping_.end()) - return it->second; - - // Object not found. - if (!create) - return NULL; // And we're forbidden from creating one. - - // Create new object. - // Check to see if we have a per-Profile testing factory that we should use - // instead of default behavior. - ProfileKeyedService* service = NULL; - ProfileOverriddenFunctions::const_iterator jt = factories_.find(profile); - if (jt != factories_.end()) { - if (jt->second) { - if (!profile->IsOffTheRecord()) - RegisterUserPrefsOnProfile(profile); - service = jt->second(profile); - } - } else { - service = BuildServiceInstanceFor(profile); - } - - Associate(profile, service); - return service; -} - -void ProfileKeyedServiceFactory::Associate(content::BrowserContext* profile, - ProfileKeyedService* service) { - DCHECK(!ContainsKey(mapping_, profile)); - mapping_.insert(std::make_pair(profile, service)); -} - -void ProfileKeyedServiceFactory::ProfileShutdown( - content::BrowserContext* profile) { - ProfileKeyedServices::iterator it = mapping_.find(profile); - if (it != mapping_.end() && it->second) - it->second->Shutdown(); -} - -void ProfileKeyedServiceFactory::ProfileDestroyed( - content::BrowserContext* profile) { - ProfileKeyedServices::iterator it = mapping_.find(profile); - if (it != mapping_.end()) { - delete it->second; - mapping_.erase(it); - } - - // For unit tests, we also remove the factory function both so we don't - // maintain a big map of dead pointers, but also since we may have a second - // object that lives at the same address (see other comments about unit tests - // in this file). - factories_.erase(profile); - - ProfileKeyedBaseFactory::ProfileDestroyed(profile); -} - -void ProfileKeyedServiceFactory::SetEmptyTestingFactory( - content::BrowserContext* profile) { - SetTestingFactory(profile, NULL); -} - -void ProfileKeyedServiceFactory::CreateServiceNow( - content::BrowserContext* profile) { - GetServiceForProfile(profile, true); -} diff --git a/chrome/browser/profiles/profile_keyed_service_factory.h b/chrome/browser/profiles/profile_keyed_service_factory.h deleted file mode 100644 index 78c73ba..0000000 --- a/chrome/browser/profiles/profile_keyed_service_factory.h +++ /dev/null @@ -1,115 +0,0 @@ -// 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. - -#ifndef CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_FACTORY_H_ -#define CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_FACTORY_H_ - -#include - -#include "base/basictypes.h" -#include "base/compiler_specific.h" -#include "chrome/browser/profiles/profile_keyed_base_factory.h" -#include "chrome/browser/profiles/profile_keyed_service.h" - -class ProfileDependencyManager; -class ProfileKeyedService; - -// Base class for Factories that take a Profile object and return some service -// on a one-to-one mapping. Each factory that derives from this class *must* -// be a Singleton (only unit tests don't do that). See ThemeServiceFactory as -// an example of how to derive from this class. -// -// We do this because services depend on each other and we need to control -// shutdown/destruction order. In each derived classes' constructors, the -// implementors must explicitly state which services are depended on. -class ProfileKeyedServiceFactory : public ProfileKeyedBaseFactory { - public: - // A function that supplies the instance of a ProfileKeyedService for a given - // Profile. This is used primarily for testing, where we want to feed a - // specific mock into the PKSF system. - typedef ProfileKeyedService* - (*FactoryFunction)(content::BrowserContext* profile); - - // Associates |factory| with |profile| so that |factory| is used to create - // the ProfileKeyedService when requested. |factory| can be NULL to signal - // that ProfileKeyedService should be NULL. Multiple calls to - // SetTestingFactory() are allowed; previous services will be shut down. - void SetTestingFactory(content::BrowserContext* profile, - FactoryFunction factory); - - // Associates |factory| with |profile| and immediately returns the created - // ProfileKeyedService. Since the factory will be used immediately, it may - // not be NULL. - ProfileKeyedService* SetTestingFactoryAndUse(content::BrowserContext* profile, - FactoryFunction factory); - - protected: - // ProfileKeyedServiceFactories must communicate with a - // ProfileDependencyManager. For all non-test code, write your subclass - // constructors like this: - // - // MyServiceFactory::MyServiceFactory() - // : ProfileKeyedServiceFactory( - // "MyService", - // ProfileDependencyManager::GetInstance()) - // {} - ProfileKeyedServiceFactory(const char* name, - ProfileDependencyManager* manager); - virtual ~ProfileKeyedServiceFactory(); - - // Common implementation that maps |profile| to some service object. Deals - // with incognito profiles per subclass instructions with - // ServiceRedirectedInIncognito() and ServiceHasOwnInstanceInIncognito() - // through the GetProfileToUse() method on the base. If |create| is true, - // the service will be created using BuildServiceInstanceFor() if it doesn't - // already exist. - ProfileKeyedService* GetServiceForProfile(content::BrowserContext* profile, - bool create); - - // Maps |profile| to |service| with debug checks to prevent duplication. - void Associate(content::BrowserContext* profile, - ProfileKeyedService* service); - - // All subclasses of ProfileKeyedServiceFactory must return a - // ProfileKeyedService instead of just a ProfileKeyedBase. - virtual ProfileKeyedService* BuildServiceInstanceFor( - content::BrowserContext* profile) const = 0; - - // A helper object actually listens for notifications about Profile - // destruction, calculates the order in which things are destroyed and then - // does a two pass shutdown. - // - // First, ProfileShutdown() is called on every ServiceFactory and will - // usually call ProfileKeyedService::Shutdown(), which gives each - // ProfileKeyedService a chance to remove dependencies on other services that - // it may be holding. - // - // Secondly, ProfileDestroyed() is called on every ServiceFactory and the - // default implementation removes it from |mapping_| and deletes the pointer. - virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE; - virtual void ProfileDestroyed(content::BrowserContext* profile) OVERRIDE; - - virtual void SetEmptyTestingFactory( - content::BrowserContext* profile) OVERRIDE; - virtual void CreateServiceNow(content::BrowserContext* profile) OVERRIDE; - - private: - friend class ProfileDependencyManager; - friend class ProfileDependencyManagerUnittests; - - typedef std::map - ProfileKeyedServices; - typedef std::map - ProfileOverriddenFunctions; - - // The mapping between a Profile and its service. - std::map mapping_; - - // The mapping between a Profile and its overridden FactoryFunction. - std::map factories_; - - DISALLOW_COPY_AND_ASSIGN(ProfileKeyedServiceFactory); -}; - -#endif // CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_FACTORY_H_ diff --git a/chrome/browser/profiles/refcounted_profile_keyed_service.cc b/chrome/browser/profiles/refcounted_profile_keyed_service.cc deleted file mode 100644 index aa8eeae..0000000 --- a/chrome/browser/profiles/refcounted_profile_keyed_service.cc +++ /dev/null @@ -1,34 +0,0 @@ -// 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. - -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" - -namespace impl { - -// static -void RefcountedProfileKeyedServiceTraits::Destruct( - const RefcountedProfileKeyedService* obj) { - if (obj->requires_destruction_on_thread_ && - !content::BrowserThread::CurrentlyOn(obj->thread_id_)) { - content::BrowserThread::DeleteSoon(obj->thread_id_, FROM_HERE, obj); - } else { - delete obj; - } -} - -} // namespace impl - -RefcountedProfileKeyedService::RefcountedProfileKeyedService() - : requires_destruction_on_thread_(false), - thread_id_(content::BrowserThread::UI) { -} - -RefcountedProfileKeyedService::RefcountedProfileKeyedService( - const content::BrowserThread::ID thread_id) - : requires_destruction_on_thread_(true), - thread_id_(thread_id) { -} - -RefcountedProfileKeyedService::~RefcountedProfileKeyedService() {} - diff --git a/chrome/browser/profiles/refcounted_profile_keyed_service.h b/chrome/browser/profiles/refcounted_profile_keyed_service.h deleted file mode 100644 index a7c41af..0000000 --- a/chrome/browser/profiles/refcounted_profile_keyed_service.h +++ /dev/null @@ -1,70 +0,0 @@ -// 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. - -#ifndef CHROME_BROWSER_PROFILES_REFCOUNTED_PROFILE_KEYED_SERVICE_H_ -#define CHROME_BROWSER_PROFILES_REFCOUNTED_PROFILE_KEYED_SERVICE_H_ - -#include "base/memory/ref_counted.h" -#include "base/sequenced_task_runner_helpers.h" -#include "content/public/browser/browser_thread.h" - -class RefcountedProfileKeyedService; - -namespace impl { - -struct RefcountedProfileKeyedServiceTraits { - static void Destruct(const RefcountedProfileKeyedService* obj); -}; - -} // namespace impl - -// Base class for refcounted objects that hang off the Profile. -// -// The two pass shutdown described in ProfileKeyedService works a bit -// differently because there could be outstanding references on other -// threads. ShutdownOnUIThread() will be called on the UI thread, and then the -// destructor will run when the last reference is dropped, which may or may not -// be after the corresponding Profile has been destroyed. -// -// Optionally, if you initialize your service with the constructor that takes a -// thread ID, your service will be deleted on that thread. We can't use -// content::DeleteOnThread<> directly because RefcountedProfileKeyedService -// must be one type that RefcountedProfileKeyedServiceFactory can use. -class RefcountedProfileKeyedService - : public base::RefCountedThreadSafe< - RefcountedProfileKeyedService, - impl::RefcountedProfileKeyedServiceTraits> { - public: - // Unlike ProfileKeyedService, ShutdownOnUI is not optional. You must do - // something to drop references during the first pass Shutdown() because this - // is the only point where you are guaranteed that something is running on - // the UI thread. The PKSF framework will ensure that this is only called on - // the UI thread; you do not need to check for that yourself. - virtual void ShutdownOnUIThread() = 0; - - protected: - // If your service does not need to be deleted on a specific thread, use the - // default constructor. - RefcountedProfileKeyedService(); - - // If you need your service to be deleted on a specific thread (for example, - // you're converting a service that used content::DeleteOnThread), then - // use this constructor with the ID of the thread. - explicit RefcountedProfileKeyedService( - const content::BrowserThread::ID thread_id); - - // The second pass destruction can happen anywhere unless you specify which - // thread this service must be destroyed on by using the second constructor. - virtual ~RefcountedProfileKeyedService(); - - private: - friend struct impl::RefcountedProfileKeyedServiceTraits; - friend class base::DeleteHelper; - - // Do we have to delete this object on a specific thread? - bool requires_destruction_on_thread_; - content::BrowserThread::ID thread_id_; -}; - -#endif // CHROME_BROWSER_PROFILES_REFCOUNTED_PROFILE_KEYED_SERVICE_H_ diff --git a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc b/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc deleted file mode 100644 index d02fb1e..0000000 --- a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc +++ /dev/null @@ -1,127 +0,0 @@ -// 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. - -#include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" - -#include "base/logging.h" -#include "base/stl_util.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" - -void RefcountedProfileKeyedServiceFactory::SetTestingFactory( - content::BrowserContext* profile, - FactoryFunction factory) { - // Destroying the profile may cause us to lose data about whether |profile| - // has our preferences registered on it (since the profile object itself - // isn't dead). See if we need to readd it once we've gone through normal - // destruction. - bool add_profile = ArePreferencesSetOn(profile); - - // We have to go through the shutdown and destroy mechanisms because there - // are unit tests that create a service on a profile and then change the - // testing service mid-test. - ProfileShutdown(profile); - ProfileDestroyed(profile); - - if (add_profile) - MarkPreferencesSetOn(profile); - - factories_[profile] = factory; -} - -scoped_refptr -RefcountedProfileKeyedServiceFactory::SetTestingFactoryAndUse( - content::BrowserContext* profile, - FactoryFunction factory) { - DCHECK(factory); - SetTestingFactory(profile, factory); - return GetServiceForProfile(profile, true); -} - -RefcountedProfileKeyedServiceFactory::RefcountedProfileKeyedServiceFactory( - const char* name, - ProfileDependencyManager* manager) - : ProfileKeyedBaseFactory(name, manager) { -} - -RefcountedProfileKeyedServiceFactory::~RefcountedProfileKeyedServiceFactory() { - DCHECK(mapping_.empty()); -} - -scoped_refptr -RefcountedProfileKeyedServiceFactory::GetServiceForProfile( - content::BrowserContext* profile, - bool create) { - profile = GetBrowserContextToUse(profile); - if (!profile) - return NULL; - - // NOTE: If you modify any of the logic below, make sure to update the - // non-refcounted version in profile_keyed_service_factory.cc! - RefCountedStorage::const_iterator it = mapping_.find(profile); - if (it != mapping_.end()) - return it->second; - - // Object not found. - if (!create) - return NULL; // And we're forbidden from creating one. - - // Create new object. - // Check to see if we have a per-Profile testing factory that we should use - // instead of default behavior. - scoped_refptr service; - ProfileOverriddenFunctions::const_iterator jt = factories_.find(profile); - if (jt != factories_.end()) { - if (jt->second) { - if (!profile->IsOffTheRecord()) - RegisterUserPrefsOnProfile(profile); - service = jt->second(profile); - } - } else { - service = BuildServiceInstanceFor(profile); - } - - Associate(profile, service); - return service; -} - -void RefcountedProfileKeyedServiceFactory::Associate( - content::BrowserContext* profile, - const scoped_refptr& service) { - DCHECK(!ContainsKey(mapping_, profile)); - mapping_.insert(std::make_pair(profile, service)); -} - -void RefcountedProfileKeyedServiceFactory::ProfileShutdown( - content::BrowserContext* profile) { - RefCountedStorage::iterator it = mapping_.find(profile); - if (it != mapping_.end() && it->second) - it->second->ShutdownOnUIThread(); -} - -void RefcountedProfileKeyedServiceFactory::ProfileDestroyed( - content::BrowserContext* profile) { - // We "merely" drop our reference to the service. Hopefully this will cause - // the service to be destroyed. If not, oh well. - mapping_.erase(profile); - - // For unit tests, we also remove the factory function both so we don't - // maintain a big map of dead pointers, but also since we may have a second - // object that lives at the same address (see other comments about unit tests - // in this file). - factories_.erase(profile); - - ProfileKeyedBaseFactory::ProfileDestroyed(profile); -} - -void RefcountedProfileKeyedServiceFactory::SetEmptyTestingFactory( - content::BrowserContext* profile) { - SetTestingFactory(profile, NULL); -} - -void RefcountedProfileKeyedServiceFactory::CreateServiceNow( - content::BrowserContext* profile) { - GetServiceForProfile(profile, true); -} diff --git a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.h b/chrome/browser/profiles/refcounted_profile_keyed_service_factory.h deleted file mode 100644 index 07be306..0000000 --- a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.h +++ /dev/null @@ -1,88 +0,0 @@ -// 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. - -#ifndef CHROME_BROWSER_PROFILES_REFCOUNTED_PROFILE_KEYED_SERVICE_FACTORY_H_ -#define CHROME_BROWSER_PROFILES_REFCOUNTED_PROFILE_KEYED_SERVICE_FACTORY_H_ - -#include "base/basictypes.h" -#include "base/compiler_specific.h" -#include "base/memory/ref_counted.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" - -class Profile; -class RefcountedProfileKeyedService; - -// A specialized ProfileKeyedServiceFactory that manages a -// RefcountedThreadSafe<>. -// -// While the factory returns RefcountedThreadSafe<>s, the factory itself is a -// base::NotThreadSafe. Only call methods on this object on the UI thread. -// -// Implementers of RefcountedProfileKeyedService should note that we guarantee -// that ShutdownOnUIThread() is called on the UI thread, but actual object -// destruction can happen anywhere. -class RefcountedProfileKeyedServiceFactory : public ProfileKeyedBaseFactory { - public: - // A function that supplies the instance of a ProfileKeyedService for a given - // Profile. This is used primarily for testing, where we want to feed a - // specific mock into the PKSF system. - typedef scoped_refptr - (*FactoryFunction)(content::BrowserContext* profile); - - // Associates |factory| with |profile| so that |factory| is used to create - // the ProfileKeyedService when requested. |factory| can be NULL to signal - // that ProfileKeyedService should be NULL. Multiple calls to - // SetTestingFactory() are allowed; previous services will be shut down. - void SetTestingFactory(content::BrowserContext* profile, - FactoryFunction factory); - - // Associates |factory| with |profile| and immediately returns the created - // ProfileKeyedService. Since the factory will be used immediately, it may - // not be NULL. - scoped_refptr SetTestingFactoryAndUse( - content::BrowserContext* profile, - FactoryFunction factory); - - protected: - RefcountedProfileKeyedServiceFactory(const char* name, - ProfileDependencyManager* manager); - virtual ~RefcountedProfileKeyedServiceFactory(); - - scoped_refptr GetServiceForProfile( - content::BrowserContext* profile, - bool create); - - // Maps |profile| to |service| with debug checks to prevent duplication. - void Associate(content::BrowserContext* profile, - const scoped_refptr& service); - - // All subclasses of RefcountedProfileKeyedServiceFactory must return a - // RefcountedProfileKeyedService instead of just a ProfileKeyedBase. - virtual scoped_refptr BuildServiceInstanceFor( - content::BrowserContext* profile) const = 0; - - virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE; - virtual void ProfileDestroyed(content::BrowserContext* profile) OVERRIDE; - virtual void SetEmptyTestingFactory( - content::BrowserContext* profile) OVERRIDE; - virtual void CreateServiceNow(content::BrowserContext* profile) OVERRIDE; - - private: - typedef std::map > - RefCountedStorage; - typedef std::map ProfileOverriddenFunctions; - - // The mapping between a Profile and its refcounted service. - RefCountedStorage mapping_; - - // The mapping between a Profile and its overridden FactoryFunction. - ProfileOverriddenFunctions factories_; - - DISALLOW_COPY_AND_ASSIGN(RefcountedProfileKeyedServiceFactory); -}; - -#endif // CHROME_BROWSER_PROFILES_REFCOUNTED_PROFILE_KEYED_SERVICE_FACTORY_H_ diff --git a/chrome/browser/profiles/startup_task_runner_service.h b/chrome/browser/profiles/startup_task_runner_service.h index f6298a3..b94f078 100644 --- a/chrome/browser/profiles/startup_task_runner_service.h +++ b/chrome/browser/profiles/startup_task_runner_service.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "base/memory/ref_counted.h" #include "base/threading/non_thread_safe.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class Profile; diff --git a/chrome/browser/profiles/startup_task_runner_service_factory.cc b/chrome/browser/profiles/startup_task_runner_service_factory.cc index 00ef076..24e50ad 100644 --- a/chrome/browser/profiles/startup_task_runner_service_factory.cc +++ b/chrome/browser/profiles/startup_task_runner_service_factory.cc @@ -5,8 +5,8 @@ #include "chrome/browser/profiles/startup_task_runner_service_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/profiles/startup_task_runner_service.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" StartupTaskRunnerServiceFactory::StartupTaskRunnerServiceFactory() : ProfileKeyedServiceFactory("StartupTaskRunnerServiceFactory", diff --git a/chrome/browser/profiles/startup_task_runner_service_factory.h b/chrome/browser/profiles/startup_task_runner_service_factory.h index 5811154..1876c63 100644 --- a/chrome/browser/profiles/startup_task_runner_service_factory.h +++ b/chrome/browser/profiles/startup_task_runner_service_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class StartupTaskRunnerService; class PrefRegistrySyncable; diff --git a/chrome/browser/search/instant_service.h b/chrome/browser/search/instant_service.h index 14738fc..a3d5fb4 100644 --- a/chrome/browser/search/instant_service.h +++ b/chrome/browser/search/instant_service.h @@ -12,8 +12,8 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/ref_counted.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/common/instant_restricted_id_cache.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/search/instant_service_factory.cc b/chrome/browser/search/instant_service_factory.cc index 0b1b4fb..f4b6daa 100644 --- a/chrome/browser/search/instant_service_factory.cc +++ b/chrome/browser/search/instant_service_factory.cc @@ -6,8 +6,8 @@ #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/search/instant_service.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static InstantService* InstantServiceFactory::GetForProfile(Profile* profile) { diff --git a/chrome/browser/search/instant_service_factory.h b/chrome/browser/search/instant_service_factory.h index 3be9347..0c31f05 100644 --- a/chrome/browser/search/instant_service_factory.h +++ b/chrome/browser/search/instant_service_factory.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class InstantService; class Profile; diff --git a/chrome/browser/search_engines/template_url_fetcher.h b/chrome/browser/search_engines/template_url_fetcher.h index 29ac93e..5e51cc7 100644 --- a/chrome/browser/search_engines/template_url_fetcher.h +++ b/chrome/browser/search_engines/template_url_fetcher.h @@ -7,7 +7,7 @@ #include "base/memory/scoped_vector.h" #include "base/string16.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "ui/gfx/native_widget_types.h" class GURL; diff --git a/chrome/browser/search_engines/template_url_fetcher_factory.cc b/chrome/browser/search_engines/template_url_fetcher_factory.cc index 415106f..256b198 100644 --- a/chrome/browser/search_engines/template_url_fetcher_factory.cc +++ b/chrome/browser/search_engines/template_url_fetcher_factory.cc @@ -6,9 +6,9 @@ #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/search_engines/template_url_fetcher.h" #include "chrome/browser/search_engines/template_url_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static TemplateURLFetcher* TemplateURLFetcherFactory::GetForProfile( diff --git a/chrome/browser/search_engines/template_url_fetcher_factory.h b/chrome/browser/search_engines/template_url_fetcher_factory.h index 7581cfe..7d19505 100644 --- a/chrome/browser/search_engines/template_url_fetcher_factory.h +++ b/chrome/browser/search_engines/template_url_fetcher_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_FETCHER_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; class TemplateURLFetcher; diff --git a/chrome/browser/search_engines/template_url_service.h b/chrome/browser/search_engines/template_url_service.h index 13bb8d9..2b8f5a2 100644 --- a/chrome/browser/search_engines/template_url_service.h +++ b/chrome/browser/search_engines/template_url_service.h @@ -15,9 +15,9 @@ #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/prefs/pref_change_registrar.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/search_engines/template_url_id.h" #include "chrome/browser/webdata/web_data_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "sync/api/sync_change.h" diff --git a/chrome/browser/search_engines/template_url_service_factory.cc b/chrome/browser/search_engines/template_url_service_factory.cc index 12da490..dc66f38 100644 --- a/chrome/browser/search_engines/template_url_service_factory.cc +++ b/chrome/browser/search_engines/template_url_service_factory.cc @@ -8,10 +8,10 @@ #include "chrome/browser/google/google_url_tracker_factory.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/profiles/incognito_helpers.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/search_engines/template_url_service.h" #include "chrome/browser/webdata/web_data_service_factory.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" // static diff --git a/chrome/browser/search_engines/template_url_service_factory.h b/chrome/browser/search_engines/template_url_service_factory.h index 107f167..81912de 100644 --- a/chrome/browser/search_engines/template_url_service_factory.h +++ b/chrome/browser/search_engines/template_url_service_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; class TemplateURLService; diff --git a/chrome/browser/sessions/session_service.h b/chrome/browser/sessions/session_service.h index c596bac..9aa049d 100644 --- a/chrome/browser/sessions/session_service.h +++ b/chrome/browser/sessions/session_service.h @@ -13,13 +13,13 @@ #include "base/memory/scoped_vector.h" #include "base/time.h" #include "chrome/browser/defaults.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/sessions/base_session_service.h" #include "chrome/browser/sessions/session_id.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_list_observer.h" #include "chrome/common/cancelable_task_tracker.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "ui/base/ui_base_types.h" diff --git a/chrome/browser/sessions/session_service_factory.cc b/chrome/browser/sessions/session_service_factory.cc index 938420a..3cbd0fb 100644 --- a/chrome/browser/sessions/session_service_factory.cc +++ b/chrome/browser/sessions/session_service_factory.cc @@ -5,8 +5,8 @@ #include "chrome/browser/sessions/session_service_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sessions/session_service.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static SessionService* SessionServiceFactory::GetForProfile(Profile* profile) { diff --git a/chrome/browser/sessions/session_service_factory.h b/chrome/browser/sessions/session_service_factory.h index 3500bc7..9e72a58 100644 --- a/chrome/browser/sessions/session_service_factory.h +++ b/chrome/browser/sessions/session_service_factory.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_SESSIONS_SESSION_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" #include "chrome/browser/sessions/session_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/sessions/tab_restore_service.h b/chrome/browser/sessions/tab_restore_service.h index 9f8d3b1..69edad5 100644 --- a/chrome/browser/sessions/tab_restore_service.h +++ b/chrome/browser/sessions/tab_restore_service.h @@ -11,10 +11,10 @@ #include "base/memory/ref_counted.h" #include "base/time.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/sessions/session_id.h" #include "chrome/browser/sessions/session_types.h" #include "chrome/browser/ui/host_desktop.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "components/sessions/serialized_navigation_entry.h" #include "content/public/browser/session_storage_namespace.h" #include "ui/base/window_open_disposition.h" diff --git a/chrome/browser/sessions/tab_restore_service_factory.cc b/chrome/browser/sessions/tab_restore_service_factory.cc index c4eba06..1daa2c9 100644 --- a/chrome/browser/sessions/tab_restore_service_factory.cc +++ b/chrome/browser/sessions/tab_restore_service_factory.cc @@ -5,8 +5,8 @@ #include "chrome/browser/sessions/tab_restore_service_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sessions/tab_restore_service.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static TabRestoreService* TabRestoreServiceFactory::GetForProfile(Profile* profile) { diff --git a/chrome/browser/sessions/tab_restore_service_factory.h b/chrome/browser/sessions/tab_restore_service_factory.h index f9e513e..d1eec59 100644 --- a/chrome/browser/sessions/tab_restore_service_factory.h +++ b/chrome/browser/sessions/tab_restore_service_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_SESSIONS_TAB_RESTORE_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class TabRestoreService; class Profile; diff --git a/chrome/browser/signin/about_signin_internals.h b/chrome/browser/signin/about_signin_internals.h index eac8175..971ffb6 100644 --- a/chrome/browser/signin/about_signin_internals.h +++ b/chrome/browser/signin/about_signin_internals.h @@ -11,11 +11,11 @@ #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/values.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/signin/signin_internals_util.h" #include "chrome/browser/signin/signin_manager.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/common/chrome_version_info.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class Profile; diff --git a/chrome/browser/signin/about_signin_internals_factory.cc b/chrome/browser/signin/about_signin_internals_factory.cc index 98f0128..6d88899 100644 --- a/chrome/browser/signin/about_signin_internals_factory.cc +++ b/chrome/browser/signin/about_signin_internals_factory.cc @@ -5,11 +5,11 @@ #include "chrome/browser/signin/about_signin_internals_factory.h" #include "base/prefs/pref_service.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/signin/about_signin_internals.h" #include "chrome/browser/signin/signin_internals_util.h" #include "chrome/browser/signin/token_service_factory.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" #include "google_apis/gaia/gaia_constants.h" diff --git a/chrome/browser/signin/about_signin_internals_factory.h b/chrome/browser/signin/about_signin_internals_factory.h index 9169420..9414dc8 100644 --- a/chrome/browser/signin/about_signin_internals_factory.h +++ b/chrome/browser/signin/about_signin_internals_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class AboutSigninInternals; class Profile; diff --git a/chrome/browser/signin/profile_oauth2_token_service.h b/chrome/browser/signin/profile_oauth2_token_service.h index 8804b6f..393b50c 100644 --- a/chrome/browser/signin/profile_oauth2_token_service.h +++ b/chrome/browser/signin/profile_oauth2_token_service.h @@ -8,9 +8,9 @@ #include #include "base/gtest_prod_util.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/signin/oauth2_token_service.h" #include "chrome/browser/signin/signin_global_error.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/signin/profile_oauth2_token_service_factory.cc b/chrome/browser/signin/profile_oauth2_token_service_factory.cc index 8f1723c..f6ce724 100644 --- a/chrome/browser/signin/profile_oauth2_token_service_factory.cc +++ b/chrome/browser/signin/profile_oauth2_token_service_factory.cc @@ -5,10 +5,10 @@ #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/signin/profile_oauth2_token_service.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/signin/token_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #if defined(OS_ANDROID) #include "chrome/browser/signin/android_profile_oauth2_token_service.h" diff --git a/chrome/browser/signin/profile_oauth2_token_service_factory.h b/chrome/browser/signin/profile_oauth2_token_service_factory.h index 1d350df..9b56e3e 100644 --- a/chrome/browser/signin/profile_oauth2_token_service_factory.h +++ b/chrome/browser/signin/profile_oauth2_token_service_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_SIGNIN_PROFILE_OAUTH2_TOKEN_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class ProfileOAuth2TokenService; class Profile; diff --git a/chrome/browser/signin/signin_manager.h b/chrome/browser/signin/signin_manager.h index 36b844c..9a8d3dc 100644 --- a/chrome/browser/signin/signin_manager.h +++ b/chrome/browser/signin/signin_manager.h @@ -31,10 +31,10 @@ #include "base/prefs/pref_change_registrar.h" #include "base/prefs/pref_member.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/signin/signin_internals_util.h" #include "chrome/browser/signin/signin_manager_base.h" #include "chrome/browser/signin/ubertoken_fetcher.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "google_apis/gaia/gaia_auth_consumer.h" diff --git a/chrome/browser/signin/signin_manager_base.h b/chrome/browser/signin/signin_manager_base.h index 1e59cb8..967fc91 100644 --- a/chrome/browser/signin/signin_manager_base.h +++ b/chrome/browser/signin/signin_manager_base.h @@ -33,8 +33,8 @@ #include "base/prefs/pref_change_registrar.h" #include "base/prefs/pref_member.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/signin/signin_internals_util.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class CookieSettings; class ProfileIOData; diff --git a/chrome/browser/signin/signin_manager_factory.cc b/chrome/browser/signin/signin_manager_factory.cc index 891a813..f31bc07 100644 --- a/chrome/browser/signin/signin_manager_factory.cc +++ b/chrome/browser/signin/signin_manager_factory.cc @@ -6,12 +6,12 @@ #include "base/prefs/pref_registry_simple.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/signin/chrome_signin_manager_delegate.h" #include "chrome/browser/signin/signin_manager.h" #include "chrome/browser/signin/token_service_factory.h" #include "chrome/browser/ui/global_error/global_error_service_factory.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" SigninManagerFactory::SigninManagerFactory() diff --git a/chrome/browser/signin/signin_manager_factory.h b/chrome/browser/signin/signin_manager_factory.h index d10df60..c1523cc 100644 --- a/chrome/browser/signin/signin_manager_factory.h +++ b/chrome/browser/signin/signin_manager_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class SigninManager; class SigninManagerBase; diff --git a/chrome/browser/signin/token_service.h b/chrome/browser/signin/token_service.h index 7d2d8fb..af9f2f4 100644 --- a/chrome/browser/signin/token_service.h +++ b/chrome/browser/signin/token_service.h @@ -51,9 +51,9 @@ #include "base/gtest_prod_util.h" #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/signin/signin_internals_util.h" #include "chrome/browser/webdata/web_data_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "google_apis/gaia/gaia_auth_consumer.h" #include "google_apis/gaia/gaia_auth_fetcher.h" #include "google_apis/gaia/google_service_auth_error.h" diff --git a/chrome/browser/signin/token_service_factory.cc b/chrome/browser/signin/token_service_factory.cc index d9645c2..1e326f5 100644 --- a/chrome/browser/signin/token_service_factory.cc +++ b/chrome/browser/signin/token_service_factory.cc @@ -4,9 +4,9 @@ #include "chrome/browser/signin/token_service_factory.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/signin/token_service.h" #include "chrome/browser/webdata/web_data_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" TokenServiceFactory::TokenServiceFactory() : ProfileKeyedServiceFactory("TokenService", diff --git a/chrome/browser/signin/token_service_factory.h b/chrome/browser/signin/token_service_factory.h index 6b6a338..92c815ee 100644 --- a/chrome/browser/signin/token_service_factory.h +++ b/chrome/browser/signin/token_service_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_SIGNIN_TOKEN_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class TokenService; class Profile; diff --git a/chrome/browser/speech/chrome_speech_recognition_preferences.cc b/chrome/browser/speech/chrome_speech_recognition_preferences.cc index d25cbc1..bc7cce7 100644 --- a/chrome/browser/speech/chrome_speech_recognition_preferences.cc +++ b/chrome/browser/speech/chrome_speech_recognition_preferences.cc @@ -8,9 +8,9 @@ #include "base/prefs/pref_service.h" #include "base/values.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_details.h" diff --git a/chrome/browser/speech/chrome_speech_recognition_preferences.h b/chrome/browser/speech/chrome_speech_recognition_preferences.h index b18fc2a..1a3d1a4c 100644 --- a/chrome/browser/speech/chrome_speech_recognition_preferences.h +++ b/chrome/browser/speech/chrome_speech_recognition_preferences.h @@ -12,8 +12,8 @@ #include "base/prefs/pref_change_registrar.h" #include "base/synchronization/lock.h" #include "base/threading/non_thread_safe.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" #include "content/public/browser/speech_recognition_preferences.h" class PrefService; diff --git a/chrome/browser/speech/tts_extension_loader_chromeos.cc b/chrome/browser/speech/tts_extension_loader_chromeos.cc index 71c1b6b..c454ec6 100644 --- a/chrome/browser/speech/tts_extension_loader_chromeos.cc +++ b/chrome/browser/speech/tts_extension_loader_chromeos.cc @@ -12,12 +12,12 @@ #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" #include "chrome/browser/speech/extension_api/tts_engine_extension_api.h" #include "chrome/browser/speech/tts_controller.h" #include "chrome/common/extensions/extension_constants.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" #include "grit/browser_resources.h" // Factory to load one instance of TtsExtensionLoaderChromeOs per profile. diff --git a/chrome/browser/speech/tts_extension_loader_chromeos.h b/chrome/browser/speech/tts_extension_loader_chromeos.h index 3757c05..b989de4 100644 --- a/chrome/browser/speech/tts_extension_loader_chromeos.h +++ b/chrome/browser/speech/tts_extension_loader_chromeos.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_SPEECH_TTS_EXTENSION_LOADER_CHROMEOS_H_ #include "chrome/browser/extensions/event_router.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" // Profile-keyed class that loads a built-in TTS component extension // into a given profile on Chrome OS. diff --git a/chrome/browser/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc index 7ac11ba..c222b54 100644 --- a/chrome/browser/spellchecker/spellcheck_factory.cc +++ b/chrome/browser/spellchecker/spellcheck_factory.cc @@ -8,9 +8,9 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/spellchecker/spellcheck_service.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" #include "content/public/browser/render_process_host.h" #include "grit/locale_settings.h" diff --git a/chrome/browser/spellchecker/spellcheck_factory.h b/chrome/browser/spellchecker/spellcheck_factory.h index 9f1de12..1399646 100644 --- a/chrome/browser/spellchecker/spellcheck_factory.h +++ b/chrome/browser/spellchecker/spellcheck_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class SpellcheckService; class Profile; diff --git a/chrome/browser/spellchecker/spellcheck_service.h b/chrome/browser/spellchecker/spellcheck_service.h index cc7ef95..b278961 100644 --- a/chrome/browser/spellchecker/spellcheck_service.h +++ b/chrome/browser/spellchecker/spellcheck_service.h @@ -10,11 +10,11 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/prefs/pref_change_registrar.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/spellchecker/spellcheck_custom_dictionary.h" #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" #include "chrome/browser/spellchecker/spelling_service_feedback.h" #include "chrome/common/spellcheck_common.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc index 04f4cff..2af216d 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc @@ -15,7 +15,6 @@ #include "chrome/browser/history/history_service.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" #include "chrome/browser/sync/glue/change_processor_mock.h" #include "chrome/browser/sync/glue/data_type_controller_mock.h" #include "chrome/browser/sync/glue/model_associator_mock.h" @@ -24,6 +23,7 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/test/base/profile_mock.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" #include "content/public/browser/notification_service.h" #include "content/public/test/test_browser_thread.h" #include "sync/api/sync_error.h" diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index 2c60f55..cb6731a 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -22,7 +22,6 @@ #include "base/timer.h" #include "chrome/browser/invalidation/invalidation_frontend.h" #include "chrome/browser/invalidation/invalidator_storage.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/signin/signin_global_error.h" #include "chrome/browser/sync/backend_unrecoverable_error_handler.h" #include "chrome/browser/sync/failed_datatypes_handler.h" @@ -33,6 +32,7 @@ #include "chrome/browser/sync/profile_sync_service_base.h" #include "chrome/browser/sync/profile_sync_service_observer.h" #include "chrome/browser/sync/sync_prefs.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_types.h" diff --git a/chrome/browser/sync/profile_sync_service_factory.cc b/chrome/browser/sync/profile_sync_service_factory.cc index 38fb2ea..635a119 100644 --- a/chrome/browser/sync/profile_sync_service_factory.cc +++ b/chrome/browser/sync/profile_sync_service_factory.cc @@ -14,7 +14,6 @@ #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/password_manager/password_store_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/sessions/tab_restore_service_factory.h" @@ -27,6 +26,7 @@ #include "chrome/browser/ui/global_error/global_error_service_factory.h" #include "chrome/browser/webdata/web_data_service_factory.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static ProfileSyncServiceFactory* ProfileSyncServiceFactory::GetInstance() { diff --git a/chrome/browser/sync/profile_sync_service_factory.h b/chrome/browser/sync/profile_sync_service_factory.h index f8550b5..f632f046 100644 --- a/chrome/browser/sync/profile_sync_service_factory.h +++ b/chrome/browser/sync/profile_sync_service_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; class ProfileSyncService; diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc index 99608b98..d84c5b5 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -21,7 +21,6 @@ #include "chrome/browser/history/history_service.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/history/history_types.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" #include "chrome/browser/signin/signin_manager.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/signin/token_service_factory.h" @@ -40,6 +39,7 @@ #include "chrome/common/chrome_notification_types.h" #include "chrome/test/base/profile_mock.h" #include "chrome/test/base/testing_profile.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" #include "content/public/browser/notification_service.h" #include "google_apis/gaia/gaia_constants.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/sync_file_system/sync_file_system_service.cc b/chrome/browser/sync_file_system/sync_file_system_service.cc index e57dc54..1fbbcca 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service.cc +++ b/chrome/browser/sync_file_system/sync_file_system_service.cc @@ -12,7 +12,6 @@ #include "base/stl_util.h" #include "chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync_file_system/drive_file_sync_service.h" @@ -20,6 +19,7 @@ #include "chrome/browser/sync_file_system/sync_event_observer.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/extensions/extension.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_service.h" diff --git a/chrome/browser/sync_file_system/sync_file_system_service.h b/chrome/browser/sync_file_system/sync_file_system_service.h index 0cddd28..b051490 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service.h +++ b/chrome/browser/sync_file_system/sync_file_system_service.h @@ -14,13 +14,13 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/timer.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/sync/profile_sync_service_observer.h" #include "chrome/browser/sync_file_system/conflict_resolution_policy.h" #include "chrome/browser/sync_file_system/file_status_observer.h" #include "chrome/browser/sync_file_system/local_file_sync_service.h" #include "chrome/browser/sync_file_system/remote_file_sync_service.h" #include "chrome/browser/sync_file_system/sync_service_state.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/sync_file_system/sync_file_system_service_factory.cc b/chrome/browser/sync_file_system/sync_file_system_service_factory.cc index 94f2e5d..d13cfc8 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service_factory.cc +++ b/chrome/browser/sync_file_system/sync_file_system_service_factory.cc @@ -7,10 +7,10 @@ #include "base/command_line.h" #include "chrome/browser/google_apis/drive_notification_manager_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync_file_system/drive_file_sync_service.h" #include "chrome/browser/sync_file_system/sync_file_system_service.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "webkit/fileapi/syncable/syncable_file_system_util.h" namespace sync_file_system { diff --git a/chrome/browser/sync_file_system/sync_file_system_service_factory.h b/chrome/browser/sync_file_system/sync_file_system_service_factory.h index 51e1122..69ea9d0 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service_factory.h +++ b/chrome/browser/sync_file_system/sync_file_system_service_factory.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/themes/theme_service.h b/chrome/browser/themes/theme_service.h index 4baa6af..96d4ea3 100644 --- a/chrome/browser/themes/theme_service.h +++ b/chrome/browser/themes/theme_service.h @@ -14,7 +14,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/threading/non_thread_safe.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "ui/base/theme_provider.h" diff --git a/chrome/browser/themes/theme_service_factory.cc b/chrome/browser/themes/theme_service_factory.cc index 9264aa1..3a7e8ec 100644 --- a/chrome/browser/themes/theme_service_factory.cc +++ b/chrome/browser/themes/theme_service_factory.cc @@ -9,9 +9,9 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" #if defined(TOOLKIT_GTK) diff --git a/chrome/browser/themes/theme_service_factory.h b/chrome/browser/themes/theme_service_factory.h index f645f75..e786ef9 100644 --- a/chrome/browser/themes/theme_service_factory.h +++ b/chrome/browser/themes/theme_service_factory.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; class ThemeService; diff --git a/chrome/browser/thumbnails/thumbnail_service.h b/chrome/browser/thumbnails/thumbnail_service.h index 9daafa7..6c0eacf 100644 --- a/chrome/browser/thumbnails/thumbnail_service.h +++ b/chrome/browser/thumbnails/thumbnail_service.h @@ -5,8 +5,8 @@ #ifndef CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_H_ #define CHROME_BROWSER_THUMBNAILS_THUMBNAIL_SERVICE_H_ -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" #include "chrome/common/thumbnail_score.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" #include "googleurl/src/gurl.h" #include "ui/gfx/image/image.h" diff --git a/chrome/browser/thumbnails/thumbnail_service_factory.cc b/chrome/browser/thumbnails/thumbnail_service_factory.cc index 4de144a..9a2592e 100644 --- a/chrome/browser/thumbnails/thumbnail_service_factory.cc +++ b/chrome/browser/thumbnails/thumbnail_service_factory.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "chrome/browser/thumbnails/thumbnail_service.h" #include "chrome/browser/thumbnails/thumbnail_service_impl.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" using thumbnails::ThumbnailService; using thumbnails::ThumbnailServiceImpl; diff --git a/chrome/browser/thumbnails/thumbnail_service_factory.h b/chrome/browser/thumbnails/thumbnail_service_factory.h index 9126a6a..655cfa6 100644 --- a/chrome/browser/thumbnails/thumbnail_service_factory.h +++ b/chrome/browser/thumbnails/thumbnail_service_factory.h @@ -7,7 +7,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h" class Profile; diff --git a/chrome/browser/ui/ash/app_sync_ui_state.h b/chrome/browser/ui/ash/app_sync_ui_state.h index 225232b..e138c91 100644 --- a/chrome/browser/ui/ash/app_sync_ui_state.h +++ b/chrome/browser/ui/ash/app_sync_ui_state.h @@ -9,8 +9,8 @@ #include "base/compiler_specific.h" #include "base/observer_list.h" #include "base/timer.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/sync/profile_sync_service_observer.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/ui/ash/app_sync_ui_state_factory.cc b/chrome/browser/ui/ash/app_sync_ui_state_factory.cc index e284734..01ad273 100644 --- a/chrome/browser/ui/ash/app_sync_ui_state_factory.cc +++ b/chrome/browser/ui/ash/app_sync_ui_state_factory.cc @@ -5,9 +5,9 @@ #include "chrome/browser/ui/ash/app_sync_ui_state_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/ui/ash/app_sync_ui_state.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static AppSyncUIState* AppSyncUIStateFactory::GetForProfile(Profile* profile) { diff --git a/chrome/browser/ui/ash/app_sync_ui_state_factory.h b/chrome/browser/ui/ash/app_sync_ui_state_factory.h index 1d6b6b1..bcadd93 100644 --- a/chrome/browser/ui/ash/app_sync_ui_state_factory.h +++ b/chrome/browser/ui/ash/app_sync_ui_state_factory.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class AppSyncUIState; class Profile; diff --git a/chrome/browser/ui/find_bar/find_bar_state.h b/chrome/browser/ui/find_bar/find_bar_state.h index b4cf6a0..7ed5678 100644 --- a/chrome/browser/ui/find_bar/find_bar_state.h +++ b/chrome/browser/ui/find_bar/find_bar_state.h @@ -10,7 +10,7 @@ #include "base/basictypes.h" #include "base/string16.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class Profile; diff --git a/chrome/browser/ui/find_bar/find_bar_state_factory.cc b/chrome/browser/ui/find_bar/find_bar_state_factory.cc index b0488a4..a29aebc 100644 --- a/chrome/browser/ui/find_bar/find_bar_state_factory.cc +++ b/chrome/browser/ui/find_bar/find_bar_state_factory.cc @@ -6,8 +6,8 @@ #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/ui/find_bar/find_bar_state.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static FindBarState* FindBarStateFactory::GetForProfile(Profile* profile) { diff --git a/chrome/browser/ui/find_bar/find_bar_state_factory.h b/chrome/browser/ui/find_bar/find_bar_state_factory.h index ace19a3..cee7411 100644 --- a/chrome/browser/ui/find_bar/find_bar_state_factory.h +++ b/chrome/browser/ui/find_bar/find_bar_state_factory.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" #include "base/string16.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; class FindBarState; diff --git a/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc b/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc index 017104c..0c7d02a 100644 --- a/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc +++ b/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc @@ -13,9 +13,9 @@ #include "base/prefs/pref_service.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_service.h" diff --git a/chrome/browser/ui/gesture_prefs_observer_factory_aura.h b/chrome/browser/ui/gesture_prefs_observer_factory_aura.h index f49a3ae..9e8fa0f 100644 --- a/chrome/browser/ui/gesture_prefs_observer_factory_aura.h +++ b/chrome/browser/ui/gesture_prefs_observer_factory_aura.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class PrefService; class Profile; diff --git a/chrome/browser/ui/global_error/global_error_service.h b/chrome/browser/ui/global_error/global_error_service.h index 8bc42d3..a418877 100644 --- a/chrome/browser/ui/global_error/global_error_service.h +++ b/chrome/browser/ui/global_error/global_error_service.h @@ -8,7 +8,7 @@ #include #include "base/basictypes.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class GlobalError; class Profile; diff --git a/chrome/browser/ui/global_error/global_error_service_factory.cc b/chrome/browser/ui/global_error/global_error_service_factory.cc index 09c3d15..7c78f642 100644 --- a/chrome/browser/ui/global_error/global_error_service_factory.cc +++ b/chrome/browser/ui/global_error/global_error_service_factory.cc @@ -6,8 +6,8 @@ #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/ui/global_error/global_error_service.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static GlobalErrorService* GlobalErrorServiceFactory::GetForProfile(Profile* profile) { diff --git a/chrome/browser/ui/global_error/global_error_service_factory.h b/chrome/browser/ui/global_error/global_error_service_factory.h index badb03e..09df139 100644 --- a/chrome/browser/ui/global_error/global_error_service_factory.h +++ b/chrome/browser/ui/global_error/global_error_service_factory.h @@ -8,7 +8,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class GlobalErrorService; class Profile; diff --git a/chrome/browser/ui/tabs/pinned_tab_service.h b/chrome/browser/ui/tabs/pinned_tab_service.h index 649248e..b093d7f 100644 --- a/chrome/browser/ui/tabs/pinned_tab_service.h +++ b/chrome/browser/ui/tabs/pinned_tab_service.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_TABS_PINNED_TAB_SERVICE_H_ #include "base/compiler_specific.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" diff --git a/chrome/browser/ui/tabs/pinned_tab_service_factory.cc b/chrome/browser/ui/tabs/pinned_tab_service_factory.cc index 1d86612..4496289 100644 --- a/chrome/browser/ui/tabs/pinned_tab_service_factory.cc +++ b/chrome/browser/ui/tabs/pinned_tab_service_factory.cc @@ -5,8 +5,8 @@ #include "chrome/browser/ui/tabs/pinned_tab_service_factory.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/ui/tabs/pinned_tab_service.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static PinnedTabService* PinnedTabServiceFactory::GetForProfile( diff --git a/chrome/browser/ui/tabs/pinned_tab_service_factory.h b/chrome/browser/ui/tabs/pinned_tab_service_factory.h index 9137bf2..90e937f 100644 --- a/chrome/browser/ui/tabs/pinned_tab_service_factory.h +++ b/chrome/browser/ui/tabs/pinned_tab_service_factory.h @@ -7,7 +7,7 @@ #include "base/compiler_specific.h" #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class PinnedTabService; class Profile; diff --git a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc index a85ccc4..7d0a1d9 100644 --- a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc +++ b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc @@ -6,9 +6,9 @@ #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static NTPResourceCache* AppResourceCacheFactory::GetForProfile(Profile* profile) { diff --git a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h index 1b53d50..52672e4 100644 --- a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h +++ b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_WEBUI_NTP_APP_RESOURCE_CACHE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class NTPResourceCache; class Profile; diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.h b/chrome/browser/ui/webui/ntp/ntp_resource_cache.h index e52f4f8..8d020c0 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.h +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.h @@ -10,7 +10,7 @@ #include "base/memory/ref_counted.h" #include "base/prefs/pref_change_registrar.h" #include "base/string16.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" 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 515f3ac..c1165e8 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc @@ -6,9 +6,9 @@ #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/webui/ntp/ntp_resource_cache.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static NTPResourceCache* NTPResourceCacheFactory::GetForProfile(Profile* profile) { diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h index 8d7145b..3137f06 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_WEBUI_NTP_NTP_RESOURCE_CACHE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class NTPResourceCache; class Profile; diff --git a/chrome/browser/ui/webui/signin/login_ui_service.h b/chrome/browser/ui/webui/signin/login_ui_service.h index d8a57de..b30233dd 100644 --- a/chrome/browser/ui/webui/signin/login_ui_service.h +++ b/chrome/browser/ui/webui/signin/login_ui_service.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" #include "base/observer_list.h" -#include "chrome/browser/profiles/profile_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" class Browser; class Profile; diff --git a/chrome/browser/ui/webui/signin/login_ui_service_factory.cc b/chrome/browser/ui/webui/signin/login_ui_service_factory.cc index 9ae2d26..4242a41 100644 --- a/chrome/browser/ui/webui/signin/login_ui_service_factory.cc +++ b/chrome/browser/ui/webui/signin/login_ui_service_factory.cc @@ -5,10 +5,10 @@ #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" #include "base/prefs/pref_service.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/signin/signin_manager.h" #include "chrome/browser/ui/webui/signin/login_ui_service.h" #include "chrome/common/pref_names.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" LoginUIServiceFactory::LoginUIServiceFactory() : ProfileKeyedServiceFactory("LoginUIServiceFactory", diff --git a/chrome/browser/ui/webui/signin/login_ui_service_factory.h b/chrome/browser/ui/webui/signin/login_ui_service_factory.h index d5ebb33..b838d5e 100644 --- a/chrome/browser/ui/webui/signin/login_ui_service_factory.h +++ b/chrome/browser/ui/webui/signin/login_ui_service_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class LoginUIService; class Profile; diff --git a/chrome/browser/usb/usb_service.h b/chrome/browser/usb/usb_service.h index 3987786d3..716359b 100644 --- a/chrome/browser/usb/usb_service.h +++ b/chrome/browser/usb/usb_service.h @@ -11,8 +11,8 @@ #include "base/basictypes.h" #include "base/threading/platform_thread.h" -#include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/usb/usb_device.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" #include "third_party/libusb/src/libusb/libusb.h" class UsbEventHandler; diff --git a/chrome/browser/usb/usb_service_factory.cc b/chrome/browser/usb/usb_service_factory.cc index 6b91c19..cd91233 100644 --- a/chrome/browser/usb/usb_service_factory.cc +++ b/chrome/browser/usb/usb_service_factory.cc @@ -6,8 +6,8 @@ #include "base/memory/singleton.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/usb/usb_service.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" UsbServiceFactory* UsbServiceFactory::GetInstance() { return Singleton::get(); diff --git a/chrome/browser/usb/usb_service_factory.h b/chrome/browser/usb/usb_service_factory.h index 662b46a..7a4b691 100644 --- a/chrome/browser/usb/usb_service_factory.h +++ b/chrome/browser/usb/usb_service_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_USB_USB_SERVICE_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" class Profile; class UsbService; diff --git a/chrome/browser/user_style_sheet_watcher.h b/chrome/browser/user_style_sheet_watcher.h index baad82d..711f188 100644 --- a/chrome/browser/user_style_sheet_watcher.h +++ b/chrome/browser/user_style_sheet_watcher.h @@ -10,7 +10,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/sequenced_task_runner_helpers.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "googleurl/src/gurl.h" diff --git a/chrome/browser/user_style_sheet_watcher_factory.cc b/chrome/browser/user_style_sheet_watcher_factory.cc index 307dd1c..fb572fb 100644 --- a/chrome/browser/user_style_sheet_watcher_factory.cc +++ b/chrome/browser/user_style_sheet_watcher_factory.cc @@ -6,8 +6,8 @@ #include "chrome/browser/profiles/incognito_helpers.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/user_style_sheet_watcher.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" // static scoped_refptr diff --git a/chrome/browser/user_style_sheet_watcher_factory.h b/chrome/browser/user_style_sheet_watcher_factory.h index cfdb10d..e3e744a 100644 --- a/chrome/browser/user_style_sheet_watcher_factory.h +++ b/chrome/browser/user_style_sheet_watcher_factory.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_USER_STYLE_SHEET_WATCHER_FACTORY_H_ #include "base/memory/singleton.h" -#include "chrome/browser/profiles/refcounted_profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h" class Profile; class UserStyleSheetWatcher; diff --git a/chrome/browser/webdata/web_data_service_factory.cc b/chrome/browser/webdata/web_data_service_factory.cc index 943de85..f3514c1 100644 --- a/chrome/browser/webdata/web_data_service_factory.cc +++ b/chrome/browser/webdata/web_data_service_factory.cc @@ -8,7 +8,6 @@ #include "base/files/file_path.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/incognito_helpers.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sync/glue/sync_start_util.h" #include "chrome/browser/ui/profile_error_dialog.h" #include "chrome/browser/webdata/autocomplete_syncable_service.h" @@ -22,6 +21,7 @@ #include "components/autofill/browser/autofill_country.h" #include "components/autofill/browser/webdata/autofill_table.h" #include "components/autofill/browser/webdata/autofill_webdata_service.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/webdata/common/webdata_constants.h" #include "content/public/browser/browser_thread.h" #include "grit/chromium_strings.h" diff --git a/chrome/browser/webdata/web_data_service_factory.h b/chrome/browser/webdata/web_data_service_factory.h index 9f88d42..5d3d4a9 100644 --- a/chrome/browser/webdata/web_data_service_factory.h +++ b/chrome/browser/webdata/web_data_service_factory.h @@ -9,8 +9,8 @@ #include "base/memory/ref_counted.h" #include "base/memory/singleton.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_keyed_service.h" -#include "chrome/browser/profiles/profile_keyed_service_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" #include "components/webdata/common/web_database_service.h" class WebDataService; diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 911930e..1d4bb6f 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -27,6 +27,7 @@ 'safe_browsing_report_proto', 'variations_seed_proto', '../build/temp_gyp/googleurl.gyp:googleurl', + '../components/components.gyp:browser_context_keyed_service', '../components/components.gyp:encryptor', '../components/components.gyp:sessions', '../components/components.gyp:user_prefs', @@ -1564,9 +1565,6 @@ 'browser/profiles/chrome_browser_main_extra_parts_profiles.h', 'browser/profiles/chrome_version_service.cc', 'browser/profiles/chrome_version_service.h', - 'browser/profiles/dependency_graph.cc', - 'browser/profiles/dependency_graph.h', - 'browser/profiles/dependency_node.h', 'browser/profiles/gaia_info_update_service.cc', 'browser/profiles/gaia_info_update_service.h', 'browser/profiles/gaia_info_update_service_factory.cc', @@ -1581,8 +1579,6 @@ 'browser/profiles/profile.h', 'browser/profiles/profile_android.cc', 'browser/profiles/profile_android.h', - 'browser/profiles/profile_dependency_manager.cc', - 'browser/profiles/profile_dependency_manager.h', 'browser/profiles/profile_destroyer.cc', 'browser/profiles/profile_destroyer.h', 'browser/profiles/profile_downloader.cc', @@ -1600,11 +1596,6 @@ 'browser/profiles/profile_info_util.h', 'browser/profiles/profile_io_data.cc', 'browser/profiles/profile_io_data.h', - 'browser/profiles/profile_keyed_base_factory.h', - 'browser/profiles/profile_keyed_base_factory.cc', - 'browser/profiles/profile_keyed_service.h', - 'browser/profiles/profile_keyed_service_factory.cc', - 'browser/profiles/profile_keyed_service_factory.h', 'browser/profiles/profile_manager.cc', 'browser/profiles/profile_manager.h', 'browser/profiles/profile_metrics.cc', @@ -1614,10 +1605,6 @@ 'browser/profiles/profile_shortcut_manager_stub.cc', 'browser/profiles/profile_shortcut_manager_win.cc', 'browser/profiles/profile_shortcut_manager_win.h', - 'browser/profiles/refcounted_profile_keyed_service.cc', - 'browser/profiles/refcounted_profile_keyed_service.h', - 'browser/profiles/refcounted_profile_keyed_service_factory.cc', - 'browser/profiles/refcounted_profile_keyed_service_factory.h', 'browser/profiles/startup_task_runner_service.cc', 'browser/profiles/startup_task_runner_service.h', 'browser/profiles/startup_task_runner_service_factory.cc', diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index 44549c6..856a0ca 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -1040,10 +1040,8 @@ 'browser/process_singleton_mac_unittest.cc', 'browser/profile_resetter/profile_resetter_unittest.cc', 'browser/profiles/avatar_menu_model_unittest.cc', - 'browser/profiles/dependency_graph_unittest.cc', 'browser/profiles/gaia_info_update_service_unittest.cc', 'browser/profiles/off_the_record_profile_impl_unittest.cc', - 'browser/profiles/profile_dependency_manager_unittest.cc', 'browser/profiles/profile_downloader_unittest.cc', 'browser/profiles/profile_info_cache_unittest.cc', 'browser/profiles/profile_info_cache_unittest.h', diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index a1efcfc..97f3d1c 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -1564,10 +1564,6 @@ const char kFileManagerExtensionPath[] = "filemgr-ext-path"; // Enables overriding the path of image loader extension. const char kImageLoaderExtensionPath[] = "image-loader-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 8b979d2..6d429b2 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -439,7 +439,6 @@ extern const char kWaitForMutex[]; #ifndef NDEBUG extern const char kFileManagerExtensionPath[]; extern const char kImageLoaderExtensionPath[]; -extern const char kDumpProfileDependencyGraph[]; #endif #if defined(GOOGLE_CHROME_BUILD) diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index a8b6e85..0c51fe9 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -45,7 +45,6 @@ #include "chrome/browser/prefs/pref_service_syncable.h" #include "chrome/browser/prerender/prerender_manager.h" #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h" -#include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/profiles/storage_partition_descriptor.h" #include "chrome/browser/search_engines/template_url_fetcher_factory.h" #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" @@ -59,6 +58,7 @@ #include "chrome/test/base/history_index_restore_observer.h" #include "chrome/test/base/testing_pref_service_syncable.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" #include "components/user_prefs/user_prefs.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" diff --git a/components/browser_context_keyed_service.gypi b/components/browser_context_keyed_service.gypi new file mode 100644 index 0000000..03bd8f2 --- /dev/null +++ b/components/browser_context_keyed_service.gypi @@ -0,0 +1,38 @@ +# Copyright 2013 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. + +{ + 'targets': [ + { + 'target_name': 'browser_context_keyed_service', + 'type': 'static_library', + 'include_dirs': [ + '..', + ], + 'dependencies': [ + '../base/base.gyp:base', + '../base/base.gyp:base_prefs', + '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', + '../content/content.gyp:content_common', + 'user_prefs', + ], + 'sources': [ + 'browser_context_keyed_service/browser_context_dependency_manager.cc', + 'browser_context_keyed_service/browser_context_dependency_manager.h', + 'browser_context_keyed_service/browser_context_keyed_base_factory.h', + 'browser_context_keyed_service/browser_context_keyed_base_factory.cc', + 'browser_context_keyed_service/browser_context_keyed_service.h', + 'browser_context_keyed_service/browser_context_keyed_service_factory.cc', + 'browser_context_keyed_service/browser_context_keyed_service_factory.h', + 'browser_context_keyed_service/dependency_graph.cc', + 'browser_context_keyed_service/dependency_graph.h', + 'browser_context_keyed_service/dependency_node.h', + 'browser_context_keyed_service/refcounted_browser_context_keyed_service.cc', + 'browser_context_keyed_service/refcounted_browser_context_keyed_service.h', + 'browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.cc', + 'browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h', + ], + }, + ], +} diff --git a/components/browser_context_keyed_service/DEPS b/components/browser_context_keyed_service/DEPS new file mode 100644 index 0000000..1c35d9c --- /dev/null +++ b/components/browser_context_keyed_service/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+content/public/browser", +] diff --git a/components/browser_context_keyed_service/browser_context_dependency_manager.cc b/components/browser_context_keyed_service/browser_context_dependency_manager.cc new file mode 100644 index 0000000..44d40b4 --- /dev/null +++ b/components/browser_context_keyed_service/browser_context_dependency_manager.cc @@ -0,0 +1,149 @@ +// Copyright (c) 2013 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. + +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" + +#include +#include +#include + +#include "base/bind.h" +#include "components/browser_context_keyed_service/browser_context_keyed_base_factory.h" +#include "content/public/browser/browser_context.h" + +#ifndef NDEBUG +#include "base/command_line.h" +#include "base/file_util.h" +#include "content/public/common/content_switches.h" +#endif + +class Profile; + +void ProfileDependencyManager::AddComponent( + ProfileKeyedBaseFactory* component) { + dependency_graph_.AddNode(component); +} + +void ProfileDependencyManager::RemoveComponent( + ProfileKeyedBaseFactory* component) { + dependency_graph_.RemoveNode(component); +} + +void ProfileDependencyManager::AddEdge(ProfileKeyedBaseFactory* depended, + ProfileKeyedBaseFactory* dependee) { + dependency_graph_.AddEdge(depended, dependee); +} + +void ProfileDependencyManager::CreateProfileServices( + content::BrowserContext* profile, bool is_testing_profile) { +#ifndef NDEBUG + // Unmark |profile| as dead. This exists because of unit tests, which will + // often have similar stack structures. 0xWhatever might be created, go out + // of scope, and then a new Profile object might be created at 0xWhatever. + dead_profile_pointers_.erase(profile); +#endif + + std::vector construction_order; + if (!dependency_graph_.GetConstructionOrder(&construction_order)) { + NOTREACHED(); + } + +#ifndef NDEBUG + DumpProfileDependencies(profile); +#endif + + for (size_t i = 0; i < construction_order.size(); i++) { + ProfileKeyedBaseFactory* factory = + static_cast(construction_order[i]); + + if (!profile->IsOffTheRecord()) { + // We only register preferences on normal profiles because the incognito + // profile shares the pref service with the normal one. + factory->RegisterUserPrefsOnProfile(profile); + } + + if (is_testing_profile && factory->ServiceIsNULLWhileTesting()) { + factory->SetEmptyTestingFactory(profile); + } else if (factory->ServiceIsCreatedWithProfile()) { + // Create the service. + factory->CreateServiceNow(profile); + } + } +} + +void ProfileDependencyManager::DestroyProfileServices( + content::BrowserContext* profile) { + std::vector destruction_order; + if (!dependency_graph_.GetDestructionOrder(&destruction_order)) { + NOTREACHED(); + } + +#ifndef NDEBUG + DumpProfileDependencies(profile); +#endif + + for (size_t i = 0; i < destruction_order.size(); i++) { + ProfileKeyedBaseFactory* factory = + static_cast(destruction_order[i]); + factory->ProfileShutdown(profile); + } + +#ifndef NDEBUG + // The profile is now dead to the rest of the program. + dead_profile_pointers_.insert(profile); +#endif + + for (size_t i = 0; i < destruction_order.size(); i++) { + ProfileKeyedBaseFactory* factory = + static_cast(destruction_order[i]); + factory->ProfileDestroyed(profile); + } +} + +#ifndef NDEBUG +void ProfileDependencyManager::AssertProfileWasntDestroyed( + content::BrowserContext* profile) { + if (dead_profile_pointers_.find(profile) != dead_profile_pointers_.end()) { + NOTREACHED() << "Attempted to access a Profile that was ShutDown(). This " + << "is most likely a heap smasher in progress. After " + << "ProfileKeyedService::Shutdown() completes, your service " + << "MUST NOT refer to depended Profile services again."; + } +} +#endif + +// static +ProfileDependencyManager* ProfileDependencyManager::GetInstance() { + return Singleton::get(); +} + +ProfileDependencyManager::ProfileDependencyManager() { +} + +ProfileDependencyManager::~ProfileDependencyManager() { +} + +#ifndef NDEBUG +namespace { + +std::string ProfileKeyedBaseFactoryGetNodeName(DependencyNode* node) { + return static_cast(node)->name(); +} + +} // namespace + +void ProfileDependencyManager::DumpProfileDependencies( + content::BrowserContext* profile) { + // 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::kDumpBrowserContextDependencyGraph)) { + base::FilePath dot_file = + profile->GetPath().AppendASCII("browser-context-dependencies.dot"); + std::string contents = dependency_graph_.DumpAsGraphviz( + "Profile", base::Bind(&ProfileKeyedBaseFactoryGetNodeName)); + file_util::WriteFile(dot_file, contents.c_str(), contents.size()); + } +} +#endif // NDEBUG diff --git a/components/browser_context_keyed_service/browser_context_dependency_manager.h b/components/browser_context_keyed_service/browser_context_dependency_manager.h new file mode 100644 index 0000000..2b5ba0e --- /dev/null +++ b/components/browser_context_keyed_service/browser_context_dependency_manager.h @@ -0,0 +1,86 @@ +// 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. + +#ifndef COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_DEPENDENCY_MANAGER_H_ +#define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_DEPENDENCY_MANAGER_H_ + +#include "base/memory/singleton.h" +#include "components/browser_context_keyed_service/dependency_graph.h" + +#ifndef NDEBUG +#include +#endif + +class ProfileKeyedBaseFactory; + +namespace content { +class BrowserContext; +} + +// A singleton that listens for profile destruction notifications and +// rebroadcasts them to each ProfileKeyedBaseFactory in a safe order based +// on the stated dependencies by each service. +class ProfileDependencyManager { + public: + // Adds/Removes a component from our list of live components. Removing will + // also remove live dependency links. + void AddComponent(ProfileKeyedBaseFactory* component); + void RemoveComponent(ProfileKeyedBaseFactory* component); + + // Adds a dependency between two factories. + void AddEdge(ProfileKeyedBaseFactory* depended, + ProfileKeyedBaseFactory* dependee); + + // Called by each Profile to alert us of its creation. Several services want + // to be started when a profile is created. Testing configuration is also + // done at this time. (If you want your ProfileKeyedService to be started + // with the Profile, override ProfileKeyedBaseFactory:: + // ServiceIsCreatedWithProfile() to return true.) + void CreateProfileServices(content::BrowserContext* profile, + bool is_testing_profile); + + // Called by each Profile to alert us that we should destroy services + // associated with it. + // + // Why not use the existing PROFILE_DESTROYED notification? + // + // - Because we need to do everything here after the application has handled + // being notified about PROFILE_DESTROYED. + // - Because this class is a singleton and Singletons can't rely on + // NotificationService in unit tests because NotificationService is + // replaced in many tests. + void DestroyProfileServices(content::BrowserContext* profile); + +#ifndef NDEBUG + // Debugging assertion called as part of GetServiceForProfile in debug + // mode. This will NOTREACHED() whenever the user is trying to access a stale + // Profile*. + void AssertProfileWasntDestroyed(content::BrowserContext* profile); +#endif + + static ProfileDependencyManager* GetInstance(); + + private: + friend class ProfileDependencyManagerUnittests; + friend struct DefaultSingletonTraits; + + ProfileDependencyManager(); + virtual ~ProfileDependencyManager(); + +#ifndef NDEBUG + void DumpProfileDependencies(content::BrowserContext* profile); +#endif + + DependencyGraph dependency_graph_; + +#ifndef NDEBUG + // A list of profile objects that have gone through the Shutdown() + // phase. These pointers are most likely invalid, but we keep track of their + // locations in memory so we can nicely assert if we're asked to do anything + // with them. + std::set dead_profile_pointers_; +#endif +}; + +#endif // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_DEPENDENCY_MANAGER_H_ diff --git a/components/browser_context_keyed_service/browser_context_dependency_manager_unittest.cc b/components/browser_context_keyed_service/browser_context_dependency_manager_unittest.cc new file mode 100644 index 0000000..a0c03ff --- /dev/null +++ b/components/browser_context_keyed_service/browser_context_dependency_manager_unittest.cc @@ -0,0 +1,173 @@ +// 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. + +#include "testing/gtest/include/gtest/gtest.h" + +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" + +class ProfileDependencyManagerUnittests : public ::testing::Test { + protected: + // To get around class access: + void DependOn(ProfileKeyedServiceFactory* child, + ProfileKeyedServiceFactory* parent) { + child->DependsOn(parent); + } + + ProfileDependencyManager* manager() { return &dependency_manager_; } + + std::vector* shutdown_order() { return &shutdown_order_; } + + private: + ProfileDependencyManager dependency_manager_; + + std::vector shutdown_order_; +}; + +class TestService : public ProfileKeyedServiceFactory { + public: + TestService(const std::string& name, + std::vector* fill_on_shutdown, + ProfileDependencyManager* manager) + : ProfileKeyedServiceFactory("TestService", manager), + name_(name), + fill_on_shutdown_(fill_on_shutdown) { + } + + virtual ProfileKeyedService* BuildServiceInstanceFor( + content::BrowserContext* profile) const OVERRIDE { + ADD_FAILURE() << "This isn't part of the tests!"; + return NULL; + } + + virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE { + fill_on_shutdown_->push_back(name_); + } + + private: + const std::string name_; + std::vector* fill_on_shutdown_; +}; + +// Tests that we can deal with a single component. +TEST_F(ProfileDependencyManagerUnittests, SingleCase) { + TestService service("service", shutdown_order(), manager()); + + manager()->DestroyProfileServices(NULL); + + ASSERT_EQ(1U, shutdown_order()->size()); + EXPECT_STREQ("service", (*shutdown_order())[0].c_str()); +} + +// Tests that we get a simple one component depends on the other case. +TEST_F(ProfileDependencyManagerUnittests, SimpleDependency) { + TestService parent("parent", shutdown_order(), manager()); + TestService child("child", shutdown_order(), manager()); + DependOn(&child, &parent); + + manager()->DestroyProfileServices(NULL); + + ASSERT_EQ(2U, shutdown_order()->size()); + EXPECT_STREQ("child", (*shutdown_order())[0].c_str()); + EXPECT_STREQ("parent", (*shutdown_order())[1].c_str()); +} + +// Tests two children, one parent +TEST_F(ProfileDependencyManagerUnittests, TwoChildrenOneParent) { + TestService parent("parent", shutdown_order(), manager()); + TestService child1("child1", shutdown_order(), manager()); + TestService child2("child2", shutdown_order(), manager()); + DependOn(&child1, &parent); + DependOn(&child2, &parent); + + manager()->DestroyProfileServices(NULL); + + ASSERT_EQ(3U, shutdown_order()->size()); + EXPECT_STREQ("child2", (*shutdown_order())[0].c_str()); + EXPECT_STREQ("child1", (*shutdown_order())[1].c_str()); + EXPECT_STREQ("parent", (*shutdown_order())[2].c_str()); +} + +// Tests an M configuration +TEST_F(ProfileDependencyManagerUnittests, MConfiguration) { + TestService parent1("parent1", shutdown_order(), manager()); + TestService parent2("parent2", shutdown_order(), manager()); + + TestService child_of_1("child_of_1", shutdown_order(), manager()); + DependOn(&child_of_1, &parent1); + + TestService child_of_12("child_of_12", shutdown_order(), manager()); + DependOn(&child_of_12, &parent1); + DependOn(&child_of_12, &parent2); + + TestService child_of_2("child_of_2", shutdown_order(), manager()); + DependOn(&child_of_2, &parent2); + + manager()->DestroyProfileServices(NULL); + + ASSERT_EQ(5U, shutdown_order()->size()); + EXPECT_STREQ("child_of_2", (*shutdown_order())[0].c_str()); + EXPECT_STREQ("child_of_12", (*shutdown_order())[1].c_str()); + EXPECT_STREQ("child_of_1", (*shutdown_order())[2].c_str()); + EXPECT_STREQ("parent2", (*shutdown_order())[3].c_str()); + EXPECT_STREQ("parent1", (*shutdown_order())[4].c_str()); +} + +// Tests that it can deal with a simple diamond. +TEST_F(ProfileDependencyManagerUnittests, DiamondConfiguration) { + TestService parent("parent", shutdown_order(), manager()); + + TestService middle_row_1("middle_row_1", shutdown_order(), manager()); + DependOn(&middle_row_1, &parent); + + TestService middle_row_2("middle_row_2", shutdown_order(), manager()); + DependOn(&middle_row_2, &parent); + + TestService bottom("bottom", shutdown_order(), manager()); + DependOn(&bottom, &middle_row_1); + DependOn(&bottom, &middle_row_2); + + manager()->DestroyProfileServices(NULL); + + ASSERT_EQ(4U, shutdown_order()->size()); + EXPECT_STREQ("bottom", (*shutdown_order())[0].c_str()); + EXPECT_STREQ("middle_row_2", (*shutdown_order())[1].c_str()); + EXPECT_STREQ("middle_row_1", (*shutdown_order())[2].c_str()); + EXPECT_STREQ("parent", (*shutdown_order())[3].c_str()); +} + +// A final test that works with a more complex graph. +TEST_F(ProfileDependencyManagerUnittests, ComplexGraph) { + TestService everything_depends_on_me("everything_depends_on_me", + shutdown_order(), manager()); + + TestService intermediary_service("intermediary_service", + shutdown_order(), manager()); + DependOn(&intermediary_service, &everything_depends_on_me); + + TestService specialized_service("specialized_service", + shutdown_order(), manager()); + DependOn(&specialized_service, &everything_depends_on_me); + DependOn(&specialized_service, &intermediary_service); + + TestService other_root("other_root", shutdown_order(), manager()); + + TestService other_intermediary("other_intermediary", + shutdown_order(), manager()); + DependOn(&other_intermediary, &other_root); + + TestService bottom("bottom", shutdown_order(), manager()); + DependOn(&bottom, &specialized_service); + DependOn(&bottom, &other_intermediary); + + manager()->DestroyProfileServices(NULL); + + ASSERT_EQ(6U, shutdown_order()->size()); + EXPECT_STREQ("bottom", (*shutdown_order())[0].c_str()); + EXPECT_STREQ("specialized_service", (*shutdown_order())[1].c_str()); + EXPECT_STREQ("other_intermediary", (*shutdown_order())[2].c_str()); + EXPECT_STREQ("intermediary_service", (*shutdown_order())[3].c_str()); + EXPECT_STREQ("other_root", (*shutdown_order())[4].c_str()); + EXPECT_STREQ("everything_depends_on_me", (*shutdown_order())[5].c_str()); +} diff --git a/components/browser_context_keyed_service/browser_context_keyed_base_factory.cc b/components/browser_context_keyed_service/browser_context_keyed_base_factory.cc new file mode 100644 index 0000000..9228400 --- /dev/null +++ b/components/browser_context_keyed_service/browser_context_keyed_base_factory.cc @@ -0,0 +1,110 @@ +// 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. + +#include "components/browser_context_keyed_service/browser_context_keyed_base_factory.h" + +#include "base/prefs/pref_service.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "components/user_prefs/pref_registry_syncable.h" +#include "components/user_prefs/user_prefs.h" +#include "content/public/browser/browser_context.h" + +ProfileKeyedBaseFactory::ProfileKeyedBaseFactory( + const char* name, ProfileDependencyManager* manager) + : dependency_manager_(manager) +#ifndef NDEBUG + , service_name_(name) +#endif +{ + dependency_manager_->AddComponent(this); +} + +ProfileKeyedBaseFactory::~ProfileKeyedBaseFactory() { + dependency_manager_->RemoveComponent(this); +} + +void ProfileKeyedBaseFactory::DependsOn(ProfileKeyedBaseFactory* rhs) { + dependency_manager_->AddEdge(rhs, this); +} + +content::BrowserContext* ProfileKeyedBaseFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { + DCHECK(CalledOnValidThread()); + +#ifndef NDEBUG + dependency_manager_->AssertProfileWasntDestroyed(context); +#endif + + // Safe default for the Incognito mode: no service. + if (context->IsOffTheRecord()) + return NULL; + + return context; +} + +void ProfileKeyedBaseFactory::RegisterUserPrefsOnProfile( + content::BrowserContext* profile) { + // Safe timing for pref registration is hard. Previously, we made Profile + // responsible for all pref registration on every service that used + // Profile. Now we don't and there are timing issues. + // + // With normal profiles, prefs can simply be registered at + // ProfileDependencyManager::CreateProfileServices time. With incognito + // profiles, we just never register since incognito profiles share the same + // pref services with their parent profiles. + // + // TestingProfiles throw a wrench into the mix, in that some tests will + // swap out the PrefService after we've registered user prefs on the original + // PrefService. Test code that does this is responsible for either manually + // invoking RegisterUserPrefs() on the appropriate ProfileKeyedServiceFactory + // associated with the prefs they need, or they can use SetTestingFactory() + // and create a service (since service creation with a factory method causes + // registration to happen at service creation time). + // + // Now that services are responsible for declaring their preferences, we have + // to enforce a uniquenes check here because some tests create one profile and + // multiple services of the same type attached to that profile (serially, not + // parallel) and we don't want to register multiple times on the same profile. + DCHECK(!profile->IsOffTheRecord()); + + std::set::iterator it = + registered_preferences_.find(profile); + if (it == registered_preferences_.end()) { + PrefService* prefs = components::UserPrefs::Get(profile); + user_prefs::PrefRegistrySyncable* registry = + static_cast( + prefs->DeprecatedGetPrefRegistry()); + RegisterUserPrefs(registry); + registered_preferences_.insert(profile); + } +} + +bool ProfileKeyedBaseFactory::ServiceIsCreatedWithProfile() const { + return false; +} + +bool ProfileKeyedBaseFactory::ServiceIsNULLWhileTesting() const { + return false; +} + +void ProfileKeyedBaseFactory::ProfileDestroyed( + content::BrowserContext* profile) { + // While object destruction can be customized in ways where the object is + // only dereferenced, this still must run on the UI thread. + DCHECK(CalledOnValidThread()); + + registered_preferences_.erase(profile); +} + +bool ProfileKeyedBaseFactory::ArePreferencesSetOn( + content::BrowserContext* profile) const { + return registered_preferences_.find(profile) != + registered_preferences_.end(); +} + +void ProfileKeyedBaseFactory::MarkPreferencesSetOn( + content::BrowserContext* profile) { + DCHECK(!ArePreferencesSetOn(profile)); + registered_preferences_.insert(profile); +} diff --git a/components/browser_context_keyed_service/browser_context_keyed_base_factory.h b/components/browser_context_keyed_service/browser_context_keyed_base_factory.h new file mode 100644 index 0000000..30a0c32 --- /dev/null +++ b/components/browser_context_keyed_service/browser_context_keyed_base_factory.h @@ -0,0 +1,133 @@ +// 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. + +#ifndef COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_BASE_FACTORY_H_ +#define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_BASE_FACTORY_H_ + +#include + +#include "base/threading/non_thread_safe.h" +#include "components/browser_context_keyed_service/dependency_node.h" + +class PrefService; +class ProfileDependencyManager; + +namespace content { +class BrowserContext; +} + +namespace user_prefs { +class PrefRegistrySyncable; +} +// Base class for Factories that take a Profile object and return some service. +// +// Unless you're trying to make a new type of Factory, you probably don't want +// this class, but its subclasses: ProfileKeyedServiceFactory and +// RefcountedProfileKeyedServiceFactory. This object describes general +// dependency management between Factories; subclasses react to lifecycle +// events and implement memory management. +class ProfileKeyedBaseFactory : public base::NonThreadSafe, + public DependencyNode { + public: + // Registers preferences used in this service on the pref service of + // |profile|. This is the public interface and is safe to be called multiple + // times because testing code can have multiple services of the same type + // attached to a single |profile|. + void RegisterUserPrefsOnProfile(content::BrowserContext* 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: + ProfileKeyedBaseFactory(const char* name, + ProfileDependencyManager* manager); + virtual ~ProfileKeyedBaseFactory(); + + // The main public interface for declaring dependencies between services + // created by factories. + void DependsOn(ProfileKeyedBaseFactory* rhs); + + // Interface for people building a concrete FooServiceFactory: -------------- + + // Finds which browser context (if any) to use. + virtual content::BrowserContext* GetBrowserContextToUse( + content::BrowserContext* context) const; + + // Register any user preferences on this service. This is called during + // CreateProfileService() since preferences are registered on a per Profile + // basis. + virtual void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry) {} + + // By default, we create instances of a service lazily and wait until + // GetForProfile() is called on our subclass. Some services need to be + // created as soon as the Profile has been brought up. + virtual bool ServiceIsCreatedWithProfile() const; + + // By default, TestingProfiles will be treated like normal profiles. You can + // override this so that by default, the service associated with the + // TestingProfile is NULL. (This is just a shortcut around + // SetTestingFactory() to make sure our profiles don't directly refer to the + // services they use.) + virtual bool ServiceIsNULLWhileTesting() const; + + // Interface for people building a type of ProfileKeyedFactory: ------------- + + // A helper object actually listens for notifications about Profile + // destruction, calculates the order in which things are destroyed and then + // does a two pass shutdown. + // + // It is up to the individual factory types to determine what this two pass + // shutdown means. The general framework guarantees the following: + // + // - Each ProfileShutdown() is called in dependency order (and you may reach + // out to other services during this phase). + // + // - Each ProfileDestroyed() is called in dependency order. We will + // NOTREACHED() if you attempt to GetForProfile() any other service. You + // should delete/deref/do other final memory management things during this + // phase. You must also call the base class method as the last thing you + // do. + virtual void ProfileShutdown(content::BrowserContext* profile) = 0; + virtual void ProfileDestroyed(content::BrowserContext* profile); + + // Returns whether we've registered the preferences on this profile. + bool ArePreferencesSetOn(content::BrowserContext* profile) const; + + // Mark profile as Preferences set. + void MarkPreferencesSetOn(content::BrowserContext* profile); + + private: + friend class ProfileDependencyManager; + friend class ProfileDependencyManagerUnittests; + + // These two methods are for tight integration with the + // ProfileDependencyManager. + + // Because of ServiceIsNULLWhileTesting(), we need a way to tell different + // subclasses that they should disable testing. + virtual void SetEmptyTestingFactory(content::BrowserContext* profile) = 0; + + // We also need a generalized, non-returning method that generates the object + // now for when we're creating the profile. + virtual void CreateServiceNow(content::BrowserContext* profile) = 0; + + // Which ProfileDependencyManager we should communicate with. In real code, + // this will always be ProfileDependencyManager::GetInstance(), but unit + // tests will want to use their own copy. + ProfileDependencyManager* dependency_manager_; + + // Profiles that have this service's preferences registered on them. + std::set registered_preferences_; + +#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 // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_BASE_FACTORY_H_ diff --git a/components/browser_context_keyed_service/browser_context_keyed_service.h b/components/browser_context_keyed_service/browser_context_keyed_service.h new file mode 100644 index 0000000..b87aeac --- /dev/null +++ b/components/browser_context_keyed_service/browser_context_keyed_service.h @@ -0,0 +1,30 @@ +// 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. + +#ifndef COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVICE_H_ +#define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVICE_H_ + +class ProfileKeyedServiceFactory; + +// Base class for all ProfileKeyedServices to allow for correct destruction +// order. +// +// Many services that hang off Profile have a two-pass shutdown. Many +// subsystems need a first pass shutdown phase where they drop references. Not +// all services will need this, so there's a default implementation. Only once +// every system has been given a chance to drop references do we start deleting +// objects. +class ProfileKeyedService { + public: + // The first pass is to call Shutdown on a ProfileKeyedService. + virtual void Shutdown() {} + + protected: + friend class ProfileKeyedServiceFactory; + + // The second pass is the actual deletion of each object. + virtual ~ProfileKeyedService() {} +}; + +#endif // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVICE_H_ diff --git a/components/browser_context_keyed_service/browser_context_keyed_service_factory.cc b/components/browser_context_keyed_service/browser_context_keyed_service_factory.cc new file mode 100644 index 0000000..bfc1c74 --- /dev/null +++ b/components/browser_context_keyed_service/browser_context_keyed_service_factory.cc @@ -0,0 +1,126 @@ +// 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. + +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" + +#include + +#include "base/logging.h" +#include "base/stl_util.h" +#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "content/public/browser/browser_context.h" + +void ProfileKeyedServiceFactory::SetTestingFactory( + content::BrowserContext* profile, FactoryFunction factory) { + // Destroying the profile may cause us to lose data about whether |profile| + // has our preferences registered on it (since the profile object itself + // isn't dead). See if we need to readd it once we've gone through normal + // destruction. + bool add_profile = ArePreferencesSetOn(profile); + + // We have to go through the shutdown and destroy mechanisms because there + // are unit tests that create a service on a profile and then change the + // testing service mid-test. + ProfileShutdown(profile); + ProfileDestroyed(profile); + + if (add_profile) + MarkPreferencesSetOn(profile); + + factories_[profile] = factory; +} + +ProfileKeyedService* ProfileKeyedServiceFactory::SetTestingFactoryAndUse( + content::BrowserContext* profile, + FactoryFunction factory) { + DCHECK(factory); + SetTestingFactory(profile, factory); + return GetServiceForProfile(profile, true); +} + +ProfileKeyedServiceFactory::ProfileKeyedServiceFactory( + const char* name, ProfileDependencyManager* manager) + : ProfileKeyedBaseFactory(name, manager) { +} + +ProfileKeyedServiceFactory::~ProfileKeyedServiceFactory() { + DCHECK(mapping_.empty()); +} + +ProfileKeyedService* ProfileKeyedServiceFactory::GetServiceForProfile( + content::BrowserContext* profile, + bool create) { + profile = GetBrowserContextToUse(profile); + if (!profile) + return NULL; + + // NOTE: If you modify any of the logic below, make sure to update the + // refcounted version in refcounted_profile_keyed_service_factory.cc! + ProfileKeyedServices::const_iterator it = mapping_.find(profile); + if (it != mapping_.end()) + return it->second; + + // Object not found. + if (!create) + return NULL; // And we're forbidden from creating one. + + // Create new object. + // Check to see if we have a per-Profile testing factory that we should use + // instead of default behavior. + ProfileKeyedService* service = NULL; + ProfileOverriddenFunctions::const_iterator jt = factories_.find(profile); + if (jt != factories_.end()) { + if (jt->second) { + if (!profile->IsOffTheRecord()) + RegisterUserPrefsOnProfile(profile); + service = jt->second(profile); + } + } else { + service = BuildServiceInstanceFor(profile); + } + + Associate(profile, service); + return service; +} + +void ProfileKeyedServiceFactory::Associate(content::BrowserContext* profile, + ProfileKeyedService* service) { + DCHECK(!ContainsKey(mapping_, profile)); + mapping_.insert(std::make_pair(profile, service)); +} + +void ProfileKeyedServiceFactory::ProfileShutdown( + content::BrowserContext* profile) { + ProfileKeyedServices::iterator it = mapping_.find(profile); + if (it != mapping_.end() && it->second) + it->second->Shutdown(); +} + +void ProfileKeyedServiceFactory::ProfileDestroyed( + content::BrowserContext* profile) { + ProfileKeyedServices::iterator it = mapping_.find(profile); + if (it != mapping_.end()) { + delete it->second; + mapping_.erase(it); + } + + // For unit tests, we also remove the factory function both so we don't + // maintain a big map of dead pointers, but also since we may have a second + // object that lives at the same address (see other comments about unit tests + // in this file). + factories_.erase(profile); + + ProfileKeyedBaseFactory::ProfileDestroyed(profile); +} + +void ProfileKeyedServiceFactory::SetEmptyTestingFactory( + content::BrowserContext* profile) { + SetTestingFactory(profile, NULL); +} + +void ProfileKeyedServiceFactory::CreateServiceNow( + content::BrowserContext* profile) { + GetServiceForProfile(profile, true); +} diff --git a/components/browser_context_keyed_service/browser_context_keyed_service_factory.h b/components/browser_context_keyed_service/browser_context_keyed_service_factory.h new file mode 100644 index 0000000..f222c42 --- /dev/null +++ b/components/browser_context_keyed_service/browser_context_keyed_service_factory.h @@ -0,0 +1,115 @@ +// 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. + +#ifndef COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVICE_FACTORY_H_ +#define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVICE_FACTORY_H_ + +#include + +#include "base/basictypes.h" +#include "base/compiler_specific.h" +#include "components/browser_context_keyed_service/browser_context_keyed_base_factory.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" + +class ProfileDependencyManager; +class ProfileKeyedService; + +// Base class for Factories that take a Profile object and return some service +// on a one-to-one mapping. Each factory that derives from this class *must* +// be a Singleton (only unit tests don't do that). See ThemeServiceFactory as +// an example of how to derive from this class. +// +// We do this because services depend on each other and we need to control +// shutdown/destruction order. In each derived classes' constructors, the +// implementors must explicitly state which services are depended on. +class ProfileKeyedServiceFactory : public ProfileKeyedBaseFactory { + public: + // A function that supplies the instance of a ProfileKeyedService for a given + // Profile. This is used primarily for testing, where we want to feed a + // specific mock into the PKSF system. + typedef ProfileKeyedService* + (*FactoryFunction)(content::BrowserContext* profile); + + // Associates |factory| with |profile| so that |factory| is used to create + // the ProfileKeyedService when requested. |factory| can be NULL to signal + // that ProfileKeyedService should be NULL. Multiple calls to + // SetTestingFactory() are allowed; previous services will be shut down. + void SetTestingFactory(content::BrowserContext* profile, + FactoryFunction factory); + + // Associates |factory| with |profile| and immediately returns the created + // ProfileKeyedService. Since the factory will be used immediately, it may + // not be NULL. + ProfileKeyedService* SetTestingFactoryAndUse(content::BrowserContext* profile, + FactoryFunction factory); + + protected: + // ProfileKeyedServiceFactories must communicate with a + // ProfileDependencyManager. For all non-test code, write your subclass + // constructors like this: + // + // MyServiceFactory::MyServiceFactory() + // : ProfileKeyedServiceFactory( + // "MyService", + // ProfileDependencyManager::GetInstance()) + // {} + ProfileKeyedServiceFactory(const char* name, + ProfileDependencyManager* manager); + virtual ~ProfileKeyedServiceFactory(); + + // Common implementation that maps |profile| to some service object. Deals + // with incognito profiles per subclass instructions with + // ServiceRedirectedInIncognito() and ServiceHasOwnInstanceInIncognito() + // through the GetProfileToUse() method on the base. If |create| is true, + // the service will be created using BuildServiceInstanceFor() if it doesn't + // already exist. + ProfileKeyedService* GetServiceForProfile(content::BrowserContext* profile, + bool create); + + // Maps |profile| to |service| with debug checks to prevent duplication. + void Associate(content::BrowserContext* profile, + ProfileKeyedService* service); + + // All subclasses of ProfileKeyedServiceFactory must return a + // ProfileKeyedService instead of just a ProfileKeyedBase. + virtual ProfileKeyedService* BuildServiceInstanceFor( + content::BrowserContext* profile) const = 0; + + // A helper object actually listens for notifications about Profile + // destruction, calculates the order in which things are destroyed and then + // does a two pass shutdown. + // + // First, ProfileShutdown() is called on every ServiceFactory and will + // usually call ProfileKeyedService::Shutdown(), which gives each + // ProfileKeyedService a chance to remove dependencies on other services that + // it may be holding. + // + // Secondly, ProfileDestroyed() is called on every ServiceFactory and the + // default implementation removes it from |mapping_| and deletes the pointer. + virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE; + virtual void ProfileDestroyed(content::BrowserContext* profile) OVERRIDE; + + virtual void SetEmptyTestingFactory( + content::BrowserContext* profile) OVERRIDE; + virtual void CreateServiceNow(content::BrowserContext* profile) OVERRIDE; + + private: + friend class ProfileDependencyManager; + friend class ProfileDependencyManagerUnittests; + + typedef std::map + ProfileKeyedServices; + typedef std::map + ProfileOverriddenFunctions; + + // The mapping between a Profile and its service. + std::map mapping_; + + // The mapping between a Profile and its overridden FactoryFunction. + std::map factories_; + + DISALLOW_COPY_AND_ASSIGN(ProfileKeyedServiceFactory); +}; + +#endif // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_BROWSER_CONTEXT_KEYED_SERVICE_FACTORY_H_ diff --git a/components/browser_context_keyed_service/dependency_graph.cc b/components/browser_context_keyed_service/dependency_graph.cc new file mode 100644 index 0000000..253f5dd --- /dev/null +++ b/components/browser_context_keyed_service/dependency_graph.cc @@ -0,0 +1,166 @@ +// Copyright 2013 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. + +#include "components/browser_context_keyed_service/dependency_graph.h" + +#include +#include +#include + +DependencyGraph::DependencyGraph() { +} + +DependencyGraph::~DependencyGraph() { +} + +void DependencyGraph::AddNode(DependencyNode* node) { + all_nodes_.push_back(node); + construction_order_.clear(); +} + +void DependencyGraph::RemoveNode(DependencyNode* node) { + all_nodes_.erase(std::remove(all_nodes_.begin(), + all_nodes_.end(), + node), + all_nodes_.end()); + + // Remove all dependency edges that contain this node. + EdgeMap::iterator it = edges_.begin(); + while (it != edges_.end()) { + EdgeMap::iterator temp = it; + ++it; + + if (temp->first == node || temp->second == node) + edges_.erase(temp); + } + + construction_order_.clear(); +} + +void DependencyGraph::AddEdge(DependencyNode* depended, + DependencyNode* dependee) { + edges_.insert(std::make_pair(depended, dependee)); + construction_order_.clear(); +} + +bool DependencyGraph::GetConstructionOrder( + std::vector* order) { + if (construction_order_.empty() && !BuildConstructionOrder()) + return false; + + *order = construction_order_; + return true; +} + +bool DependencyGraph::GetDestructionOrder( + std::vector* order) { + if (construction_order_.empty() && !BuildConstructionOrder()) + return false; + + *order = construction_order_; + + // Destroy nodes in reverse order. + std::reverse(order->begin(), order->end()); + + return true; +} + +bool DependencyGraph::BuildConstructionOrder() { + // Step 1: Build a set of nodes with no incoming edges. + std::deque queue; + std::copy(all_nodes_.begin(), + all_nodes_.end(), + std::back_inserter(queue)); + + std::deque::iterator queue_end = queue.end(); + for (EdgeMap::const_iterator it = edges_.begin(); + it != edges_.end(); ++it) { + queue_end = std::remove(queue.begin(), queue_end, it->second); + } + queue.erase(queue_end, queue.end()); + + // Step 2: Do the Kahn topological sort. + std::vector output; + EdgeMap edges(edges_); + while (!queue.empty()) { + DependencyNode* node = queue.front(); + queue.pop_front(); + output.push_back(node); + + std::pair range = + edges.equal_range(node); + EdgeMap::iterator it = range.first; + while (it != range.second) { + DependencyNode* dest = it->second; + EdgeMap::iterator temp = it; + it++; + edges.erase(temp); + + bool has_incoming_edges = false; + for (EdgeMap::iterator jt = edges.begin(); jt != edges.end(); ++jt) { + if (jt->second == dest) { + has_incoming_edges = true; + break; + } + } + + if (!has_incoming_edges) + queue.push_back(dest); + } + } + + if (!edges.empty()) { + // Dependency graph has a cycle. + return false; + } + + construction_order_ = output; + return true; +} + +std::string DependencyGraph::DumpAsGraphviz( + const std::string& toplevel_name, + const base::Callback& + node_name_callback) const { + std::string result("digraph {\n"); + + // Make a copy of all nodes. + std::deque nodes; + std::copy(all_nodes_.begin(), all_nodes_.end(), std::back_inserter(nodes)); + + // State all dependencies and remove |second| so we don't generate an + // implicit dependency on the top level node. + std::deque::iterator nodes_end(nodes.end()); + result.append(" /* Dependencies */\n"); + for (EdgeMap::const_iterator it = edges_.begin(); it != edges_.end(); ++it) { + result.append(" "); + result.append(node_name_callback.Run(it->second)); + result.append(" -> "); + result.append(node_name_callback.Run(it->first)); + result.append(";\n"); + + nodes_end = std::remove(nodes.begin(), nodes_end, it->second); + } + nodes.erase(nodes_end, nodes.end()); + + // Every node that doesn't depend on anything else will implicitly depend on + // the top level node. + result.append("\n /* Toplevel attachments */\n"); + for (std::deque::const_iterator it = + nodes.begin(); it != nodes.end(); ++it) { + result.append(" "); + result.append(node_name_callback.Run(*it)); + result.append(" -> "); + result.append(toplevel_name); + result.append(";\n"); + } + + result.append("\n /* Toplevel node */\n"); + result.append(" "); + result.append(toplevel_name); + result.append(" [shape=box];\n"); + + result.append("}\n"); + return result; +} diff --git a/components/browser_context_keyed_service/dependency_graph.h b/components/browser_context_keyed_service/dependency_graph.h new file mode 100644 index 0000000..0f5d66a --- /dev/null +++ b/components/browser_context_keyed_service/dependency_graph.h @@ -0,0 +1,67 @@ +// Copyright 2013 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. + +#ifndef COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_DEPENDENCY_GRAPH_H_ +#define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_DEPENDENCY_GRAPH_H_ + +#include +#include +#include + +#include "base/callback.h" +#include "base/compiler_specific.h" + +class DependencyNode; + +// Dynamic graph of dependencies between nodes. +class DependencyGraph { + public: + DependencyGraph(); + ~DependencyGraph(); + + // Adds/Removes a node from our list of live nodes. Removing will + // also remove live dependency links. + void AddNode(DependencyNode* node); + void RemoveNode(DependencyNode* node); + + // Adds a dependency between two nodes. + void AddEdge(DependencyNode* depended, DependencyNode* dependee); + + // Topologically sorts nodes to produce a safe construction order + // (all nodes after their dependees). + bool GetConstructionOrder( + std::vector* order) WARN_UNUSED_RESULT; + + // Topologically sorts nodes to produce a safe destruction order + // (all nodes before their dependees). + bool GetDestructionOrder( + std::vector* order) WARN_UNUSED_RESULT; + + // Returns representation of the dependency graph in graphviz format. + std::string DumpAsGraphviz( + const std::string& toplevel_name, + const base::Callback& + node_name_callback) const; + + private: + typedef std::multimap EdgeMap; + + // Populates |construction_order_| with computed construction order. + // Returns true on success. + bool BuildConstructionOrder() WARN_UNUSED_RESULT; + + // Keeps track of all live nodes (see AddNode, RemoveNode). + std::vector all_nodes_; + + // Keeps track of edges of the dependency graph. + EdgeMap edges_; + + // Cached construction order (needs rebuild with BuildConstructionOrder + // when empty). + std::vector construction_order_; + + DISALLOW_COPY_AND_ASSIGN(DependencyGraph); +}; + +#endif // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_DEPENDENCY_GRAPH_H_ diff --git a/components/browser_context_keyed_service/dependency_graph_unittest.cc b/components/browser_context_keyed_service/dependency_graph_unittest.cc new file mode 100644 index 0000000..541ada7 --- /dev/null +++ b/components/browser_context_keyed_service/dependency_graph_unittest.cc @@ -0,0 +1,161 @@ +// Copyright 2013 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. + +#include "components/browser_context_keyed_service/dependency_graph.h" +#include "components/browser_context_keyed_service/dependency_node.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace { + +class DependencyGraphTest : public testing::Test { +}; + +class DummyNode : public DependencyNode { + public: + explicit DummyNode(DependencyGraph* graph) : dependency_graph_(graph) { + dependency_graph_->AddNode(this); + } + + ~DummyNode() { + dependency_graph_->RemoveNode(this); + } + + private: + DependencyGraph* dependency_graph_; + + DISALLOW_COPY_AND_ASSIGN(DummyNode); +}; + +// Tests that we can deal with a single component. +TEST_F(DependencyGraphTest, SingleCase) { + DependencyGraph graph; + DummyNode node(&graph); + + std::vector construction_order; + EXPECT_TRUE(graph.GetConstructionOrder(&construction_order)); + ASSERT_EQ(1U, construction_order.size()); + EXPECT_EQ(&node, construction_order[0]); + + std::vector destruction_order; + EXPECT_TRUE(graph.GetDestructionOrder(&destruction_order)); + ASSERT_EQ(1U, destruction_order.size()); + EXPECT_EQ(&node, destruction_order[0]); +} + +// Tests that we get a simple one component depends on the other case. +TEST_F(DependencyGraphTest, SimpleDependency) { + DependencyGraph graph; + DummyNode parent(&graph); + DummyNode child(&graph); + + graph.AddEdge(&parent, &child); + + std::vector construction_order; + EXPECT_TRUE(graph.GetConstructionOrder(&construction_order)); + ASSERT_EQ(2U, construction_order.size()); + EXPECT_EQ(&parent, construction_order[0]); + EXPECT_EQ(&child, construction_order[1]); + + std::vector destruction_order; + EXPECT_TRUE(graph.GetDestructionOrder(&destruction_order)); + ASSERT_EQ(2U, destruction_order.size()); + EXPECT_EQ(&child, destruction_order[0]); + EXPECT_EQ(&parent, destruction_order[1]); +} + +// Tests two children, one parent. +TEST_F(DependencyGraphTest, TwoChildrenOneParent) { + DependencyGraph graph; + DummyNode parent(&graph); + DummyNode child1(&graph); + DummyNode child2(&graph); + + graph.AddEdge(&parent, &child1); + graph.AddEdge(&parent, &child2); + + std::vector construction_order; + EXPECT_TRUE(graph.GetConstructionOrder(&construction_order)); + ASSERT_EQ(3U, construction_order.size()); + EXPECT_EQ(&parent, construction_order[0]); + EXPECT_EQ(&child1, construction_order[1]); + EXPECT_EQ(&child2, construction_order[2]); + + std::vector destruction_order; + EXPECT_TRUE(graph.GetDestructionOrder(&destruction_order)); + ASSERT_EQ(3U, destruction_order.size()); + EXPECT_EQ(&child2, destruction_order[0]); + EXPECT_EQ(&child1, destruction_order[1]); + EXPECT_EQ(&parent, destruction_order[2]); +} + +// Tests an M configuration. +TEST_F(DependencyGraphTest, MConfiguration) { + DependencyGraph graph; + + DummyNode parent1(&graph); + DummyNode parent2(&graph); + + DummyNode child_of_1(&graph); + graph.AddEdge(&parent1, &child_of_1); + + DummyNode child_of_12(&graph); + graph.AddEdge(&parent1, &child_of_12); + graph.AddEdge(&parent2, &child_of_12); + + DummyNode child_of_2(&graph); + graph.AddEdge(&parent2, &child_of_2); + + std::vector construction_order; + EXPECT_TRUE(graph.GetConstructionOrder(&construction_order)); + ASSERT_EQ(5U, construction_order.size()); + EXPECT_EQ(&parent1, construction_order[0]); + EXPECT_EQ(&parent2, construction_order[1]); + EXPECT_EQ(&child_of_1, construction_order[2]); + EXPECT_EQ(&child_of_12, construction_order[3]); + EXPECT_EQ(&child_of_2, construction_order[4]); + + std::vector destruction_order; + EXPECT_TRUE(graph.GetDestructionOrder(&destruction_order)); + ASSERT_EQ(5U, destruction_order.size()); + EXPECT_EQ(&child_of_2, destruction_order[0]); + EXPECT_EQ(&child_of_12, destruction_order[1]); + EXPECT_EQ(&child_of_1, destruction_order[2]); + EXPECT_EQ(&parent2, destruction_order[3]); + EXPECT_EQ(&parent1, destruction_order[4]); +} + +// Tests that it can deal with a simple diamond. +TEST_F(DependencyGraphTest, DiamondConfiguration) { + DependencyGraph graph; + + DummyNode parent(&graph); + + DummyNode middle1(&graph); + graph.AddEdge(&parent, &middle1); + + DummyNode middle2(&graph); + graph.AddEdge(&parent, &middle2); + + DummyNode bottom(&graph); + graph.AddEdge(&middle1, &bottom); + graph.AddEdge(&middle2, &bottom); + + std::vector construction_order; + EXPECT_TRUE(graph.GetConstructionOrder(&construction_order)); + ASSERT_EQ(4U, construction_order.size()); + EXPECT_EQ(&parent, construction_order[0]); + EXPECT_EQ(&middle1, construction_order[1]); + EXPECT_EQ(&middle2, construction_order[2]); + EXPECT_EQ(&bottom, construction_order[3]); + + std::vector destruction_order; + EXPECT_TRUE(graph.GetDestructionOrder(&destruction_order)); + ASSERT_EQ(4U, destruction_order.size()); + EXPECT_EQ(&bottom, destruction_order[0]); + EXPECT_EQ(&middle2, destruction_order[1]); + EXPECT_EQ(&middle1, destruction_order[2]); + EXPECT_EQ(&parent, destruction_order[3]); +} + +} // namespace diff --git a/components/browser_context_keyed_service/dependency_node.h b/components/browser_context_keyed_service/dependency_node.h new file mode 100644 index 0000000..d870b67 --- /dev/null +++ b/components/browser_context_keyed_service/dependency_node.h @@ -0,0 +1,16 @@ +// Copyright 2013 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. + +#ifndef COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_DEPENDENCY_NODE_H_ +#define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_DEPENDENCY_NODE_H_ + +// Base class representing a node in a DependencyGraph. +class DependencyNode { + protected: + // This is intended to be used by the subclasses, not directly. + DependencyNode() {} + ~DependencyNode() {} +}; + +#endif // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_DEPENDENCY_NODE_H_ diff --git a/components/browser_context_keyed_service/refcounted_browser_context_keyed_service.cc b/components/browser_context_keyed_service/refcounted_browser_context_keyed_service.cc new file mode 100644 index 0000000..da92a6d --- /dev/null +++ b/components/browser_context_keyed_service/refcounted_browser_context_keyed_service.cc @@ -0,0 +1,34 @@ +// 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. + +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" + +namespace impl { + +// static +void RefcountedProfileKeyedServiceTraits::Destruct( + const RefcountedProfileKeyedService* obj) { + if (obj->requires_destruction_on_thread_ && + !content::BrowserThread::CurrentlyOn(obj->thread_id_)) { + content::BrowserThread::DeleteSoon(obj->thread_id_, FROM_HERE, obj); + } else { + delete obj; + } +} + +} // namespace impl + +RefcountedProfileKeyedService::RefcountedProfileKeyedService() + : requires_destruction_on_thread_(false), + thread_id_(content::BrowserThread::UI) { +} + +RefcountedProfileKeyedService::RefcountedProfileKeyedService( + const content::BrowserThread::ID thread_id) + : requires_destruction_on_thread_(true), + thread_id_(thread_id) { +} + +RefcountedProfileKeyedService::~RefcountedProfileKeyedService() {} + diff --git a/components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h b/components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h new file mode 100644 index 0000000..1d19f72 --- /dev/null +++ b/components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h @@ -0,0 +1,70 @@ +// 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. + +#ifndef COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_REFCOUNTED_BROWSER_CONTEXT_KEYED_SERVICE_H_ +#define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_REFCOUNTED_BROWSER_CONTEXT_KEYED_SERVICE_H_ + +#include "base/memory/ref_counted.h" +#include "base/sequenced_task_runner_helpers.h" +#include "content/public/browser/browser_thread.h" + +class RefcountedProfileKeyedService; + +namespace impl { + +struct RefcountedProfileKeyedServiceTraits { + static void Destruct(const RefcountedProfileKeyedService* obj); +}; + +} // namespace impl + +// Base class for refcounted objects that hang off the Profile. +// +// The two pass shutdown described in ProfileKeyedService works a bit +// differently because there could be outstanding references on other +// threads. ShutdownOnUIThread() will be called on the UI thread, and then the +// destructor will run when the last reference is dropped, which may or may not +// be after the corresponding Profile has been destroyed. +// +// Optionally, if you initialize your service with the constructor that takes a +// thread ID, your service will be deleted on that thread. We can't use +// content::DeleteOnThread<> directly because RefcountedProfileKeyedService +// must be one type that RefcountedProfileKeyedServiceFactory can use. +class RefcountedProfileKeyedService + : public base::RefCountedThreadSafe< + RefcountedProfileKeyedService, + impl::RefcountedProfileKeyedServiceTraits> { + public: + // Unlike ProfileKeyedService, ShutdownOnUI is not optional. You must do + // something to drop references during the first pass Shutdown() because this + // is the only point where you are guaranteed that something is running on + // the UI thread. The PKSF framework will ensure that this is only called on + // the UI thread; you do not need to check for that yourself. + virtual void ShutdownOnUIThread() = 0; + + protected: + // If your service does not need to be deleted on a specific thread, use the + // default constructor. + RefcountedProfileKeyedService(); + + // If you need your service to be deleted on a specific thread (for example, + // you're converting a service that used content::DeleteOnThread), then + // use this constructor with the ID of the thread. + explicit RefcountedProfileKeyedService( + const content::BrowserThread::ID thread_id); + + // The second pass destruction can happen anywhere unless you specify which + // thread this service must be destroyed on by using the second constructor. + virtual ~RefcountedProfileKeyedService(); + + private: + friend struct impl::RefcountedProfileKeyedServiceTraits; + friend class base::DeleteHelper; + + // Do we have to delete this object on a specific thread? + bool requires_destruction_on_thread_; + content::BrowserThread::ID thread_id_; +}; + +#endif // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_REFCOUNTED_BROWSER_CONTEXT_KEYED_SERVICE_H_ diff --git a/components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.cc b/components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.cc new file mode 100644 index 0000000..560180d --- /dev/null +++ b/components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.cc @@ -0,0 +1,127 @@ +// 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. + +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h" + +#include "base/logging.h" +#include "base/stl_util.h" +#include "content/public/browser/browser_context.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" + +void RefcountedProfileKeyedServiceFactory::SetTestingFactory( + content::BrowserContext* profile, + FactoryFunction factory) { + // Destroying the profile may cause us to lose data about whether |profile| + // has our preferences registered on it (since the profile object itself + // isn't dead). See if we need to readd it once we've gone through normal + // destruction. + bool add_profile = ArePreferencesSetOn(profile); + + // We have to go through the shutdown and destroy mechanisms because there + // are unit tests that create a service on a profile and then change the + // testing service mid-test. + ProfileShutdown(profile); + ProfileDestroyed(profile); + + if (add_profile) + MarkPreferencesSetOn(profile); + + factories_[profile] = factory; +} + +scoped_refptr +RefcountedProfileKeyedServiceFactory::SetTestingFactoryAndUse( + content::BrowserContext* profile, + FactoryFunction factory) { + DCHECK(factory); + SetTestingFactory(profile, factory); + return GetServiceForProfile(profile, true); +} + +RefcountedProfileKeyedServiceFactory::RefcountedProfileKeyedServiceFactory( + const char* name, + ProfileDependencyManager* manager) + : ProfileKeyedBaseFactory(name, manager) { +} + +RefcountedProfileKeyedServiceFactory::~RefcountedProfileKeyedServiceFactory() { + DCHECK(mapping_.empty()); +} + +scoped_refptr +RefcountedProfileKeyedServiceFactory::GetServiceForProfile( + content::BrowserContext* profile, + bool create) { + profile = GetBrowserContextToUse(profile); + if (!profile) + return NULL; + + // NOTE: If you modify any of the logic below, make sure to update the + // non-refcounted version in profile_keyed_service_factory.cc! + RefCountedStorage::const_iterator it = mapping_.find(profile); + if (it != mapping_.end()) + return it->second; + + // Object not found. + if (!create) + return NULL; // And we're forbidden from creating one. + + // Create new object. + // Check to see if we have a per-Profile testing factory that we should use + // instead of default behavior. + scoped_refptr service; + ProfileOverriddenFunctions::const_iterator jt = factories_.find(profile); + if (jt != factories_.end()) { + if (jt->second) { + if (!profile->IsOffTheRecord()) + RegisterUserPrefsOnProfile(profile); + service = jt->second(profile); + } + } else { + service = BuildServiceInstanceFor(profile); + } + + Associate(profile, service); + return service; +} + +void RefcountedProfileKeyedServiceFactory::Associate( + content::BrowserContext* profile, + const scoped_refptr& service) { + DCHECK(!ContainsKey(mapping_, profile)); + mapping_.insert(std::make_pair(profile, service)); +} + +void RefcountedProfileKeyedServiceFactory::ProfileShutdown( + content::BrowserContext* profile) { + RefCountedStorage::iterator it = mapping_.find(profile); + if (it != mapping_.end() && it->second) + it->second->ShutdownOnUIThread(); +} + +void RefcountedProfileKeyedServiceFactory::ProfileDestroyed( + content::BrowserContext* profile) { + // We "merely" drop our reference to the service. Hopefully this will cause + // the service to be destroyed. If not, oh well. + mapping_.erase(profile); + + // For unit tests, we also remove the factory function both so we don't + // maintain a big map of dead pointers, but also since we may have a second + // object that lives at the same address (see other comments about unit tests + // in this file). + factories_.erase(profile); + + ProfileKeyedBaseFactory::ProfileDestroyed(profile); +} + +void RefcountedProfileKeyedServiceFactory::SetEmptyTestingFactory( + content::BrowserContext* profile) { + SetTestingFactory(profile, NULL); +} + +void RefcountedProfileKeyedServiceFactory::CreateServiceNow( + content::BrowserContext* profile) { + GetServiceForProfile(profile, true); +} diff --git a/components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h b/components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h new file mode 100644 index 0000000..195c657 --- /dev/null +++ b/components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.h @@ -0,0 +1,88 @@ +// 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. + +#ifndef COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_REFCOUNTED_BROWSER_CONTEXT_KEYED_SERVICE_FACTORY_H_ +#define COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_REFCOUNTED_BROWSER_CONTEXT_KEYED_SERVICE_FACTORY_H_ + +#include "base/basictypes.h" +#include "base/compiler_specific.h" +#include "base/memory/ref_counted.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h" +#include "components/browser_context_keyed_service/refcounted_browser_context_keyed_service.h" + +class Profile; +class RefcountedProfileKeyedService; + +// A specialized ProfileKeyedServiceFactory that manages a +// RefcountedThreadSafe<>. +// +// While the factory returns RefcountedThreadSafe<>s, the factory itself is a +// base::NotThreadSafe. Only call methods on this object on the UI thread. +// +// Implementers of RefcountedProfileKeyedService should note that we guarantee +// that ShutdownOnUIThread() is called on the UI thread, but actual object +// destruction can happen anywhere. +class RefcountedProfileKeyedServiceFactory : public ProfileKeyedBaseFactory { + public: + // A function that supplies the instance of a ProfileKeyedService for a given + // Profile. This is used primarily for testing, where we want to feed a + // specific mock into the PKSF system. + typedef scoped_refptr + (*FactoryFunction)(content::BrowserContext* profile); + + // Associates |factory| with |profile| so that |factory| is used to create + // the ProfileKeyedService when requested. |factory| can be NULL to signal + // that ProfileKeyedService should be NULL. Multiple calls to + // SetTestingFactory() are allowed; previous services will be shut down. + void SetTestingFactory(content::BrowserContext* profile, + FactoryFunction factory); + + // Associates |factory| with |profile| and immediately returns the created + // ProfileKeyedService. Since the factory will be used immediately, it may + // not be NULL. + scoped_refptr SetTestingFactoryAndUse( + content::BrowserContext* profile, + FactoryFunction factory); + + protected: + RefcountedProfileKeyedServiceFactory(const char* name, + ProfileDependencyManager* manager); + virtual ~RefcountedProfileKeyedServiceFactory(); + + scoped_refptr GetServiceForProfile( + content::BrowserContext* profile, + bool create); + + // Maps |profile| to |service| with debug checks to prevent duplication. + void Associate(content::BrowserContext* profile, + const scoped_refptr& service); + + // All subclasses of RefcountedProfileKeyedServiceFactory must return a + // RefcountedProfileKeyedService instead of just a ProfileKeyedBase. + virtual scoped_refptr BuildServiceInstanceFor( + content::BrowserContext* profile) const = 0; + + virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE; + virtual void ProfileDestroyed(content::BrowserContext* profile) OVERRIDE; + virtual void SetEmptyTestingFactory( + content::BrowserContext* profile) OVERRIDE; + virtual void CreateServiceNow(content::BrowserContext* profile) OVERRIDE; + + private: + typedef std::map > + RefCountedStorage; + typedef std::map ProfileOverriddenFunctions; + + // The mapping between a Profile and its refcounted service. + RefCountedStorage mapping_; + + // The mapping between a Profile and its overridden FactoryFunction. + ProfileOverriddenFunctions factories_; + + DISALLOW_COPY_AND_ASSIGN(RefcountedProfileKeyedServiceFactory); +}; + +#endif // COMPONENTS_BROWSER_CONTEXT_KEYED_SERVICE_REFCOUNTED_BROWSER_CONTEXT_KEYED_SERVICE_FACTORY_H_ diff --git a/components/components.gyp b/components/components.gyp index 7243700..c361739 100644 --- a/components/components.gyp +++ b/components/components.gyp @@ -12,6 +12,7 @@ 'includes': [ 'autofill.gypi', 'auto_login_parser.gypi', + 'browser_context_keyed_service.gypi', 'components_tests.gypi', 'navigation_interception.gypi', 'sessions.gypi', diff --git a/components/components_tests.gypi b/components/components_tests.gypi index 8fa321b..2de146b 100644 --- a/components/components_tests.gypi +++ b/components/components_tests.gypi @@ -11,6 +11,8 @@ 'type': '<(gtest_target_type)', 'sources': [ 'auto_login_parser/auto_login_parser_unittest.cc', + 'browser_context_keyed_service/browser_context_dependency_manager_unittest.cc', + 'browser_context_keyed_service/dependency_graph_unittest.cc', 'navigation_interception/intercept_navigation_resource_throttle_unittest.cc', 'sessions/serialized_navigation_entry_unittest.cc', 'test/run_all_unittests.cc', @@ -30,6 +32,9 @@ # Dependencies of auto_login_parser 'auto_login_parser', + # Dependencies of browser_context_keyed_service + 'browser_context_keyed_service', + # Dependencies of encryptor 'encryptor', diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 2e70d70..b44c85d 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -782,6 +782,12 @@ const char kDisableSoftwareRasterizer[] = "disable-software-rasterizer"; extern const char kTestCompositor[] = "test-compositor"; #endif +#ifndef NDEBUG +// Dumps dependency information about our browser context keyed services +// into a dot file in the browser context directory. +const char kDumpBrowserContextDependencyGraph[] = "dump-browser-context-graph"; +#endif + // Sets the tile size used by composited layers. const char kDefaultTileWidth[] = "default-tile-width"; const char kDefaultTileHeight[] = "default-tile-height"; diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index b51ab06..098f1a9 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -251,6 +251,10 @@ extern const char kDisableCarbonInterposing[]; CONTENT_EXPORT extern const char kTestCompositor[]; #endif +#ifndef NDEBUG +CONTENT_EXPORT extern const char kDumpBrowserContextDependencyGraph[]; +#endif + extern const char kEnableWebPInAcceptHeader[]; CONTENT_EXPORT extern const char kOverscrollHistoryNavigation[]; -- cgit v1.1