From a5b8c1f1ba50dd65c7cbe7bacbb79ed71cc78ac7 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Tue, 5 Sep 2023 16:26:54 +0200 Subject: [PATCH] v117 to be checked --- build/patches/00Disable-WebGPU.patch | 32 +- ...e-privacy-issues-in-password-manager.patch | 37 +- ...ct-the-entire-FrameTree-like-desktop.patch | 11 +- ...00Eyeo-Adblock-Remove-Privacy-Issues.patch | 737 +++++++----------- ...0Remove-GoogleAccountsPrivateApiHost.patch | 48 ++ 5 files changed, 375 insertions(+), 490 deletions(-) create mode 100644 build/patches/00Remove-GoogleAccountsPrivateApiHost.patch diff --git a/build/patches/00Disable-WebGPU.patch b/build/patches/00Disable-WebGPU.patch index e06ee423..f9a17b6e 100644 --- a/build/patches/00Disable-WebGPU.patch +++ b/build/patches/00Disable-WebGPU.patch @@ -2,15 +2,16 @@ From: uazo Date: Mon, 1 May 2023 12:07:49 +0000 Subject: Disable WebGPU +License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- - gpu/config/gpu_finch_features.cc | 2 +- - .../blink/renderer/platform/runtime_enabled_features.json5 | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) + gpu/config/gpu_finch_features.cc | 2 +- + third_party/blink/renderer/modules/webgpu/gpu.cc | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc --- a/gpu/config/gpu_finch_features.cc +++ b/gpu/config/gpu_finch_features.cc -@@ -273,7 +273,7 @@ BASE_FEATURE(kEnableDrDcVulkan, +@@ -284,7 +284,7 @@ BASE_FEATURE(kEnableDrDcVulkan, // Enable WebGPU on gpu service side only. This is used with origin trial and // enabled by default on supported platforms. #if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_CHROMEOS_ASH) @@ -19,17 +20,16 @@ diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc #else #define WEBGPU_ENABLED base::FEATURE_DISABLED_BY_DEFAULT #endif -diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 ---- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 -+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5 -@@ -3975,7 +3975,7 @@ - // Note that this isn't enough to enable WebGPU and that access to - // WebGPU is further gated on the "WebGPUService" feature exposing GPU - // process access to WebGPU to the renderer process. -- status: "stable", -+ status: "test", - }, - { - // WebGPU developer features are deliberately not enabled by experimental +diff --git a/third_party/blink/renderer/modules/webgpu/gpu.cc b/third_party/blink/renderer/modules/webgpu/gpu.cc +--- a/third_party/blink/renderer/modules/webgpu/gpu.cc ++++ b/third_party/blink/renderer/modules/webgpu/gpu.cc +@@ -357,6 +357,7 @@ ScriptPromise GPU::requestAdapter(ScriptState* script_state, + "WebGPU is experimental on this platform. See " + "https://github.com/gpuweb/gpuweb/wiki/" + "Implementation-Status#implementation-status")); ++ (UAZO) add exception + } + + auto* resolver = MakeGarbageCollected(script_state); -- 2.25.1 diff --git a/build/patches/00Disable-privacy-issues-in-password-manager.patch b/build/patches/00Disable-privacy-issues-in-password-manager.patch index 76f0951b..d8f810f1 100644 --- a/build/patches/00Disable-privacy-issues-in-password-manager.patch +++ b/build/patches/00Disable-privacy-issues-in-password-manager.patch @@ -2,21 +2,22 @@ From: uazo Date: Tue, 14 Mar 2023 15:59:38 +0000 Subject: Disable privacy issues in password manager +License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- chrome/android/java/AndroidManifest.xml | 9 -------- .../generated_password_leak_detection_pref.cc | 3 +-- .../affiliation/affiliation_backend.cc | 1 + .../affiliation/affiliation_service_impl.cc | 4 ++++ .../core/browser/affiliation/facet_manager.cc | 23 +++---------------- + .../browser/features/password_features.cc | 4 ++-- .../leak_detection_check_factory_impl.cc | 5 ++++ .../leak_detection_check_impl.cc | 4 +--- - .../core/common/password_manager_features.cc | 4 ++-- 8 files changed, 17 insertions(+), 36 deletions(-) diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml -@@ -458,15 +458,6 @@ by a child template that "extends" this file. +@@ -445,15 +445,6 @@ by a child template that "extends" this file. @@ -48,7 +49,7 @@ diff --git a/chrome/browser/password_manager/generated_password_leak_detection_p diff --git a/components/password_manager/core/browser/affiliation/affiliation_backend.cc b/components/password_manager/core/browser/affiliation/affiliation_backend.cc --- a/components/password_manager/core/browser/affiliation/affiliation_backend.cc +++ b/components/password_manager/core/browser/affiliation/affiliation_backend.cc -@@ -403,6 +403,7 @@ void AffiliationBackend::OnMalformedResponse( +@@ -405,6 +405,7 @@ void AffiliationBackend::OnMalformedResponse( } bool AffiliationBackend::OnCanSendNetworkRequest() { @@ -59,7 +60,7 @@ diff --git a/components/password_manager/core/browser/affiliation/affiliation_ba diff --git a/components/password_manager/core/browser/affiliation/affiliation_service_impl.cc b/components/password_manager/core/browser/affiliation/affiliation_service_impl.cc --- a/components/password_manager/core/browser/affiliation/affiliation_service_impl.cc +++ b/components/password_manager/core/browser/affiliation/affiliation_service_impl.cc -@@ -138,6 +138,10 @@ void AffiliationServiceImpl::Shutdown() { +@@ -135,6 +135,10 @@ void AffiliationServiceImpl::Shutdown() { void AffiliationServiceImpl::PrefetchChangePasswordURLs( const std::vector& urls, base::OnceClosure callback) { @@ -110,6 +111,20 @@ diff --git a/components/password_manager/core/browser/affiliation/facet_manager. } // static +diff --git a/components/password_manager/core/browser/features/password_features.cc b/components/password_manager/core/browser/features/password_features.cc +--- a/components/password_manager/core/browser/features/password_features.cc ++++ b/components/password_manager/core/browser/features/password_features.cc +@@ -58,8 +58,8 @@ BASE_FEATURE(kFillingAcrossGroupedSites, + // Enables the experiment for the password manager to only fill on account + // selection, rather than autofilling on page load, with highlighting of fields. + BASE_FEATURE(kFillOnAccountSelect, +- "fill-on-account-select", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ "fill-on-account-select", // always enabled ++ base::FEATURE_ENABLED_BY_DEFAULT); // by default + + // Enables the notification UI that is displayed to the user when visiting a + // website for which a stored password has been shared by another user. diff --git a/components/password_manager/core/browser/leak_detection/leak_detection_check_factory_impl.cc b/components/password_manager/core/browser/leak_detection/leak_detection_check_factory_impl.cc --- a/components/password_manager/core/browser/leak_detection/leak_detection_check_factory_impl.cc +++ b/components/password_manager/core/browser/leak_detection/leak_detection_check_factory_impl.cc @@ -139,19 +154,5 @@ diff --git a/components/password_manager/core/browser/leak_detection/leak_detect } void LeakDetectionCheckImpl::Start(LeakDetectionInitiator initiator, -diff --git a/components/password_manager/core/common/password_manager_features.cc b/components/password_manager/core/common/password_manager_features.cc ---- a/components/password_manager/core/common/password_manager_features.cc -+++ b/components/password_manager/core/common/password_manager_features.cc -@@ -87,8 +87,8 @@ BASE_FEATURE(kFillingAcrossGroupedSites, - // Enables the experiment for the password manager to only fill on account - // selection, rather than autofilling on page load, with highlighting of fields. - BASE_FEATURE(kFillOnAccountSelect, -- "fill-on-account-select", -- base::FEATURE_DISABLED_BY_DEFAULT); -+ "fill-on-account-select", // always enabled -+ base::FEATURE_ENABLED_BY_DEFAULT); // in bromite - - // Enables logging the content of chrome://password-manager-internals to the - // terminal. -- 2.25.1 diff --git a/build/patches/00Evict-the-entire-FrameTree-like-desktop.patch b/build/patches/00Evict-the-entire-FrameTree-like-desktop.patch index 9973b4bd..d93d50a4 100644 --- a/build/patches/00Evict-the-entire-FrameTree-like-desktop.patch +++ b/build/patches/00Evict-the-entire-FrameTree-like-desktop.patch @@ -1,7 +1,8 @@ -From: Your Name +From: uazo Date: Tue, 14 Feb 2023 16:23:08 +0000 Subject: Evict the entire FrameTree like desktop +License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- components/viz/common/features.cc | 2 +- content/public/common/content_features.cc | 4 ++-- @@ -10,19 +11,19 @@ Subject: Evict the entire FrameTree like desktop diff --git a/components/viz/common/features.cc b/components/viz/common/features.cc --- a/components/viz/common/features.cc +++ b/components/viz/common/features.cc -@@ -231,7 +231,7 @@ BASE_FEATURE(kRendererAllocatesImages, +@@ -233,7 +233,7 @@ BASE_FEATURE(kRendererAllocatesImages, // evicts itself. This differs from Destkop platforms which evict the entire // FrameTree along with the topmost viz::Surface. When this feature is enabled, // Android will begin also evicting the entire FrameTree. --BASE_FEATURE(kEvictSubtree, "EvictSubtree", base::FEATURE_DISABLED_BY_DEFAULT); -+BASE_FEATURE(kEvictSubtree, "EvictSubtree", base::FEATURE_ENABLED_BY_DEFAULT); +-BASE_FEATURE(kEvictSubtree, "EvictSubtree", base::FEATURE_ENABLED_BY_DEFAULT); ++BASE_FEATURE(kEvictSubtree, "EvictSubtree", base::FEATURE_ENABLED_BY_DEFAULT); // enabled by default // If enabled, CompositorFrameSinkClient::OnBeginFrame is also treated as the // DidReceiveCompositorFrameAck. Both in providing the Ack for the previous diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc -@@ -564,8 +564,8 @@ BASE_FEATURE(kInMemoryCodeCache, +@@ -537,8 +537,8 @@ BASE_FEATURE(kInMemoryCodeCache, // frames. Otherwise only toplevel frames and OOPIF are handled, and other // cases, e.g. PDF tiles are ignored. See https://crbug.com/1360351 for details. BASE_FEATURE(kInnerFrameCompositorSurfaceEviction, diff --git a/build/patches/00Eyeo-Adblock-Remove-Privacy-Issues.patch b/build/patches/00Eyeo-Adblock-Remove-Privacy-Issues.patch index 27c139fc..b2fe6fb2 100644 --- a/build/patches/00Eyeo-Adblock-Remove-Privacy-Issues.patch +++ b/build/patches/00Eyeo-Adblock-Remove-Privacy-Issues.patch @@ -8,13 +8,9 @@ suit Bromite logic .../android/java/res/xml/main_preferences.xml | 11 +- chrome/browser/BUILD.gn | 2 - .../adblock/adblock_content_browser_client.cc | 26 +- - .../adblock/adblock_controller_factory.cc | 3 +- - .../adblock_telemetry_service_factory.cc | 127 - - .../adblock_telemetry_service_factory.h | 56 - - .../adblock/subscription_service_factory.cc | 11 +- .../adblock/subscription_service_factory.h | 1 + chrome/browser/android/adblock/adblock_jni.cc | 50 +- - .../adblock_private/adblock_private_api.cc | 70 +- + .../adblock_private/adblock_private_api.cc | 68 +- .../api/adblock_private/adblock_private_api.h | 49 + .../eyeo_filtering_private_api.cc | 20 +- ...hrome_browser_main_extra_parts_profiles.cc | 2 - @@ -45,11 +41,15 @@ suit Bromite logic .../settings/AdblockFilterListsAdapter.java | 6 + .../settings/AdblockSettingsFragment.java | 45 +- components/adblock/content/browser/BUILD.gn | 16 +- + .../adblock_controller_factory_base.cc | 2 +- + .../adblock_telemetry_service_factory_base.cc | 49 - + .../adblock_telemetry_service_factory_base.h | 24 - .../browser/adblock_webcontents_observer.cc | 25 +- .../browser/adblock_webcontents_observer.h | 5 +- .../content_security_policy_injector_impl.cc | 1 + + .../subscription_service_factory_base.cc | 10 +- components/adblock/core/BUILD.gn | 39 - - .../activeping_telemetry_topic_provider.cc | 242 -- + .../activeping_telemetry_topic_provider.cc | 243 -- .../activeping_telemetry_topic_provider.h | 84 - components/adblock/core/adblock_controller.h | 6 + .../adblock/core/adblock_controller_impl.cc | 35 +- @@ -95,7 +95,6 @@ suit Bromite logic .../subscription/subscription_service_impl.h | 3 + .../subscription/subscription_updater_impl.cc | 8 +- .../subscription_validator_impl.cc | 4 +- - components/adblock/features.gni | 44 - .../browser/bromite_content_settings/ads.inc | 3 + components/resources/BUILD.gn | 1 - components/resources/adblock_resources.grdp | 3 - @@ -109,9 +108,7 @@ suit Bromite logic .../blink/renderer/core/css/style_engine.h | 1 + .../renderer/core/exported/web_document.cc | 13 +- .../definitions/adblock_private.d.ts | 14 + - 104 files changed, 5041 insertions(+), 1296 deletions(-) - delete mode 100644 chrome/browser/adblock/adblock_telemetry_service_factory.cc - delete mode 100644 chrome/browser/adblock/adblock_telemetry_service_factory.h + 103 files changed, 5038 insertions(+), 1142 deletions(-) create mode 100644 chrome/browser/resources/settings/adblock_page/adblock_page.html create mode 100644 chrome/browser/resources/settings/adblock_page/adblock_page.ts rename components/adblock/android/java/res/xml/{adblock_preferences.xml => eyeo_adblock_preferences.xml} (56%) @@ -120,7 +117,6 @@ suit Bromite logic delete mode 100644 components/adblock/core/adblock_telemetry_service.cc delete mode 100644 components/adblock/core/adblock_telemetry_service.h create mode 100644 components/adblock/core/converter/parser/test/test_rules.txt - delete mode 100644 components/adblock/features.gni create mode 100644 components/content_settings/core/browser/bromite_content_settings/ads.inc create mode 100755 components/resources/adblocking/snippets/dist/isolated-first.jst create mode 100755 components/resources/adblocking/snippets/dist/isolated-first.source.jst @@ -142,7 +138,7 @@ diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/j -@@ -101,7 +92,7 @@ Use of this source code is governed by the GPLv3 that can be found in the compon +@@ -106,7 +97,7 @@ Use of this source code is governed by the GPLv3 that can be found in the compon android:title="@string/prefs_accessibility"/> ( std::move(config), content::GlobalRenderFrameHostId(render_process_id, -diff --git a/chrome/browser/adblock/adblock_controller_factory.cc b/chrome/browser/adblock/adblock_controller_factory.cc ---- a/chrome/browser/adblock/adblock_controller_factory.cc -+++ b/chrome/browser/adblock/adblock_controller_factory.cc -@@ -65,8 +65,7 @@ KeyedService* AdblockControllerFactory::BuildServiceInstanceFor( - std::make_unique( - prefs, kAdblockFilteringConfigurationName); - -- if (base::CommandLine::ForCurrentProcess()->HasSwitch( -- adblock::switches::kDisableAcceptableAds)) { -+ if ((true)) { - adblock_filtering_configuration->RemoveFilterList(AcceptableAdsUrl()); - } - if (base::CommandLine::ForCurrentProcess()->HasSwitch( -diff --git a/chrome/browser/adblock/adblock_telemetry_service_factory.cc b/chrome/browser/adblock/adblock_telemetry_service_factory.cc -deleted file mode 100644 ---- a/chrome/browser/adblock/adblock_telemetry_service_factory.cc -+++ /dev/null -@@ -1,127 +0,0 @@ --/* -- * This file is part of eyeo Chromium SDK, -- * Copyright (C) 2006-present eyeo GmbH -- * -- * eyeo Chromium SDK is free software: you can redistribute it and/or modify -- * it under the terms of the GNU General Public License version 3 as -- * published by the Free Software Foundation. -- * -- * eyeo Chromium SDK is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with eyeo Chromium SDK. If not, see . -- */ -- --#include "chrome/browser/adblock/adblock_telemetry_service_factory.h" -- --#include -- --#include "base/no_destructor.h" --#include "chrome/browser/adblock/adblock_controller_factory.h" --#include "chrome/browser/adblock/subscription_service_factory.h" --#include "chrome/browser/profiles/incognito_helpers.h" --#include "chrome/browser/profiles/profile.h" --#include "chrome/common/pref_names.h" --#include "components/adblock/core/activeping_telemetry_topic_provider.h" --#include "components/adblock/core/adblock_telemetry_service.h" --#include "components/adblock/core/common/adblock_utils.h" --#include "components/adblock/core/configuration/filtering_configuration.h" --#include "components/keyed_service/content/browser_context_dependency_manager.h" --#include "content/public/browser/storage_partition.h" -- --namespace adblock { --namespace { --std::optional g_check_interval_for_testing; --std::optional g_initial_delay_for_testing; -- --base::TimeDelta GetInitialDelay() { -- static base::TimeDelta kInitialDelay = -- g_initial_delay_for_testing ? g_initial_delay_for_testing.value() -- : base::Seconds(30); -- return kInitialDelay; --} -- --base::TimeDelta GetCheckInterval() { -- static base::TimeDelta kCheckInterval = -- g_check_interval_for_testing ? g_check_interval_for_testing.value() -- : base::Minutes(5); -- return kCheckInterval; --} -- --} // namespace -- --// static --AdblockTelemetryService* AdblockTelemetryServiceFactory::GetForProfile( -- Profile* profile) { -- return static_cast( -- GetInstance()->GetServiceForBrowserContext(profile, true)); --} --// static --AdblockTelemetryServiceFactory* AdblockTelemetryServiceFactory::GetInstance() { -- static base::NoDestructor instance; -- return instance.get(); --} -- --AdblockTelemetryServiceFactory::AdblockTelemetryServiceFactory() -- : BrowserContextKeyedServiceFactory( -- "AdblockTelemetryService", -- BrowserContextDependencyManager::GetInstance()) { -- // AdblockController creates Adblock Filtering Configuration required by -- // AdblockTelemetryService -- DependsOn(AdblockControllerFactory::GetInstance()); --} -- --AdblockTelemetryServiceFactory::~AdblockTelemetryServiceFactory() = default; -- --KeyedService* AdblockTelemetryServiceFactory::BuildServiceInstanceFor( -- content::BrowserContext* context) const { -- // Need to use a URLLoaderFactory specific to the browser context, not from -- // system_network_context_manager(), because the required Accept-Language -- // header depends on user's language settings and is not present in requests -- // made from the System network context. -- scoped_refptr url_loader_factory = -- context->GetDefaultStoragePartition() -- ->GetURLLoaderFactoryForBrowserProcess(); -- auto* prefs = Profile::FromBrowserContext(context)->GetPrefs(); -- auto service = std::make_unique( -- SubscriptionServiceFactory::GetForBrowserContext(context) -- ->GetAdblockFilteringConfiguration(), -- url_loader_factory, GetInitialDelay(), GetCheckInterval()); -- service->AddTopicProvider(std::make_unique( -- utils::GetAppInfo(), prefs, -- AdblockControllerFactory::GetForBrowserContext(context), -- ActivepingTelemetryTopicProvider::DefaultBaseUrl(), -- ActivepingTelemetryTopicProvider::DefaultAuthToken())); -- -- if (url_loader_factory) { -- service->Start(); -- } -- -- return service.release(); --} -- --content::BrowserContext* AdblockTelemetryServiceFactory::GetBrowserContextToUse( -- content::BrowserContext* context) const { -- return chrome::GetBrowserContextRedirectedInIncognito(context); --} -- --bool AdblockTelemetryServiceFactory::ServiceIsNULLWhileTesting() const { -- return true; --} -- --bool AdblockTelemetryServiceFactory::ServiceIsCreatedWithBrowserContext() -- const { -- return true; --} -- --void AdblockTelemetryServiceFactory::SetCheckAndDelayIntervalsForTesting( -- base::TimeDelta check_interval, -- base::TimeDelta initial_delay) { -- g_check_interval_for_testing = check_interval; -- g_initial_delay_for_testing = initial_delay; --} -- --} // namespace adblock -diff --git a/chrome/browser/adblock/adblock_telemetry_service_factory.h b/chrome/browser/adblock/adblock_telemetry_service_factory.h -deleted file mode 100644 ---- a/chrome/browser/adblock/adblock_telemetry_service_factory.h -+++ /dev/null -@@ -1,56 +0,0 @@ --/* -- * This file is part of eyeo Chromium SDK, -- * Copyright (C) 2006-present eyeo GmbH -- * -- * eyeo Chromium SDK is free software: you can redistribute it and/or modify -- * it under the terms of the GNU General Public License version 3 as -- * published by the Free Software Foundation. -- * -- * eyeo Chromium SDK is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with eyeo Chromium SDK. If not, see . -- */ -- --#ifndef CHROME_BROWSER_ADBLOCK_ADBLOCK_TELEMETRY_SERVICE_FACTORY_H_ --#define CHROME_BROWSER_ADBLOCK_ADBLOCK_TELEMETRY_SERVICE_FACTORY_H_ -- --#include "base/no_destructor.h" --#include "base/time/time.h" --#include "components/keyed_service/content/browser_context_keyed_service_factory.h" -- --class Profile; -- --namespace adblock { --class AdblockTelemetryService; --class AdblockTelemetryServiceFactory -- : public BrowserContextKeyedServiceFactory { -- public: -- static AdblockTelemetryService* GetForProfile(Profile* profile); -- static AdblockTelemetryServiceFactory* GetInstance(); -- -- // Sets the initial delay and interval checks required for browser tests. -- // Must be called before BuildServiceInstanceFor(). -- void SetCheckAndDelayIntervalsForTesting(base::TimeDelta check_interval, -- base::TimeDelta initial_delay); -- -- private: -- friend class base::NoDestructor; -- AdblockTelemetryServiceFactory(); -- ~AdblockTelemetryServiceFactory() override; -- -- // BrowserContextKeyedServiceFactory: -- KeyedService* BuildServiceInstanceFor( -- content::BrowserContext* context) const override; -- content::BrowserContext* GetBrowserContextToUse( -- content::BrowserContext* context) const override; -- bool ServiceIsNULLWhileTesting() const override; -- bool ServiceIsCreatedWithBrowserContext() const override; --}; -- --} // namespace adblock -- --#endif // CHROME_BROWSER_ADBLOCK_ADBLOCK_TELEMETRY_SERVICE_FACTORY_H_ -diff --git a/chrome/browser/adblock/subscription_service_factory.cc b/chrome/browser/adblock/subscription_service_factory.cc ---- a/chrome/browser/adblock/subscription_service_factory.cc -+++ b/chrome/browser/adblock/subscription_service_factory.cc -@@ -25,6 +25,7 @@ - #include "base/functional/bind.h" - #include "base/task/thread_pool.h" - #include "base/trace_event/trace_event.h" -+#include "base/rand_util.h" - #include "chrome/browser/adblock/subscription_persistent_metadata_factory.h" - #include "chrome/browser/profiles/incognito_helpers.h" - #include "chrome/browser/profiles/profile.h" -@@ -66,7 +67,7 @@ base::TimeDelta GetUpdateCheckInterval() { - static base::TimeDelta kCheckInterval = - g_update_check_interval_for_testing - ? g_update_check_interval_for_testing.value() -- : base::Hours(1); -+ : base::Hours(24) + base::Minutes(base::RandInt(-60,60)); - return kCheckInterval; - } - -@@ -87,7 +88,8 @@ std::unique_ptr MakeOngoingSubscriptionRequest( - } - - ConversionResult ConvertFilterFile(const GURL& subscription_url, -- const base::FilePath& path) { -+ const base::FilePath& path, -+ bool allow_privileged_filter) { - TRACE_EVENT1("eyeo", "ConvertFileToFlatbuffer", "url", - subscription_url.spec()); - ConversionResult result; -@@ -97,7 +99,7 @@ ConversionResult ConvertFilterFile(const GURL& subscription_url, - } else { - result = FlatbufferConverter::Convert( - input_stream, subscription_url, -- config::AllowPrivilegedFilters(subscription_url)); -+ allow_privileged_filter && config::AllowPrivilegedFilters(subscription_url)); - } - base::DeleteFile(path); - return result; -@@ -162,10 +164,11 @@ SubscriptionServiceFactory::ConvertCustomFilters( - void SubscriptionServiceFactory::ConvertFilterListFile( - const GURL& subscription_url, - const base::FilePath& path, -+ bool allow_privileged_filter, - base::OnceCallback result_callback) const { - base::ThreadPool::PostTaskAndReplyWithResult( - FROM_HERE, {base::MayBlock()}, -- base::BindOnce(&ConvertFilterFile, subscription_url, path), -+ base::BindOnce(&ConvertFilterFile, subscription_url, path, allow_privileged_filter), - std::move(result_callback)); - } - diff --git a/chrome/browser/adblock/subscription_service_factory.h b/chrome/browser/adblock/subscription_service_factory.h --- a/chrome/browser/adblock/subscription_service_factory.h +++ b/chrome/browser/adblock/subscription_service_factory.h -@@ -42,6 +42,7 @@ class SubscriptionServiceFactory : public BrowserContextKeyedServiceFactory, - void ConvertFilterListFile( - const GURL& subscription_url, - const base::FilePath& path, +@@ -34,6 +34,7 @@ class SubscriptionServiceFactory : public SubscriptionServiceFactoryBase { + protected: + PrefService* GetPrefs(content::BrowserContext* context) const override; + SubscriptionPersistentMetadata* GetSubscriptionPersistentMetadata( + bool allow_privileged_filter, - base::OnceCallback) const override; + content::BrowserContext* context) const override; private: diff --git a/chrome/browser/android/adblock/adblock_jni.cc b/chrome/browser/android/adblock/adblock_jni.cc @@ -586,7 +324,7 @@ diff --git a/chrome/browser/android/adblock/adblock_jni.cc b/chrome/browser/andr diff --git a/chrome/browser/extensions/api/adblock_private/adblock_private_api.cc b/chrome/browser/extensions/api/adblock_private/adblock_private_api.cc --- a/chrome/browser/extensions/api/adblock_private/adblock_private_api.cc +++ b/chrome/browser/extensions/api/adblock_private/adblock_private_api.cc -@@ -137,26 +137,12 @@ std::vector CopySessionsStats( +@@ -75,26 +75,12 @@ std::vector CopySessionsStats( return result; } @@ -616,7 +354,7 @@ diff --git a/chrome/browser/extensions/api/adblock_private/adblock_private_api.c std::vector result; for (auto& sub : current_subscriptions) { api::adblock_private::Subscription js_sub; -@@ -164,9 +150,13 @@ std::vector CopySubscriptions( +@@ -102,9 +88,13 @@ std::vector CopySubscriptions( js_sub.title = sub->GetTitle(); js_sub.current_version = sub->GetCurrentVersion(); js_sub.installation_state = @@ -631,7 +369,7 @@ diff --git a/chrome/browser/extensions/api/adblock_private/adblock_private_api.c result.emplace_back(std::move(js_sub)); } return result; -@@ -402,6 +392,44 @@ void AdblockPrivateAPI::OnListenerAdded( +@@ -345,6 +335,44 @@ void AdblockPrivateAPI::OnListenerAdded( namespace api { @@ -676,25 +414,16 @@ diff --git a/chrome/browser/extensions/api/adblock_private/adblock_private_api.c AdblockPrivateSetEnabledFunction::AdblockPrivateSetEnabledFunction() {} AdblockPrivateSetEnabledFunction::~AdblockPrivateSetEnabledFunction() {} -@@ -547,7 +575,7 @@ AdblockPrivateGetSelectedBuiltInSubscriptionsFunction::Run() { - - return RespondNow(ArgumentList( - api::adblock_private::GetSelectedBuiltInSubscriptions::Results::Create( -- CopySubscriptions(controller->GetSelectedBuiltInSubscriptions())))); -+ CopySubscriptions(controller, controller->GetSelectedBuiltInSubscriptions())))); - } - - AdblockPrivateAddCustomSubscriptionFunction:: -@@ -605,7 +633,7 @@ AdblockPrivateGetCustomSubscriptionsFunction::Run() { +@@ -403,7 +431,7 @@ AdblockPrivateIsAcceptableAdsEnabledFunction::Run() { browser_context()); return RespondNow(ArgumentList( - api::adblock_private::GetCustomSubscriptions::Results::Create( -- CopySubscriptions(controller->GetCustomSubscriptions())))); -+ CopySubscriptions(controller, controller->GetCustomSubscriptions())))); + api::adblock_private::IsAcceptableAdsEnabled::Results::Create( +- controller->IsAcceptableAdsEnabled()))); ++ controller, controller->IsAcceptableAdsEnabled()))); } - AdblockPrivateInstallSubscriptionFunction:: -@@ -662,7 +690,7 @@ AdblockPrivateGetInstalledSubscriptionsFunction::Run() { + AdblockPrivateGetBuiltInSubscriptionsFunction:: +@@ -486,7 +514,7 @@ AdblockPrivateGetInstalledSubscriptionsFunction::Run() { browser_context()); return RespondNow(ArgumentList( api::adblock_private::GetInstalledSubscriptions::Results::Create( @@ -817,7 +546,7 @@ diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc #include "chrome/browser/adblock/content_security_policy_injector_factory.h" #include "chrome/browser/adblock/element_hider_factory.h" #include "chrome/browser/adblock/resource_classification_runner_factory.h" -@@ -683,7 +682,6 @@ void ChromeBrowserMainExtraPartsProfiles:: +@@ -721,7 +720,6 @@ void ChromeBrowserMainExtraPartsProfiles:: ExitTypeServiceFactory::GetInstance(); #endif adblock::AdblockControllerFactory::GetInstance(); @@ -828,7 +557,7 @@ diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc diff --git a/chrome/browser/resources/settings/BUILD.gn b/chrome/browser/resources/settings/BUILD.gn --- a/chrome/browser/resources/settings/BUILD.gn +++ b/chrome/browser/resources/settings/BUILD.gn -@@ -70,6 +70,7 @@ build_webui("build") { +@@ -72,6 +72,7 @@ build_webui("build") { web_component_files = [ "a11y_page/a11y_page.ts", "about_page/about_page.ts", @@ -836,7 +565,7 @@ diff --git a/chrome/browser/resources/settings/BUILD.gn b/chrome/browser/resourc "appearance_page/appearance_fonts_page.ts", "appearance_page/appearance_page.ts", "appearance_page/home_url_input.ts", -@@ -381,6 +382,7 @@ build_webui("build") { +@@ -365,6 +366,7 @@ build_webui("build") { ts_composite = true ts_definitions = [ "//tools/typescript/definitions/autofill_private.d.ts", @@ -1389,7 +1118,7 @@ diff --git a/chrome/browser/resources/settings/page_visibility.ts b/chrome/brows diff --git a/chrome/browser/resources/settings/route.ts b/chrome/browser/resources/settings/route.ts --- a/chrome/browser/resources/settings/route.ts +++ b/chrome/browser/resources/settings/route.ts -@@ -176,6 +176,10 @@ function createBrowserSettingsRoutes(): SettingsRoutes { +@@ -178,6 +178,10 @@ function createBrowserSettingsRoutes(): SettingsRoutes { r.FONTS = r.APPEARANCE.createChild('/fonts'); } @@ -1414,12 +1143,12 @@ diff --git a/chrome/browser/resources/settings/router.ts b/chrome/browser/resour diff --git a/chrome/browser/resources/settings/settings.ts b/chrome/browser/resources/settings/settings.ts --- a/chrome/browser/resources/settings/settings.ts +++ b/chrome/browser/resources/settings/settings.ts -@@ -42,6 +42,7 @@ export {AppearanceBrowserProxy, AppearanceBrowserProxyImpl} from './appearance_p +@@ -47,6 +47,7 @@ export {AppearanceBrowserProxy, AppearanceBrowserProxyImpl} from './appearance_p export {SettingsAppearancePageElement, SystemTheme} from './appearance_page/appearance_page.js'; export {HomeUrlInputElement} from './appearance_page/home_url_input.js'; export {SettingsAutofillPageElement} from './autofill_page/autofill_page.js'; +export {SettingsAdblockPageElement} from './adblock_page/adblock_page.js'; - export {AccountStorageOptInStateChangedListener, CredentialsChangedListener, PasswordCheckInteraction, PasswordCheckReferrer, PasswordCheckStatusChangedListener, PasswordExceptionListChangedListener, PasswordManagerAuthTimeoutListener, PasswordManagerImpl, PasswordManagerPage, PasswordManagerProxy, PasswordsFileExportProgressListener, SavedPasswordListChangedListener} from './autofill_page/password_manager_proxy.js'; + export {PasswordCheckReferrer, PasswordManagerImpl, PasswordManagerPage, PasswordManagerProxy} from './autofill_page/password_manager_proxy.js'; export {BaseMixin} from './base_mixin.js'; export {SettingsBasicPageElement} from './basic_page/basic_page.js'; diff --git a/chrome/browser/resources/settings/settings_menu/settings_menu.html b/chrome/browser/resources/settings/settings_menu/settings_menu.html @@ -1440,7 +1169,7 @@ diff --git a/chrome/browser/resources/settings/settings_menu/settings_menu.html diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc --- a/chrome/browser/ui/tab_helpers.cc +++ b/chrome/browser/ui/tab_helpers.cc -@@ -345,6 +345,8 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) { +@@ -353,6 +353,8 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) { } #endif @@ -1449,7 +1178,7 @@ diff --git a/chrome/browser/ui/tab_helpers.cc b/chrome/browser/ui/tab_helpers.cc AdblockWebContentObserver::CreateForWebContents( web_contents, adblock::SubscriptionServiceFactory::GetForBrowserContext( -@@ -353,7 +355,8 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) { +@@ -361,7 +363,8 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) { web_contents->GetBrowserContext()), adblock::SitekeyStorageFactory::GetForBrowserContext( web_contents->GetBrowserContext()), @@ -1473,7 +1202,7 @@ diff --git a/chrome/common/extensions/api/_permission_features.json b/chrome/com "autofillPrivate": { "channel": "trunk", "extension_types": ["extension", "platform_app"], -@@ -345,10 +341,6 @@ +@@ -341,10 +337,6 @@ "extension", "legacy_packaged_app", "hosted_app", "platform_app" ] }, @@ -1487,7 +1216,7 @@ diff --git a/chrome/common/extensions/api/_permission_features.json b/chrome/com diff --git a/chrome/common/extensions/api/adblock_private.idl b/chrome/common/extensions/api/adblock_private.idl --- a/chrome/common/extensions/api/adblock_private.idl +++ b/chrome/common/extensions/api/adblock_private.idl -@@ -43,6 +43,8 @@ dictionary Subscription { +@@ -47,6 +47,8 @@ dictionary Subscription { // Time of last successful installation or update, in ISO 8601 format. // May be passed directly to the Date constructor. DOMString last_installation_time; @@ -1496,7 +1225,7 @@ diff --git a/chrome/common/extensions/api/adblock_private.idl b/chrome/common/ex }; dictionary SessionStatsEntry { -@@ -91,6 +93,12 @@ callback ListCallback = void(DOMString[] result); +@@ -97,6 +99,12 @@ callback ListCallback = void(DOMString[] result); callback SessionStatsCallback = void(SessionStatsEntry[] result); interface Functions { @@ -1520,7 +1249,7 @@ diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn import("//components/captive_portal/core/features.gni") import("//components/enterprise/buildflags/buildflags.gni") import("//components/feed/features.gni") -@@ -2545,10 +2544,6 @@ if (!is_android) { +@@ -2670,10 +2669,6 @@ if (!is_android) { sources += [ "../browser/chrome_for_testing/chrome_for_testing_info_bar_browsertest.cc" ] } @@ -1799,7 +1528,7 @@ diff --git a/components/adblock/android/java/src/org/chromium/components/adblock break; } } -@@ -190,6 +217,27 @@ public final class AdblockController extends FilteringConfiguration { +@@ -182,6 +209,27 @@ public final class AdblockController extends FilteringConfiguration { removeFilterList(url); } @@ -1827,7 +1556,7 @@ diff --git a/components/adblock/android/java/src/org/chromium/components/adblock @UiThread public List getInstalledSubscriptions() { return (List) (List) Arrays.asList( -@@ -259,6 +307,10 @@ public final class AdblockController extends FilteringConfiguration { +@@ -251,6 +299,10 @@ public final class AdblockController extends FilteringConfiguration { @NativeMethods interface Natives { @@ -2144,8 +1873,8 @@ diff --git a/components/adblock/content/browser/BUILD.gn b/components/adblock/co } source_set("browser_impl") { -@@ -51,15 +44,10 @@ source_set("browser_impl") { - "session_stats_impl.h", +@@ -62,15 +55,10 @@ source_set("browser_impl") { + ] - if (eyeo_intercept_debug_url) { @@ -2159,14 +1888,117 @@ diff --git a/components/adblock/content/browser/BUILD.gn b/components/adblock/co "//base", + "//components/content_settings/browser", + "//components/content_settings/core/browser", + "//components/adblock/core/converter:converter", + "//components/keyed_service/content:content", "//components/resources:components_resources_grit", - "//url:url", - ] +diff --git a/components/adblock/content/browser/adblock_controller_factory_base.cc b/components/adblock/content/browser/adblock_controller_factory_base.cc +--- a/components/adblock/content/browser/adblock_controller_factory_base.cc ++++ b/components/adblock/content/browser/adblock_controller_factory_base.cc +@@ -47,7 +47,7 @@ KeyedService* AdblockControllerFactoryBase::BuildServiceInstanceFor( + std::make_unique( + prefs, kAdblockFilteringConfigurationName); + +- if (base::CommandLine::ForCurrentProcess()->HasSwitch( ++ if ((true) && base::CommandLine::ForCurrentProcess()->HasSwitch( + adblock::switches::kDisableAcceptableAds)) { + adblock_filtering_configuration->RemoveFilterList(AcceptableAdsUrl()); + } +diff --git a/components/adblock/content/browser/adblock_telemetry_service_factory_base.cc b/components/adblock/content/browser/adblock_telemetry_service_factory_base.cc +--- a/components/adblock/content/browser/adblock_telemetry_service_factory_base.cc ++++ b/components/adblock/content/browser/adblock_telemetry_service_factory_base.cc +@@ -48,53 +48,4 @@ base::TimeDelta GetCheckInterval() { + + } // namespace + +-AdblockTelemetryServiceFactoryBase::AdblockTelemetryServiceFactoryBase() +- : BrowserContextKeyedServiceFactory( +- "AdblockTelemetryService", +- BrowserContextDependencyManager::GetInstance()) {} +- +-AdblockTelemetryServiceFactoryBase::~AdblockTelemetryServiceFactoryBase() = +- default; +- +-KeyedService* AdblockTelemetryServiceFactoryBase::BuildServiceInstanceFor( +- content::BrowserContext* context) const { +- // Need to use a URLLoaderFactory specific to the browser context, not from +- // system_network_context_manager(), because the required Accept-Language +- // header depends on user's language settings and is not present in requests +- // made from the System network context. +- scoped_refptr url_loader_factory = +- context->GetDefaultStoragePartition() +- ->GetURLLoaderFactoryForBrowserProcess(); +- auto* prefs = GetPrefs(context); +- auto service = std::make_unique( +- GetSubscriptionService(context)->GetAdblockFilteringConfiguration(), +- url_loader_factory, GetInitialDelay(), GetCheckInterval()); +- service->AddTopicProvider(std::make_unique( +- utils::GetAppInfo(), prefs, GetAdblockController(context), +- ActivepingTelemetryTopicProvider::DefaultBaseUrl(), +- ActivepingTelemetryTopicProvider::DefaultAuthToken())); +- +- if (url_loader_factory) { +- service->Start(); +- } +- +- return service.release(); +-} +- +-bool AdblockTelemetryServiceFactoryBase::ServiceIsNULLWhileTesting() const { +- return true; +-} +- +-bool AdblockTelemetryServiceFactoryBase::ServiceIsCreatedWithBrowserContext() +- const { +- return true; +-} +- +-void AdblockTelemetryServiceFactoryBase::SetCheckAndDelayIntervalsForTesting( +- base::TimeDelta check_interval, +- base::TimeDelta initial_delay) { +- g_check_interval_for_testing = check_interval; +- g_initial_delay_for_testing = initial_delay; +-} +- + } // namespace adblock +diff --git a/components/adblock/content/browser/adblock_telemetry_service_factory_base.h b/components/adblock/content/browser/adblock_telemetry_service_factory_base.h +--- a/components/adblock/content/browser/adblock_telemetry_service_factory_base.h ++++ b/components/adblock/content/browser/adblock_telemetry_service_factory_base.h +@@ -27,30 +27,6 @@ namespace adblock { + + class AdblockController; + class SubscriptionService; +-class AdblockTelemetryServiceFactoryBase +- : public BrowserContextKeyedServiceFactory { +- public: +- // Sets the initial delay and interval checks required for browser tests. +- // Must be called before BuildServiceInstanceFor(). +- void SetCheckAndDelayIntervalsForTesting(base::TimeDelta check_interval, +- base::TimeDelta initial_delay); +- +- protected: +- virtual PrefService* GetPrefs(content::BrowserContext* context) const = 0; +- virtual AdblockController* GetAdblockController( +- content::BrowserContext* context) const = 0; +- virtual SubscriptionService* GetSubscriptionService( +- content::BrowserContext* context) const = 0; +- AdblockTelemetryServiceFactoryBase(); +- ~AdblockTelemetryServiceFactoryBase() override; +- +- private: +- // BrowserContextKeyedServiceFactory: +- KeyedService* BuildServiceInstanceFor( +- content::BrowserContext* context) const override; +- bool ServiceIsNULLWhileTesting() const override; +- bool ServiceIsCreatedWithBrowserContext() const override; +-}; + + } // namespace adblock + diff --git a/components/adblock/content/browser/adblock_webcontents_observer.cc b/components/adblock/content/browser/adblock_webcontents_observer.cc --- a/components/adblock/content/browser/adblock_webcontents_observer.cc +++ b/components/adblock/content/browser/adblock_webcontents_observer.cc -@@ -20,10 +20,14 @@ - #include "base/trace_event/trace_event.h" +@@ -21,6 +21,8 @@ + #include "components/adblock/content/browser/frame_opener_info.h" #include "components/adblock/core/common/sitekey.h" #include "components/adblock/core/subscription/subscription_service.h" +#include "components/content_settings/core/browser/host_content_settings_map.h" @@ -2174,13 +2006,16 @@ diff --git a/components/adblock/content/browser/adblock_webcontents_observer.cc #include "content/public/browser/navigation_handle.h" #include "net/base/url_util.h" #include "third_party/blink/public/common/frame/frame_owner_element_type.h" - -+namespace { +@@ -56,7 +58,7 @@ const char* WindowOpenDispositionToString(WindowOpenDisposition value) { + return ""; + } + } +-} // namespace + + void TraceHandleLoadComplete( content::RenderFrameHost* frame_host, - const adblock::ElementHider::ElemhideInjectionData&) { -@@ -32,18 +36,32 @@ void TraceHandleLoadComplete( +@@ -66,18 +68,32 @@ void TraceHandleLoadComplete( TRACE_ID_LOCAL(frame_host)); } @@ -2194,7 +2029,7 @@ diff --git a/components/adblock/content/browser/adblock_webcontents_observer.cc + return true; +} + -+} ++} // namespace + AdblockWebContentObserver::AdblockWebContentObserver( content::WebContents* web_contents, @@ -2215,7 +2050,7 @@ diff --git a/components/adblock/content/browser/adblock_webcontents_observer.cc AdblockWebContentObserver::~AdblockWebContentObserver() = default; -@@ -63,6 +81,9 @@ void AdblockWebContentObserver::DidFinishNavigation( +@@ -122,6 +138,9 @@ void AdblockWebContentObserver::DidFinishNavigation( if (!navigation_handle->GetRenderFrameHost()) { return; } @@ -2246,7 +2081,7 @@ diff --git a/components/adblock/content/browser/adblock_webcontents_observer.h b ~AdblockWebContentObserver() override; AdblockWebContentObserver(const AdblockWebContentObserver&) = delete; AdblockWebContentObserver& operator=(const AdblockWebContentObserver&) = -@@ -71,5 +73,6 @@ class AdblockWebContentObserver +@@ -81,5 +83,6 @@ class AdblockWebContentObserver raw_ptr sitekey_storage_; std::unique_ptr frame_hierarchy_builder_; @@ -2264,6 +2099,54 @@ diff --git a/components/adblock/content/browser/content_security_policy_injector for (const auto& collection : subscription_collections) { const auto injection = collection->GetCspInjections(request_url, frame_hierarchy_chain); +diff --git a/components/adblock/content/browser/subscription_service_factory_base.cc b/components/adblock/content/browser/subscription_service_factory_base.cc +--- a/components/adblock/content/browser/subscription_service_factory_base.cc ++++ b/components/adblock/content/browser/subscription_service_factory_base.cc +@@ -21,6 +21,7 @@ + #include + #include + ++#include "base/rand_util.h" + #include "base/command_line.h" + #include "base/files/file_util.h" + #include "base/functional/bind.h" +@@ -65,7 +66,7 @@ base::TimeDelta GetUpdateCheckInterval() { + static base::TimeDelta kCheckInterval = + g_update_check_interval_for_testing + ? g_update_check_interval_for_testing.value() +- : base::Hours(1); ++ : base::Hours(24) + base::Minutes(base::RandInt(-60,60)); + return kCheckInterval; + } + +@@ -86,7 +87,8 @@ std::unique_ptr MakeOngoingSubscriptionRequest( + } + + ConversionResult ConvertFilterFile(const GURL& subscription_url, +- const base::FilePath& path) { ++ const base::FilePath& path, ++ bool allow_privileged_filter) { + TRACE_EVENT1("eyeo", "ConvertFileToFlatbuffer", "url", + subscription_url.spec()); + ConversionResult result; +@@ -96,7 +98,7 @@ ConversionResult ConvertFilterFile(const GURL& subscription_url, + } else { + result = FlatbufferConverter::Convert( + input_stream, subscription_url, +- config::AllowPrivilegedFilters(subscription_url)); ++ allow_privileged_filter && config::AllowPrivilegedFilters(subscription_url)); + } + base::DeleteFile(path); + return result; +@@ -205,7 +207,7 @@ void SubscriptionServiceFactoryBase::ConvertFilterListFile( + base::OnceCallback result_callback) const { + base::ThreadPool::PostTaskAndReplyWithResult( + FROM_HERE, {base::MayBlock()}, +- base::BindOnce(&ConvertFilterFile, subscription_url, path), ++ base::BindOnce(&ConvertFilterFile, subscription_url, path, allow_privileged_filter), + std::move(result_callback)); + } + diff --git a/components/adblock/core/BUILD.gn b/components/adblock/core/BUILD.gn --- a/components/adblock/core/BUILD.gn +++ b/components/adblock/core/BUILD.gn @@ -2344,7 +2227,7 @@ diff --git a/components/adblock/core/activeping_telemetry_topic_provider.cc b/co deleted file mode 100644 --- a/components/adblock/core/activeping_telemetry_topic_provider.cc +++ /dev/null -@@ -1,242 +0,0 @@ +@@ -1,243 +0,0 @@ -/* - * This file is part of eyeo Chromium SDK, - * Copyright (C) 2006-present eyeo GmbH @@ -2364,11 +2247,11 @@ deleted file mode 100644 - -#include "components/adblock/core/activeping_telemetry_topic_provider.h" - --#include "base/guid.h" -#include "base/json/json_reader.h" -#include "base/json/json_writer.h" -#include "base/system/sys_info.h" -#include "base/time/time.h" +-#include "base/uuid.h" -#include "components/adblock/core/common/adblock_prefs.h" - -namespace adblock { @@ -2406,10 +2289,10 @@ deleted file mode 100644 -void AppendStringIfPresent(PrefService* pref_service, - const std::string& pref_name, - base::StringPiece payload_key, -- base::Value& payload) { +- base::Value::Dict& payload) { - auto str = pref_service->GetString(pref_name); - if (!str.empty()) { -- payload.SetStringKey(payload_key, std::move(str)); +- payload.Set(payload_key, std::move(str)); - } -} -} // namespace @@ -2443,8 +2326,8 @@ deleted file mode 100644 -// static -std::string ActivepingTelemetryTopicProvider::DefaultAuthToken() { -#if defined(EYEO_TELEMETRY_ACTIVEPING_AUTH_TOKEN) -- VLOG(1) << "[eyeo] Using " << EYEO_TELEMETRY_ACTIVEPING_AUTH_TOKEN -- << " as Telemetry authentication token"; +- DVLOG(1) << "[eyeo] Using " << EYEO_TELEMETRY_ACTIVEPING_AUTH_TOKEN +- << " as Telemetry authentication token"; - return EYEO_TELEMETRY_ACTIVEPING_AUTH_TOKEN; -#else - LOG(WARNING) @@ -2464,29 +2347,28 @@ deleted file mode 100644 -} - -void ActivepingTelemetryTopicProvider::GetPayload(PayloadCallback callback) { -- base::Value payload(base::Value::Type::DICT); -- payload.SetStringKey("addon_name", "eyeo-chromium-sdk"); -- payload.SetStringKey("addon_version", "2.0.0"); -- payload.SetStringKey("application", app_info_.name); -- payload.SetStringKey("application_version", app_info_.version); -- payload.SetBoolKey("aa_active", -- adblock_controller_->IsAcceptableAdsEnabled()); -- payload.SetStringKey("platform", base::SysInfo::OperatingSystemName()); -- payload.SetStringKey("platform_version", -- base::SysInfo::OperatingSystemVersion()); +- base::Value::Dict payload; +- payload.Set("addon_name", "eyeo-chromium-sdk"); +- payload.Set("addon_version", "2.0.0"); +- payload.Set("application", app_info_.name); +- payload.Set("application_version", app_info_.version); +- payload.Set("aa_active", adblock_controller_->IsAcceptableAdsEnabled()); +- payload.Set("platform", base::SysInfo::OperatingSystemName()); +- payload.Set("platform_version", base::SysInfo::OperatingSystemVersion()); - // Server requires the following parameters to either have a correct, - // non-empty value, or not be present at all. We shall not send empty strings. -- AppendStringIfPresent(pref_service_, prefs::kTelemetryLastPingTag, +- AppendStringIfPresent(pref_service_, common::prefs::kTelemetryLastPingTag, - "last_ping_tag", payload); -- AppendStringIfPresent(pref_service_, prefs::kTelemetryFirstPingTime, +- AppendStringIfPresent(pref_service_, common::prefs::kTelemetryFirstPingTime, - "first_ping", payload); -- AppendStringIfPresent(pref_service_, prefs::kTelemetryLastPingTime, +- AppendStringIfPresent(pref_service_, common::prefs::kTelemetryLastPingTime, - "last_ping", payload); -- AppendStringIfPresent(pref_service_, prefs::kTelemetryPreviousLastPingTime, +- AppendStringIfPresent(pref_service_, +- common::prefs::kTelemetryPreviousLastPingTime, - "previous_last_ping", payload); - -- base::Value root(base::Value::Type::DICT); -- root.SetKey("payload", std::move(payload)); +- base::Value::Dict root; +- root.Set("payload", std::move(payload)); - std::string serialized; - // The only way JSONWriter::Write() can return fail is then the Value - // contains lists or dicts that are too deep (200 levels). We just built the @@ -2498,7 +2380,7 @@ deleted file mode 100644 - -base::Time ActivepingTelemetryTopicProvider::GetTimeOfNextRequest() const { - const auto next_ping_time = -- pref_service_->GetTime(prefs::kTelemetryNextPingTime); +- pref_service_->GetTime(common::prefs::kTelemetryNextPingTime); - // Next ping time may be unset if this is a first run. Next request should - // happen ASAP. - if (next_ping_time.is_null()) { @@ -2517,15 +2399,15 @@ deleted file mode 100644 - } - - VLOG(1) << "[eyeo] Response from Telemetry server: " << *response_content; -- auto parsed = base::JSONReader::Read(*response_content); -- if (!parsed || !parsed->is_dict()) { +- auto parsed = base::JSONReader::ReadDict(*response_content); +- if (!parsed) { - VLOG(1) - << "[eyeo] Telemetry ping failed, response could not be parsed as JSON"; - ScheduleNextPing(GetRetryPingInterval()); - return; - } - -- auto* error_message = parsed->FindStringKey("error"); +- auto* error_message = parsed->FindString("error"); - if (error_message) { - VLOG(1) << "[eyeo] Telemetry ping failed, error message: " - << *error_message; @@ -2537,7 +2419,7 @@ deleted file mode 100644 - // should be the server time of when the ping was handled, possibly truncated - // for anonymity. We don't parse it or interpret it, just send it back with - // next ping. -- auto* ping_response_time = parsed->FindStringKey("token"); +- auto* ping_response_time = parsed->FindString("token"); - if (!ping_response_time) { - VLOG(1) << "[eyeo] Telemetry ping failed, response did not contain a last " - "ping / token value"; @@ -2551,26 +2433,28 @@ deleted file mode 100644 -} - -void ActivepingTelemetryTopicProvider::ScheduleNextPing(base::TimeDelta delay) { -- pref_service_->SetTime(prefs::kTelemetryNextPingTime, +- pref_service_->SetTime(common::prefs::kTelemetryNextPingTime, - base::Time::Now() + delay); -} - -void ActivepingTelemetryTopicProvider::UpdatePrefs( - const std::string& ping_response_time) { - // First ping is only set once per client. -- if (pref_service_->GetString(prefs::kTelemetryFirstPingTime).empty()) { -- pref_service_->SetString(prefs::kTelemetryFirstPingTime, +- if (pref_service_->GetString(common::prefs::kTelemetryFirstPingTime) +- .empty()) { +- pref_service_->SetString(common::prefs::kTelemetryFirstPingTime, - ping_response_time); - } - // Previous-to-last becomes last, last becomes current. - pref_service_->SetString( -- prefs::kTelemetryPreviousLastPingTime, -- pref_service_->GetString(prefs::kTelemetryLastPingTime)); -- pref_service_->SetString(prefs::kTelemetryLastPingTime, ping_response_time); +- common::prefs::kTelemetryPreviousLastPingTime, +- pref_service_->GetString(common::prefs::kTelemetryLastPingTime)); +- pref_service_->SetString(common::prefs::kTelemetryLastPingTime, +- ping_response_time); - // Generate a new random tag that wil be sent along with ping times in the - // next request. -- const auto tag = base::GUID::GenerateRandomV4(); -- pref_service_->SetString(prefs::kTelemetryLastPingTag, +- const auto tag = base::Uuid::GenerateRandomV4(); +- pref_service_->SetString(common::prefs::kTelemetryLastPingTag, - tag.AsLowercaseString()); -} - @@ -2687,7 +2571,7 @@ diff --git a/components/adblock/core/adblock_controller.h b/components/adblock/c #include "components/keyed_service/core/keyed_service.h" class GURL; -@@ -57,6 +58,11 @@ class AdblockController : public KeyedService { +@@ -43,6 +44,11 @@ class AdblockController : public KeyedService { virtual void SetAcceptableAdsEnabled(bool enabled) = 0; virtual bool IsAcceptableAdsEnabled() const = 0; @@ -2702,7 +2586,7 @@ diff --git a/components/adblock/core/adblock_controller.h b/components/adblock/c diff --git a/components/adblock/core/adblock_controller_impl.cc b/components/adblock/core/adblock_controller_impl.cc --- a/components/adblock/core/adblock_controller_impl.cc +++ b/components/adblock/core/adblock_controller_impl.cc -@@ -129,6 +129,7 @@ bool AdblockControllerImpl::IsAdblockEnabled() const { +@@ -103,6 +103,7 @@ bool AdblockControllerImpl::IsAdblockEnabled() const { } void AdblockControllerImpl::SetAcceptableAdsEnabled(bool enabled) { @@ -2710,7 +2594,7 @@ diff --git a/components/adblock/core/adblock_controller_impl.cc b/components/adb if (enabled) { InstallSubscription(AcceptableAdsUrl()); } else { -@@ -142,7 +143,33 @@ bool AdblockControllerImpl::IsAcceptableAdsEnabled() const { +@@ -116,7 +117,33 @@ bool AdblockControllerImpl::IsAcceptableAdsEnabled() const { [&](const auto& url) { return url == AcceptableAdsUrl(); }); } @@ -2744,8 +2628,8 @@ diff --git a/components/adblock/core/adblock_controller_impl.cc b/components/adb adblock_filtering_configuration_->AddFilterList(url); } -@@ -241,10 +268,8 @@ void AdblockControllerImpl::RunFirstRunLogic(PrefService* pref_service) { - if (pref_service->GetBoolean(prefs::kInstallFirstStartSubscriptions)) { +@@ -165,10 +192,8 @@ void AdblockControllerImpl::RunFirstRunLogic(PrefService* pref_service) { + common::prefs::kInstallFirstStartSubscriptions)) { // On first run, install additional subscriptions. for (const auto& cur : known_subscriptions_) { - if (cur.first_run == SubscriptionFirstRunBehavior::Subscribe) { @@ -2757,7 +2641,7 @@ diff --git a/components/adblock/core/adblock_controller_impl.cc b/components/adb // Do not install Acceptable Ads on first run because a command line // switch forbids it. Mostly used for testing. continue; -@@ -307,7 +332,7 @@ void AdblockControllerImpl::InstallLanguageBasedRecommendedSubscriptions() { +@@ -236,7 +261,7 @@ void AdblockControllerImpl::InstallLanguageBasedRecommendedSubscriptions() { SubscriptionFirstRunBehavior::SubscribeIfLocaleMatch && std::find(subscription.languages.begin(), subscription.languages.end(), language_) != subscription.languages.end()) { @@ -2769,7 +2653,7 @@ diff --git a/components/adblock/core/adblock_controller_impl.cc b/components/adb diff --git a/components/adblock/core/adblock_controller_impl.h b/components/adblock/core/adblock_controller_impl.h --- a/components/adblock/core/adblock_controller_impl.h +++ b/components/adblock/core/adblock_controller_impl.h -@@ -62,6 +62,11 @@ class AdblockControllerImpl : public AdblockController, +@@ -58,6 +58,11 @@ class AdblockControllerImpl : public AdblockController { void SetAcceptableAdsEnabled(bool enabled) override; bool IsAcceptableAdsEnabled() const override; @@ -2778,9 +2662,9 @@ diff --git a/components/adblock/core/adblock_controller_impl.h b/components/adbl + void SetPrivilegedFiltersEnabled(bool enabled) override; + bool IsPrivilegedFiltersEnabled() override; + - void SelectBuiltInSubscription(const GURL& url) override; - void UnselectBuiltInSubscription(const GURL& url) override; - std::vector> GetSelectedBuiltInSubscriptions() + void InstallSubscription(const GURL& url) override; + void UninstallSubscription(const GURL& url) override; + std::vector> GetInstalledSubscriptions() diff --git a/components/adblock/core/adblock_switches.cc b/components/adblock/core/adblock_switches.cc --- a/components/adblock/core/adblock_switches.cc +++ b/components/adblock/core/adblock_switches.cc @@ -2790,7 +2674,7 @@ diff --git a/components/adblock/core/adblock_switches.cc b/components/adblock/co -const char kDisableAcceptableAds[] = "disable-aa"; const char kDisableAdblock[] = "disable-adblock"; - const char kDisableWebUiCompatibility[] = "disable-webui-compatibility"; + const char kDisableEyeoFiltering[] = "disable-eyeo-filtering"; diff --git a/components/adblock/core/adblock_switches.h b/components/adblock/core/adblock_switches.h --- a/components/adblock/core/adblock_switches.h @@ -2801,8 +2685,8 @@ diff --git a/components/adblock/core/adblock_switches.h b/components/adblock/cor -extern const char kDisableAcceptableAds[]; extern const char kDisableAdblock[]; - // TODO(mpawlowski) remove in 111, when this becomes standard: - extern const char kDisableWebUiCompatibility[]; + extern const char kDisableEyeoFiltering[]; + diff --git a/components/adblock/core/adblock_telemetry_service.cc b/components/adblock/core/adblock_telemetry_service.cc deleted file mode 100644 --- a/components/adblock/core/adblock_telemetry_service.cc @@ -3173,10 +3057,10 @@ diff --git a/components/adblock/core/common/BUILD.gn b/components/adblock/core/c -import("//components/adblock/features.gni") - - source_set("common") { - sources = [ - "adblock_constants.cc", -@@ -47,14 +45,6 @@ source_set("common") { + config("eyeo_filtering_config") { + defines = [] + +@@ -59,14 +57,6 @@ source_set("common") { config("eyeo_application_config") { defines = [] @@ -3206,7 +3090,7 @@ diff --git a/components/adblock/core/common/adblock_constants.cc b/components/ad diff --git a/components/adblock/core/common/adblock_constants.h b/components/adblock/core/common/adblock_constants.h --- a/components/adblock/core/common/adblock_constants.h +++ b/components/adblock/core/common/adblock_constants.h -@@ -27,7 +27,6 @@ namespace flat { +@@ -28,7 +28,6 @@ namespace flat { enum AbpResource : int8_t; } @@ -3218,7 +3102,7 @@ diff --git a/components/adblock/core/common/adblock_prefs.cc b/components/adbloc --- a/components/adblock/core/common/adblock_prefs.cc +++ b/components/adblock/core/common/adblock_prefs.cc @@ -23,7 +23,9 @@ - namespace adblock::prefs { + namespace adblock::common::prefs { // Whether to block ads -const char kEnableAdblockLegacy[] = "adblock.enable"; @@ -3291,7 +3175,7 @@ diff --git a/components/adblock/core/common/adblock_prefs.h b/components/adblock --- a/components/adblock/core/common/adblock_prefs.h +++ b/components/adblock/core/common/adblock_prefs.h @@ -23,6 +23,7 @@ class PrefRegistrySimple; - namespace adblock::prefs { + namespace adblock::common::prefs { extern const char kEnableAdblockLegacy[]; +extern const char kAllowPrivilegedFilters[]; @@ -3354,15 +3238,15 @@ diff --git a/components/adblock/core/configuration/filtering_configuration.h b/c diff --git a/components/adblock/core/configuration/persistent_filtering_configuration.cc b/components/adblock/core/configuration/persistent_filtering_configuration.cc --- a/components/adblock/core/configuration/persistent_filtering_configuration.cc +++ b/components/adblock/core/configuration/persistent_filtering_configuration.cc -@@ -24,6 +24,7 @@ - #include "base/strings/string_util.h" +@@ -25,6 +25,7 @@ + #include "components/adblock/core/configuration/filtering_configuration_prefs.h" #include "components/prefs/pref_service.h" #include "components/prefs/scoped_user_pref_update.h" +#include "components/adblock/core/common/adblock_prefs.h" - namespace adblock { - namespace { -@@ -134,6 +135,7 @@ const std::string& PersistentFilteringConfiguration::GetName() const { + #include "base/logging.h" + +@@ -135,6 +136,7 @@ const std::string& PersistentFilteringConfiguration::GetName() const { } void PersistentFilteringConfiguration::SetEnabled(bool enabled) { @@ -3370,7 +3254,7 @@ diff --git a/components/adblock/core/configuration/persistent_filtering_configur if (IsEnabled() == enabled) { return; } -@@ -142,6 +144,14 @@ void PersistentFilteringConfiguration::SetEnabled(bool enabled) { +@@ -143,6 +145,14 @@ void PersistentFilteringConfiguration::SetEnabled(bool enabled) { NotifyEnabledStateChanged(); } @@ -3383,7 +3267,7 @@ diff --git a/components/adblock/core/configuration/persistent_filtering_configur +} + bool PersistentFilteringConfiguration::IsEnabled() const { - const auto pref_value = dictionary_.GetDict().FindBool(kEnabledKey); + const auto pref_value = dictionary_.FindBool(kEnabledKey); DCHECK(pref_value); diff --git a/components/adblock/core/configuration/persistent_filtering_configuration.h b/components/adblock/core/configuration/persistent_filtering_configuration.h --- a/components/adblock/core/configuration/persistent_filtering_configuration.h @@ -3413,7 +3297,7 @@ diff --git a/components/adblock/core/converter/flatbuffer_converter.cc b/compone diff --git a/components/adblock/core/converter/parser/metadata.cc b/components/adblock/core/converter/parser/metadata.cc --- a/components/adblock/core/converter/parser/metadata.cc +++ b/components/adblock/core/converter/parser/metadata.cc -@@ -57,13 +57,6 @@ absl::optional Metadata::FromStream(std::istream& filter_stream) { +@@ -58,13 +58,6 @@ absl::optional Metadata::FromStream(std::istream& filter_stream) { if (key == "homepage") { homepage = value; } else if (key == "redirect") { @@ -3427,7 +3311,7 @@ diff --git a/components/adblock/core/converter/parser/metadata.cc b/components/a } else if (key == "title") { title = value; } else if (key == "version") { -@@ -106,6 +99,7 @@ Metadata::~Metadata() = default; +@@ -107,6 +100,7 @@ Metadata::~Metadata() = default; // static bool Metadata::IsValidAdblockHeader(const std::string& adblock_header) { @@ -3435,7 +3319,7 @@ diff --git a/components/adblock/core/converter/parser/metadata.cc b/components/a static re2::RE2 adblock_header_re("^\\[Adblock.*\\]"); std::string adblock_header_trimmed; -@@ -130,7 +124,7 @@ base::TimeDelta Metadata::ParseExpirationTime( +@@ -131,7 +125,7 @@ base::TimeDelta Metadata::ParseExpirationTime( if (!re2::RE2::FullMatch(expiration_value, expiration_time_re, &expiration_time, &expiration_unit)) { @@ -3635,7 +3519,7 @@ diff --git a/components/adblock/core/converter/serializer/flatbuffer_serializer. class Buffer : public FlatbufferData { public: explicit Buffer(flatbuffers::DetachedBuffer&& buffer) -@@ -119,9 +174,25 @@ void FlatbufferSerializer::SerializeContentFilter( +@@ -118,9 +173,25 @@ void FlatbufferSerializer::SerializeContentFilter( void FlatbufferSerializer::SerializeSnippetFilter( const SnippetFilter snippet_filter) { if (!allow_privileged_) { @@ -3662,7 +3546,7 @@ diff --git a/components/adblock/core/converter/serializer/flatbuffer_serializer. std::vector> offsets; offsets.reserve(snippet_filter.snippet_script.size()); -@@ -143,7 +214,7 @@ void FlatbufferSerializer::SerializeSnippetFilter( +@@ -141,7 +212,7 @@ void FlatbufferSerializer::SerializeSnippetFilter( void FlatbufferSerializer::SerializeUrlFilter(const UrlFilter url_filter) { const auto& options = url_filter.options; if (!allow_privileged_ && options.Headers().has_value()) { @@ -3744,7 +3628,7 @@ diff --git a/components/adblock/core/subscription/filtering_configuration_mainta diff --git a/components/adblock/core/subscription/filtering_configuration_maintainer_impl.cc b/components/adblock/core/subscription/filtering_configuration_maintainer_impl.cc --- a/components/adblock/core/subscription/filtering_configuration_maintainer_impl.cc +++ b/components/adblock/core/subscription/filtering_configuration_maintainer_impl.cc -@@ -250,6 +250,19 @@ void FilteringConfigurationMaintainerImpl::RemoveDuplicateSubscriptions() { +@@ -254,6 +254,19 @@ void FilteringConfigurationMaintainerImpl::RemoveDuplicateSubscriptions() { unique_subscriptions.end()); } @@ -3764,7 +3648,7 @@ diff --git a/components/adblock/core/subscription/filtering_configuration_mainta void FilteringConfigurationMaintainerImpl::RunUpdateCheck() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); VLOG(1) << "[eyeo] Running update check"; -@@ -282,7 +295,6 @@ void FilteringConfigurationMaintainerImpl::RunUpdateCheck() { +@@ -286,7 +299,6 @@ void FilteringConfigurationMaintainerImpl::RunUpdateCheck() { AcceptableAdsUrl(); }) && persistent_metadata_->IsExpired(AcceptableAdsUrl())) { @@ -3772,7 +3656,7 @@ diff --git a/components/adblock/core/subscription/filtering_configuration_mainta } } -@@ -374,15 +386,6 @@ void FilteringConfigurationMaintainerImpl::SubscriptionAddedToStorage( +@@ -378,15 +390,6 @@ void FilteringConfigurationMaintainerImpl::SubscriptionAddedToStorage( subscription_updated_callback_.Run(subscription->GetSourceUrl()); } @@ -3788,7 +3672,7 @@ diff --git a/components/adblock/core/subscription/filtering_configuration_mainta void FilteringConfigurationMaintainerImpl::OnHeadRequestDone( const std::string version) { if (version.empty()) { -@@ -395,20 +398,20 @@ void FilteringConfigurationMaintainerImpl::OnHeadRequestDone( +@@ -399,20 +402,20 @@ void FilteringConfigurationMaintainerImpl::OnHeadRequestDone( void FilteringConfigurationMaintainerImpl::UninstallSubscription( const GURL& subscription_url) { @@ -3991,7 +3875,7 @@ diff --git a/components/adblock/core/subscription/subscription.h b/components/ad diff --git a/components/adblock/core/subscription/subscription_collection_impl.cc b/components/adblock/core/subscription/subscription_collection_impl.cc --- a/components/adblock/core/subscription/subscription_collection_impl.cc +++ b/components/adblock/core/subscription/subscription_collection_impl.cc -@@ -426,6 +426,7 @@ std::set SubscriptionCollectionImpl::GetHeaderFilters( +@@ -342,6 +342,7 @@ std::set SubscriptionCollectionImpl::GetHeaderFilters( ContentType content_type, FilterCategory category) const { std::set filters{}; @@ -4197,7 +4081,7 @@ diff --git a/components/adblock/core/subscription/subscription_persistent_metada namespace adblock { @@ -146,6 +147,12 @@ void SubscriptionPersistentMetadataImpl::UpdatePrefs() { - prefs_->SetDict(prefs::kSubscriptionMetadata, std::move(dict)); + prefs_->SetDict(common::prefs::kSubscriptionMetadata, std::move(dict)); } +bool SubscriptionPersistentMetadataImpl::AllowPrivilegedFilters( @@ -4207,8 +4091,8 @@ diff --git a/components/adblock/core/subscription/subscription_persistent_metada +} + void SubscriptionPersistentMetadataImpl::LoadFromPrefs() { - const base::Value& dict = prefs_->GetValue(prefs::kSubscriptionMetadata); - DCHECK(dict.is_dict()); + const base::Value& dict = + prefs_->GetValue(common::prefs::kSubscriptionMetadata); diff --git a/components/adblock/core/subscription/subscription_persistent_metadata_impl.h b/components/adblock/core/subscription/subscription_persistent_metadata_impl.h --- a/components/adblock/core/subscription/subscription_persistent_metadata_impl.h +++ b/components/adblock/core/subscription/subscription_persistent_metadata_impl.h @@ -4271,7 +4155,7 @@ diff --git a/components/adblock/core/subscription/subscription_persistent_storag diff --git a/components/adblock/core/subscription/subscription_service.h b/components/adblock/core/subscription/subscription_service.h --- a/components/adblock/core/subscription/subscription_service.h +++ b/components/adblock/core/subscription/subscription_service.h -@@ -69,6 +69,9 @@ class SubscriptionService : public KeyedService { +@@ -77,6 +77,9 @@ class SubscriptionService : public KeyedService { // concurrently, and future changes to the installed subscriptions will not // impact it. virtual Snapshot GetCurrentSnapshot() const = 0; @@ -4284,8 +4168,8 @@ diff --git a/components/adblock/core/subscription/subscription_service.h b/compo diff --git a/components/adblock/core/subscription/subscription_service_impl.cc b/components/adblock/core/subscription/subscription_service_impl.cc --- a/components/adblock/core/subscription/subscription_service_impl.cc +++ b/components/adblock/core/subscription/subscription_service_impl.cc -@@ -113,6 +113,18 @@ void SubscriptionServiceImpl::InstallFilteringConfiguration( - } +@@ -133,6 +133,18 @@ void SubscriptionServiceImpl::UninstallFilteringConfiguration( + maintainers_.erase(it); } +raw_ptr SubscriptionServiceImpl::GetMetadataFor( @@ -4303,7 +4187,7 @@ diff --git a/components/adblock/core/subscription/subscription_service_impl.cc b std::vector SubscriptionServiceImpl::GetInstalledFilteringConfigurations() { std::vector result; -@@ -143,6 +155,15 @@ SubscriptionService::Snapshot SubscriptionServiceImpl::GetCurrentSnapshot() +@@ -163,6 +175,15 @@ SubscriptionService::Snapshot SubscriptionServiceImpl::GetCurrentSnapshot() return snapshot; } @@ -4319,7 +4203,7 @@ diff --git a/components/adblock/core/subscription/subscription_service_impl.cc b void SubscriptionServiceImpl::AddObserver(SubscriptionObserver* o) { observers_.AddObserver(o); } -@@ -158,7 +179,7 @@ void SubscriptionServiceImpl::OnEnabledStateChanged( +@@ -178,7 +199,7 @@ void SubscriptionServiceImpl::OnEnabledStateChanged( }); DCHECK(it != maintainers_.end()) << "Received OnEnabledStateChanged from " "unregistered FilteringConfiguration"; @@ -4331,7 +4215,7 @@ diff --git a/components/adblock/core/subscription/subscription_service_impl.cc b diff --git a/components/adblock/core/subscription/subscription_service_impl.h b/components/adblock/core/subscription/subscription_service_impl.h --- a/components/adblock/core/subscription/subscription_service_impl.h +++ b/components/adblock/core/subscription/subscription_service_impl.h -@@ -65,6 +65,9 @@ class SubscriptionServiceImpl final : public SubscriptionService, +@@ -70,6 +70,9 @@ class SubscriptionServiceImpl final : public SubscriptionService, final; FilteringConfiguration* GetAdblockFilteringConfiguration() const final; Snapshot GetCurrentSnapshot() const final; @@ -4388,55 +4272,6 @@ diff --git a/components/adblock/core/subscription/subscription_validator_impl.cc return false; } return true; -diff --git a/components/adblock/features.gni b/components/adblock/features.gni -deleted file mode 100644 ---- a/components/adblock/features.gni -+++ /dev/null -@@ -1,44 +0,0 @@ --# --# This file is part of eyeo Chromium SDK, --# Copyright (C) 2006-present eyeo GmbH --# --# eyeo Chromium SDK is free software: you can redistribute it and/or modify --# it under the terms of the GNU General Public License version 3 as --# published by the Free Software Foundation. --# --# eyeo Chromium SDK is distributed in the hope that it will be useful, --# but WITHOUT ANY WARRANTY; without even the implied warranty of --# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --# GNU General Public License for more details. --# --# You should have received a copy of the GNU General Public License --# along with eyeo Chromium SDK. If not, see . -- --declare_args() { -- # eyeo Chromium SDK telemetry client id, provided on per-partner basis by eyeo. Used to -- # attribute usage reports to specific browsers. -- eyeo_telemetry_client_id = "" -- -- # eyeo Chromium SDK telemetry server address, by default evaluated to -- # "https://${eyeo_telemetry_client_id}.telemetry.eyeo.com/". -- # Override only for testing. -- eyeo_telemetry_server_url = "" -- -- # eyeo Chromium SDK telemetry authentication token, provided on per-partner basis by eyeo. -- eyeo_telemetry_activeping_auth_token = "" -- -- # eyeo Chromium SDK application name to be used in telemetry and -- # filter list download requests. If not set the value returned by -- # version_info::GetProductName() will be used instead. -- eyeo_application_name = "" -- -- # eyeo Chromium SDK application version to be used in telemetry and -- # filter list download requests. If not set the value returned by -- # version_info::GetVersionNumber() will be used instead. -- eyeo_application_version = "" -- -- # If true then requests to "adblock.test.data" domain will be intercepted -- # in order to allow installing/removing/listing filter lists via navigating to -- # special URLs. This is used for internal automated testing (see DPD-1407). -- eyeo_intercept_debug_url = false --} diff --git a/components/content_settings/core/browser/bromite_content_settings/ads.inc b/components/content_settings/core/browser/bromite_content_settings/ads.inc new file mode 100644 --- /dev/null @@ -8247,7 +8082,7 @@ new file mode 100755 diff --git a/third_party/blink/renderer/core/css/style_engine.cc b/third_party/blink/renderer/core/css/style_engine.cc --- a/third_party/blink/renderer/core/css/style_engine.cc +++ b/third_party/blink/renderer/core/css/style_engine.cc -@@ -600,6 +600,14 @@ void StyleEngine::UpdateActiveStyleSheetsInShadow( +@@ -623,6 +623,14 @@ void StyleEngine::UpdateActiveStyleSheetsInShadow( } } diff --git a/build/patches/00Remove-GoogleAccountsPrivateApiHost.patch b/build/patches/00Remove-GoogleAccountsPrivateApiHost.patch new file mode 100644 index 00000000..8eedb271 --- /dev/null +++ b/build/patches/00Remove-GoogleAccountsPrivateApiHost.patch @@ -0,0 +1,48 @@ +From: uazo +Date: Tue, 5 Sep 2023 12:55:40 +0000 +Subject: Remove GoogleAccountsPrivateApiHost + +--- + .../browser/chrome_content_browser_client_receiver_bindings.cc | 2 +- + chrome/browser/signin/google_accounts_private_api_host.cc | 2 +- + chrome/renderer/chrome_content_renderer_client.cc | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/chrome/browser/chrome_content_browser_client_receiver_bindings.cc b/chrome/browser/chrome_content_browser_client_receiver_bindings.cc +--- a/chrome/browser/chrome_content_browser_client_receiver_bindings.cc ++++ b/chrome/browser/chrome_content_browser_client_receiver_bindings.cc +@@ -543,7 +543,7 @@ void ChromeContentBrowserClient:: + chrome::mojom::GoogleAccountsPrivateApiExtension>(base::BindRepeating( + [](content::RenderFrameHost* render_frame_host, + mojo::PendingAssociatedReceiver< +- chrome::mojom::GoogleAccountsPrivateApiExtension> receiver) { ++ chrome::mojom::GoogleAccountsPrivateApiExtension_UAZO_REMOVE_IT> receiver) { + GoogleAccountsPrivateApiHost::BindHost(std::move(receiver), + render_frame_host); + }, +diff --git a/chrome/browser/signin/google_accounts_private_api_host.cc b/chrome/browser/signin/google_accounts_private_api_host.cc +--- a/chrome/browser/signin/google_accounts_private_api_host.cc ++++ b/chrome/browser/signin/google_accounts_private_api_host.cc +@@ -9,7 +9,7 @@ + #include "content/public/browser/navigation_handle.h" + #include "content/public/browser/render_frame_host.h" + +-GoogleAccountsPrivateApiHost::GoogleAccountsPrivateApiHost( ++GoogleAccountsPrivateApiHost::GoogleAccountsPrivateApiHost_UAZO_REMOVE_IT( + content::RenderFrameHost* rfh, + base::RepeatingCallback + on_consent_result_callback) +diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc +--- a/chrome/renderer/chrome_content_renderer_client.cc ++++ b/chrome/renderer/chrome_content_renderer_client.cc +@@ -644,7 +644,7 @@ void ChromeContentRendererClient::RenderFrameCreated( + #endif + + TrustedVaultEncryptionKeysExtension::Create(render_frame); +- GoogleAccountsPrivateApiExtension::Create(render_frame); ++ GoogleAccountsPrivateApiExtension::Create(render_frame); (UAZO) REMOVE IT + + if (render_frame->IsMainFrame()) + new webapps::WebPageMetadataAgent(render_frame); +-- +2.25.1