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_FRAME_SWAP_MESSAGE_QUEUE_H_ | 5 #ifndef CONTENT_RENDERER_GPU_FRAME_SWAP_MESSAGE_QUEUE_H_ |
6 #define CONTENT_RENDERER_GPU_FRAME_SWAP_MESSAGE_QUEUE_H_ | 6 #define CONTENT_RENDERER_GPU_FRAME_SWAP_MESSAGE_QUEUE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // |is_first| - output parameter. Set to true if this was the first message | 45 // |is_first| - output parameter. Set to true if this was the first message |
46 // enqueued for the given source_frame_number. | 46 // enqueued for the given source_frame_number. |
47 void QueueMessageForFrame(MessageDeliveryPolicy policy, | 47 void QueueMessageForFrame(MessageDeliveryPolicy policy, |
48 int source_frame_number, | 48 int source_frame_number, |
49 scoped_ptr<IPC::Message> msg, | 49 scoped_ptr<IPC::Message> msg, |
50 bool* is_first); | 50 bool* is_first); |
51 | 51 |
52 // Returns true if there are no messages in the queue. | 52 // Returns true if there are no messages in the queue. |
53 bool Empty() const; | 53 bool Empty() const; |
54 | 54 |
55 // Should be called when a successful swap occurs. The messages for that swap | 55 // Should be called when a successful activation occurs. The messages for |
56 // can be obtained by calling DrainMessages. | 56 // that activation can be obtained by calling DrainMessages. |
| 57 // |
| 58 // |source_frame_number| frame number for which the activate occurred. |
| 59 void DidActivate(int source_frame_number); |
| 60 |
| 61 // Should be called when a successful swap occurs. The messages for that |
| 62 // swap can be obtained by calling DrainMessages. |
57 // | 63 // |
58 // |source_frame_number| frame number for which the swap occurred. | 64 // |source_frame_number| frame number for which the swap occurred. |
59 void DidSwap(int source_frame_number); | 65 void DidSwap(int source_frame_number); |
60 | 66 |
61 // Should be called when we know a swap will not occur. This also means we | 67 // Should be called when we know a swap will not occur. |
62 // won't be expecting a DrainMessages call. | |
63 // | 68 // |
64 // |source_frame_number| frame number for which the swap will not occur. | 69 // |source_frame_number| frame number for which the swap will not occur. |
65 // |reason| reason for the which the swap will not occur. | 70 // |reason| reason for the which the swap will not occur. |
66 // |messages| depending on |reason| it may make sense to deliver certain | 71 // |messages| depending on |reason| it may make sense to deliver certain |
67 // messages asynchronously. This vector will contain those | 72 // messages asynchronously. This vector will contain those |
68 // messages. | 73 // messages. |
69 void DidNotSwap(int source_frame_number, | 74 void DidNotSwap(int source_frame_number, |
70 cc::SwapPromise::DidNotSwapReason reason, | 75 cc::SwapPromise::DidNotSwapReason reason, |
71 ScopedVector<IPC::Message>* messages); | 76 ScopedVector<IPC::Message>* messages); |
72 | 77 |
(...skipping 26 matching lines...) Expand all Loading... |
99 scoped_ptr<FrameSwapMessageSubQueue> visual_state_queue_; | 104 scoped_ptr<FrameSwapMessageSubQueue> visual_state_queue_; |
100 scoped_ptr<FrameSwapMessageSubQueue> swap_queue_; | 105 scoped_ptr<FrameSwapMessageSubQueue> swap_queue_; |
101 ScopedVector<IPC::Message> next_drain_messages_; | 106 ScopedVector<IPC::Message> next_drain_messages_; |
102 | 107 |
103 DISALLOW_COPY_AND_ASSIGN(FrameSwapMessageQueue); | 108 DISALLOW_COPY_AND_ASSIGN(FrameSwapMessageQueue); |
104 }; | 109 }; |
105 | 110 |
106 } // namespace content | 111 } // namespace content |
107 | 112 |
108 #endif // CONTENT_RENDERER_GPU_FRAME_SWAP_MESSAGE_QUEUE_H_ | 113 #endif // CONTENT_RENDERER_GPU_FRAME_SWAP_MESSAGE_QUEUE_H_ |
OLD | NEW |