| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 MOJO_SERVICES_GFX_IMAGES_INTERFACES_IMAGE_PIPE_PRODUCER_ENDPOINT_H_ | 5 #ifndef MOJO_SERVICES_GFX_IMAGES_INTERFACES_IMAGE_PIPE_PRODUCER_ENDPOINT_H_ |
| 6 #define MOJO_SERVICES_GFX_IMAGES_INTERFACES_IMAGE_PIPE_PRODUCER_ENDPOINT_H_ | 6 #define MOJO_SERVICES_GFX_IMAGES_INTERFACES_IMAGE_PIPE_PRODUCER_ENDPOINT_H_ |
| 7 | 7 |
| 8 #include "image_pipe_endpoint.h" | 8 #include "image_pipe_endpoint.h" |
| 9 #include "mojo/public/c/system/macros.h" | 9 #include "mojo/public/cpp/system/macros.h" |
| 10 #include "mojo/services/gfx/images/interfaces/image_pipe.mojom.h" | 10 #include "mojo/services/gfx/images/interfaces/image_pipe.mojom.h" |
| 11 | 11 |
| 12 namespace image_pipe { | 12 namespace image_pipe { |
| 13 | 13 |
| 14 // This class wraps the producer end of an ImagePipe and validates the sanity | 14 // This class wraps the producer end of an ImagePipe and validates the sanity |
| 15 // of both the producer actions and the consumer actions coming over the | 15 // of both the producer actions and the consumer actions coming over the |
| 16 // message pipe. It also tracks the state of Images in the pipe's image pool | 16 // message pipe. It also tracks the state of Images in the pipe's image pool |
| 17 // and provides conviennce mechanisms for accessing this state (like the ability | 17 // and provides conviennce mechanisms for accessing this state (like the ability |
| 18 // to get the ID of an available image without having to manually track the | 18 // to get the ID of an available image without having to manually track the |
| 19 // lifecycle of these images. | 19 // lifecycle of these images. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // This exists wrap ImagePipeEndpoint::ConsumerRelease because for some reason | 56 // This exists wrap ImagePipeEndpoint::ConsumerRelease because for some reason |
| 57 // GCC doesnt like us calling protected methods on our base class from inside | 57 // GCC doesnt like us calling protected methods on our base class from inside |
| 58 // a lambda that captures 'this', which breaks the fnl build. Clang handles it | 58 // a lambda that captures 'this', which breaks the fnl build. Clang handles it |
| 59 // fine, but its unclear whos right here, so we trampoline it as a workaround | 59 // fine, but its unclear whos right here, so we trampoline it as a workaround |
| 60 void ConsumerReleaseInternal(uint32_t id, | 60 void ConsumerReleaseInternal(uint32_t id, |
| 61 mojo::gfx::PresentationStatus status); | 61 mojo::gfx::PresentationStatus status); |
| 62 | 62 |
| 63 ImagePipeEndpoint state_tracker_; | 63 ImagePipeEndpoint state_tracker_; |
| 64 mojo::gfx::ImagePipePtr image_pipe_ptr_; | 64 mojo::gfx::ImagePipePtr image_pipe_ptr_; |
| 65 std::function<void()> endpoint_closed_callback_; | 65 std::function<void()> endpoint_closed_callback_; |
| 66 |
| 67 MOJO_DISALLOW_COPY_AND_ASSIGN(ImagePipeProducerEndpoint); |
| 66 }; | 68 }; |
| 67 | 69 |
| 68 } // namespace image_pipe | 70 } // namespace image_pipe |
| 69 | 71 |
| 70 #endif // MOJO_SERVICES_GFX_IMAGES_INTERFACES_IMAGE_PIPE_PRODUCER_ENDPOINT_H_ | 72 #endif // MOJO_SERVICES_GFX_IMAGES_INTERFACES_IMAGE_PIPE_PRODUCER_ENDPOINT_H_ |
| OLD | NEW |