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 #include "content/renderer/gpu/frame_swap_message_queue.h" | 5 #include "content/renderer/gpu/frame_swap_message_queue.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 } | 105 } |
106 | 106 |
107 private: | 107 private: |
108 std::vector<std::unique_ptr<IPC::Message>> queue_; | 108 std::vector<std::unique_ptr<IPC::Message>> queue_; |
109 | 109 |
110 DISALLOW_COPY_AND_ASSIGN(SwapQueue); | 110 DISALLOW_COPY_AND_ASSIGN(SwapQueue); |
111 }; | 111 }; |
112 | 112 |
113 } // namespace | 113 } // namespace |
114 | 114 |
115 FrameSwapMessageQueue::FrameSwapMessageQueue() | 115 FrameSwapMessageQueue::FrameSwapMessageQueue(int32_t routing_id) |
116 : visual_state_queue_(new VisualStateQueue()), | 116 : visual_state_queue_(new VisualStateQueue()), |
117 swap_queue_(new SwapQueue()) { | 117 swap_queue_(new SwapQueue()), |
118 } | 118 routing_id_(routing_id) {} |
119 | 119 |
120 FrameSwapMessageQueue::~FrameSwapMessageQueue() { | 120 FrameSwapMessageQueue::~FrameSwapMessageQueue() { |
121 } | 121 } |
122 | 122 |
123 bool FrameSwapMessageQueue::Empty() const { | 123 bool FrameSwapMessageQueue::Empty() const { |
124 base::AutoLock lock(lock_); | 124 base::AutoLock lock(lock_); |
125 return next_drain_messages_.empty() && visual_state_queue_->Empty() && | 125 return next_drain_messages_.empty() && visual_state_queue_->Empty() && |
126 swap_queue_->Empty(); | 126 swap_queue_->Empty(); |
127 } | 127 } |
128 | 128 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 dest->push_back(*msg.get()); | 204 dest->push_back(*msg.get()); |
205 } | 205 } |
206 source->clear(); | 206 source->clear(); |
207 } | 207 } |
208 | 208 |
209 uint32_t FrameSwapMessageQueue::AllocateFrameToken() { | 209 uint32_t FrameSwapMessageQueue::AllocateFrameToken() { |
210 return ++last_used_frame_token_; | 210 return ++last_used_frame_token_; |
211 } | 211 } |
212 | 212 |
213 } // namespace content | 213 } // namespace content |
OLD | NEW |