[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 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. | ||||
4 | |||||
tfarina | bccc34c7 | 2015-02-27 21:32:15 | [diff] [blame] | 5 | #ifndef CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_ |
6 | #define CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_ | ||||
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 7 | |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 8 | #include <stdint.h> |
9 | |||||
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 10 | #include "base/memory/ref_counted.h" |
danakj | ba65a091 | 2017-09-21 16:38:42 | [diff] [blame^] | 11 | #include "cc/trees/swap_promise.h" |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 12 | |
13 | namespace IPC { | ||||
14 | class SyncMessageFilter; | ||||
15 | } | ||||
16 | |||||
17 | namespace content { | ||||
18 | |||||
19 | class FrameSwapMessageQueue; | ||||
20 | |||||
21 | class QueueMessageSwapPromise : public cc::SwapPromise { | ||||
22 | public: | ||||
23 | QueueMessageSwapPromise(scoped_refptr<IPC::SyncMessageFilter> message_sender, | ||||
24 | scoped_refptr<FrameSwapMessageQueue> message_queue, | ||||
25 | int source_frame_number); | ||||
26 | |||||
dcheng | 6d18e40 | 2014-10-21 12:32:52 | [diff] [blame] | 27 | ~QueueMessageSwapPromise() override; |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 28 | |
tobiasjs | 93d46484 | 2015-05-15 17:52:44 | [diff] [blame] | 29 | void DidActivate() override; |
samans | e7345c8 | 2016-12-16 02:51:16 | [diff] [blame] | 30 | void WillSwap(cc::CompositorFrameMetadata* metadata) override; |
31 | void DidSwap() override; | ||||
svartmetal | 751af1f9 | 2016-08-13 11:47:33 | [diff] [blame] | 32 | DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override; |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 33 | |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 34 | int64_t TraceId() const override; |
[email protected] | dab0a42 | 2014-08-13 16:09:46 | [diff] [blame] | 35 | |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 36 | private: |
37 | void PromiseCompleted(); | ||||
38 | |||||
39 | scoped_refptr<IPC::SyncMessageFilter> message_sender_; | ||||
40 | scoped_refptr<content::FrameSwapMessageQueue> message_queue_; | ||||
41 | int source_frame_number_; | ||||
danakj | e649f57 | 2015-01-08 23:35:58 | [diff] [blame] | 42 | #if DCHECK_IS_ON() |
[email protected] | 586871b | 2014-07-22 17:05:11 | [diff] [blame] | 43 | bool completed_; |
44 | #endif | ||||
45 | }; | ||||
46 | |||||
47 | } // namespace content | ||||
48 | |||||
tfarina | bccc34c7 | 2015-02-27 21:32:15 | [diff] [blame] | 49 | #endif // CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_ |