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

Unified Diff: services/ui/public/cpp/gpu/gpu.cc

Issue 2968053002: mus-gpu: Fix handling channel establish requests. (Closed)
Patch Set: . Created 3 years, 5 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 | « no previous file | services/ui/public/cpp/tests/gpu_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/public/cpp/gpu/gpu.cc
diff --git a/services/ui/public/cpp/gpu/gpu.cc b/services/ui/public/cpp/gpu/gpu.cc
index 190bb01c2bbc97ae216f5cac072b759421191771..82c392f20e47a7bdc97a381baefc3548645b1744 100644
--- a/services/ui/public/cpp/gpu/gpu.cc
+++ b/services/ui/public/cpp/gpu/gpu.cc
@@ -95,8 +95,7 @@ void Gpu::EstablishGpuChannel(
DCHECK(IsMainThread());
scoped_refptr<gpu::GpuChannelHost> channel = GetGpuChannel();
if (channel) {
- main_task_runner_->PostTask(FROM_HERE,
- base::Bind(callback, std::move(channel)));
+ callback.Run(std::move(channel));
return;
}
establish_callbacks_.push_back(callback);
@@ -154,9 +153,10 @@ void Gpu::OnEstablishedGpuChannel(int client_id,
}
gpu_.reset();
- for (const auto& i : establish_callbacks_)
- i.Run(gpu_channel_);
+ auto callbacks = std::move(establish_callbacks_);
establish_callbacks_.clear();
+ for (const auto& callback : callbacks)
+ callback.Run(gpu_channel_);
}
bool Gpu::IsMainThread() {
« no previous file with comments | « no previous file | services/ui/public/cpp/tests/gpu_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698