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

Side by Side Diff: components/update_client/update_engine.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 | « components/update_client/update_engine.h ('k') | no next file » | 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/update_engine.h" 5 #include "components/update_client/update_engine.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 13 matching lines...) Expand all
24 bool is_foreground, 24 bool is_foreground,
25 const std::vector<std::string>& ids, 25 const std::vector<std::string>& ids,
26 const UpdateClient::CrxDataCallback& crx_data_callback, 26 const UpdateClient::CrxDataCallback& crx_data_callback,
27 const UpdateEngine::NotifyObserversCallback& notify_observers_callback, 27 const UpdateEngine::NotifyObserversCallback& notify_observers_callback,
28 const UpdateEngine::CompletionCallback& callback, 28 const UpdateEngine::CompletionCallback& callback,
29 UpdateChecker::Factory update_checker_factory, 29 UpdateChecker::Factory update_checker_factory,
30 CrxDownloader::Factory crx_downloader_factory, 30 CrxDownloader::Factory crx_downloader_factory,
31 PingManager* ping_manager) 31 PingManager* ping_manager)
32 : config(config), 32 : config(config),
33 is_foreground(is_foreground), 33 is_foreground(is_foreground),
34 enabled_component_updates(config->EnabledComponentUpdates()),
34 ids(ids), 35 ids(ids),
35 crx_data_callback(crx_data_callback), 36 crx_data_callback(crx_data_callback),
36 notify_observers_callback(notify_observers_callback), 37 notify_observers_callback(notify_observers_callback),
37 callback(callback), 38 callback(callback),
38 main_task_runner(base::ThreadTaskRunnerHandle::Get()), 39 main_task_runner(base::ThreadTaskRunnerHandle::Get()),
39 blocking_task_runner(config->GetSequencedTaskRunner()), 40 blocking_task_runner(config->GetSequencedTaskRunner()),
40 update_checker_factory(update_checker_factory), 41 update_checker_factory(update_checker_factory),
41 crx_downloader_factory(crx_downloader_factory), 42 crx_downloader_factory(crx_downloader_factory),
42 ping_manager(ping_manager), 43 ping_manager(ping_manager),
43 retry_after_sec_(0) {} 44 retry_after_sec_(0) {}
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 145
145 const auto now(base::Time::Now()); 146 const auto now(base::Time::Now());
146 147
147 // Throttle the calls in the interval (t - 1 day, t) to limit the effect of 148 // Throttle the calls in the interval (t - 1 day, t) to limit the effect of
148 // unset clocks or clock drift. 149 // unset clocks or clock drift.
149 return throttle_updates_until_ - base::TimeDelta::FromDays(1) < now && 150 return throttle_updates_until_ - base::TimeDelta::FromDays(1) < now &&
150 now < throttle_updates_until_; 151 now < throttle_updates_until_;
151 } 152 }
152 153
153 } // namespace update_client 154 } // namespace update_client
OLDNEW
« no previous file with comments | « components/update_client/update_engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698