| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 using Events = UpdateClient::Observer::Events; | 25 using Events = UpdateClient::Observer::Events; |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 // Returns true if a differential update is available, it has not failed yet, | 29 // Returns true if a differential update is available, it has not failed yet, |
| 30 // and the configuration allows this update. | 30 // and the configuration allows this update. |
| 31 bool CanTryDiffUpdate(const CrxUpdateItem* update_item, | 31 bool CanTryDiffUpdate(const CrxUpdateItem* update_item, |
| 32 const scoped_refptr<Configurator>& config) { | 32 const scoped_refptr<Configurator>& config) { |
| 33 return HasDiffUpdate(update_item) && !update_item->diff_update_failed && | 33 return HasDiffUpdate(update_item) && !update_item->diff_update_failed && |
| 34 config->DeltasEnabled(); | 34 config->EnabledDeltas(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace | 37 } // namespace |
| 38 | 38 |
| 39 ActionImpl::ActionImpl() : update_context_(nullptr) { | 39 ActionImpl::ActionImpl() : update_context_(nullptr) { |
| 40 } | 40 } |
| 41 | 41 |
| 42 ActionImpl::~ActionImpl() { | 42 ActionImpl::~ActionImpl() { |
| 43 DCHECK(thread_checker_.CalledOnValidThread()); | 43 DCHECK(thread_checker_.CalledOnValidThread()); |
| 44 } | 44 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 | 174 |
| 175 void ActionImpl::UpdateComplete(int error) { | 175 void ActionImpl::UpdateComplete(int error) { |
| 176 DCHECK(thread_checker_.CalledOnValidThread()); | 176 DCHECK(thread_checker_.CalledOnValidThread()); |
| 177 | 177 |
| 178 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, | 178 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
| 179 base::Bind(callback_, error)); | 179 base::Bind(callback_, error)); |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace update_client | 182 } // namespace update_client |
| OLD | NEW |