| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/input/render_widget_input_handler.h" | 5 #include "content/renderer/input/render_widget_input_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 "step", "HandleInputEventMain"); | 242 "step", "HandleInputEventMain"); |
| 243 | 243 |
| 244 // If we don't have a high res timer, these metrics won't be accurate enough | 244 // If we don't have a high res timer, these metrics won't be accurate enough |
| 245 // to be worth collecting. Note that this does introduce some sampling bias. | 245 // to be worth collecting. Note that this does introduce some sampling bias. |
| 246 if (!start_time.is_null()) | 246 if (!start_time.is_null()) |
| 247 LogInputEventLatencyUma(input_event, start_time); | 247 LogInputEventLatencyUma(input_event, start_time); |
| 248 | 248 |
| 249 std::unique_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; | 249 std::unique_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor; |
| 250 ui::LatencyInfo swap_latency_info(latency_info); | 250 ui::LatencyInfo swap_latency_info(latency_info); |
| 251 swap_latency_info.AddLatencyNumber( | 251 swap_latency_info.AddLatencyNumber( |
| 252 ui::LatencyComponentType::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0, | 252 ui::LatencyComponentType::INPUT_EVENT_LATENCY_RENDERER_MAIN_COMPONENT, 0); |
| 253 0); | |
| 254 if (widget_->compositor()) { | 253 if (widget_->compositor()) { |
| 255 latency_info_swap_promise_monitor = | 254 latency_info_swap_promise_monitor = |
| 256 widget_->compositor()->CreateLatencyInfoSwapPromiseMonitor( | 255 widget_->compositor()->CreateLatencyInfoSwapPromiseMonitor( |
| 257 &swap_latency_info); | 256 &swap_latency_info); |
| 258 } | 257 } |
| 259 | 258 |
| 260 bool prevent_default = false; | 259 bool prevent_default = false; |
| 261 if (WebInputEvent::IsMouseEventType(input_event.GetType())) { | 260 if (WebInputEvent::IsMouseEventType(input_event.GetType())) { |
| 262 const WebMouseEvent& mouse_event = | 261 const WebMouseEvent& mouse_event = |
| 263 static_cast<const WebMouseEvent&>(input_event); | 262 static_cast<const WebMouseEvent&>(input_event); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 // it can be bundled in the event ack. | 459 // it can be bundled in the event ack. |
| 461 if (handling_event_overscroll_) { | 460 if (handling_event_overscroll_) { |
| 462 *handling_event_overscroll_ = std::move(params); | 461 *handling_event_overscroll_ = std::move(params); |
| 463 return; | 462 return; |
| 464 } | 463 } |
| 465 | 464 |
| 466 delegate_->OnDidOverscroll(*params); | 465 delegate_->OnDidOverscroll(*params); |
| 467 } | 466 } |
| 468 | 467 |
| 469 } // namespace content | 468 } // namespace content |
| OLD | NEW |