| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cc/base/latency_info_swap_promise_monitor.h" | 5 #include "cc/base/latency_info_swap_promise_monitor.h" |
| 6 | 6 |
| 7 #include "base/threading/platform_thread.h" | 7 #include "base/threading/platform_thread.h" |
| 8 #include "cc/base/latency_info_swap_promise.h" | 8 #include "cc/base/latency_info_swap_promise.h" |
| 9 #include "cc/trees/layer_tree_host.h" | 9 #include "cc/trees/layer_tree_host.h" |
| 10 #include "cc/trees/layer_tree_host_impl.h" | 10 #include "cc/trees/layer_tree_host_impl.h" |
| 11 #include "cc/trees/layer_tree_impl.h" | 11 #include "cc/trees/layer_tree_impl.h" |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 | 14 |
| 15 bool AddRenderingScheduledComponent(ui::LatencyInfo* latency_info) { | 15 bool AddRenderingScheduledComponent(ui::LatencyInfo* latency_info) { |
| 16 if (latency_info->FindLatency( | 16 if (latency_info->FindLatency( |
| 17 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, NULL)) | 17 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, nullptr)) |
| 18 return false; | 18 return false; |
| 19 latency_info->AddLatencyNumber( | 19 latency_info->AddLatencyNumber( |
| 20 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, 0); | 20 ui::INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_COMPONENT, 0, 0); |
| 21 return true; | 21 return true; |
| 22 } | 22 } |
| 23 | 23 |
| 24 bool AddForwardingScrollUpdateToMainComponent(ui::LatencyInfo* latency_info) { | 24 bool AddForwardingScrollUpdateToMainComponent(ui::LatencyInfo* latency_info) { |
| 25 if (latency_info->FindLatency( | 25 if (latency_info->FindLatency( |
| 26 ui::INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT, | 26 ui::INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT, |
| 27 0, | 27 0, |
| 28 NULL)) | 28 nullptr)) |
| 29 return false; | 29 return false; |
| 30 latency_info->AddLatencyNumber( | 30 latency_info->AddLatencyNumber( |
| 31 ui::INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT, | 31 ui::INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT, |
| 32 0, | 32 0, |
| 33 latency_info->trace_id); | 33 latency_info->trace_id); |
| 34 return true; | 34 return true; |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace | 37 } // namespace |
| 38 | 38 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 *latency_, | 88 *latency_, |
| 89 ui::INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT); | 89 ui::INPUT_EVENT_LATENCY_FORWARD_SCROLL_UPDATE_TO_MAIN_COMPONENT); |
| 90 scoped_ptr<SwapPromise> swap_promise( | 90 scoped_ptr<SwapPromise> swap_promise( |
| 91 new LatencyInfoSwapPromise(new_latency)); | 91 new LatencyInfoSwapPromise(new_latency)); |
| 92 layer_tree_host_impl_->QueueSwapPromiseForMainThreadScrollUpdate( | 92 layer_tree_host_impl_->QueueSwapPromiseForMainThreadScrollUpdate( |
| 93 swap_promise.Pass()); | 93 swap_promise.Pass()); |
| 94 } | 94 } |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace cc | 97 } // namespace cc |
| OLD | NEW |