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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 case CrxUpdateItem::State::kLastStatus: | 95 case CrxUpdateItem::State::kLastStatus: |
96 // No notification for these states. | 96 // No notification for these states. |
97 break; | 97 break; |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 size_t ActionImpl::ChangeAllItemsState(CrxUpdateItem::State from, | 101 size_t ActionImpl::ChangeAllItemsState(CrxUpdateItem::State from, |
102 CrxUpdateItem::State to) { | 102 CrxUpdateItem::State to) { |
103 DCHECK(thread_checker_.CalledOnValidThread()); | 103 DCHECK(thread_checker_.CalledOnValidThread()); |
104 size_t count = 0; | 104 size_t count = 0; |
105 for (auto item : update_context_->update_items) { | 105 for (auto* item : update_context_->update_items) { |
106 if (item->state == from) { | 106 if (item->state == from) { |
107 ChangeItemState(item, to); | 107 ChangeItemState(item, to); |
108 ++count; | 108 ++count; |
109 } | 109 } |
110 } | 110 } |
111 return count; | 111 return count; |
112 } | 112 } |
113 | 113 |
114 void ActionImpl::NotifyObservers(UpdateClient::Observer::Events event, | 114 void ActionImpl::NotifyObservers(UpdateClient::Observer::Events event, |
115 const std::string& id) { | 115 const std::string& id) { |
(...skipping 57 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 |