Commit 20a41c8b authored by Glen Robertson's avatar Glen Robertson Committed by Chromium LUCI CQ

Separate profile.{cc,h} (& observer) to its own GN target.

This allows other code to depend on profile.h (very common as it is a
keyed service key) without depending on all of //c/b:browser. This
improves modularization of the codebase and will help to break
dependency cycles in GN.

Bug: 1149277
Fixed: 1149277
Change-Id: Ib8a160dbcd29301490f9826278262980e34dbf9b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542933Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: Glen Robertson <glenrob@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844698}
parent 780bb57f
...@@ -1449,8 +1449,6 @@ static_library("browser") { ...@@ -1449,8 +1449,6 @@ static_library("browser") {
"profiles/off_the_record_profile_impl.h", "profiles/off_the_record_profile_impl.h",
"profiles/pref_service_builder_utils.cc", "profiles/pref_service_builder_utils.cc",
"profiles/pref_service_builder_utils.h", "profiles/pref_service_builder_utils.h",
"profiles/profile.cc",
"profiles/profile.h",
"profiles/profile_attributes_entry.cc", "profiles/profile_attributes_entry.cc",
"profiles/profile_attributes_entry.h", "profiles/profile_attributes_entry.h",
"profiles/profile_attributes_storage.cc", "profiles/profile_attributes_storage.cc",
...@@ -1483,7 +1481,6 @@ static_library("browser") { ...@@ -1483,7 +1481,6 @@ static_library("browser") {
"profiles/profile_manager_observer.h", "profiles/profile_manager_observer.h",
"profiles/profile_metrics.cc", "profiles/profile_metrics.cc",
"profiles/profile_metrics.h", "profiles/profile_metrics.h",
"profiles/profile_observer.h",
"profiles/profiles_state.cc", "profiles/profiles_state.cc",
"profiles/profiles_state.h", "profiles/profiles_state.h",
"profiles/renderer_updater.cc", "profiles/renderer_updater.cc",
...@@ -1995,6 +1992,7 @@ static_library("browser") { ...@@ -1995,6 +1992,7 @@ static_library("browser") {
"//chrome/browser/persisted_state_db:persisted_state_db_content_proto", "//chrome/browser/persisted_state_db:persisted_state_db_content_proto",
"//chrome/browser/policy:path_parser", "//chrome/browser/policy:path_parser",
"//chrome/browser/privacy_budget", "//chrome/browser/privacy_budget",
"//chrome/browser/profiles:profile",
"//chrome/browser/profiling_host", "//chrome/browser/profiling_host",
"//chrome/browser/promo_browser_command:mojo_bindings", "//chrome/browser/promo_browser_command:mojo_bindings",
"//chrome/browser/push_messaging:budget_proto", "//chrome/browser/push_messaging:budget_proto",
...@@ -5755,7 +5753,7 @@ static_library("browser") { ...@@ -5755,7 +5753,7 @@ static_library("browser") {
"//chrome/browser/extensions", "//chrome/browser/extensions",
"//chrome/browser/web_applications", "//chrome/browser/web_applications",
# TODO(loyso): Erase these.crbug.com / 877898. # TODO(crbug.com/877898): Erase these.
"//chrome/browser/web_applications:web_applications_on_extensions", "//chrome/browser/web_applications:web_applications_on_extensions",
"//chrome/browser/web_applications/components", "//chrome/browser/web_applications/components",
"//chrome/browser/web_applications/extensions", "//chrome/browser/web_applications/extensions",
...@@ -6704,13 +6702,13 @@ static_library("test_support") { ...@@ -6704,13 +6702,13 @@ static_library("test_support") {
public_deps = [ public_deps = [
":browser", ":browser",
"//chrome/browser/profiles:profile",
"//chrome/browser/safe_browsing:test_support", "//chrome/browser/safe_browsing:test_support",
"//chrome/browser/ui:test_support", "//chrome/browser/ui:test_support",
] ]
deps = [ deps = [
"//build:chromeos_buildflags", "//build:chromeos_buildflags",
"//chrome/app/theme:theme_resources", "//chrome/app/theme:theme_resources",
"//chrome/browser",
"//chrome/browser:browser_process", "//chrome/browser:browser_process",
"//chrome/common", "//chrome/common",
"//chrome/common/safe_browsing:proto", "//chrome/common/safe_browsing:proto",
...@@ -6979,6 +6977,7 @@ if (!is_android) { ...@@ -6979,6 +6977,7 @@ if (!is_android) {
":browser", ":browser",
"//chrome:browser_tests_pak", "//chrome:browser_tests_pak",
"//chrome/browser:browser_process", "//chrome/browser:browser_process",
"//chrome/browser/profiles:profile",
"//chrome/common:mojo_bindings", "//chrome/common:mojo_bindings",
"//chrome/test/data:web_ui_test_bindings", "//chrome/test/data:web_ui_test_bindings",
"//components/metrics:test_support", "//components/metrics:test_support",
......
...@@ -67,6 +67,7 @@ static_library("vr_android") { ...@@ -67,6 +67,7 @@ static_library("vr_android") {
"//cc", "//cc",
"//chrome/android/features/vr:jni_headers", "//chrome/android/features/vr:jni_headers",
"//chrome/browser:browser_process", "//chrome/browser:browser_process",
"//chrome/browser/profiles:profile",
"//chrome/browser/ui", "//chrome/browser/ui",
"//chrome/browser/vr:vr_common", "//chrome/browser/vr:vr_common",
"//chrome/common", "//chrome/common",
......
...@@ -25,6 +25,7 @@ source_set("app_shim") { ...@@ -25,6 +25,7 @@ source_set("app_shim") {
deps = [ deps = [
"//apps", "//apps",
"//chrome/browser:browser_process", "//chrome/browser:browser_process",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications:web_applications", "//chrome/browser/web_applications:web_applications",
"//chrome/browser/web_applications/components", "//chrome/browser/web_applications/components",
"//chrome/common", "//chrome/common",
......
...@@ -55,6 +55,7 @@ source_set("platform_apps") { ...@@ -55,6 +55,7 @@ source_set("platform_apps") {
"//chrome/browser:browser_process", "//chrome/browser:browser_process",
"//chrome/browser/extensions", "//chrome/browser/extensions",
"//chrome/browser/media/router/discovery", "//chrome/browser/media/router/discovery",
"//chrome/browser/profiles:profile",
"//chrome/browser/sharing/proto:proto", "//chrome/browser/sharing/proto:proto",
"//chrome/browser/web_applications/components:components", "//chrome/browser/web_applications/components:components",
"//chrome/browser/web_applications/extensions", "//chrome/browser/web_applications/extensions",
......
...@@ -53,6 +53,7 @@ source_set("api") { ...@@ -53,6 +53,7 @@ source_set("api") {
"//chrome/browser:browser_process", "//chrome/browser:browser_process",
"//chrome/browser/apps/platform_apps/api/music_manager_private", "//chrome/browser/apps/platform_apps/api/music_manager_private",
"//chrome/browser/extensions", "//chrome/browser/extensions",
"//chrome/browser/profiles:profile",
"//chrome/common", "//chrome/common",
"//chrome/common/apps/platform_apps", "//chrome/common/apps/platform_apps",
"//chrome/common/apps/platform_apps/api", "//chrome/common/apps/platform_apps/api",
......
...@@ -92,6 +92,7 @@ source_set("chromeos") { ...@@ -92,6 +92,7 @@ source_set("chromeos") {
"//chrome/browser/extensions", "//chrome/browser/extensions",
"//chrome/browser/image_decoder", "//chrome/browser/image_decoder",
"//chrome/browser/nearby_sharing/logging", "//chrome/browser/nearby_sharing/logging",
"//chrome/browser/profiles:profile",
"//chrome/browser/resource_coordinator:tab_metrics_event_proto", "//chrome/browser/resource_coordinator:tab_metrics_event_proto",
"//chrome/browser/resources/settings:settings_resources_grit", "//chrome/browser/resources/settings:settings_resources_grit",
"//chrome/browser/ui/webui/bluetooth_internals:mojo_bindings", "//chrome/browser/ui/webui/bluetooth_internals:mojo_bindings",
......
...@@ -784,6 +784,7 @@ static_library("extensions") { ...@@ -784,6 +784,7 @@ static_library("extensions") {
"//chrome/browser/image_decoder", "//chrome/browser/image_decoder",
"//chrome/browser/media/router", "//chrome/browser/media/router",
"//chrome/browser/media/router/discovery", "//chrome/browser/media/router/discovery",
"//chrome/browser/profiles:profile",
"//chrome/browser/resource_coordinator:intervention_policy_database_proto", "//chrome/browser/resource_coordinator:intervention_policy_database_proto",
"//chrome/browser/resource_coordinator:mojo_bindings", "//chrome/browser/resource_coordinator:mojo_bindings",
"//chrome/browser/safe_browsing", "//chrome/browser/safe_browsing",
......
...@@ -2,6 +2,47 @@ ...@@ -2,6 +2,47 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/chromeos/ui_mode.gni")
import("//extensions/buildflags/buildflags.gni")
source_set("profile") {
sources = [
"profile.cc",
"profile.h",
"profile_observer.h",
]
# Cannot depend on //chrome/browser:browser.
deps = [
"//base",
"//build:chromeos_buildflags",
"//chrome/browser/browsing_data:constants",
"//chrome/common:buildflags",
"//chrome/common:constants",
"//components/data_reduction_proxy/core/browser",
"//components/keyed_service/content",
"//components/language/core/browser",
"//components/media_router/common",
"//components/pref_registry",
"//components/sync/driver",
"//components/variations",
"//content/public/browser",
"//extensions/buildflags",
]
if (enable_extensions) {
deps += [ "//extensions/browser" ]
}
if (is_chromeos_ash) {
deps += [ "//chromeos/constants" ]
}
if (is_chromeos_lacros) {
deps += [ "//chromeos/lacros" ]
}
if (is_android) {
deps += [ "//chrome/browser/profiles/android:jni_headers" ]
}
}
if (is_android) { if (is_android) {
import("//build/config/android/rules.gni") import("//build/config/android/rules.gni")
......
...@@ -4,18 +4,4 @@ specific_include_rules = { ...@@ -4,18 +4,4 @@ specific_include_rules = {
# is created. # is created.
"+chrome/browser/performance_manager/persistence/site_data/site_data_cache_facade_factory.h" "+chrome/browser/performance_manager/persistence/site_data/site_data_cache_facade_factory.h"
], ],
# TODO(crbug.com/1149277): Remove include rules for profile once it is in its
# own GN target. GN will prevent dependency cycles more reliably.
"profile\.(cc|h)": [
# Profile is a dependency for most of //chrome/browser for keyed services.
# It should not depend on anything in the //chrome/browser target.
"-chrome/browser",
"+chrome/browser/profiles/profile.h",
# Files without dependencies on //chrome/browser:
"+chrome/browser/browsing_data/chrome_browsing_data_remover_constants.h",
"+chrome/browser/profiles/android/jni_headers",
"+chrome/browser/profiles/profile_observer.h",
# TODO(crbug.com/1149277): Remove this:
"+chrome/browser/first_run/first_run.h",
]
} }
...@@ -59,6 +59,7 @@ static_library("chrome_cleaner") { ...@@ -59,6 +59,7 @@ static_library("chrome_cleaner") {
":public", ":public",
"//chrome/browser:browser_process", "//chrome/browser:browser_process",
"//chrome/browser/extensions", "//chrome/browser/extensions",
"//chrome/browser/profiles:profile",
"//chrome/browser/safe_browsing", "//chrome/browser/safe_browsing",
"//chrome/browser/ui", "//chrome/browser/ui",
"//chrome/common", "//chrome/common",
......
...@@ -21,6 +21,7 @@ static_library("test_support") { ...@@ -21,6 +21,7 @@ static_library("test_support") {
] ]
deps = [ deps = [
"//chrome/browser", "//chrome/browser",
"//chrome/browser/profiles:profile",
"//chrome/common:constants", "//chrome/common:constants",
"//components/prefs", "//components/prefs",
] ]
......
...@@ -366,6 +366,7 @@ static_library("ui") { ...@@ -366,6 +366,7 @@ static_library("ui") {
"//chrome/browser/image_decoder", "//chrome/browser/image_decoder",
"//chrome/browser/media:mojo_bindings", "//chrome/browser/media:mojo_bindings",
"//chrome/browser/media/feeds:mojo_bindings", "//chrome/browser/media/feeds:mojo_bindings",
"//chrome/browser/profiles:profile",
"//chrome/browser/profiling_host", "//chrome/browser/profiling_host",
"//chrome/browser/resources/invalidations:invalidations_resources", "//chrome/browser/resources/invalidations:invalidations_resources",
"//chrome/browser/resources/media:webrtc_logs_resources", "//chrome/browser/resources/media:webrtc_logs_resources",
...@@ -4724,6 +4725,7 @@ static_library("test_support") { ...@@ -4724,6 +4725,7 @@ static_library("test_support") {
"//chrome/app/theme:theme_resources", "//chrome/app/theme:theme_resources",
"//chrome/browser", "//chrome/browser",
"//chrome/browser/devtools", "//chrome/browser/devtools",
"//chrome/browser/profiles:profile",
"//components/omnibox/browser", "//components/omnibox/browser",
"//components/password_manager/core/browser", "//components/password_manager/core/browser",
"//components/payments/content", "//components/payments/content",
......
...@@ -22,6 +22,7 @@ source_set("browser_tests") { ...@@ -22,6 +22,7 @@ source_set("browser_tests") {
"//chrome/browser/chromeos", "//chrome/browser/chromeos",
"//chrome/browser/chromeos:test_support", "//chrome/browser/chromeos:test_support",
"//chrome/browser/extensions", "//chrome/browser/extensions",
"//chrome/browser/profiles:profile",
"//chrome/browser/ui", "//chrome/browser/ui",
"//chrome/test:test_support_ui", "//chrome/test:test_support_ui",
"//chromeos/dbus/power:power", "//chromeos/dbus/power:power",
......
...@@ -18,6 +18,7 @@ source_set("bluetooth_internals") { ...@@ -18,6 +18,7 @@ source_set("bluetooth_internals") {
deps = [ deps = [
":mojo_bindings", ":mojo_bindings",
"//build:chromeos_buildflags", "//build:chromeos_buildflags",
"//chrome/browser/profiles:profile",
"//chrome/browser/resources/bluetooth_internals:resources", "//chrome/browser/resources/bluetooth_internals:resources",
"//chrome/common", "//chrome/common",
"//content/public/browser", "//content/public/browser",
......
...@@ -80,6 +80,7 @@ source_set("web_applications") { ...@@ -80,6 +80,7 @@ source_set("web_applications") {
":web_app_group", ":web_app_group",
"//build:chromeos_buildflags", "//build:chromeos_buildflags",
"//chrome/browser:browser_process", "//chrome/browser:browser_process",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications/components", "//chrome/browser/web_applications/components",
"//chrome/browser/web_applications/preinstalled_web_apps", "//chrome/browser/web_applications/preinstalled_web_apps",
"//chrome/common", "//chrome/common",
...@@ -184,6 +185,7 @@ source_set("web_applications_test_support") { ...@@ -184,6 +185,7 @@ source_set("web_applications_test_support") {
"//base/test:test_support", "//base/test:test_support",
"//chrome/app/theme:chrome_unscaled_resources_grit", "//chrome/app/theme:chrome_unscaled_resources_grit",
"//chrome/browser", "//chrome/browser",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications/components", "//chrome/browser/web_applications/components",
"//components/crx_file:crx_file", "//components/crx_file:crx_file",
"//components/sync:test_support_model", "//components/sync:test_support_model",
...@@ -309,6 +311,7 @@ source_set("web_applications_on_extensions") { ...@@ -309,6 +311,7 @@ source_set("web_applications_on_extensions") {
deps = [ deps = [
":web_app_group", ":web_app_group",
":web_applications", ":web_applications",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications/components", "//chrome/browser/web_applications/components",
"//chrome/browser/web_applications/extensions", "//chrome/browser/web_applications/extensions",
"//chrome/common", "//chrome/common",
...@@ -339,6 +342,7 @@ source_set("web_applications_on_extensions_test_support") { ...@@ -339,6 +342,7 @@ source_set("web_applications_on_extensions_test_support") {
"//base", "//base",
"//base/test:test_support", "//base/test:test_support",
"//chrome/browser", "//chrome/browser",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications/components", "//chrome/browser/web_applications/components",
"//components/keyed_service/content", "//components/keyed_service/content",
"//ui/webui", "//ui/webui",
......
...@@ -143,6 +143,7 @@ source_set("components") { ...@@ -143,6 +143,7 @@ source_set("components") {
"//chrome/app/resources:platform_locale_settings", "//chrome/app/resources:platform_locale_settings",
"//chrome/app/theme:chrome_unscaled_resources", "//chrome/app/theme:chrome_unscaled_resources",
"//chrome/browser:browser_process", "//chrome/browser:browser_process",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications:web_app_group", "//chrome/browser/web_applications:web_app_group",
"//chrome/common", "//chrome/common",
"//components/crx_file", "//components/crx_file",
...@@ -215,6 +216,7 @@ source_set("unit_tests") { ...@@ -215,6 +216,7 @@ source_set("unit_tests") {
"//base/test:test_support", "//base/test:test_support",
"//build:chromeos_buildflags", "//build:chromeos_buildflags",
"//chrome/app/theme:theme_resources", "//chrome/app/theme:theme_resources",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications:web_app_test_group", "//chrome/browser/web_applications:web_app_test_group",
"//chrome/browser/web_applications:web_applications", "//chrome/browser/web_applications:web_applications",
"//chrome/browser/web_applications:web_applications_test_support", "//chrome/browser/web_applications:web_applications_test_support",
...@@ -251,6 +253,7 @@ source_set("browser_tests") { ...@@ -251,6 +253,7 @@ source_set("browser_tests") {
deps = [ deps = [
":components", ":components",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications:web_applications_test_support", "//chrome/browser/web_applications:web_applications_test_support",
"//chrome/test:test_support", "//chrome/test:test_support",
"//chrome/test:test_support_ui", "//chrome/test:test_support_ui",
......
...@@ -38,8 +38,9 @@ source_set("extensions") { ...@@ -38,8 +38,9 @@ source_set("extensions") {
deps = [ deps = [
"//base", "//base",
"//chrome/browser:browser_process",
"//build:chromeos_buildflags", "//build:chromeos_buildflags",
"//chrome/browser:browser_process",
"//chrome/browser/profiles:profile",
"//chrome/browser/web_applications", "//chrome/browser/web_applications",
"//chrome/browser/web_applications:web_app_group", "//chrome/browser/web_applications:web_app_group",
"//chrome/browser/web_applications/components", "//chrome/browser/web_applications/components",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment