OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/native_viewport/native_viewport_application_delegate.h" | 5 #include "components/native_viewport/native_viewport_application_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "components/native_viewport/native_viewport_impl.h" | 8 #include "components/native_viewport/native_viewport_impl.h" |
9 #include "components/native_viewport/public/cpp/args.h" | 9 #include "components/native_viewport/public/cpp/args.h" |
10 #include "mojo/application/public/cpp/application_connection.h" | 10 #include "mojo/application/public/cpp/application_connection.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 connection->AddService<mojo::NativeViewport>(this); | 42 connection->AddService<mojo::NativeViewport>(this); |
43 connection->AddService<mojo::Gpu>(this); | 43 connection->AddService<mojo::Gpu>(this); |
44 return true; | 44 return true; |
45 } | 45 } |
46 | 46 |
47 void NativeViewportApplicationDelegate::Create( | 47 void NativeViewportApplicationDelegate::Create( |
48 mojo::ApplicationConnection* connection, | 48 mojo::ApplicationConnection* connection, |
49 mojo::InterfaceRequest<mojo::NativeViewport> request) { | 49 mojo::InterfaceRequest<mojo::NativeViewport> request) { |
50 if (!gpu_state_.get()) | 50 if (!gpu_state_.get()) |
51 gpu_state_ = new gles2::GpuState; | 51 gpu_state_ = new gles2::GpuState; |
52 new NativeViewportImpl(is_headless_, gpu_state_, request.Pass()); | 52 new NativeViewportImpl(is_headless_, gpu_state_, request.Pass(), |
| 53 app_lifetime_helper_.CreateAppRefCount()); |
53 } | 54 } |
54 | 55 |
55 void NativeViewportApplicationDelegate::Create( | 56 void NativeViewportApplicationDelegate::Create( |
56 mojo::ApplicationConnection* connection, | 57 mojo::ApplicationConnection* connection, |
57 mojo::InterfaceRequest<mojo::Gpu> request) { | 58 mojo::InterfaceRequest<mojo::Gpu> request) { |
58 if (!gpu_state_.get()) | 59 if (!gpu_state_.get()) |
59 gpu_state_ = new gles2::GpuState; | 60 gpu_state_ = new gles2::GpuState; |
60 new gles2::GpuImpl(request.Pass(), gpu_state_); | 61 new gles2::GpuImpl(request.Pass(), gpu_state_); |
61 } | 62 } |
62 | 63 |
63 } // namespace native_viewport | 64 } // namespace native_viewport |
OLD | NEW |