Skip to content

Commit

Permalink
[Deduplication] Removed outdated code
Browse files Browse the repository at this point in the history
Deduplication code no longer utilises component updater. This CL removes any code corresponding to that.

Bug: b/283900876
Change-Id: I4bd8129c2a36d461f63a173db82e8b08b5374b45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4564933
Reviewed-by: Joshua Pawlicki <waffles@chromium.org>
Reviewed-by: Melissa Zhang <melzhang@chromium.org>
Commit-Queue: Sharmin Zaman <sharminzaman@google.com>
Cr-Commit-Position: refs/heads/main@{#1150357}
  • Loading branch information
Sharmin Zaman authored and Chromium LUCI CQ committed May 30, 2023
1 parent ff7dec5 commit 67a7fb9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 470 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,55 +151,6 @@ bool AppDeduplicationService::AreDuplicates(const Entry& entry_1,
return duplication_index_1 == duplication_index_2;
}

// This function is only used when the kAppDeduplicationService flag
// is enabled.
void AppDeduplicationService::OnDuplicatedGroupListUpdated(
const proto::DuplicatedGroupList& duplicated_group_list) {
// Use the index as the internal indexing key for fast look up. If the
// size of the duplicated groups goes over integer 32 limit, a new indexing
// key needs to be introduced.
uint32_t index = 1;
for (auto const& group : duplicated_group_list.duplicate_group()) {
DuplicateGroup duplicate_group;
for (auto const& app : group.app()) {
const std::string& app_id = app.app_id_for_platform();
const std::string& source = app.source_name();
Entry entry;
// TODO(b/238394602): Add more data type when real data is ready.
// TODO(b/238394602): Add server data verification.
if (source == "arc") {
entry = Entry(app_id, AppType::kArc);
} else if (source == "web") {
entry = Entry(app_id, AppType::kWeb);
} else if (source == "website") {
GURL entry_url = GURL(app_id);
if (entry_url.is_valid()) {
entry = Entry(GURL(app_id));
} else {
continue;
}
} else {
continue;
}

entry_to_group_map_[entry] = index;
// Initialize entry status.
entry_status_[entry] = entry.entry_type == EntryType::kApp
? EntryStatus::kNotInstalledApp
: EntryStatus::kNonApp;
duplicate_group.entries.push_back(std::move(entry));
}
duplication_map_[index] = std::move(duplicate_group);
index++;
}

apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(profile_);
proxy->AppRegistryCache().ForEachApp([this](const apps::AppUpdate& update) {
UpdateInstallationStatus(update);
});
}

void AppDeduplicationService::OnAppUpdate(const apps::AppUpdate& update) {
UpdateInstallationStatus(update);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ class AppDeduplicationService : public KeyedService,
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);

private:
friend class AppDeduplicationServiceTest;
FRIEND_TEST_ALL_PREFIXES(AppDeduplicationServiceTest,
OnDuplicatedGroupListUpdated);
FRIEND_TEST_ALL_PREFIXES(AppDeduplicationServiceTest,
ExactDuplicateAllInstalled);
FRIEND_TEST_ALL_PREFIXES(AppDeduplicationServiceTest, Installation);
FRIEND_TEST_ALL_PREFIXES(AppDeduplicationServiceTest, Websites);

friend class AppDeduplicationServiceAlmanacTest;
FRIEND_TEST_ALL_PREFIXES(AppDeduplicationServiceAlmanacTest,
DeduplicateDataToEntries);
Expand Down Expand Up @@ -87,10 +79,6 @@ class AppDeduplicationService : public KeyedService,
// between now and the time stored in the server pref.
void StartLoginFlow();

// AppProvisioningDataManager::Observer:
void OnDuplicatedGroupListUpdated(
const proto::DuplicatedGroupList& duplicated_apps_map) override;

// apps::AppRegistryCache::Observer:
void OnAppUpdate(const apps::AppUpdate& update) override;
void OnAppRegistryCacheWillBeDestroyed(
Expand Down

0 comments on commit 67a7fb9

Please sign in to comment.