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

Side by Side Diff: components/component_updater/component_updater_service.cc

Issue 590333002: Replace usage of basictypes.h with a combination of stdint.h and base/macros.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/component_updater/component_updater_service.h" 5 #include "components/component_updater/component_updater_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/at_exit.h" 11 #include "base/at_exit.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/bind_helpers.h" 13 #include "base/bind_helpers.h"
14 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/compiler_specific.h" 15 #include "base/compiler_specific.h"
16 #include "base/files/file_path.h" 16 #include "base/files/file_path.h"
17 #include "base/files/file_util.h" 17 #include "base/files/file_util.h"
18 #include "base/logging.h" 18 #include "base/logging.h"
19 #include "base/macros.h"
19 #include "base/memory/scoped_ptr.h" 20 #include "base/memory/scoped_ptr.h"
20 #include "base/message_loop/message_loop_proxy.h" 21 #include "base/message_loop/message_loop_proxy.h"
21 #include "base/observer_list.h" 22 #include "base/observer_list.h"
22 #include "base/sequenced_task_runner.h" 23 #include "base/sequenced_task_runner.h"
23 #include "base/stl_util.h" 24 #include "base/stl_util.h"
24 #include "base/threading/sequenced_worker_pool.h" 25 #include "base/threading/sequenced_worker_pool.h"
25 #include "base/threading/thread_checker.h" 26 #include "base/threading/thread_checker.h"
26 #include "base/timer/timer.h" 27 #include "base/timer/timer.h"
27 #include "components/component_updater/component_patcher_operation.h" 28 #include "components/component_updater/component_patcher_operation.h"
28 #include "components/component_updater/component_unpacker.h" 29 #include "components/component_updater/component_unpacker.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 virtual std::vector<std::string> GetComponentIDs() const OVERRIDE; 114 virtual std::vector<std::string> GetComponentIDs() const OVERRIDE;
114 virtual OnDemandUpdater& GetOnDemandUpdater() OVERRIDE; 115 virtual OnDemandUpdater& GetOnDemandUpdater() OVERRIDE;
115 virtual void MaybeThrottle(const std::string& crx_id, 116 virtual void MaybeThrottle(const std::string& crx_id,
116 const base::Closure& callback) OVERRIDE; 117 const base::Closure& callback) OVERRIDE;
117 virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() 118 virtual scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner()
118 OVERRIDE; 119 OVERRIDE;
119 120
120 // Context for a crx download url request. 121 // Context for a crx download url request.
121 struct CRXContext { 122 struct CRXContext {
122 ComponentInstaller* installer; 123 ComponentInstaller* installer;
123 std::vector<uint8> pk_hash; 124 std::vector<uint8_t> pk_hash;
124 std::string id; 125 std::string id;
125 std::string fingerprint; 126 std::string fingerprint;
126 CRXContext() : installer(NULL) {} 127 CRXContext() : installer(NULL) {}
127 }; 128 };
128 129
129 private: 130 private:
130 enum ErrorCategory { 131 enum ErrorCategory {
131 kErrorNone = 0, 132 kErrorNone = 0,
132 kNetworkError, 133 kNetworkError,
133 kUnpackError, 134 kUnpackError,
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 DCHECK(!update_checker_); 313 DCHECK(!update_checker_);
313 CHECK(!timer_.IsRunning()); 314 CHECK(!timer_.IsRunning());
314 // It could be the case that Stop() had been called while a url request 315 // It could be the case that Stop() had been called while a url request
315 // or unpacking was in flight, if so we arrive here but |running_| is 316 // or unpacking was in flight, if so we arrive here but |running_| is
316 // false. In that case do not loop again. 317 // false. In that case do not loop again.
317 if (!running_) 318 if (!running_)
318 return; 319 return;
319 320
320 // Keep the delay short if in the middle of an update (step_delay), 321 // Keep the delay short if in the middle of an update (step_delay),
321 // or there are new requested_work_items_ that have not been processed yet. 322 // or there are new requested_work_items_ that have not been processed yet.
322 int64 delay_seconds = 0; 323 int64_t delay_seconds = 0;
323 if (!HasOnDemandItems()) { 324 if (!HasOnDemandItems()) {
324 switch (step_delay) { 325 switch (step_delay) {
325 case kStepDelayShort: 326 case kStepDelayShort:
326 delay_seconds = config_->StepDelay(); 327 delay_seconds = config_->StepDelay();
327 break; 328 break;
328 case kStepDelayMedium: 329 case kStepDelayMedium:
329 delay_seconds = config_->StepDelayMedium(); 330 delay_seconds = config_->StepDelayMedium();
330 break; 331 break;
331 case kStepDelayLong: 332 case kStepDelayLong:
332 delay_seconds = config_->NextCheckDelay(); 333 delay_seconds = config_->NextCheckDelay();
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 /////////////////////////////////////////////////////////////////////////////// 1014 ///////////////////////////////////////////////////////////////////////////////
1014 1015
1015 // The component update factory. Using the component updater as a singleton 1016 // The component update factory. Using the component updater as a singleton
1016 // is the job of the browser process. 1017 // is the job of the browser process.
1017 ComponentUpdateService* ComponentUpdateServiceFactory(Configurator* config) { 1018 ComponentUpdateService* ComponentUpdateServiceFactory(Configurator* config) {
1018 DCHECK(config); 1019 DCHECK(config);
1019 return new CrxUpdateService(config); 1020 return new CrxUpdateService(config);
1020 } 1021 }
1021 1022
1022 } // namespace component_updater 1023 } // namespace component_updater
OLDNEW
« no previous file with comments | « components/component_updater/component_updater_service.h ('k') | components/component_updater/component_updater_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698