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

Side by Side Diff: shell/android/native_viewport_application_loader.cc

Issue 1979723002: ApplicationConnection devolution, part 3. (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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "shell/android/native_viewport_application_loader.h" 5 #include "shell/android/native_viewport_application_loader.h"
6 6
7 #include "mojo/public/cpp/application/application_impl.h" 7 #include "mojo/public/cpp/application/application_impl.h"
8 #include "services/gles2/gpu_state.h" 8 #include "services/gles2/gpu_state.h"
9 #include "services/native_viewport/native_viewport_impl.h" 9 #include "services/native_viewport/native_viewport_impl.h"
10 10
(...skipping 10 matching lines...) Expand all
21 } 21 }
22 22
23 void NativeViewportApplicationLoader::Load( 23 void NativeViewportApplicationLoader::Load(
24 const GURL& url, 24 const GURL& url,
25 InterfaceRequest<mojo::Application> application_request) { 25 InterfaceRequest<mojo::Application> application_request) {
26 DCHECK(application_request.is_pending()); 26 DCHECK(application_request.is_pending());
27 app_.reset(new mojo::ApplicationImpl(this, application_request.Pass())); 27 app_.reset(new mojo::ApplicationImpl(this, application_request.Pass()));
28 } 28 }
29 29
30 bool NativeViewportApplicationLoader::ConfigureIncomingConnection( 30 bool NativeViewportApplicationLoader::ConfigureIncomingConnection(
31 ApplicationConnection* connection) { 31 mojo::ServiceProviderImpl* service_provider_impl) {
32 connection->GetServiceProviderImpl().AddService<mojo::NativeViewport>( 32 service_provider_impl->AddService<mojo::NativeViewport>(
33 [this](const ConnectionContext& connection_context, 33 [this](const ConnectionContext& connection_context,
34 InterfaceRequest<mojo::NativeViewport> native_viewport_request) { 34 InterfaceRequest<mojo::NativeViewport> native_viewport_request) {
35 if (!gpu_state_) 35 if (!gpu_state_)
36 gpu_state_ = new gles2::GpuState(); 36 gpu_state_ = new gles2::GpuState();
37 new native_viewport::NativeViewportImpl(app_.get(), false, gpu_state_, 37 new native_viewport::NativeViewportImpl(app_.get(), false, gpu_state_,
38 native_viewport_request.Pass()); 38 native_viewport_request.Pass());
39 }); 39 });
40 connection->GetServiceProviderImpl().AddService<mojo::Gpu>( 40 service_provider_impl->AddService<mojo::Gpu>(
41 [this](const ConnectionContext& connection_context, 41 [this](const ConnectionContext& connection_context,
42 InterfaceRequest<mojo::Gpu> gpu_request) { 42 InterfaceRequest<mojo::Gpu> gpu_request) {
43 if (!gpu_state_) 43 if (!gpu_state_)
44 gpu_state_ = new gles2::GpuState(); 44 gpu_state_ = new gles2::GpuState();
45 new gles2::GpuImpl(gpu_request.Pass(), gpu_state_); 45 new gles2::GpuImpl(gpu_request.Pass(), gpu_state_);
46 }); 46 });
47 return true; 47 return true;
48 } 48 }
49 49
50 } // namespace shell 50 } // namespace shell
OLDNEW
« no previous file with comments | « shell/android/native_viewport_application_loader.h ('k') | shell/application_manager/application_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698