Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: content/renderer/gpu/frame_swap_message_queue.cc

Issue 2313593002: Content Renderer FrameSwapMessageQueue: Fix DidActivate with DidNotSwap. (Closed)
Patch Set: Fix QueueMessageSwapPromiseTest.VisualStateSwapPromiseDidActivate Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/renderer/gpu/frame_swap_message_queue_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <utility> 9 #include <utility>
10 10
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 169 }
170 170
171 void FrameSwapMessageQueue::DidNotSwap( 171 void FrameSwapMessageQueue::DidNotSwap(
172 int source_frame_number, 172 int source_frame_number,
173 cc::SwapPromise::DidNotSwapReason reason, 173 cc::SwapPromise::DidNotSwapReason reason,
174 std::vector<std::unique_ptr<IPC::Message>>* messages) { 174 std::vector<std::unique_ptr<IPC::Message>>* messages) {
175 base::AutoLock lock(lock_); 175 base::AutoLock lock(lock_);
176 switch (reason) { 176 switch (reason) {
177 case cc::SwapPromise::SWAP_FAILS: 177 case cc::SwapPromise::SWAP_FAILS:
178 case cc::SwapPromise::COMMIT_NO_UPDATE: 178 case cc::SwapPromise::COMMIT_NO_UPDATE:
179 DrainMessages(messages);
179 swap_queue_->DrainMessages(source_frame_number, messages); 180 swap_queue_->DrainMessages(source_frame_number, messages);
180 visual_state_queue_->DrainMessages(source_frame_number, messages); 181 visual_state_queue_->DrainMessages(source_frame_number, messages);
181 break; 182 break;
182 case cc::SwapPromise::COMMIT_FAILS: 183 case cc::SwapPromise::COMMIT_FAILS:
183 case cc::SwapPromise::ACTIVATION_FAILS: 184 case cc::SwapPromise::ACTIVATION_FAILS:
184 // Do not queue any responses here. If ACTIVATION_FAILS or 185 // Do not queue any responses here. If ACTIVATION_FAILS or
185 // COMMIT_FAILS the renderer is shutting down, which will result 186 // COMMIT_FAILS the renderer is shutting down, which will result
186 // in the RenderFrameHostImpl destructor firing the remaining 187 // in the RenderFrameHostImpl destructor firing the remaining
187 // response callbacks itself. 188 // response callbacks itself.
188 break; 189 break;
(...skipping 17 matching lines...) Expand all
206 void FrameSwapMessageQueue::TransferMessages( 207 void FrameSwapMessageQueue::TransferMessages(
207 std::vector<std::unique_ptr<IPC::Message>>* source, 208 std::vector<std::unique_ptr<IPC::Message>>* source,
208 vector<IPC::Message>* dest) { 209 vector<IPC::Message>* dest) {
209 for (const auto& msg : *source) { 210 for (const auto& msg : *source) {
210 dest->push_back(*msg.get()); 211 dest->push_back(*msg.get());
211 } 212 }
212 source->clear(); 213 source->clear();
213 } 214 }
214 215
215 } // namespace content 216 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/gpu/frame_swap_message_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698