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

Unified Diff: mojo/services/native_viewport/native_viewport_service.cc

Issue 272323003: Mojo: Implement support for |Foo&| mojom syntax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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 | « mojo/services/native_viewport/native_viewport.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/native_viewport/native_viewport_service.cc
diff --git a/mojo/services/native_viewport/native_viewport_service.cc b/mojo/services/native_viewport/native_viewport_service.cc
index 96d9ec50ca42bc12ecd19b55e71278971e0b8fdc..336f497162f019814ab8b5df9813ead2954b65d1 100644
--- a/mojo/services/native_viewport/native_viewport_service.cc
+++ b/mojo/services/native_viewport/native_viewport_service.cc
@@ -66,16 +66,13 @@ class NativeViewportImpl
native_viewport_->SetBounds(bounds.To<gfx::Rect>());
}
- virtual void CreateGLES2Context(ScopedMessagePipeHandle client_handle)
- OVERRIDE {
- if (command_buffer_.get() || command_buffer_handle_.is_valid()) {
+ virtual void CreateGLES2Context(
+ InterfaceRequest<CommandBuffer> command_buffer_request) OVERRIDE {
+ if (command_buffer_.get() || command_buffer_request_.is_pending()) {
LOG(ERROR) << "Can't create multiple contexts on a NativeViewport";
return;
}
-
- // TODO(darin): CreateGLES2Context should accept a |CommandBufferPtr*|.
- command_buffer_handle_ = client_handle.Pass();
-
+ command_buffer_request_ = command_buffer_request.Pass();
CreateCommandBufferIfNeeded();
}
@@ -84,7 +81,7 @@ class NativeViewportImpl
}
void CreateCommandBufferIfNeeded() {
- if (!command_buffer_handle_.is_valid())
+ if (!command_buffer_request_.is_pending())
return;
DCHECK(!command_buffer_.get());
if (widget_ == gfx::kNullAcceleratedWidget)
@@ -93,8 +90,8 @@ class NativeViewportImpl
if (size.IsEmpty())
return;
command_buffer_.reset(
- BindToPipe(new CommandBufferImpl(widget_, native_viewport_->GetSize()),
- command_buffer_handle_.Pass()));
+ new CommandBufferImpl(widget_, native_viewport_->GetSize()));
+ BindToRequest(command_buffer_.get(), &command_buffer_request_);
}
virtual bool OnEvent(ui::Event* ui_event) OVERRIDE {
@@ -167,7 +164,7 @@ class NativeViewportImpl
shell::Context* context_;
gfx::AcceleratedWidget widget_;
scoped_ptr<services::NativeViewport> native_viewport_;
- ScopedMessagePipeHandle command_buffer_handle_;
+ InterfaceRequest<CommandBuffer> command_buffer_request_;
scoped_ptr<CommandBufferImpl> command_buffer_;
bool waiting_for_event_ack_;
};
« no previous file with comments | « mojo/services/native_viewport/native_viewport.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698