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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 } | 154 } |
155 | 155 |
156 void FrameSwapMessageQueue::DidNotSwap(int source_frame_number, | 156 void FrameSwapMessageQueue::DidNotSwap(int source_frame_number, |
157 cc::SwapPromise::DidNotSwapReason reason, | 157 cc::SwapPromise::DidNotSwapReason reason, |
158 ScopedVector<IPC::Message>* messages) { | 158 ScopedVector<IPC::Message>* messages) { |
159 base::AutoLock lock(lock_); | 159 base::AutoLock lock(lock_); |
160 switch (reason) { | 160 switch (reason) { |
161 case cc::SwapPromise::SWAP_FAILS: | 161 case cc::SwapPromise::SWAP_FAILS: |
162 case cc::SwapPromise::COMMIT_NO_UPDATE: | 162 case cc::SwapPromise::COMMIT_NO_UPDATE: |
163 swap_queue_->DrainMessages(source_frame_number, messages); | 163 swap_queue_->DrainMessages(source_frame_number, messages); |
164 // fallthrough | 164 visual_state_queue_->DrainMessages(source_frame_number, messages); |
| 165 break; |
165 case cc::SwapPromise::COMMIT_FAILS: | 166 case cc::SwapPromise::COMMIT_FAILS: |
166 visual_state_queue_->DrainMessages(source_frame_number, messages); | 167 // Do not queue any responses here. |
| 168 // If COMMIT_FAILS the renderer is shutting down, which will |
| 169 // result in the RenderFrameHostImpl destructor firing the |
| 170 // remaining response callbacks itself. |
167 break; | 171 break; |
168 default: | 172 default: |
169 NOTREACHED(); | 173 NOTREACHED(); |
170 } | 174 } |
171 } | 175 } |
172 | 176 |
173 void FrameSwapMessageQueue::DrainMessages( | 177 void FrameSwapMessageQueue::DrainMessages( |
174 ScopedVector<IPC::Message>* messages) { | 178 ScopedVector<IPC::Message>* messages) { |
175 lock_.AssertAcquired(); | 179 lock_.AssertAcquired(); |
176 | 180 |
(...skipping 15 matching lines...) Expand all Loading... |
192 for (vector<IPC::Message*>::iterator i = source.begin(); i != source.end(); | 196 for (vector<IPC::Message*>::iterator i = source.begin(); i != source.end(); |
193 ++i) { | 197 ++i) { |
194 IPC::Message* m(*i); | 198 IPC::Message* m(*i); |
195 dest->push_back(*m); | 199 dest->push_back(*m); |
196 delete m; | 200 delete m; |
197 } | 201 } |
198 source.weak_clear(); | 202 source.weak_clear(); |
199 } | 203 } |
200 | 204 |
201 } // namespace content | 205 } // namespace content |
OLD | NEW |