Skip to content

Commit

Permalink
Remove url_param_filter component updater code
Browse files Browse the repository at this point in the history
Bug: 1380927
Change-Id: I6796d483341ab9c5c8463034310b93b736377f22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4014245
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Matt Reichhoff <mreichhoff@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1069944}
  • Loading branch information
mreichhoff authored and Chromium LUCI CQ committed Nov 10, 2022
1 parent 3f2bcc4 commit fad9105
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 1,137 deletions.
1 change: 0 additions & 1 deletion chrome/browser/component_updater/DEPS
Expand Up @@ -7,7 +7,6 @@ include_rules = [
"+components/feed",
"+components/live_caption",
"+components/soda",
"+components/url_param_filter/core",
"+media/cdm",
"+ppapi/thunk",
"+third_party/widevine",
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/component_updater/autofill_regex_remover.cc
Expand Up @@ -7,7 +7,7 @@
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/component_updater/component_updater_utils.h"
#include "components/component_updater/component_updater_utils.h"

namespace component_updater {

Expand Down
30 changes: 0 additions & 30 deletions chrome/browser/component_updater/component_updater_utils.cc
Expand Up @@ -4,43 +4,13 @@

#include "chrome/browser/component_updater/component_updater_utils.h"

#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/version.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_WIN)
#include "chrome/installer/util/install_util.h"
#endif // BUILDFLAG(IS_WIN)

namespace component_updater {

void DeleteFilesAndParentDirectory(const base::FilePath& file_path) {
const base::FilePath base_dir = file_path.DirName();
base::FileEnumerator file_enumerator(base_dir, false,
base::FileEnumerator::DIRECTORIES);
for (base::FilePath path = file_enumerator.Next(); !path.value().empty();
path = file_enumerator.Next()) {
base::Version version(path.BaseName().MaybeAsASCII());

// Ignore folders that don't have valid version names. These folders are
// not managed by the component installer, so don't try to remove them.
if (!version.IsValid())
continue;

if (!base::DeletePathRecursively(path)) {
DLOG(ERROR) << "Couldn't delete " << path.value();
}
}

if (base::IsDirectoryEmpty(base_dir)) {
if (!base::DeleteFile(base_dir)) {
DLOG(ERROR) << "Couldn't delete " << base_dir.value();
}
}
}

bool IsPerUserInstall() {
#if BUILDFLAG(IS_WIN)
// The installer computes and caches this value in memory during the
Expand Down
7 changes: 0 additions & 7 deletions chrome/browser/component_updater/component_updater_utils.h
Expand Up @@ -5,10 +5,6 @@
#ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
#define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_

namespace base {
class FilePath;
} // namespace base

namespace component_updater {

// Returns true if Chrome is installed for the current user, or false
Expand All @@ -17,9 +13,6 @@ namespace component_updater {
// install and return true.
bool IsPerUserInstall();

// A helper function to delete the path and directory for removed compoennts.
void DeleteFilesAndParentDirectory(const base::FilePath& file_path);

} // namespace component_updater

#endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_UTILS_H_
Expand Up @@ -7,7 +7,7 @@
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/component_updater/component_updater_utils.h"
#include "components/component_updater/component_updater_utils.h"

namespace component_updater {

Expand Down
5 changes: 3 additions & 2 deletions chrome/browser/component_updater/registration.cc
Expand Up @@ -37,7 +37,7 @@
#include "components/component_updater/installer_policies/on_device_head_suggest_component_installer.h"
#include "components/component_updater/installer_policies/optimization_hints_component_installer.h"
#include "components/component_updater/installer_policies/safety_tips_component_installer.h"
#include "components/component_updater/installer_policies/url_param_classification_component_installer.h"
#include "components/component_updater/url_param_filter_remover.h"
#include "components/nacl/common/buildflags.h"
#include "components/services/screen_ai/buildflags/buildflags.h"
#include "device/vr/buildflags/buildflags.h"
Expand Down Expand Up @@ -149,6 +149,8 @@ void RegisterComponentsForUpdate() {

component_updater::DeleteAutofillRegex(path);

component_updater::DeleteUrlParamFilter(path);

#if BUILDFLAG(IS_ANDROID)
// Clean up any desktop sharing hubs that were installed on Android.
component_updater::DeleteDesktopSharingHub(path);
Expand Down Expand Up @@ -221,7 +223,6 @@ void RegisterComponentsForUpdate() {
RegisterScreenAIComponent(cus, g_browser_process->local_state());
#endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)

RegisterUrlParamClassificationComponent(cus);
RegisterCommerceHeuristicsComponent(cus);
}

Expand Down

0 comments on commit fad9105

Please sign in to comment.