Files
cromite/build/patches/WIN-Disable-updater.patch
T
2025-06-24 16:26:13 +02:00

119 lines
4.7 KiB
Diff

From: uazo <uazo@users.noreply.github.com>
Date: Sun, 7 May 2023 14:03:55 +0000
Subject: WIN Disable updater
---
chrome/browser/active_use_util.h | 2 +-
chrome/browser/updater/BUILD.gn | 16 -------
.../browser/updater/browser_updater_client.cc | 46 +------------------
3 files changed, 2 insertions(+), 62 deletions(-)
diff --git a/chrome/browser/active_use_util.h b/chrome/browser/active_use_util.h
--- a/chrome/browser/active_use_util.h
+++ b/chrome/browser/active_use_util.h
@@ -9,6 +9,6 @@
#include "chrome/install_static/buildflags.h"
inline constexpr bool kShouldRecordActiveUse =
- !BUILDFLAG(IS_WIN) || BUILDFLAG(USE_GOOGLE_UPDATE_INTEGRATION);
+ false;
#endif // CHROME_BROWSER_ACTIVE_USE_UTIL_H_
diff --git a/chrome/browser/updater/BUILD.gn b/chrome/browser/updater/BUILD.gn
--- a/chrome/browser/updater/BUILD.gn
+++ b/chrome/browser/updater/BUILD.gn
@@ -30,22 +30,6 @@ if (is_win || is_mac) {
"//components/version_info",
]
- if (is_win) {
- sources += [ "browser_updater_client_win.cc" ]
-
- if (enable_updater) {
- sources += [ "browser_updater_client_util_win.cc" ]
- } else {
- sources += [ "browser_updater_client_util_no_updater.cc" ]
- }
-
- deps += [
- "//chrome/browser/google",
- "//chrome/install_static:install_static_util",
- "//chrome/installer/util:with_no_strings",
- ]
- }
-
if (is_mac) {
sources += [
"browser_updater_client_mac.mm",
diff --git a/chrome/browser/updater/browser_updater_client.cc b/chrome/browser/updater/browser_updater_client.cc
--- a/chrome/browser/updater/browser_updater_client.cc
+++ b/chrome/browser/updater/browser_updater_client.cc
@@ -63,19 +63,6 @@ BrowserUpdaterClient::~BrowserUpdaterClient() {
void BrowserUpdaterClient::Register(base::OnceClosure complete) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- base::ThreadPool::PostTaskAndReplyWithResult(
- FROM_HERE, {base::MayBlock()},
- base::BindOnce(&BrowserUpdaterClient::GetRegistrationRequest, this),
- base::BindOnce(
- [](base::OnceCallback<void(int)> callback,
- scoped_refptr<updater::UpdateService> update_service,
- const updater::RegistrationRequest& request) {
- update_service->RegisterApp(request, std::move(callback));
- },
- base::BindPostTaskToCurrentDefault(
- base::BindOnce(&BrowserUpdaterClient::RegistrationCompleted, this,
- std::move(complete))),
- update_service_));
}
void BrowserUpdaterClient::RegistrationCompleted(base::OnceClosure complete,
@@ -107,24 +94,6 @@ void BrowserUpdaterClient::CheckForUpdate(
base::RepeatingCallback<void(const updater::UpdateService::UpdateState&)>
version_updater_callback) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-
- updater::UpdateService::UpdateState update_state;
- update_state.state =
- updater::UpdateService::UpdateState::State::kCheckingForUpdates;
- version_updater_callback.Run(update_state);
- update_service_->Update(
- GetAppId(), {}, updater::UpdateService::Priority::kForeground,
- updater::UpdateService::PolicySameVersionUpdate::kNotAllowed,
- /*language=*/{},
- base::BindPostTaskToCurrentDefault(
- base::BindRepeating([](const updater::UpdateService::UpdateState&
- state) {
- *GetLastOnDemandUpdateStateStorage() = state;
- return state;
- }).Then(version_updater_callback)),
- base::BindPostTaskToCurrentDefault(
- base::BindOnce(&BrowserUpdaterClient::UpdateCompleted, this,
- version_updater_callback)));
}
void BrowserUpdaterClient::UpdateCompleted(
@@ -173,20 +142,7 @@ void BrowserUpdaterClient::IsBrowserRegisteredCompleted(
base::OnceCallback<void(bool)> callback,
const std::vector<updater::UpdateService::AppState>& apps) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- const auto updater = std::ranges::find_if(
- apps, [](const updater::UpdateService::AppState& state) {
- return base::EqualsCaseInsensitiveASCII(state.app_id,
- updater::kUpdaterAppId);
- });
- if (updater != apps.end()) {
- *GetLastKnownUpdaterRegistrationStorage() = *updater;
- }
- const auto app =
- std::ranges::find_if(apps, &BrowserUpdaterClient::AppMatches);
- if (app != apps.end()) {
- *GetLastKnownBrowserRegistrationStorage() = *app;
- }
- std::move(callback).Run(app != apps.end());
+ std::move(callback).Run(true);
}
// User and System BrowserUpdaterClients must be kept separate - the template
--