| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 return; | 198 return; |
| 198 } | 199 } |
| 199 | 200 |
| 200 if (compositor_host_pending_renderer_state_.size() != params.size()) { | 201 if (compositor_host_pending_renderer_state_.size() != params.size()) { |
| 201 bad_message::ReceivedBadMessage(render_process_host_, | 202 bad_message::ReceivedBadMessage(render_process_host_, |
| 202 bad_message::SCO_INVALID_ARGUMENT); | 203 bad_message::SCO_INVALID_ARGUMENT); |
| 204 compositor_host_pending_renderer_state_.clear(); |
| 203 return; | 205 return; |
| 204 } | 206 } |
| 205 | 207 |
| 206 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) { |
| 207 compositor_host_pending_renderer_state_[i]->ProcessCommonParams(params[i]); | 209 compositor_host_pending_renderer_state_[i]->ProcessCommonParams(params[i]); |
| 208 } | 210 } |
| 209 compositor_host_pending_renderer_state_.clear(); | 211 compositor_host_pending_renderer_state_.clear(); |
| 210 } | 212 } |
| 211 | 213 |
| 212 } // namespace content | 214 } // namespace content |
| OLD | NEW |