| OLD | NEW |
| 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 "services/surfaces/surfaces_service_application.h" | 5 #include "services/surfaces/surfaces_service_application.h" |
| 6 | 6 |
| 7 #include "cc/surfaces/display.h" | 7 #include "cc/surfaces/display.h" |
| 8 #include "mojo/application/application_runner_chromium.h" | 8 #include "mojo/application/application_runner_chromium.h" |
| 9 #include "mojo/common/tracing_impl.h" | |
| 10 #include "mojo/public/c/system/main.h" | 9 #include "mojo/public/c/system/main.h" |
| 11 #include "services/surfaces/surfaces_impl.h" | 10 #include "services/surfaces/surfaces_impl.h" |
| 12 #include "services/surfaces/surfaces_service_impl.h" | 11 #include "services/surfaces/surfaces_service_impl.h" |
| 13 | 12 |
| 14 namespace surfaces { | 13 namespace surfaces { |
| 15 | 14 |
| 16 SurfacesServiceApplication::SurfacesServiceApplication() | 15 SurfacesServiceApplication::SurfacesServiceApplication() |
| 17 : next_id_namespace_(1u), display_(nullptr) { | 16 : next_id_namespace_(1u), display_(nullptr) { |
| 18 } | 17 } |
| 19 | 18 |
| 20 SurfacesServiceApplication::~SurfacesServiceApplication() { | 19 SurfacesServiceApplication::~SurfacesServiceApplication() { |
| 21 } | 20 } |
| 22 | 21 |
| 23 void SurfacesServiceApplication::Initialize(mojo::ApplicationImpl* app) { | 22 void SurfacesServiceApplication::Initialize(mojo::ApplicationImpl* app) { |
| 24 mojo::TracingImpl::Create(app); | 23 tracing_.Initialize(app); |
| 25 scheduler_.reset(new SurfacesScheduler(this)); | 24 scheduler_.reset(new SurfacesScheduler(this)); |
| 26 } | 25 } |
| 27 | 26 |
| 28 bool SurfacesServiceApplication::ConfigureIncomingConnection( | 27 bool SurfacesServiceApplication::ConfigureIncomingConnection( |
| 29 mojo::ApplicationConnection* connection) { | 28 mojo::ApplicationConnection* connection) { |
| 30 connection->AddService<mojo::SurfacesService>(this); | 29 connection->AddService<mojo::SurfacesService>(this); |
| 31 connection->AddService<mojo::Surface>(this); | 30 connection->AddService<mojo::Surface>(this); |
| 32 return true; | 31 return true; |
| 33 } | 32 } |
| 34 | 33 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 display_->Draw(); | 67 display_->Draw(); |
| 69 } | 68 } |
| 70 | 69 |
| 71 } // namespace surfaces | 70 } // namespace surfaces |
| 72 | 71 |
| 73 MojoResult MojoMain(MojoHandle shell_handle) { | 72 MojoResult MojoMain(MojoHandle shell_handle) { |
| 74 mojo::ApplicationRunnerChromium runner( | 73 mojo::ApplicationRunnerChromium runner( |
| 75 new surfaces::SurfacesServiceApplication); | 74 new surfaces::SurfacesServiceApplication); |
| 76 return runner.Run(shell_handle); | 75 return runner.Run(shell_handle); |
| 77 } | 76 } |
| OLD | NEW |