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