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

Unified Diff: components/update_client/task_update.cc

Issue 1439153002: Revert of Change the update_client task runner behavior to continue on shutdown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/update_client/task_update.h ('k') | components/update_client/update_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/task_update.cc
diff --git a/components/update_client/task_update.cc b/components/update_client/task_update.cc
index c6a72e6ee2f15444ede4eff5a2eaa30ff8694b0f..d253466e7e1110d6ca3b266dca50f308dd0118d0 100644
--- a/components/update_client/task_update.cc
+++ b/components/update_client/task_update.cc
@@ -8,7 +8,6 @@
#include "base/location.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
-#include "components/update_client/update_client.h"
#include "components/update_client/update_engine.h"
namespace update_client {
@@ -33,30 +32,23 @@
DCHECK(thread_checker_.CalledOnValidThread());
if (ids_.empty()) {
- TaskComplete(Error::ERROR_UPDATE_INVALID_ARGUMENT);
+ RunComplete(-1);
return;
}
update_engine_->Update(
is_foreground_, ids_, crx_data_callback_,
- base::Bind(&TaskUpdate::TaskComplete, base::Unretained(this)));
-}
-
-void TaskUpdate::Cancel() {
- DCHECK(thread_checker_.CalledOnValidThread());
-
- TaskComplete(Error::ERROR_UPDATE_CANCELED);
+ base::Bind(&TaskUpdate::RunComplete, base::Unretained(this)));
}
std::vector<std::string> TaskUpdate::GetIds() const {
return ids_;
}
-void TaskUpdate::TaskComplete(int error) {
+void TaskUpdate::RunComplete(int error) {
DCHECK(thread_checker_.CalledOnValidThread());
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(callback_, this, error));
+ callback_.Run(this, error);
}
} // namespace update_client
« no previous file with comments | « components/update_client/task_update.h ('k') | components/update_client/update_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698