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_update_check.h" | 5 #include "components/update_client/action_update_check.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
8 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
11 #include "base/callback.h" | 12 #include "base/callback.h" |
12 #include "base/location.h" | 13 #include "base/location.h" |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
15 #include "base/thread_task_runner_handle.h" | 16 #include "base/thread_task_runner_handle.h" |
16 #include "base/version.h" | 17 #include "base/version.h" |
17 #include "components/update_client/action_update.h" | 18 #include "components/update_client/action_update.h" |
(...skipping 14 matching lines...) Expand all Loading... |
32 Version proposed_ver(proposed); | 33 Version proposed_ver(proposed); |
33 return proposed_ver.IsValid() && current.CompareTo(proposed_ver) < 0; | 34 return proposed_ver.IsValid() && current.CompareTo(proposed_ver) < 0; |
34 } | 35 } |
35 | 36 |
36 } // namespace | 37 } // namespace |
37 | 38 |
38 ActionUpdateCheck::ActionUpdateCheck( | 39 ActionUpdateCheck::ActionUpdateCheck( |
39 scoped_ptr<UpdateChecker> update_checker, | 40 scoped_ptr<UpdateChecker> update_checker, |
40 const base::Version& browser_version, | 41 const base::Version& browser_version, |
41 const std::string& extra_request_parameters) | 42 const std::string& extra_request_parameters) |
42 : update_checker_(update_checker.Pass()), | 43 : update_checker_(std::move(update_checker)), |
43 browser_version_(browser_version), | 44 browser_version_(browser_version), |
44 extra_request_parameters_(extra_request_parameters) { | 45 extra_request_parameters_(extra_request_parameters) {} |
45 } | |
46 | 46 |
47 ActionUpdateCheck::~ActionUpdateCheck() { | 47 ActionUpdateCheck::~ActionUpdateCheck() { |
48 DCHECK(thread_checker_.CalledOnValidThread()); | 48 DCHECK(thread_checker_.CalledOnValidThread()); |
49 } | 49 } |
50 | 50 |
51 void ActionUpdateCheck::Run(UpdateContext* update_context, Callback callback) { | 51 void ActionUpdateCheck::Run(UpdateContext* update_context, Callback callback) { |
52 DCHECK(thread_checker_.CalledOnValidThread()); | 52 DCHECK(thread_checker_.CalledOnValidThread()); |
53 | 53 |
54 ActionImpl::Run(update_context, callback); | 54 ActionImpl::Run(update_context, callback); |
55 | 55 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 VLOG(1) << "Update check failed." << error; | 203 VLOG(1) << "Update check failed." << error; |
204 | 204 |
205 ChangeAllItemsState(CrxUpdateItem::State::kChecking, | 205 ChangeAllItemsState(CrxUpdateItem::State::kChecking, |
206 CrxUpdateItem::State::kNoUpdate); | 206 CrxUpdateItem::State::kNoUpdate); |
207 | 207 |
208 UpdateComplete(error); | 208 UpdateComplete(error); |
209 } | 209 } |
210 | 210 |
211 } // namespace update_client | 211 } // namespace update_client |
OLD | NEW |