| 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/fake_surfaces/fake_surfaces_service_application.h" | 5 #include "services/fake_surfaces/fake_surfaces_service_application.h" |
| 6 | 6 |
| 7 #include "mojo/application/application_runner_chromium.h" | 7 #include "mojo/application/application_runner_chromium.h" |
| 8 #include "mojo/common/tracing_impl.h" | |
| 9 #include "mojo/public/c/system/main.h" | 8 #include "mojo/public/c/system/main.h" |
| 10 #include "mojo/public/cpp/application/application_connection.h" | 9 #include "mojo/public/cpp/application/application_connection.h" |
| 10 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 11 #include "mojo/services/surfaces/public/interfaces/surfaces.mojom.h" | 11 #include "mojo/services/surfaces/public/interfaces/surfaces.mojom.h" |
| 12 | 12 |
| 13 using mojo::InterfaceRequest; | 13 using mojo::InterfaceRequest; |
| 14 | 14 |
| 15 namespace fake_surfaces { | 15 namespace fake_surfaces { |
| 16 | 16 |
| 17 class FakeSurfaceImpl : public mojo::Surface { | 17 class FakeSurfaceImpl : public mojo::Surface { |
| 18 public: | 18 public: |
| 19 FakeSurfaceImpl(uint32_t id_namespace, mojo::SurfacePtr* ptr) | 19 FakeSurfaceImpl(uint32_t id_namespace, mojo::SurfacePtr* ptr) |
| 20 : binding_(this, ptr) { | 20 : binding_(this, ptr) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 FakeSurfacesServiceApplication::FakeSurfacesServiceApplication() | 87 FakeSurfacesServiceApplication::FakeSurfacesServiceApplication() |
| 88 : next_id_namespace_(1u) { | 88 : next_id_namespace_(1u) { |
| 89 } | 89 } |
| 90 | 90 |
| 91 FakeSurfacesServiceApplication::~FakeSurfacesServiceApplication() { | 91 FakeSurfacesServiceApplication::~FakeSurfacesServiceApplication() { |
| 92 } | 92 } |
| 93 | 93 |
| 94 void FakeSurfacesServiceApplication::Initialize(mojo::ApplicationImpl* app) { | 94 void FakeSurfacesServiceApplication::Initialize(mojo::ApplicationImpl* app) { |
| 95 mojo::TracingImpl::Create(app); | 95 tracing_.Initialize(app); |
| 96 } | 96 } |
| 97 | 97 |
| 98 bool FakeSurfacesServiceApplication::ConfigureIncomingConnection( | 98 bool FakeSurfacesServiceApplication::ConfigureIncomingConnection( |
| 99 mojo::ApplicationConnection* connection) { | 99 mojo::ApplicationConnection* connection) { |
| 100 connection->AddService(this); | 100 connection->AddService(this); |
| 101 return true; | 101 return true; |
| 102 } | 102 } |
| 103 | 103 |
| 104 void FakeSurfacesServiceApplication::Create( | 104 void FakeSurfacesServiceApplication::Create( |
| 105 mojo::ApplicationConnection* connection, | 105 mojo::ApplicationConnection* connection, |
| 106 InterfaceRequest<mojo::SurfacesService> request) { | 106 InterfaceRequest<mojo::SurfacesService> request) { |
| 107 new FakeSurfacesServiceImpl(&next_id_namespace_, request.Pass()); | 107 new FakeSurfacesServiceImpl(&next_id_namespace_, request.Pass()); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace fake_surfaces | 110 } // namespace fake_surfaces |
| 111 | 111 |
| 112 MojoResult MojoMain(MojoHandle shell_handle) { | 112 MojoResult MojoMain(MojoHandle shell_handle) { |
| 113 mojo::ApplicationRunnerChromium runner( | 113 mojo::ApplicationRunnerChromium runner( |
| 114 new fake_surfaces::FakeSurfacesServiceApplication); | 114 new fake_surfaces::FakeSurfacesServiceApplication); |
| 115 return runner.Run(shell_handle); | 115 return runner.Run(shell_handle); |
| 116 } | 116 } |
| OLD | NEW |