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

Unified Diff: services/ui/public/cpp/lib/command_buffer_client_impl.cc

Issue 2096293002: Eliminate usage of InterfacePtr::WaitForIncomingResponse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybots failure Created 4 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
Index: services/ui/public/cpp/lib/command_buffer_client_impl.cc
diff --git a/services/ui/public/cpp/lib/command_buffer_client_impl.cc b/services/ui/public/cpp/lib/command_buffer_client_impl.cc
index c4566d5f93515875033b8903e0dfede19d998ae1..42e2e2ea8d6e467f7516dadbd6254b053e6ccaa0 100644
--- a/services/ui/public/cpp/lib/command_buffer_client_impl.cc
+++ b/services/ui/public/cpp/lib/command_buffer_client_impl.cc
@@ -40,16 +40,6 @@ bool CreateAndMapSharedBuffer(size_t size,
return true;
}
-void MakeProgressCallback(gpu::CommandBuffer::State* output,
- const gpu::CommandBuffer::State& input) {
- *output = input;
-}
-
-void InitializeCallback(ui::mojom::CommandBufferInitializeResultPtr* output,
- ui::mojom::CommandBufferInitializeResultPtr input) {
- *output = std::move(input);
-}
-
} // namespace
CommandBufferClientImpl::CommandBufferClientImpl(
@@ -87,13 +77,11 @@ bool CommandBufferClientImpl::Initialize() {
client_binding_.Bind(GetProxy(&client_ptr));
ui::mojom::CommandBufferInitializeResultPtr initialize_result;
- command_buffer_->Initialize(
- std::move(client_ptr), std::move(handle),
- mojo::Array<int32_t>::From(attribs_),
- base::Bind(&InitializeCallback, &initialize_result));
+ result = command_buffer_->Initialize(std::move(client_ptr), std::move(handle),
+ mojo::Array<int32_t>::From(attribs_),
+ &initialize_result);
- base::ThreadRestrictions::ScopedAllowWait wait;
- if (!command_buffer_.WaitForIncomingResponse()) {
+ if (!result) {
VLOG(1) << "Channel encountered error while creating command buffer.";
return false;
}
@@ -297,11 +285,9 @@ void CommandBufferClientImpl::TryUpdateState() {
void CommandBufferClientImpl::MakeProgressAndUpdateState() {
gpu::CommandBuffer::State state;
- command_buffer_->MakeProgress(last_state_.get_offset,
- base::Bind(&MakeProgressCallback, &state));
+ bool result = command_buffer_->MakeProgress(last_state_.get_offset, &state);
- base::ThreadRestrictions::ScopedAllowWait wait;
- if (!command_buffer_.WaitForIncomingResponse()) {
+ if (!result) {
VLOG(1) << "Channel encountered error while waiting for command buffer.";
// TODO(piman): is it ok for this to re-enter?
Destroyed(gpu::error::kUnknown, gpu::error::kLostContext);
« no previous file with comments | « services/catalog/public/interfaces/catalog.mojom ('k') | services/ui/public/interfaces/command_buffer.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698