| 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 "ui/events/latency_info.h" | 5 #include "ui/events/latency_info.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/json/json_writer.h" | 13 #include "base/json/json_writer.h" |
| 14 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 17 #include "base/trace_event/trace_event.h" |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 const size_t kMaxLatencyInfoNumber = 100; | 21 const size_t kMaxLatencyInfoNumber = 100; |
| 21 | 22 |
| 22 const char* GetComponentName(ui::LatencyComponentType type) { | 23 const char* GetComponentName(ui::LatencyComponentType type) { |
| 23 #define CASE_TYPE(t) case ui::t: return #t | 24 #define CASE_TYPE(t) case ui::t: return #t |
| 24 switch (type) { | 25 switch (type) { |
| 25 CASE_TYPE(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT); | 26 CASE_TYPE(INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT); |
| 26 CASE_TYPE(LATENCY_BEGIN_SCROLL_LISTENER_UPDATE_MAIN_COMPONENT); | 27 CASE_TYPE(LATENCY_BEGIN_SCROLL_LISTENER_UPDATE_MAIN_COMPONENT); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 } | 368 } |
| 368 | 369 |
| 369 bool LatencyInfo::AddInputCoordinate(const gfx::PointF& input_coordinate) { | 370 bool LatencyInfo::AddInputCoordinate(const gfx::PointF& input_coordinate) { |
| 370 if (input_coordinates_size_ >= kMaxInputCoordinates) | 371 if (input_coordinates_size_ >= kMaxInputCoordinates) |
| 371 return false; | 372 return false; |
| 372 input_coordinates_[input_coordinates_size_++] = input_coordinate; | 373 input_coordinates_[input_coordinates_size_++] = input_coordinate; |
| 373 return true; | 374 return true; |
| 374 } | 375 } |
| 375 | 376 |
| 376 } // namespace ui | 377 } // namespace ui |
| OLD | NEW |