diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-11 14:44:25 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-11 14:44:25 +0000 |
commit | 76b8e58c5b8cf693f61ec1aa981df99c12e00506 (patch) | |
tree | 116afbb6d8ab0c2bf20afdfa5c8d796e3656b38a /mojo/gles2 | |
parent | 033f12364a6adb6992787a8c4e737df26b1ce356 (diff) | |
download | chromium_src-76b8e58c5b8cf693f61ec1aa981df99c12e00506.zip chromium_src-76b8e58c5b8cf693f61ec1aa981df99c12e00506.tar.gz chromium_src-76b8e58c5b8cf693f61ec1aa981df99c12e00506.tar.bz2 |
Mojo: Introduce InterfaceHandle<S>, Interface<S> and InterfacePipe<S,P>
Teach the C++ bindings generator produce code with a typed variant of ScopedMessagePipeHandle when possible. Require that RemotePtr<S> be initialized from such.
InterfaceHandle<S> is the typed variant of MessagePipeHandle.
Interface<S>::ScopedHandle is the typed variant of ScopedMessagePipeHandle.
In addition, generate typedefs for InterfaceHandle<S> and Interface<S>::ScopedHandle for convenience. For example, from shell.mojom we generate {Scoped}ShellHandle and {Scoped}ShellClientHandle.
BUG=336722
Review URL: https://codereview.chromium.org/152793005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250407 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo/gles2')
-rw-r--r-- | mojo/gles2/command_buffer_client_impl.cc | 10 | ||||
-rw-r--r-- | mojo/gles2/command_buffer_client_impl.h | 7 | ||||
-rw-r--r-- | mojo/gles2/gles2_context.cc | 4 | ||||
-rw-r--r-- | mojo/gles2/gles2_context.h | 2 | ||||
-rw-r--r-- | mojo/gles2/gles2_support_impl.cc | 3 |
5 files changed, 13 insertions, 13 deletions
diff --git a/mojo/gles2/command_buffer_client_impl.cc b/mojo/gles2/command_buffer_client_impl.cc index 1e87c1d..e4d0357 100644 --- a/mojo/gles2/command_buffer_client_impl.cc +++ b/mojo/gles2/command_buffer_client_impl.cc @@ -23,9 +23,9 @@ void CommandBufferDelegate::DrawAnimationFrame() {} CommandBufferClientImpl::CommandBufferClientImpl( CommandBufferDelegate* delegate, MojoAsyncWaiter* async_waiter, - ScopedMessagePipeHandle command_buffer) + ScopedCommandBufferHandle command_buffer_handle) : delegate_(delegate), - command_buffer_(command_buffer.Pass(), this, this, async_waiter), + command_buffer_(command_buffer_handle.Pass(), this, this, async_waiter), last_put_offset_(-1), next_transfer_buffer_id_(0), initialize_result_(false) {} @@ -45,11 +45,11 @@ bool CommandBufferClientImpl::Initialize() { shared_state()->Initialize(); - MessagePipe sync_pipe; + InterfacePipe<CommandBufferSyncClient, NoInterface> sync_pipe; sync_dispatcher_.reset(new SyncDispatcher<CommandBufferSyncClient>( - sync_pipe.handle1.Pass(), this)); + sync_pipe.handle_to_peer.Pass(), this)); AllocationScope scope; - command_buffer_->Initialize(sync_pipe.handle0.Pass(), handle); + command_buffer_->Initialize(sync_pipe.handle_to_self.Pass(), handle); // Wait for DidInitialize to come on the sync client pipe. if (!sync_dispatcher_->WaitAndDispatchOneMessage()) { VLOG(1) << "Channel encountered error while creating command buffer"; diff --git a/mojo/gles2/command_buffer_client_impl.h b/mojo/gles2/command_buffer_client_impl.h index a0367d8..fa1d1a8 100644 --- a/mojo/gles2/command_buffer_client_impl.h +++ b/mojo/gles2/command_buffer_client_impl.h @@ -42,9 +42,10 @@ class CommandBufferClientImpl : public CommandBufferClient, public gpu::CommandBuffer, public gpu::GpuControl { public: - explicit CommandBufferClientImpl(CommandBufferDelegate* delegate, - MojoAsyncWaiter* async_waiter, - ScopedMessagePipeHandle command_buffer); + explicit CommandBufferClientImpl( + CommandBufferDelegate* delegate, + MojoAsyncWaiter* async_waiter, + ScopedCommandBufferHandle command_buffer_handle); virtual ~CommandBufferClientImpl(); // CommandBuffer implementation: diff --git a/mojo/gles2/gles2_context.cc b/mojo/gles2/gles2_context.cc index 126a513..195ec60 100644 --- a/mojo/gles2/gles2_context.cc +++ b/mojo/gles2/gles2_context.cc @@ -21,11 +21,11 @@ const size_t kDefaultMaxTransferBufferSize = 16 * 1024 * 1024; } GLES2Context::GLES2Context(MojoAsyncWaiter* async_waiter, - ScopedMessagePipeHandle pipe, + ScopedCommandBufferHandle command_buffer_handle, MojoGLES2ContextLost lost_callback, MojoGLES2DrawAnimationFrame animation_callback, void* closure) - : command_buffer_(this, async_waiter, pipe.Pass()), + : command_buffer_(this, async_waiter, command_buffer_handle.Pass()), lost_callback_(lost_callback), animation_callback_(animation_callback), closure_(closure) {} diff --git a/mojo/gles2/gles2_context.h b/mojo/gles2/gles2_context.h index 430825d..cfbfcd6 100644 --- a/mojo/gles2/gles2_context.h +++ b/mojo/gles2/gles2_context.h @@ -28,7 +28,7 @@ class GLES2Context : public CommandBufferDelegate, public MojoGLES2ContextPrivate { public: explicit GLES2Context(MojoAsyncWaiter* async_waiter, - ScopedMessagePipeHandle pipe, + ScopedCommandBufferHandle command_buffer_handle, MojoGLES2ContextLost lost_callback, MojoGLES2DrawAnimationFrame animation_callback, void* closure); diff --git a/mojo/gles2/gles2_support_impl.cc b/mojo/gles2/gles2_support_impl.cc index d976065..d1330be 100644 --- a/mojo/gles2/gles2_support_impl.cc +++ b/mojo/gles2/gles2_support_impl.cc @@ -63,8 +63,7 @@ MojoGLES2Context GLES2SupportImpl::CreateContext( MojoGLES2ContextLost lost_callback, MojoGLES2DrawAnimationFrame animation_callback, void* closure) { - mojo::ScopedMessagePipeHandle scoped_handle = - mojo::ScopedMessagePipeHandle(mojo::MessagePipeHandle(handle)); + ScopedCommandBufferHandle scoped_handle(CommandBufferHandle(handle.value())); scoped_ptr<GLES2Context> client(new GLES2Context(async_waiter_, scoped_handle.Pass(), lost_callback, |