Skip to content

Commit

Permalink
fix overly permissive DEPS (#27193)
Browse files Browse the repository at this point in the history
Fix overly permissive deps
  • Loading branch information
bridiver authored Jan 13, 2025
1 parent ce1a0e5 commit afd4e02
Show file tree
Hide file tree
Showing 229 changed files with 1,099 additions and 424 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.cache/clangd
/vendor/*
vendor/python-patch
vendor/sparkle
vendor/bat-native-tweetnacl
vendor/gn-project-generators
vendor/web-discovery-project
vendor/depot_tools
.DS_Store
.brave_gclient_*
.gclient_*
Expand Down
22 changes: 6 additions & 16 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,11 @@ hooks = [
]

include_rules = [
#Everybody can use some things.
"+brave_base",
"+brave_domains",
"+crypto",
"+net",
"+sql",
"+ui/base",

"-chrome",
"-brave/app",
"-brave/browser",
"-brave/common",
"-brave/renderer",
"-brave/services",
"-ios",
"-brave/third_party/bitcoin-core",
"-brave/third_party/argon2",
"-brave",
"-third_party/rust",

# Everybody can use some things.
"+brave/base",
"+brave/brave_domains",
]
51 changes: 31 additions & 20 deletions app/DEPS
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
include_rules = [
"+android_webview/common",
from brave_chromium_utils import inline_file
inline_file('//chrome/app/DEPS', globals(), locals())

include_rules += [
"+chrome/app",
"+chrome/common",
"+brave/browser",
"+brave/common",
"+brave/renderer/brave_content_renderer_client.h",
"+chrome/app",
"+chrome/browser",
"+chrome/common",
"+chrome/child",
"+chrome/test",
"+content/public/app",
"+content/public/browser",
"+content/public/common",
"+content/public/test",
"+brave/components/brave_component_updater/browser/features.h",
"+brave/components/brave_component_updater/browser/switches.h",
"+brave/components/brave_sync/buildflags.h",
"+brave/components/constants/brave_switches.h",
"+brave/components/variations/buildflags.h",
"+brave/components/commands/common/features.h",
"+brave/components/speedreader/common/buildflags/buildflags.h",
"+brave/components/update_client/buildflags.h",
"+brave/components/variations/command_line_utils.h",
"+brave/utility/brave_content_utility_client.h",
"+components/component_updater/component_updater_switches.h",
"+components/dom_distiller/core/dom_distiller_switches.h",
"+components/embedder_support/switches.h",
Expand Down Expand Up @@ -56,19 +61,25 @@ include_rules = [
"+components/password_manager/core/common/password_manager_features.h",
"+components/device_signals/core/common/signals_features.h",
"+components/translate/core/common/translate_util.h",
"+extensions/common",
"+google_apis/gaia",
"+gpu/config",
"+media/base/media_switches.h",
"+services/device/public",
"+services/network",
"+third_party/blink/public/common",
"+ui/accessibility",
"+google_apis/gaia/gaia_switches.h",
]

specific_include_rules = {
".*test\.cc": [
"+chrome/test/base",
"+content/public/test",
],
"feature_defaults_unittest\.cc": [
"+gpu/config/gpu_finch_features.h",
"+net/base/features.h",
"+services/network/public/cpp/features.h",
"+third_party/blink/public/common/features.h",
"+ui/accessibility/accessibility_features.h",
"+ui/base/ui_base_features.h",
"+android_webview/common/aw_features.h",
"+extensions/common/extension_features.h",
"+services/device/public/cpp/device_features.h",
# code outside of content should not access content/common
"!content/common",
]
],
}
207 changes: 90 additions & 117 deletions browser/DEPS
Original file line number Diff line number Diff line change
@@ -1,127 +1,100 @@
include_rules = [
"+cc/metrics",
"+cc/paint",
"+cc/test",
from brave_chromium_utils import inline_file
inline_file("//chrome/DEPS", globals(), locals())

chrome_browser_deps = {}
inline_file("//chrome/browser/DEPS", {}, chrome_browser_deps)
include_rules += chrome_browser_deps["include_rules"]

include_rules += [
"+brave/grit",
"+brave/app",
"!brave/build/android",
"+brave/common",
"+brave/services/network/public",
"+chrome/app",
"+brave/test/base",
"+brave/ui",
"!brave/third_party/blink/renderer/brave_farbling_constants.h",
"+brave/net",
"+brave/components/constants",
"+chrome/browser",
"+chrome/common",
"+chrome/grit",
"+chrome/installer/util",
"+chrome/install_static",
"+chrome/test",
"+content/public/browser",
"+content/public/common",
"+content/public/test",
"+content/test",
# TODO(bridiver) - narrow this down
"+components",
"+device",
"+extensions/browser",
"+extensions/common",
"+extensions/buildflags",
"+extensions/grit",
"+extensions/test",
"+google_apis",
"+media/media_buildflags.h",
"+media/audio", # For media audio hang monitor.
"+media/base", # For media switches
"+media/capabilities", # For InMemoryVideoDecodeStatsDB
"+media/cdm/cdm_paths.h",
"+media/capture",
"+media/midi", # For midi switches
"+media/mojo", # For mojo media services.
"+media/renderers",
"+media/webrtc", # For webrtc media switches.
"+mojo/public",
"+net",
"+printing/buildflags/buildflags.h",
"+sandbox/mac",
"+sandbox/policy",
"+services/audio/public",
"+services/cert_verifier",
"+services/data_decoder/public",
"+services/device/public",
"+services/image_annotation/public",
"+services/media_session/public",
"+services/metrics/public",
"+services/network/host_resolver.h",
"+services/network/network_context.h",
"+services/network/network_service.h",
"+services/network/public",
"+services/network/test",
"+services/preferences/public/cpp",
"+services/preferences/public/mojom",
"+services/proxy_resolver",
"+services/proxy_resolver/public/mojom",
"+services/resource_coordinator/public/cpp",
"+services/resource_coordinator/public/mojom",
"+services/service_manager/public/cpp",
"+services/strings",
"+third_party/boringssl/src/include",
"+third_party/crashpad",
"+third_party/widevine/cdm/buildflags.h",
"+third_party/widevine/cdm/widevine_cdm_common.h",
"+ui",

# Code under //ash should be accessed via its public API. See //ash/README.md.
"-ash",
"+ash/public",
"+ash/keyboard/ui/grit",
"+ash/keyboard/ui/resources",
"+ash/components/shortcut_viewer",

# The message center should only be accessed through
# //chrome/browser/notifications.
"-ui/message_center",
"+ui/message_center/public",

# chrome only needs switches and features flags from cc. All usage of the
# compositor is from content. Definitely don't include generic stuff from
# cc/base here, if this is needed these files need to move to base/
"+cc/base/features.h",
"+cc/base/switches.h",

# Unsafe to use from //chrome, see http://goo.gl/QQG5wo
"-content/public/test/test_browser_context.h",

"+storage/browser",
"+storage/common",

# Explicitly disallow using SyncMessageFilter to prevent browser from
# sending synchronous IPC messages on non-UI threads.
"-ipc/ipc_sync_message_filter.h",

# Allows in-process use of NetworkService for URLRequestContext configuration.
# Should be removed once the actual network service ships.
"+content/public/network",

# Other libraries.
"+third_party/google_toolbox_for_mac/src",
"+third_party/icu/source/common/unicode",
"+third_party/icu/source/i18n/unicode",
"+third_party/leveldatabase",
"+third_party/libxml/chromium/xml_writer.h",
"+third_party/mozilla", # Mozilla interface headers.
"+third_party/ocmock/gtest_support.h",
"+third_party/protobuf/src/google/protobuf",
"+third_party/re2",
"+third_party/skia",
"+third_party/smhasher",
"+third_party/sqlite",
"+third_party/zlib",
# TODO(bridiver) code outside of content should only dependon content/public
"!content/test",

# No inclusion of WebKit from the browser, other than the ones in
# WebKit/public/{mojom,common}.
# TODO(crbug.com/1008303) clarify dependency and remove or move these individual headers
# into public/common.
"-third_party/blink",
"+third_party/blink/public/common",
"+third_party/blink/public/mojom",
"+third_party/blink/public/public_buildflags.h",
"+brave/components/p3a",
"+brave/components/p3a_utils",
"+brave/components/ai_chat/content/browser",
"+brave/components/ai_chat/core/common",
"+brave/components/ai_chat/core/browser",
"+brave/components/ai_rewriter/common",
"+brave/components/brave_ads/browser",
"+brave/components/brave_ads/core/public",
"+brave/components/brave_component_updater/browser",
"+brave/components/brave_news/browser",
"+brave/components/brave_news/common",
"+brave/components/brave_rewards/browser",
"+brave/components/brave_rewards/common",
"+brave/components/brave_shields/content/browser",
"+brave/components/brave_shields/core/common",
"+brave/components/brave_wallet/browser",
"+brave/components/brave_wallet/common",
"+brave/components/de_amp/common",
"+brave/components/de_amp/browser",
"+brave/components/debounce/content/browser",
"+brave/components/debounce/core/browser",
"+brave/components/debounce/core/common",
"+brave/components/google_sign_in_permission",
"+brave/components/ntp_background_images/browser",
"+brave/components/ntp_background_images/buildflags",
"+brave/components/playlist/browser",
"+brave/components/playlist/common",
"+brave/components/psst/browser/content",
"+brave/components/psst/common",
"+brave/components/skus/browser",
"+brave/components/skus/common",
"+brave/components/speedreader",
"-brave/components/speedreader/renderer",
"+brave/components/webcompat/content/browser",
"+brave/components/webcompat/core/common",
"+brave/components/brave_vpn/browser",
"+brave/components/brave_vpn/common",
"+brave/components/request_otr/browser",
"+brave/components/request_otr/common",
"+brave/components/commander/common",
"+brave/components/commands/common",
"+brave/components/brave_sync",
"+brave/components/ipfs",
"+brave/components/tor",
"-brave/components/tor/renderer",
"+brave/components/brave_referrals/browser",
"+brave/components/https_upgrade_exceptions/browser",
"+brave/components/localhost_permission",
"+brave/components/url_sanitizer/browser",
"+brave/components/body_sniffer",
"+brave/components/brave_federated",
"+brave/components/brave_search/browser",
"+brave/components/brave_search/common",
"+brave/components/brave_webtorrent/browser",
"+brave/components/cosmetic_filters/browser",
"+brave/components/cosmetic_filters/common",
"+brave/components/decentralized_dns/content",
"+brave/components/decentralized_dns/core",
"+brave/components/services/bat_ads/public",
"+brave/components/translate/core/common",
"+brave/components/brave_new_tab_ui",
"+brave/components/brave_private_new_tab_ui/common",
"+brave/components/widevine/constants.h",
"+brave/components/brave_drm",
"+brave/components/brave_search_conversion",
"+brave/components/misc_metrics",
"+brave/components/brave_wayback_machine",
"+brave/components/brave_adaptive_captcha",
"+brave/components/brave_perf_predictor/browser",
"+brave/components/omnibox/browser",
"+brave/components/search_engines",
"+brave/components/webcompat_reporter/common",
"+brave/components/sidebar/browser",
"+brave/components/l10n/common",
]

specific_include_rules = {
Expand Down
9 changes: 7 additions & 2 deletions browser/ai_chat/DEPS
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
include_rules = [
"+printing/buildflags",
"+services/screen_ai",
"+brave/components/text_recognition/common",
]

specific_include_rules = {
"brave_open_ai_chat_permission_context_unittest\.cc": [
"+brave/components/permissions/contexts/brave_open_ai_chat_permission_context.h",
]
}
3 changes: 3 additions & 0 deletions browser/android/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include_rules = [
"+brave/components/sync/service",
]
3 changes: 3 additions & 0 deletions browser/android/preferences/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include_rules = [
"+brave/components/brave_perf_predictor/common",
]
5 changes: 5 additions & 0 deletions browser/brave_ads/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include_rules = [
"+brave/components/brave_ads/content/browser",
"+brave/components/brave_ads/core/browser/service",
"+brave/components/brave_ads/core/mojom",
]
3 changes: 3 additions & 0 deletions browser/brave_ads/services/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include_rules = [
"+brave/components/services/bat_ads",
]
3 changes: 3 additions & 0 deletions browser/brave_federated/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include_rules = [
"+brave/components/brave_federated",
]
5 changes: 5 additions & 0 deletions browser/brave_rewards/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include_rules = [
"+brave/components/brave_rewards/core",
"+brave/components/brave_rewards/resources",
"+brave/components/script_injector/common",
]
4 changes: 4 additions & 0 deletions browser/brave_rewards/android/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include_rules = [
"+brave/components/brave_ads/core/browser/service",
"+brave/components/brave_ads/core/mojom",
]
8 changes: 7 additions & 1 deletion browser/brave_shields/DEPS
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
include_rules = [
"+brave/components/brave_shields/core/browser",
"+brave/components/brave_shields/content/test",
"+services/network/host_resolver.h",
]

specific_include_rules = {
"brave_timestamp_rounding_browsertest\.cc": [
"+content/public/renderer/render_frame.h",
"!content/public/renderer/render_frame.h",
],
}
6 changes: 6 additions & 0 deletions browser/brave_stats/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include_rules = [
"+brave/components/brave_referrals/common",
"+brave/components/brave_stats/browser",
"+brave/components/rpill/common",
"+brave/components/version_info",
]
Loading

0 comments on commit afd4e02

Please sign in to comment.