| 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 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 90 } |
| 91 | 91 |
| 92 update_checker_->CheckForUpdates( | 92 update_checker_->CheckForUpdates( |
| 93 update_context_->update_items, extra_request_parameters_, | 93 update_context_->update_items, extra_request_parameters_, |
| 94 base::Bind(&ActionUpdateCheck::UpdateCheckComplete, | 94 base::Bind(&ActionUpdateCheck::UpdateCheckComplete, |
| 95 base::Unretained(this))); | 95 base::Unretained(this))); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void ActionUpdateCheck::UpdateCheckComplete( | 98 void ActionUpdateCheck::UpdateCheckComplete( |
| 99 int error, | 99 int error, |
| 100 const UpdateResponse::Results& results) { | 100 const UpdateResponse::Results& results, |
| 101 int retry_after_sec) { |
| 101 DCHECK(thread_checker_.CalledOnValidThread()); | 102 DCHECK(thread_checker_.CalledOnValidThread()); |
| 102 | 103 |
| 104 update_context_->retry_after_sec_ = retry_after_sec; |
| 105 |
| 103 if (!error) | 106 if (!error) |
| 104 OnUpdateCheckSucceeded(results); | 107 OnUpdateCheckSucceeded(results); |
| 105 else | 108 else |
| 106 OnUpdateCheckFailed(error); | 109 OnUpdateCheckFailed(error); |
| 107 } | 110 } |
| 108 | 111 |
| 109 void ActionUpdateCheck::OnUpdateCheckSucceeded( | 112 void ActionUpdateCheck::OnUpdateCheckSucceeded( |
| 110 const UpdateResponse::Results& results) { | 113 const UpdateResponse::Results& results) { |
| 111 DCHECK(thread_checker_.CalledOnValidThread()); | 114 DCHECK(thread_checker_.CalledOnValidThread()); |
| 112 VLOG(1) << "Update check succeeded."; | 115 VLOG(1) << "Update check succeeded."; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 203 |
| 201 VLOG(1) << "Update check failed." << error; | 204 VLOG(1) << "Update check failed." << error; |
| 202 | 205 |
| 203 ChangeAllItemsState(CrxUpdateItem::State::kChecking, | 206 ChangeAllItemsState(CrxUpdateItem::State::kChecking, |
| 204 CrxUpdateItem::State::kNoUpdate); | 207 CrxUpdateItem::State::kNoUpdate); |
| 205 | 208 |
| 206 UpdateComplete(error); | 209 UpdateComplete(error); |
| 207 } | 210 } |
| 208 | 211 |
| 209 } // namespace update_client | 212 } // namespace update_client |
| OLD | NEW |