OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/browser/android/synchronous_compositor_browser_filter.h" | 5 #include "content/browser/android/synchronous_compositor_browser_filter.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 future_map_.clear(); | 178 future_map_.clear(); |
179 filter_ready_ = false; | 179 filter_ready_ = false; |
180 } | 180 } |
181 | 181 |
182 void SynchronousCompositorBrowserFilter::VSyncComplete() { | 182 void SynchronousCompositorBrowserFilter::VSyncComplete() { |
183 DCHECK(window_android_in_vsync_); | 183 DCHECK(window_android_in_vsync_); |
184 window_android_in_vsync_ = nullptr; | 184 window_android_in_vsync_ = nullptr; |
185 | 185 |
186 std::vector<int> routing_ids; | 186 std::vector<int> routing_ids; |
187 routing_ids.reserve(compositor_host_pending_renderer_state_.size()); | 187 routing_ids.reserve(compositor_host_pending_renderer_state_.size()); |
188 for (const auto host : compositor_host_pending_renderer_state_) | 188 for (const auto* host : compositor_host_pending_renderer_state_) |
189 routing_ids.push_back(host->routing_id()); | 189 routing_ids.push_back(host->routing_id()); |
190 | 190 |
191 std::vector<SyncCompositorCommonRendererParams> params; | 191 std::vector<SyncCompositorCommonRendererParams> params; |
192 params.reserve(compositor_host_pending_renderer_state_.size()); | 192 params.reserve(compositor_host_pending_renderer_state_.size()); |
193 | 193 |
194 if (!render_process_host_->Send( | 194 if (!render_process_host_->Send( |
195 new SyncCompositorMsg_SynchronizeRendererState(routing_ids, | 195 new SyncCompositorMsg_SynchronizeRendererState(routing_ids, |
196 ¶ms))) { | 196 ¶ms))) { |
197 compositor_host_pending_renderer_state_.clear(); | 197 compositor_host_pending_renderer_state_.clear(); |
198 return; | 198 return; |
199 } | 199 } |
200 | 200 |
201 if (compositor_host_pending_renderer_state_.size() != params.size()) { | 201 if (compositor_host_pending_renderer_state_.size() != params.size()) { |
202 bad_message::ReceivedBadMessage(render_process_host_, | 202 bad_message::ReceivedBadMessage(render_process_host_, |
203 bad_message::SCO_INVALID_ARGUMENT); | 203 bad_message::SCO_INVALID_ARGUMENT); |
204 compositor_host_pending_renderer_state_.clear(); | 204 compositor_host_pending_renderer_state_.clear(); |
205 return; | 205 return; |
206 } | 206 } |
207 | 207 |
208 for (size_t i = 0; i < compositor_host_pending_renderer_state_.size(); ++i) { | 208 for (size_t i = 0; i < compositor_host_pending_renderer_state_.size(); ++i) { |
209 compositor_host_pending_renderer_state_[i]->ProcessCommonParams(params[i]); | 209 compositor_host_pending_renderer_state_[i]->ProcessCommonParams(params[i]); |
210 } | 210 } |
211 compositor_host_pending_renderer_state_.clear(); | 211 compositor_host_pending_renderer_state_.clear(); |
212 } | 212 } |
213 | 213 |
214 } // namespace content | 214 } // namespace content |
OLD | NEW |