| Index: content/public/browser/android/synchronous_compositor.cc
|
| diff --git a/content/public/browser/android/synchronous_compositor.cc b/content/public/browser/android/synchronous_compositor.cc
|
| index 616530fc7de376d22f2008ab69c58e33307bbb10..fbdc5b23e1cc4b4a7199c6872d3464e02560b3bb 100644
|
| --- a/content/public/browser/android/synchronous_compositor.cc
|
| +++ b/content/public/browser/android/synchronous_compositor.cc
|
| @@ -18,6 +18,28 @@ SynchronousCompositor::Frame::Frame(Frame&& rhs)
|
| : compositor_frame_sink_id(rhs.compositor_frame_sink_id),
|
| frame(std::move(rhs.frame)) {}
|
|
|
| +SynchronousCompositor::FrameFuture::FrameFuture()
|
| + : waitable_event_(base::WaitableEvent::ResetPolicy::MANUAL,
|
| + base::WaitableEvent::InitialState::NOT_SIGNALED) {}
|
| +
|
| +SynchronousCompositor::FrameFuture::~FrameFuture() {}
|
| +
|
| +void SynchronousCompositor::FrameFuture::setFrame(
|
| + std::unique_ptr<Frame> frame) {
|
| + frame_ = std::move(frame);
|
| + waitable_event_.Signal();
|
| +}
|
| +
|
| +std::unique_ptr<SynchronousCompositor::Frame>
|
| +SynchronousCompositor::FrameFuture::getFrame() {
|
| +#if DCHECK_IS_ON()
|
| + DCHECK(!waited_);
|
| + waited_ = true;
|
| +#endif
|
| + waitable_event_.Wait();
|
| + return std::move(frame_);
|
| +}
|
| +
|
| SynchronousCompositor::Frame& SynchronousCompositor::Frame::operator=(
|
| Frame&& rhs) {
|
| compositor_frame_sink_id = rhs.compositor_frame_sink_id;
|
|
|