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 #ifndef COMPONENTS_SURFACES_DISPLAY_FACTORY_IMPL_H_ | 5 #ifndef COMPONENTS_SURFACES_DISPLAY_FACTORY_IMPL_H_ |
6 #define COMPONENTS_SURFACES_DISPLAY_FACTORY_IMPL_H_ | 6 #define COMPONENTS_SURFACES_DISPLAY_FACTORY_IMPL_H_ |
7 | 7 |
8 #include "components/surfaces/display_impl.h" | 8 #include "components/surfaces/display_impl.h" |
9 #include "components/surfaces/public/interfaces/display.mojom.h" | 9 #include "components/surfaces/public/interfaces/display.mojom.h" |
10 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" | 10 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 class SurfaceManager; | 13 class SurfaceManager; |
14 } | 14 } |
15 | 15 |
16 namespace surfaces { | 16 namespace surfaces { |
17 class SurfacesScheduler; | 17 class SurfacesScheduler; |
| 18 class SurfacesServiceApplication; |
18 | 19 |
19 class DisplayFactoryImpl : public mojo::DisplayFactory { | 20 class DisplayFactoryImpl : public mojo::DisplayFactory { |
20 public: | 21 public: |
21 DisplayFactoryImpl(cc::SurfaceManager* manager, | 22 DisplayFactoryImpl(SurfacesServiceApplication* application, |
| 23 cc::SurfaceManager* manager, |
22 uint32_t id_namespace, | 24 uint32_t id_namespace, |
23 SurfacesScheduler* scheduler, | 25 SurfacesScheduler* scheduler, |
24 mojo::InterfaceRequest<mojo::DisplayFactory> request); | 26 mojo::InterfaceRequest<mojo::DisplayFactory> request); |
25 ~DisplayFactoryImpl() override; | 27 ~DisplayFactoryImpl() override; |
26 | 28 |
27 private: | 29 private: |
28 // mojo::DisplayFactory implementation. | 30 // mojo::DisplayFactory implementation. |
29 void Create(mojo::ContextProviderPtr context_provider, | 31 void Create(mojo::ContextProviderPtr context_provider, |
30 mojo::ResourceReturnerPtr returner, | 32 mojo::ResourceReturnerPtr returner, |
31 mojo::InterfaceRequest<mojo::Display> display_request) override; | 33 mojo::InterfaceRequest<mojo::Display> display_request) override; |
32 | 34 |
33 // We use one ID namespace for all DisplayImpls since the ID is used only by | 35 // We use one ID namespace for all DisplayImpls since the ID is used only by |
34 // cc and not exposed through mojom. | 36 // cc and not exposed through mojom. |
35 uint32_t id_namespace_; | 37 uint32_t id_namespace_; |
36 uint32_t next_local_id_; | 38 uint32_t next_local_id_; |
| 39 SurfacesServiceApplication* application_; |
37 SurfacesScheduler* scheduler_; | 40 SurfacesScheduler* scheduler_; |
38 cc::SurfaceManager* manager_; | 41 cc::SurfaceManager* manager_; |
39 mojo::StrongBinding<mojo::DisplayFactory> binding_; | 42 mojo::StrongBinding<mojo::DisplayFactory> binding_; |
40 }; | 43 }; |
41 | 44 |
42 } // namespace surfaces | 45 } // namespace surfaces |
43 | 46 |
44 #endif // COMPONENTS_SURFACES_DISPLAY_FACTORY_IMPL_H_ | 47 #endif // COMPONENTS_SURFACES_DISPLAY_FACTORY_IMPL_H_ |
OLD | NEW |