| 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 "services/gfx/compositor/compositor_app.h" | 5 #include "services/gfx/compositor/compositor_app.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "mojo/application/application_runner_chromium.h" | 10 #include "mojo/application/application_runner_chromium.h" |
| 11 #include "mojo/common/tracing_impl.h" | 11 #include "mojo/common/tracing_impl.h" |
| 12 #include "mojo/public/c/system/main.h" | 12 #include "mojo/public/c/system/main.h" |
| 13 #include "mojo/public/cpp/application/application_impl.h" | 13 #include "mojo/public/cpp/application/application_impl.h" |
| 14 #include "mojo/public/cpp/application/service_provider_impl.h" | 14 #include "mojo/public/cpp/application/service_provider_impl.h" |
| 15 #include "services/gfx/compositor/compositor_impl.h" | 15 #include "services/gfx/compositor/compositor_impl.h" |
| 16 | 16 |
| 17 namespace compositor { | 17 namespace compositor { |
| 18 | 18 |
| 19 CompositorApp::CompositorApp() : app_impl_(nullptr) {} | 19 CompositorApp::CompositorApp() {} |
| 20 | 20 |
| 21 CompositorApp::~CompositorApp() {} | 21 CompositorApp::~CompositorApp() {} |
| 22 | 22 |
| 23 void CompositorApp::Initialize(mojo::ApplicationImpl* app_impl) { | 23 void CompositorApp::OnInitialize() { |
| 24 app_impl_ = app_impl; | |
| 25 | |
| 26 auto command_line = base::CommandLine::ForCurrentProcess(); | 24 auto command_line = base::CommandLine::ForCurrentProcess(); |
| 27 command_line->InitFromArgv(app_impl_->args()); | 25 command_line->InitFromArgv(args()); |
| 28 logging::LoggingSettings settings; | 26 logging::LoggingSettings settings; |
| 29 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 27 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
| 30 logging::InitLogging(settings); | 28 logging::InitLogging(settings); |
| 31 | 29 |
| 32 tracing_.Initialize(app_impl_->shell(), &app_impl_->args()); | 30 tracing_.Initialize(shell(), &args()); |
| 33 | 31 |
| 34 engine_.reset(new CompositorEngine()); | 32 engine_.reset(new CompositorEngine()); |
| 35 } | 33 } |
| 36 | 34 |
| 37 bool CompositorApp::ConfigureIncomingConnection( | 35 bool CompositorApp::OnAcceptConnection( |
| 38 mojo::ServiceProviderImpl* service_provider_impl) { | 36 mojo::ServiceProviderImpl* service_provider_impl) { |
| 39 service_provider_impl->AddService<mojo::gfx::composition::Compositor>( | 37 service_provider_impl->AddService<mojo::gfx::composition::Compositor>( |
| 40 [this](const mojo::ConnectionContext& connection_context, | 38 [this](const mojo::ConnectionContext& connection_context, |
| 41 mojo::InterfaceRequest<mojo::gfx::composition::Compositor> | 39 mojo::InterfaceRequest<mojo::gfx::composition::Compositor> |
| 42 compositor_request) { | 40 compositor_request) { |
| 43 compositor_bindings_.AddBinding(new CompositorImpl(engine_.get()), | 41 compositor_bindings_.AddBinding(new CompositorImpl(engine_.get()), |
| 44 compositor_request.Pass()); | 42 compositor_request.Pass()); |
| 45 }); | 43 }); |
| 46 return true; | 44 return true; |
| 47 } | 45 } |
| 48 | 46 |
| 49 } // namespace compositor | 47 } // namespace compositor |
| OLD | NEW |