Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: components/update_client/update_client.cc

Issue 1578083002: Implements an UpdateClient::SendUninstallPing API for the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/update_client/update_client.h ('k') | components/update_client/update_client_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/update_client.cc
diff --git a/components/update_client/update_client.cc b/components/update_client/update_client.cc
index 05d8fbea03473afe46f5c40bbf8977d5a05feff7..9f6e955988f0142938e644a2bf92b2b3ef935c24 100644
--- a/components/update_client/update_client.cc
+++ b/components/update_client/update_client.cc
@@ -226,6 +226,23 @@ void UpdateClientImpl::Stop() {
}
}
+void UpdateClientImpl::SendUninstallPing(const std::string& id,
+ const Version& version,
+ int reason) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
+ // The implementation of PingManager::SendPing contains a self-deleting
+ // object responsible for sending the ping.
+ CrxUpdateItem item;
+ item.state = CrxUpdateItem::State::kUninstalled;
+ item.id = id;
+ item.previous_version = version;
+ item.next_version = base::Version("0");
+ item.extra_code1 = reason;
+
+ ping_manager_->SendPing(&item);
+}
+
scoped_refptr<UpdateClient> UpdateClientFactory(
const scoped_refptr<Configurator>& config) {
scoped_ptr<PingManager> ping_manager(new PingManager(config));
« no previous file with comments | « components/update_client/update_client.h ('k') | components/update_client/update_client_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698