diff --git a/app/DEPS b/app/DEPS index c849e547e4ba..092bfce72570 100644 --- a/app/DEPS +++ b/app/DEPS @@ -12,6 +12,7 @@ include_rules = [ "+content/public/common", "+content/public/test", "+components/autofill/core/common", + "+components/component_updater/component_updater_switches.h", "+components/embedder_support/switches.h", "+components/federated_learning/features/features.h", "+components/feed/feed_feature_list.h", diff --git a/app/brave_main_delegate.cc b/app/brave_main_delegate.cc index 24a275c96d44..869f471ade64 100644 --- a/app/brave_main_delegate.cc +++ b/app/brave_main_delegate.cc @@ -18,6 +18,8 @@ #include "brave/browser/brave_content_browser_client.h" #include "brave/common/brave_switches.h" #include "brave/common/resource_bundle_helper.h" +#include "brave/components/brave_component_updater/browser/features.h" +#include "brave/components/brave_component_updater/browser/switches.h" #include "brave/components/speedreader/buildflags.h" #include "brave/renderer/brave_content_renderer_client.h" #include "brave/utility/brave_content_utility_client.h" @@ -29,6 +31,7 @@ #include "chrome/common/chrome_switches.h" #include "components/autofill/core/common/autofill_features.h" #include "components/autofill/core/common/autofill_payments_features.h" +#include "components/component_updater/component_updater_switches.h" #include "components/dom_distiller/core/dom_distiller_switches.h" #include "components/embedder_support/switches.h" #include "components/federated_learning/features/features.h" @@ -63,10 +66,29 @@ #endif namespace { + +const char kBraveOriginTrialsPublicKey[] = + "bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld9Mw3E=," + "fMS4mpO6buLQ/QMd+zJmxzty/VQ6B1EUZqoCU04zoRU="; + // staging "https://sync-v2.bravesoftware.com/v2" can be overriden by // switches::kSyncServiceURL manually const char kBraveSyncServiceStagingURL[] = "https://sync-v2.bravesoftware.com/v2"; + +const char kDummyUrl[] = "https://no-thanks.invalid"; + +std::string GetUpdateURLHost() { + const base::CommandLine& command_line = + *base::CommandLine::ForCurrentProcess(); + if (!command_line.HasSwitch(brave_component_updater::kUseGoUpdateDev) && + !base::FeatureList::IsEnabled( + brave_component_updater::kUseDevUpdaterUrl)) { + return UPDATER_PROD_ENDPOINT; + } + return UPDATER_DEV_ENDPOINT; +} + } // namespace #if !defined(CHROME_MULTIPLE_DLL_BROWSER) @@ -80,12 +102,6 @@ base::LazyInstance::DestructorAtExit g_brave_content_browser_client = LAZY_INSTANCE_INITIALIZER; #endif -const char kBraveOriginTrialsPublicKey[] = - "bYUKPJoPnCxeNvu72j4EmPuK7tr1PAC7SHh8ld9Mw3E=," - "fMS4mpO6buLQ/QMd+zJmxzty/VQ6B1EUZqoCU04zoRU="; - -const char kDummyUrl[] = "https://no-thanks.invalid"; - BraveMainDelegate::BraveMainDelegate() : ChromeMainDelegate() {} BraveMainDelegate::BraveMainDelegate(base::TimeTicks exe_entry_point_ticks) @@ -165,6 +181,12 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) { command_line.AppendSwitch(switches::kEnableDomDistiller); command_line.AppendSwitch(switches::kNoPings); + std::string update_url = GetUpdateURLHost(); + if (!update_url.empty()) { + std::string source = "url-source=" + update_url; + command_line.AppendSwitchASCII(switches::kComponentUpdater, source.c_str()); + } + if (!base::CommandLine::ForCurrentProcess()->HasSwitch( embedder_support::kOriginTrialPublicKey)) { command_line.AppendSwitchASCII(embedder_support::kOriginTrialPublicKey, diff --git a/app/brave_main_delegate_browsertest.cc b/app/brave_main_delegate_browsertest.cc index d178b26e7d43..c2ffff2788ea 100644 --- a/app/brave_main_delegate_browsertest.cc +++ b/app/brave_main_delegate_browsertest.cc @@ -9,6 +9,7 @@ #include "chrome/test/base/chrome_test_utils.h" #include "components/autofill/core/common/autofill_features.h" #include "components/autofill/core/common/autofill_payments_features.h" +#include "components/component_updater/component_updater_switches.h" #include "components/embedder_support/switches.h" #include "components/federated_learning/features/features.h" #include "components/language/core/common/language_experiments.h" @@ -51,6 +52,15 @@ IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, ShouldCreateService()); } +IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, + ComponentUpdaterReplacement) { + EXPECT_TRUE(base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kComponentUpdater)); + EXPECT_EQ(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kComponentUpdater), + "url-source=" UPDATER_PROD_ENDPOINT); +} + IN_PROC_BROWSER_TEST_F(BraveMainDelegateBrowserTest, DisableHyperlinkAuditing) { EXPECT_TRUE( base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoPings)); diff --git a/browser/extensions/BUILD.gn b/browser/extensions/BUILD.gn index acafc7989419..5b2cd617875d 100644 --- a/browser/extensions/BUILD.gn +++ b/browser/extensions/BUILD.gn @@ -120,10 +120,7 @@ source_set("extensions") { "ethereum_remote_client_util.cc", "ethereum_remote_client_util.h", ] - configs += [ - ":infura_config", - ":brave_services_config", - ] + configs += [ ":infura_config" ] deps += [ "//brave/browser/ethereum_remote_client", "//brave/components/brave_wallet/browser", @@ -227,10 +224,6 @@ group("resources") { } } -config("brave_services_config") { - defines = [ "BRAVE_SERVICES_KEY=\"$brave_services_key\"" ] -} - config("infura_config") { defines = [ "BRAVE_INFURA_PROJECT_ID=\"$brave_infura_project_id\"" ] } diff --git a/browser/net/BUILD.gn b/browser/net/BUILD.gn index 024565b8b0f9..39fb0e56d308 100644 --- a/browser/net/BUILD.gn +++ b/browser/net/BUILD.gn @@ -6,9 +6,6 @@ import("//brave/components/decentralized_dns/buildflags/buildflags.gni") import("//brave/components/ipfs/buildflags/buildflags.gni") import("//build/config/features.gni") -# Refer to the keyed API spec for more details about the Brave Services Key -defines = brave_service_key_defines - source_set("net") { # Remove when https://github.com/brave/brave-browser/issues/10659 is resolved check_includes = false diff --git a/browser/net/brave_common_static_redirect_network_delegate_helper.cc b/browser/net/brave_common_static_redirect_network_delegate_helper.cc index 096a6bb188cd..5f80c16c8ece 100644 --- a/browser/net/brave_common_static_redirect_network_delegate_helper.cc +++ b/browser/net/brave_common_static_redirect_network_delegate_helper.cc @@ -7,67 +7,17 @@ #include #include -#include -#include "base/command_line.h" -#include "base/feature_list.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "brave/common/network_constants.h" -#include "brave/components/brave_component_updater/browser/features.h" -#include "brave/components/brave_component_updater/browser/switches.h" -#include "components/component_updater/component_updater_url_constants.h" -#include "extensions/buildflags/buildflags.h" #include "extensions/common/url_pattern.h" #include "net/base/net_errors.h" -#if BUILDFLAG(ENABLE_EXTENSIONS) -#include "extensions/common/extension_urls.h" -#endif - namespace brave { -const char kUpdaterTestingEndpoint[] = "test.updater.com"; - namespace { -bool g_updater_url_host_for_testing_ = false; - -std::string GetUpdateURLHost() { - if (g_updater_url_host_for_testing_) - return kUpdaterTestingEndpoint; - - const base::CommandLine& command_line = - *base::CommandLine::ForCurrentProcess(); - if (!command_line.HasSwitch(brave_component_updater::kUseGoUpdateDev) && - !base::FeatureList::IsEnabled( - brave_component_updater::kUseDevUpdaterUrl)) { - return UPDATER_PROD_ENDPOINT; - } - return UPDATER_DEV_ENDPOINT; -} - -// Update server checks happen from the profile context for admin policy -// installed extensions. Update server checks happen from the system context for -// normal update operations. -bool IsUpdaterURL(const GURL& gurl) { - static std::vector updater_patterns( - {URLPattern(URLPattern::SCHEME_HTTPS, - std::string(component_updater::kUpdaterJSONDefaultUrl) + "*"), - URLPattern( - URLPattern::SCHEME_HTTP, - std::string(component_updater::kUpdaterJSONFallbackUrl) + "*"), -#if BUILDFLAG(ENABLE_EXTENSIONS) - URLPattern( - URLPattern::SCHEME_HTTPS, - std::string(extension_urls::kChromeWebstoreUpdateURL) + "*") -#endif - }); - return std::any_of( - updater_patterns.begin(), updater_patterns.end(), - [&gurl](URLPattern pattern) { return pattern.MatchesURL(gurl); }); -} - bool RewriteBugReportingURL(const GURL& request_url, GURL* new_url) { GURL url("https://github.com/brave/brave-browser/issues/new"); std::string query = "title=Crash%20Report&labels=crash"; @@ -94,10 +44,6 @@ bool RewriteBugReportingURL(const GURL& request_url, GURL* new_url) { } // namespace -void SetUpdateURLHostForTesting(bool testing) { - g_updater_url_host_for_testing_ = testing; -} - int OnBeforeURLRequest_CommonStaticRedirectWork( const ResponseCallback& next_callback, std::shared_ptr ctx) { @@ -124,15 +70,6 @@ int OnBeforeURLRequest_CommonStaticRedirectWorkForGURL( URLPattern::SCHEME_HTTP | URLPattern::SCHEME_HTTPS, "*://bugs.chromium.org/p/chromium/issues/entry?*"); - if (IsUpdaterURL(request_url)) { - auto update_host = GetUpdateURLHost(); - if (!update_host.empty()) { - replacements.SetQueryStr(request_url.query_piece()); - *new_url = GURL(update_host).ReplaceComponents(replacements); - } - return net::OK; - } - if (chromecast_pattern.MatchesURL(request_url)) { replacements.SetSchemeStr("https"); replacements.SetHostStr(kBraveRedirectorProxy); diff --git a/browser/net/brave_common_static_redirect_network_delegate_helper.h b/browser/net/brave_common_static_redirect_network_delegate_helper.h index 33bd68f014fe..db08dcf3823b 100644 --- a/browser/net/brave_common_static_redirect_network_delegate_helper.h +++ b/browser/net/brave_common_static_redirect_network_delegate_helper.h @@ -14,8 +14,6 @@ class GURL; namespace brave { -extern const char kUpdaterTestingEndpoint[]; - int OnBeforeURLRequest_CommonStaticRedirectWork( const ResponseCallback& next_callback, std::shared_ptr ctx); @@ -24,7 +22,6 @@ int OnBeforeURLRequest_CommonStaticRedirectWorkForGURL( const GURL& url, GURL* new_url); -void SetUpdateURLHostForTesting(bool testing); } // namespace brave #endif // BRAVE_BROWSER_NET_BRAVE_COMMON_STATIC_REDIRECT_NETWORK_DELEGATE_HELPER_H_ diff --git a/browser/net/brave_common_static_redirect_network_delegate_helper_unittest.cc b/browser/net/brave_common_static_redirect_network_delegate_helper_unittest.cc index d1f3c8769139..2b9c97e72250 100644 --- a/browser/net/brave_common_static_redirect_network_delegate_helper_unittest.cc +++ b/browser/net/brave_common_static_redirect_network_delegate_helper_unittest.cc @@ -11,8 +11,6 @@ #include "base/command_line.h" #include "brave/browser/net/url_context.h" #include "brave/common/network_constants.h" -#include "brave/components/brave_component_updater/browser/switches.h" -#include "components/component_updater/component_updater_url_constants.h" #include "net/base/net_errors.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -20,53 +18,6 @@ using brave::ResponseCallback; -namespace { -const char kComponentUpdaterProxy[] = "https://componentupdater.brave.com"; -} - -TEST(BraveCommonStaticRedirectNetworkDelegateHelperTest, - ModifyComponentUpdaterURL) { - brave::SetUpdateURLHostForTesting(true); - const std::string query_string("?foo=bar"); - const GURL url(component_updater::kUpdaterJSONDefaultUrl + query_string); - auto request_info = std::make_shared(url); - const GURL expected_url( - std::string(brave::kUpdaterTestingEndpoint + query_string)); - - int rc = OnBeforeURLRequest_CommonStaticRedirectWork(ResponseCallback(), - request_info); - EXPECT_EQ(GURL(request_info->new_url_spec), expected_url); - EXPECT_EQ(rc, net::OK); -} - -TEST(BraveCommonStaticRedirectNetworkDelegateHelperTest, - ModifyComponentUpdaterURLDev) { - brave::SetUpdateURLHostForTesting(true); - base::CommandLine::ForCurrentProcess()->AppendSwitch( - brave_component_updater::kUseGoUpdateDev); - const std::string query_string("?foo=bar"); - const GURL url(component_updater::kUpdaterJSONDefaultUrl + query_string); - auto request_info = std::make_shared(url); - const GURL expected_url( - std::string(brave::kUpdaterTestingEndpoint + query_string)); - - int rc = OnBeforeURLRequest_CommonStaticRedirectWork(ResponseCallback(), - request_info); - EXPECT_EQ(GURL(request_info->new_url_spec), expected_url); - EXPECT_EQ(rc, net::OK); -} - -TEST(BraveCommonStaticRedirectNetworkDelegateHelperTest, - NoModifyComponentUpdaterURL) { - const GURL url(kComponentUpdaterProxy); - auto request_info = std::make_shared(url); - - int rc = OnBeforeURLRequest_CommonStaticRedirectWork(ResponseCallback(), - request_info); - EXPECT_EQ(request_info->new_url_spec, GURL()); - EXPECT_EQ(rc, net::OK); -} - TEST(BraveCommonStaticRedirectNetworkDelegateHelperTest, RedirectChromecastDownload) { const GURL url( diff --git a/browser/net/brave_service_key_network_delegate_helper_browsertest.cc b/browser/net/brave_service_key_network_delegate_helper_browsertest.cc index 95b6c26b7662..ff7bf2dc83ea 100644 --- a/browser/net/brave_service_key_network_delegate_helper_browsertest.cc +++ b/browser/net/brave_service_key_network_delegate_helper_browsertest.cc @@ -85,17 +85,7 @@ IN_PROC_BROWSER_TEST_F(BraveServiceKeyNetworkDelegateBrowserTest, IN_PROC_BROWSER_TEST_F(BraveServiceKeyNetworkDelegateBrowserTest, IncludesBraveServiceKey) { - GURL target = - https_server().GetURL(GURL(UPDATER_DEV_ENDPOINT).host(), "/index.html"); - ui_test_utils::NavigateToURL(browser(), target); - EXPECT_TRUE(header_result()); - - target = - https_server().GetURL(GURL(UPDATER_PROD_ENDPOINT).host(), "/index.html"); - ui_test_utils::NavigateToURL(browser(), target); - EXPECT_TRUE(header_result()); - - target = https_server().GetURL(kExtensionUpdaterDomain, "/index.html"); + GURL target = https_server().GetURL(kExtensionUpdaterDomain, "/index.html"); ui_test_utils::NavigateToURL(browser(), target); EXPECT_TRUE(header_result()); } diff --git a/build/BUILD.gn b/build/BUILD.gn index fbf65421778d..8a5831afcd61 100644 --- a/build/BUILD.gn +++ b/build/BUILD.gn @@ -5,6 +5,8 @@ brave_include_dirs_ = [ "//brave/chromium_src" ] config("compiler") { include_dirs = brave_include_dirs_ + defines = brave_service_key_defines + defines += brave_updater_defines } # do not expose this as a public config anywhere diff --git a/build/commands/lib/config.js b/build/commands/lib/config.js index 94d657fb61a6..c3efb161e78e 100755 --- a/build/commands/lib/config.js +++ b/build/commands/lib/config.js @@ -431,8 +431,6 @@ Config.prototype.buildArgs = function () { args.ios_provider_target = "//brave/ios/browser/providers:brave_providers" delete args.safebrowsing_api_endpoint - delete args.updater_prod_endpoint - delete args.updater_dev_endpoint delete args.safe_browsing_mode delete args.proprietary_codecs delete args.ffmpeg_branding diff --git a/build/features.gni b/build/features.gni index 308109b4b18d..46411294a0cc 100644 --- a/build/features.gni +++ b/build/features.gni @@ -1,5 +1,13 @@ declare_args() { brave_services_key = "" + updater_dev_endpoint = "" + updater_prod_endpoint = "" +} + +if (is_official_build) { + assert(brave_services_key != "") + assert(updater_dev_endpoint != "") + assert(updater_prod_endpoint != "") } brave_service_key_defines = [] @@ -8,3 +16,8 @@ if (brave_services_key != "") { } else { brave_service_key_defines += [ "BRAVE_SERVICES_KEY=\"dummytoken\"" ] } + +brave_updater_defines = [ + "UPDATER_DEV_ENDPOINT=\"$updater_dev_endpoint\"", + "UPDATER_PROD_ENDPOINT=\"$updater_prod_endpoint\"", +] diff --git a/chromium_src/chrome/common/DEPS b/chromium_src/chrome/common/DEPS index 0cd460876a8e..adc6bae5e4bf 100644 --- a/chromium_src/chrome/common/DEPS +++ b/chromium_src/chrome/common/DEPS @@ -1,10 +1,11 @@ include_rules = [ "+../../../../chrome/common", + "+../../../../../chrome/common/extensions", "+../../../../../chrome/common/importer", "+../../../../../chrome/common/media", "+../../../../../../chrome/common/extensions/permissions", "+brave/common", "+chrome/common", "+components/version_info", + "+components/component_updater", ] -6 \ No newline at end of file diff --git a/chromium_src/chrome/common/initialize_extensions_client.cc b/chromium_src/chrome/common/initialize_extensions_client.cc new file mode 100644 index 000000000000..789d63b88f47 --- /dev/null +++ b/chromium_src/chrome/common/initialize_extensions_client.cc @@ -0,0 +1,10 @@ +// Copyright (c) 2021 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. + +#include "brave/common/extensions/brave_extensions_client.h" + +#define ChromeExtensionsClient BraveExtensionsClient +#include "../../../../chrome/common/initialize_extensions_client.cc" +#undef ChromeExtensionsClient diff --git a/chromium_src/components/update_client/protocol_serializer.cc b/chromium_src/components/update_client/protocol_serializer.cc new file mode 100644 index 000000000000..14f254b8a10e --- /dev/null +++ b/chromium_src/components/update_client/protocol_serializer.cc @@ -0,0 +1,26 @@ +/* Copyright (c) 2021 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "components/update_client/protocol_serializer.h" + +#define BuildUpdateCheckExtraRequestHeaders \ + BuildUpdateCheckExtraRequestHeaders_ChromiumImpl +#include "../../../../components/update_client/protocol_serializer.cc" +#undef BuildUpdateCheckExtraRequestHeaders + +namespace update_client { + +base::flat_map BuildUpdateCheckExtraRequestHeaders( + const std::string& prod_id, + const base::Version& browser_version, + const std::vector& ids, + bool is_foreground) { + auto headers = BuildUpdateCheckExtraRequestHeaders_ChromiumImpl( + prod_id, browser_version, ids, is_foreground); + headers.insert({"BraveServiceKey", BRAVE_SERVICES_KEY}); + return headers; +} + +} // namespace update_client diff --git a/common/BUILD.gn b/common/BUILD.gn index 53622f887430..f20f11178b5f 100644 --- a/common/BUILD.gn +++ b/common/BUILD.gn @@ -133,6 +133,8 @@ source_set("common") { sources += [ "extensions/brave_extensions_api_provider.cc", "extensions/brave_extensions_api_provider.h", + "extensions/brave_extensions_client.cc", + "extensions/brave_extensions_client.h", "extensions/whitelist.cc", "extensions/whitelist.h", ] diff --git a/common/extensions/DEPS b/common/extensions/DEPS index 08b52cb8cbf3..5b6b028d0d8e 100644 --- a/common/extensions/DEPS +++ b/common/extensions/DEPS @@ -1,3 +1,4 @@ include_rules = [ + "+components/component_updater", "+extensions/common", ] diff --git a/common/extensions/brave_extensions_client.cc b/common/extensions/brave_extensions_client.cc new file mode 100644 index 000000000000..4dbd92eec377 --- /dev/null +++ b/common/extensions/brave_extensions_client.cc @@ -0,0 +1,58 @@ +// Copyright (c) 2021 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. + +#include "brave/common/extensions/brave_extensions_client.h" + +#include +#include + +#include "base/command_line.h" +#include "base/strings/string_split.h" +#include "base/strings/string_util.h" +#include "components/component_updater/component_updater_switches.h" + +namespace extensions { + +namespace { + +std::string ParseUpdateUrlHost(std::string options) { + std::vector flags = base::SplitString( + options, ",", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + + for (const auto& flag : flags) { + std::vector values = base::SplitString( + flag, "=", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + + if (values.size() != 2) { + continue; + } + + std::string name = base::ToLowerASCII(values[0]); + std::string value = values[1]; + + if (name == "url-source") { + return value; + } + } + + return ""; +} + +} // namespace + +BraveExtensionsClient::BraveExtensionsClient() : ChromeExtensionsClient() {} + +void BraveExtensionsClient::InitializeWebStoreUrls( + base::CommandLine* command_line) { + webstore_update_url_ = GURL(ParseUpdateUrlHost( + command_line->GetSwitchValueASCII(switches::kComponentUpdater))); + ChromeExtensionsClient::InitializeWebStoreUrls(command_line); +} + +const GURL& BraveExtensionsClient::GetWebstoreUpdateURL() const { + return webstore_update_url_; +} + +} // namespace extensions diff --git a/common/extensions/brave_extensions_client.h b/common/extensions/brave_extensions_client.h new file mode 100644 index 000000000000..59168ff82123 --- /dev/null +++ b/common/extensions/brave_extensions_client.h @@ -0,0 +1,28 @@ +// Copyright (c) 2021 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef BRAVE_COMMON_EXTENSIONS_BRAVE_EXTENSIONS_CLIENT_H_ +#define BRAVE_COMMON_EXTENSIONS_BRAVE_EXTENSIONS_CLIENT_H_ + +#include "chrome/common/extensions/chrome_extensions_client.h" + +namespace extensions { + +class BraveExtensionsClient : public ChromeExtensionsClient { + public: + BraveExtensionsClient(); + BraveExtensionsClient(const BraveExtensionsClient&) = delete; + BraveExtensionsClient& operator=(const BraveExtensionsClient&) = delete; + + void InitializeWebStoreUrls(base::CommandLine* command_line) override; + const GURL& GetWebstoreUpdateURL() const override; + + private: + GURL webstore_update_url_; +}; + +} // namespace extensions + +#endif // BRAVE_COMMON_EXTENSIONS_BRAVE_EXTENSIONS_CLIENT_H_ diff --git a/components/brave_component_updater/browser/BUILD.gn b/components/brave_component_updater/browser/BUILD.gn index 196d6a0d4edf..a1e702aef87a 100644 --- a/components/brave_component_updater/browser/BUILD.gn +++ b/components/brave_component_updater/browser/BUILD.gn @@ -1,17 +1,5 @@ import("//extensions/buildflags/buildflags.gni") -declare_args() { - updater_dev_endpoint = "" - updater_prod_endpoint = "" -} - -config("updater_config") { - defines = [ - "UPDATER_DEV_ENDPOINT=\"$updater_dev_endpoint\"", - "UPDATER_PROD_ENDPOINT=\"$updater_prod_endpoint\"", - ] -} - static_library("browser") { sources = [ "brave_component.cc", @@ -29,7 +17,6 @@ static_library("browser") { "switches.h", ] - public_configs = [ ":updater_config" ] deps = [ "//base", "//components/component_updater:component_updater", diff --git a/components/sync/driver/BUILD.gn b/components/sync/driver/BUILD.gn index 29712f0429e9..0a43f12a7874 100644 --- a/components/sync/driver/BUILD.gn +++ b/components/sync/driver/BUILD.gn @@ -8,8 +8,6 @@ import("//brave/build/features.gni") source_set("unit_tests") { testonly = true - defines = brave_service_key_defines - public_deps = [ "//testing/gmock", "//testing/gtest", diff --git a/patches/components-sync-driver-BUILD.gn.patch b/patches/components-sync-driver-BUILD.gn.patch index d986830798f7..b245cd6c2d83 100644 --- a/patches/components-sync-driver-BUILD.gn.patch +++ b/patches/components-sync-driver-BUILD.gn.patch @@ -6,7 +6,7 @@ index b2828a0321267bba655d7872c04df3b8d07ead87..424610060c147892294d35623d4345e2 } configs += [ "//build/config/compiler:wexit_time_destructors" ] -+ sources += brave_components_sync_driver_sources deps += brave_components_sync_driver_deps defines = brave_service_key_defines ++ sources += brave_components_sync_driver_sources deps += brave_components_sync_driver_deps } static_library("test_support") { diff --git a/test/BUILD.gn b/test/BUILD.gn index 877fabdcb5fd..3a9e65a81436 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -147,8 +147,6 @@ test("brave_unit_tests") { "//components/sync_device_info/device_info_sync_bridge_unittest.cc", ] - defines = brave_service_key_defines - deps = [ ":crypto_unittests", ":test_support",