| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/update_client/update_client.h" | 5 #include "components/update_client/update_client.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // they have not picked up by the update engine, and not shared with any | 227 // they have not picked up by the update engine, and not shared with any |
| 228 // task runner yet. | 228 // task runner yet. |
| 229 while (!task_queue_.empty()) { | 229 while (!task_queue_.empty()) { |
| 230 auto* task(task_queue_.front()); | 230 auto* task(task_queue_.front()); |
| 231 task_queue_.pop(); | 231 task_queue_.pop(); |
| 232 task->Cancel(); | 232 task->Cancel(); |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 | 235 |
| 236 void UpdateClientImpl::SendUninstallPing(const std::string& id, | 236 void UpdateClientImpl::SendUninstallPing(const std::string& id, |
| 237 const Version& version, | 237 const base::Version& version, |
| 238 int reason) { | 238 int reason) { |
| 239 DCHECK(thread_checker_.CalledOnValidThread()); | 239 DCHECK(thread_checker_.CalledOnValidThread()); |
| 240 | 240 |
| 241 // The implementation of PingManager::SendPing contains a self-deleting | 241 // The implementation of PingManager::SendPing contains a self-deleting |
| 242 // object responsible for sending the ping. | 242 // object responsible for sending the ping. |
| 243 CrxUpdateItem item; | 243 CrxUpdateItem item; |
| 244 item.state = CrxUpdateItem::State::kUninstalled; | 244 item.state = CrxUpdateItem::State::kUninstalled; |
| 245 item.id = id; | 245 item.id = id; |
| 246 item.previous_version = version; | 246 item.previous_version = version; |
| 247 item.next_version = base::Version("0"); | 247 item.next_version = base::Version("0"); |
| 248 item.extra_code1 = reason; | 248 item.extra_code1 = reason; |
| 249 | 249 |
| 250 ping_manager_->SendPing(&item); | 250 ping_manager_->SendPing(&item); |
| 251 } | 251 } |
| 252 | 252 |
| 253 scoped_refptr<UpdateClient> UpdateClientFactory( | 253 scoped_refptr<UpdateClient> UpdateClientFactory( |
| 254 const scoped_refptr<Configurator>& config) { | 254 const scoped_refptr<Configurator>& config) { |
| 255 std::unique_ptr<PingManager> ping_manager(new PingManager(config)); | 255 std::unique_ptr<PingManager> ping_manager(new PingManager(config)); |
| 256 return new UpdateClientImpl(config, std::move(ping_manager), | 256 return new UpdateClientImpl(config, std::move(ping_manager), |
| 257 &UpdateChecker::Create, &CrxDownloader::Create); | 257 &UpdateChecker::Create, &CrxDownloader::Create); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void RegisterPrefs(PrefRegistrySimple* registry) { | 260 void RegisterPrefs(PrefRegistrySimple* registry) { |
| 261 PersistedData::RegisterPrefs(registry); | 261 PersistedData::RegisterPrefs(registry); |
| 262 } | 262 } |
| 263 | 263 |
| 264 } // namespace update_client | 264 } // namespace update_client |
| OLD | NEW |