Chromium Code Reviews| Index: shell/android/native_viewport_application_loader.cc |
| diff --git a/shell/android/native_viewport_application_loader.cc b/shell/android/native_viewport_application_loader.cc |
| index 765044707a68e11737e07378d2972445062138d2..597408a8dddd4be2089beb74e6172f51e0ff62b4 100644 |
| --- a/shell/android/native_viewport_application_loader.cc |
| +++ b/shell/android/native_viewport_application_loader.cc |
| @@ -30,6 +30,7 @@ bool NativeViewportApplicationLoader::ConfigureIncomingConnection( |
| ApplicationConnection* connection) { |
| connection->AddService<mojo::NativeViewport>(this); |
| connection->AddService<mojo::Gpu>(this); |
| + connection->AddService<mojo::NativeViewportShellService>(this); |
| return true; |
| } |
| @@ -38,7 +39,10 @@ void NativeViewportApplicationLoader::Create( |
| InterfaceRequest<mojo::NativeViewport> request) { |
| if (!gpu_state_) |
| gpu_state_ = new gles2::GpuState; |
| - new native_viewport::NativeViewportImpl(false, gpu_state_, request.Pass()); |
| + native_viewport::NativeViewportImpl* native_viewport_impl = |
| + new native_viewport::NativeViewportImpl(false, gpu_state_, |
| + request.Pass()); |
| + native_viewports_.push(native_viewport_impl->GetWeakPtr()); |
| } |
| void NativeViewportApplicationLoader::Create( |
| @@ -49,4 +53,23 @@ void NativeViewportApplicationLoader::Create( |
| new gles2::GpuImpl(request.Pass(), gpu_state_); |
| } |
| +void NativeViewportApplicationLoader::Create( |
| + mojo::ApplicationConnection* connection, |
| + InterfaceRequest<mojo::NativeViewportShellService> request) { |
| + native_viewport_shell_service_bindings_.AddBinding(this, request.Pass()); |
| +} |
| + |
| +void NativeViewportApplicationLoader::NewNativeSurfaceAvailable() { |
| + while (!native_viewports_.empty()) { |
| + base::WeakPtr<native_viewport::NativeViewportImpl> native_viewport = |
| + native_viewports_.front(); |
| + native_viewports_.pop(); |
| + if (native_viewport && native_viewport->NewNativeSurfaceAvailable()) { |
|
qsr
2015/08/06 14:13:20
No {} on a single if (following what is done in th
etiennej
2015/08/07 10:16:37
No longer applicable.
|
| + return; |
| + } |
| + } |
| + // Normally, a native surface is created only after a NativeViewport is |
| + // requested. |
| + NOTREACHED() << "No native viewport to attach to."; |
| +} |
| } // namespace shell |