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

Unified Diff: ui/display/chromeos/configure_displays_task.cc

Issue 800143002: Reland: Update DisplayConfigurator to use the asynchronous tasks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-refactor4
Patch Set: Fix heap use after free issue Created 6 years 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 | « no previous file | ui/display/chromeos/display_configurator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/chromeos/configure_displays_task.cc
diff --git a/ui/display/chromeos/configure_displays_task.cc b/ui/display/chromeos/configure_displays_task.cc
index 80451242a8a7b45badfa8827ba68e84db7fc1868..af80a1293edbff2633dcd0fd2ef5b277f57398c7 100644
--- a/ui/display/chromeos/configure_displays_task.cc
+++ b/ui/display/chromeos/configure_displays_task.cc
@@ -65,17 +65,19 @@ void ConfigureDisplaysTask::Run() {
if (is_configuring_)
return;
- base::AutoReset<bool> recursivity_guard(&is_configuring_, true);
- while (!pending_request_indexes_.empty()) {
- size_t index = pending_request_indexes_.front();
- DisplayConfigureRequest* request = &requests_[index];
- pending_request_indexes_.pop();
- delegate_->Configure(*request->display, request->mode, request->origin,
- base::Bind(&ConfigureDisplaysTask::OnConfigured,
- weak_ptr_factory_.GetWeakPtr(), index));
+ {
+ base::AutoReset<bool> recursivity_guard(&is_configuring_, true);
+ while (!pending_request_indexes_.empty()) {
+ size_t index = pending_request_indexes_.front();
+ DisplayConfigureRequest* request = &requests_[index];
+ pending_request_indexes_.pop();
+ delegate_->Configure(*request->display, request->mode, request->origin,
+ base::Bind(&ConfigureDisplaysTask::OnConfigured,
+ weak_ptr_factory_.GetWeakPtr(), index));
+ }
}
- // Nothing should be modified after the |callback_| is called since thie
+ // Nothing should be modified after the |callback_| is called since the
// task may be deleted in the callback.
if (num_displays_configured_ == requests_.size())
callback_.Run(task_status_);
« no previous file with comments | « no previous file | ui/display/chromeos/display_configurator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698