| 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.h" | 5 #include "components/update_client/action.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 DCHECK(thread_checker_.CalledOnValidThread()); | 121 DCHECK(thread_checker_.CalledOnValidThread()); |
| 122 DCHECK(!update_context_->queue.empty()); | 122 DCHECK(!update_context_->queue.empty()); |
| 123 | 123 |
| 124 const std::string& id = update_context_->queue.front(); | 124 const std::string& id = update_context_->queue.front(); |
| 125 CrxUpdateItem* item = FindUpdateItemById(id); | 125 CrxUpdateItem* item = FindUpdateItemById(id); |
| 126 DCHECK(item); | 126 DCHECK(item); |
| 127 | 127 |
| 128 item->update_begin = base::TimeTicks::Now(); | 128 item->update_begin = base::TimeTicks::Now(); |
| 129 | 129 |
| 130 if (item->component.supports_group_policy_enable_component_updates && | 130 if (item->component.supports_group_policy_enable_component_updates && |
| 131 !update_context_->config->EnabledComponentUpdates()) { | 131 !update_context_->enabled_component_updates) { |
| 132 item->error_category = | 132 item->error_category = |
| 133 static_cast<int>(Action::ErrorCategory::kServiceError); | 133 static_cast<int>(Action::ErrorCategory::kServiceError); |
| 134 item->error_code = | 134 item->error_code = |
| 135 static_cast<int>(Action::ServiceError::ERROR_UPDATE_DISABLED); | 135 static_cast<int>(Action::ServiceError::ERROR_UPDATE_DISABLED); |
| 136 item->extra_code1 = 0; | 136 item->extra_code1 = 0; |
| 137 ChangeItemState(item, CrxUpdateItem::State::kNoUpdate); | 137 ChangeItemState(item, CrxUpdateItem::State::kNoUpdate); |
| 138 | 138 |
| 139 UpdateCrxComplete(item); | 139 UpdateCrxComplete(item); |
| 140 return; | 140 return; |
| 141 } | 141 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 186 } |
| 187 | 187 |
| 188 void ActionImpl::UpdateComplete(int error) { | 188 void ActionImpl::UpdateComplete(int error) { |
| 189 DCHECK(thread_checker_.CalledOnValidThread()); | 189 DCHECK(thread_checker_.CalledOnValidThread()); |
| 190 | 190 |
| 191 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 191 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
| 192 base::Bind(callback_, error)); | 192 base::Bind(callback_, error)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 } // namespace update_client | 195 } // namespace update_client |
| OLD | NEW |