alloy: Remove optimization/prediction service usage (see issue #3352)

This service is required by the "PermissionOnDeviceNotificationPredictions"
feature which is enabled by default in https://crbug.com/1350956. It uses a
Google backend service as described at https://go.dev/solutions/google/chrome.

This change removes the usage of PredictionBasedPermissionUiSelector, which
triggered this dependency, along with related startup complexity that was added
to support the optimization/prediction service in the M106 update.
This commit is contained in:
Marshall Greenblatt
2022-08-23 12:20:45 -04:00
parent 7659dd60ba
commit 5dc69c6cdb
16 changed files with 29 additions and 135 deletions

View File

@@ -17,7 +17,6 @@
#include "base/command_line.h"
#include "chrome/browser/component_updater/chrome_component_updater_configurator.h"
#include "chrome/browser/metrics/chrome_metrics_services_manager_client.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/permissions/chrome_permissions_client.h"
#include "chrome/browser/policy/chrome_browser_policy_connector.h"
@@ -27,8 +26,6 @@
#include "chrome/browser/ui/prefs/pref_watcher.h"
#include "components/component_updater/component_updater_service.h"
#include "components/component_updater/timer_update_scheduler.h"
#include "components/metrics_services_manager/metrics_services_manager.h"
#include "components/metrics_services_manager/metrics_services_manager_client.h"
#include "components/net_log/chrome_net_log.h"
#include "components/prefs/pref_service.h"
#include "content/browser/startup_helper.h"
@@ -104,8 +101,6 @@ void ChromeBrowserProcessAlloy::CleanupOnUIThread() {
print_job_manager_.reset(nullptr);
print_preview_dialog_controller_ = nullptr;
metrics_services_manager_.reset();
profile_manager_.reset();
event_router_forwarder_ = nullptr;
@@ -130,7 +125,6 @@ void ChromeBrowserProcessAlloy::CleanupOnUIThread() {
}
local_state_.reset();
network_quality_tracker_.reset();
browser_policy_connector_.reset();
background_printing_manager_.reset();
field_trial_list_.reset();
@@ -150,19 +144,13 @@ void ChromeBrowserProcessAlloy::FlushLocalStateAndReply(
metrics_services_manager::MetricsServicesManager*
ChromeBrowserProcessAlloy::GetMetricsServicesManager() {
if (!metrics_services_manager_) {
auto client =
std::make_unique<ChromeMetricsServicesManagerClient>(local_state());
metrics_services_manager_client_ = client.get();
metrics_services_manager_ =
std::make_unique<metrics_services_manager::MetricsServicesManager>(
std::move(client));
}
return metrics_services_manager_.get();
NOTREACHED();
return nullptr;
}
metrics::MetricsService* ChromeBrowserProcessAlloy::metrics_service() {
return GetMetricsServicesManager()->GetMetricsService();
NOTREACHED();
return nullptr;
}
SystemNetworkContextManager*
@@ -173,11 +161,8 @@ ChromeBrowserProcessAlloy::system_network_context_manager() {
network::NetworkQualityTracker*
ChromeBrowserProcessAlloy::network_quality_tracker() {
if (!network_quality_tracker_) {
network_quality_tracker_ = std::make_unique<network::NetworkQualityTracker>(
base::BindRepeating(&content::GetNetworkService));
}
return network_quality_tracker_.get();
NOTREACHED();
return nullptr;
}
ProfileManager* ChromeBrowserProcessAlloy::profile_manager() {