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 CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_ | 5 #ifndef CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_ |
6 #define CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_ | 6 #define CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "cc/output/swap_promise.h" | 11 #include "cc/output/swap_promise.h" |
12 | 12 |
13 namespace IPC { | 13 namespace IPC { |
14 class SyncMessageFilter; | 14 class SyncMessageFilter; |
15 } | 15 } |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 class FrameSwapMessageQueue; | 19 class FrameSwapMessageQueue; |
20 | 20 |
21 class QueueMessageSwapPromise : public cc::SwapPromise { | 21 class QueueMessageSwapPromise : public cc::SwapPromise { |
22 public: | 22 public: |
23 QueueMessageSwapPromise(scoped_refptr<IPC::SyncMessageFilter> message_sender, | 23 QueueMessageSwapPromise(scoped_refptr<IPC::SyncMessageFilter> message_sender, |
24 scoped_refptr<FrameSwapMessageQueue> message_queue, | 24 scoped_refptr<FrameSwapMessageQueue> message_queue, |
25 int source_frame_number); | 25 int source_frame_number); |
26 | 26 |
27 ~QueueMessageSwapPromise() override; | 27 ~QueueMessageSwapPromise() override; |
28 | 28 |
29 void DidActivate() override; | 29 void DidActivate() override; |
30 void DidSwap(cc::CompositorFrameMetadata* metadata) override; | 30 void WillSwap(cc::CompositorFrameMetadata* metadata) override; |
| 31 void DidSwap() override; |
31 DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override; | 32 DidNotSwapAction DidNotSwap(DidNotSwapReason reason) override; |
32 | 33 |
33 int64_t TraceId() const override; | 34 int64_t TraceId() const override; |
34 | 35 |
35 private: | 36 private: |
36 void PromiseCompleted(); | 37 void PromiseCompleted(); |
37 | 38 |
38 scoped_refptr<IPC::SyncMessageFilter> message_sender_; | 39 scoped_refptr<IPC::SyncMessageFilter> message_sender_; |
39 scoped_refptr<content::FrameSwapMessageQueue> message_queue_; | 40 scoped_refptr<content::FrameSwapMessageQueue> message_queue_; |
40 int source_frame_number_; | 41 int source_frame_number_; |
41 #if DCHECK_IS_ON() | 42 #if DCHECK_IS_ON() |
42 bool completed_; | 43 bool completed_; |
43 #endif | 44 #endif |
44 }; | 45 }; |
45 | 46 |
46 } // namespace content | 47 } // namespace content |
47 | 48 |
48 #endif // CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_ | 49 #endif // CONTENT_RENDERER_GPU_QUEUE_MESSAGE_SWAP_PROMISE_H_ |
OLD | NEW |