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 #ifndef EXAMPLES_SURFACES_APP_CHILD_IMPL_H_ | 5 #ifndef EXAMPLES_SURFACES_APP_CHILD_IMPL_H_ |
6 #define EXAMPLES_SURFACES_APP_CHILD_IMPL_H_ | 6 #define EXAMPLES_SURFACES_APP_CHILD_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 public: | 33 public: |
34 class Context { | 34 class Context { |
35 public: | 35 public: |
36 virtual ApplicationConnection* ShellConnection( | 36 virtual ApplicationConnection* ShellConnection( |
37 const mojo::String& application_url) = 0; | 37 const mojo::String& application_url) = 0; |
38 }; | 38 }; |
39 explicit ChildImpl(ApplicationConnection* surfaces_service_connection); | 39 explicit ChildImpl(ApplicationConnection* surfaces_service_connection); |
40 ~ChildImpl() override; | 40 ~ChildImpl() override; |
41 | 41 |
42 private: | 42 private: |
| 43 using ProduceCallback = mojo::Callback<void(SurfaceIdPtr id)>; |
| 44 |
43 // SurfaceClient implementation | 45 // SurfaceClient implementation |
44 void SetIdNamespace(uint32_t id_namespace) override; | 46 void SetIdNamespace(uint32_t id_namespace) override; |
45 void ReturnResources(Array<ReturnedResourcePtr> resources) override; | 47 void ReturnResources(Array<ReturnedResourcePtr> resources) override; |
46 | 48 |
47 // Child implementation. | 49 // Child implementation. |
48 void ProduceFrame( | 50 void ProduceFrame(ColorPtr color, |
49 ColorPtr color, | 51 SizePtr size, |
50 SizePtr size, | 52 const ProduceCallback& callback) override; |
51 const mojo::Callback<void(SurfaceIdPtr id)>& callback) override; | |
52 | 53 |
53 scoped_ptr<cc::SurfaceIdAllocator> allocator_; | 54 scoped_ptr<cc::SurfaceIdAllocator> allocator_; |
54 SurfacePtr surface_; | 55 SurfacePtr surface_; |
55 cc::SurfaceId id_; | 56 uint32_t id_namespace_; |
56 | 57 |
57 DISALLOW_COPY_AND_ASSIGN(ChildImpl); | 58 DISALLOW_COPY_AND_ASSIGN(ChildImpl); |
58 }; | 59 }; |
59 | 60 |
60 } // namespace examples | 61 } // namespace examples |
61 } // namespace mojo | 62 } // namespace mojo |
62 | 63 |
63 #endif // EXAMPLES_SURFACES_APP_CHILD_IMPL_H_ | 64 #endif // EXAMPLES_SURFACES_APP_CHILD_IMPL_H_ |
OLD | NEW |