| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/action_update.h" | 5 #include "components/update_client/action_update.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 288 |
| 289 std::unique_ptr<Action> ActionUpdateFull::Create() { | 289 std::unique_ptr<Action> ActionUpdateFull::Create() { |
| 290 return std::unique_ptr<Action>(new ActionUpdateFull); | 290 return std::unique_ptr<Action>(new ActionUpdateFull); |
| 291 } | 291 } |
| 292 | 292 |
| 293 bool ActionUpdateFull::IsBackgroundDownload(const CrxUpdateItem* item) { | 293 bool ActionUpdateFull::IsBackgroundDownload(const CrxUpdateItem* item) { |
| 294 DCHECK(thread_checker_.CalledOnValidThread()); | 294 DCHECK(thread_checker_.CalledOnValidThread()); |
| 295 | 295 |
| 296 // On demand component updates are always downloaded in foreground. | 296 // On demand component updates are always downloaded in foreground. |
| 297 return !item->on_demand && item->component.allows_background_download && | 297 return !item->on_demand && item->component.allows_background_download && |
| 298 update_context_->config->UseBackgroundDownloader(); | 298 update_context_->config->EnabledBackgroundDownloader(); |
| 299 } | 299 } |
| 300 | 300 |
| 301 std::vector<GURL> ActionUpdateFull::GetUrls(const CrxUpdateItem* item) { | 301 std::vector<GURL> ActionUpdateFull::GetUrls(const CrxUpdateItem* item) { |
| 302 DCHECK(thread_checker_.CalledOnValidThread()); | 302 DCHECK(thread_checker_.CalledOnValidThread()); |
| 303 return item->crx_urls; | 303 return item->crx_urls; |
| 304 } | 304 } |
| 305 | 305 |
| 306 std::string ActionUpdateFull::GetHash(const CrxUpdateItem* item) { | 306 std::string ActionUpdateFull::GetHash(const CrxUpdateItem* item) { |
| 307 DCHECK(thread_checker_.CalledOnValidThread()); | 307 DCHECK(thread_checker_.CalledOnValidThread()); |
| 308 return item->hash_sha256; | 308 return item->hash_sha256; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 364 |
| 365 item->error_category = static_cast<int>(UnpackerErrorToErrorCategory(error)); | 365 item->error_category = static_cast<int>(UnpackerErrorToErrorCategory(error)); |
| 366 item->error_code = error; | 366 item->error_code = error; |
| 367 item->extra_code1 = extended_error; | 367 item->extra_code1 = extended_error; |
| 368 ChangeItemState(item, CrxUpdateItem::State::kNoUpdate); | 368 ChangeItemState(item, CrxUpdateItem::State::kNoUpdate); |
| 369 | 369 |
| 370 UpdateCrxComplete(item); | 370 UpdateCrxComplete(item); |
| 371 } | 371 } |
| 372 | 372 |
| 373 } // namespace update_client | 373 } // namespace update_client |
| OLD | NEW |