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

Unified Diff: mojo/gles2/command_buffer_client_impl.cc

Issue 718623004: Use Binding<Interface> in surfaces and gles2 code (Closed) Base URL: git@github.com:domokit/mojo.git@connector
Patch Set: use InterfaceRequest<> instead of InterfaceRequest<>* Created 6 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 | « no previous file | mojo/services/surfaces/surfaces_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/gles2/command_buffer_client_impl.cc
diff --git a/mojo/gles2/command_buffer_client_impl.cc b/mojo/gles2/command_buffer_client_impl.cc
index c4aad34dde62f21c85b53b1af5fd26bfecf8f923..f54e202b5d29a7f3d9bb5acdf5044db8f4fde096 100644
--- a/mojo/gles2/command_buffer_client_impl.cc
+++ b/mojo/gles2/command_buffer_client_impl.cc
@@ -45,19 +45,20 @@ CommandBufferDelegate::~CommandBufferDelegate() {}
void CommandBufferDelegate::ContextLost() {}
-class CommandBufferClientImpl::SyncClientImpl
- : public InterfaceImpl<CommandBufferSyncClient> {
+class CommandBufferClientImpl::SyncClientImpl : public CommandBufferSyncClient {
public:
- SyncClientImpl() : initialized_successfully_(false) {}
+ SyncClientImpl(CommandBufferSyncClientPtr* ptr,
+ const MojoAsyncWaiter* async_waiter)
+ : initialized_successfully_(false), binding_(this, ptr, async_waiter) {}
bool WaitForInitialization() {
- if (!WaitForIncomingMethodCall())
+ if (!binding_.WaitForIncomingMethodCall())
return false;
return initialized_successfully_;
}
CommandBufferStatePtr WaitForProgress() {
- if (!WaitForIncomingMethodCall())
+ if (!binding_.WaitForIncomingMethodCall())
return CommandBufferStatePtr();
return command_buffer_state_.Pass();
}
@@ -79,6 +80,9 @@ class CommandBufferClientImpl::SyncClientImpl
bool initialized_successfully_;
GpuCapabilitiesPtr capabilities_;
CommandBufferStatePtr command_buffer_state_;
+ Binding<CommandBufferSyncClient> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(SyncClientImpl);
};
CommandBufferClientImpl::CommandBufferClientImpl(
@@ -111,8 +115,7 @@ bool CommandBufferClientImpl::Initialize() {
shared_state()->Initialize();
CommandBufferSyncClientPtr sync_client;
- sync_client_impl_.reset(
- WeakBindToProxy(new SyncClientImpl(), &sync_client, async_waiter_));
+ sync_client_impl_.reset(new SyncClientImpl(&sync_client, async_waiter_));
command_buffer_->Initialize(sync_client.Pass(), duped.Pass());
« no previous file with comments | « no previous file | mojo/services/surfaces/surfaces_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698