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

Unified Diff: update_attempter.cc

Issue 6624082: Start action processing asynchronously in UpdateAttempter. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: set to null Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « update_attempter.h ('k') | update_attempter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: update_attempter.cc
diff --git a/update_attempter.cc b/update_attempter.cc
index e49a5511dda029f49c64b549643dcc5bf242f69e..c9ee712809e30d7b39680bc1620dddb1d0366529 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -248,7 +248,9 @@ void UpdateAttempter::Update(const std::string& app_version,
postinstall_runner_action.get());
SetStatusAndNotify(UPDATE_STATUS_CHECKING_FOR_UPDATE);
- processor_->StartProcessing();
+
+ // Start the processing asynchronously to unblock the event loop.
+ g_idle_add(&StaticStartProcessing, this);
}
void UpdateAttempter::CheckForUpdate(const std::string& app_version,
@@ -527,6 +529,11 @@ gboolean UpdateAttempter::StaticManagePriorityCallback(gpointer data) {
return reinterpret_cast<UpdateAttempter*>(data)->ManagePriorityCallback();
}
+gboolean UpdateAttempter::StaticStartProcessing(gpointer data) {
+ reinterpret_cast<UpdateAttempter*>(data)->processor_->StartProcessing();
+ return FALSE; // Don't call this callback again.
+}
+
bool UpdateAttempter::ManagePriorityCallback() {
SetPriority(utils::kProcessPriorityNormal);
manage_priority_source_ = NULL;
« no previous file with comments | « update_attempter.h ('k') | update_attempter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698