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

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
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..60ac19a34fe3610202711242834c4ebe6de64640 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.error_code = reason;
waffles 2016/01/12 02:26:38 I'm not sure about overloading error_code to be th
Sorin Jianu 2016/01/12 03:24:06 Done.
asargent_no_longer_on_chrome 2016/01/14 21:57:53 Just to confirm, yes, we do want to be able to sen
+
+ ping_manager_->SendPing(&item);
+}
+
scoped_refptr<UpdateClient> UpdateClientFactory(
const scoped_refptr<Configurator>& config) {
scoped_ptr<PingManager> ping_manager(new PingManager(config));

Powered by Google App Engine
This is Rietveld 408576698