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

Unified Diff: services/native_viewport/app_delegate.cc

Issue 1981513002: ApplicationConnection devolution, part 2.2. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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 | « services/native_viewport/app_delegate.h ('k') | services/prediction/prediction_service_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/native_viewport/app_delegate.cc
diff --git a/services/native_viewport/app_delegate.cc b/services/native_viewport/app_delegate.cc
index 67e5ecb9afd180eefb3ada28ba30f4b1ab8d3768..e6ac53421ff1924840176001371b15d68ff9ee0f 100644
--- a/services/native_viewport/app_delegate.cc
+++ b/services/native_viewport/app_delegate.cc
@@ -5,6 +5,7 @@
#include "services/native_viewport/app_delegate.h"
#include <vector>
+
#include "gpu/config/gpu_util.h"
namespace native_viewport {
@@ -60,26 +61,24 @@ void NativeViewportAppDelegate::Initialize(mojo::ApplicationImpl* application) {
bool NativeViewportAppDelegate::ConfigureIncomingConnection(
mojo::ApplicationConnection* connection) {
- connection->AddService<mojo::NativeViewport>(this);
- connection->AddService<mojo::Gpu>(this);
- return true;
-}
+ connection->GetServiceProviderImpl().AddService<mojo::NativeViewport>([this](
+ const mojo::ConnectionContext& connection_context,
+ mojo::InterfaceRequest<mojo::NativeViewport> native_viewport_request) {
+ if (!gpu_state_.get())
+ gpu_state_ = new gles2::GpuState();
+ new NativeViewportImpl(application_, is_headless_, gpu_state_,
+ native_viewport_request.Pass());
+ });
+
+ connection->GetServiceProviderImpl().AddService<mojo::Gpu>(
+ [this](const mojo::ConnectionContext& connection_context,
+ mojo::InterfaceRequest<mojo::Gpu> gpu_request) {
+ if (!gpu_state_.get())
+ gpu_state_ = new gles2::GpuState();
+ new gles2::GpuImpl(gpu_request.Pass(), gpu_state_);
+ });
-void NativeViewportAppDelegate::Create(
- const mojo::ConnectionContext& connection_context,
- mojo::InterfaceRequest<mojo::NativeViewport> request) {
- if (!gpu_state_.get())
- gpu_state_ = new gles2::GpuState;
- new NativeViewportImpl(application_, is_headless_, gpu_state_,
- request.Pass());
-}
-
-void NativeViewportAppDelegate::Create(
- const mojo::ConnectionContext& connection_context,
- mojo::InterfaceRequest<mojo::Gpu> request) {
- if (!gpu_state_.get())
- gpu_state_ = new gles2::GpuState;
- new gles2::GpuImpl(request.Pass(), gpu_state_);
+ return true;
}
} // namespace native_viewport
« no previous file with comments | « services/native_viewport/app_delegate.h ('k') | services/prediction/prediction_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698