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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_
6 #define CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_
8 #include "base/memory/ref_counted.h"
9 #include "cc/output/swap_promise.h"
12 class SyncMessageFilter
;
17 class FrameSwapMessageQueue
;
19 class QueueMessageSwapPromise
: public cc::SwapPromise
{
21 QueueMessageSwapPromise(scoped_refptr
<IPC::SyncMessageFilter
> message_sender
,
22 scoped_refptr
<FrameSwapMessageQueue
> message_queue
,
23 int source_frame_number
);
25 ~QueueMessageSwapPromise() override
;
27 void DidActivate() override
;
28 void DidSwap(cc::CompositorFrameMetadata
* metadata
) override
;
29 void DidNotSwap(DidNotSwapReason reason
) override
;
31 int64
TraceId() const override
;
34 void PromiseCompleted();
36 scoped_refptr
<IPC::SyncMessageFilter
> message_sender_
;
37 scoped_refptr
<content::FrameSwapMessageQueue
> message_queue_
;
38 int source_frame_number_
;
44 } // namespace content
46 #endif // CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_