Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(423)

Side by Side Diff: components/update_client/action.cc

Issue 2237153002: Use consistent values for enabled_component_updates throughout an update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UT. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/update_client/action_update_check.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | components/update_client/action_update_check.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698