| 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> |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void LatencyInfoTracedValue::AppendAsTraceFormat(std::string* out) const { | 112 void LatencyInfoTracedValue::AppendAsTraceFormat(std::string* out) const { |
| 113 std::string tmp; | 113 std::string tmp; |
| 114 base::JSONWriter::Write(*value_, &tmp); | 114 base::JSONWriter::Write(*value_, &tmp); |
| 115 *out += tmp; | 115 *out += tmp; |
| 116 } | 116 } |
| 117 | 117 |
| 118 LatencyInfoTracedValue::LatencyInfoTracedValue(base::Value* value) | 118 LatencyInfoTracedValue::LatencyInfoTracedValue(base::Value* value) |
| 119 : value_(value) { | 119 : value_(value) { |
| 120 } | 120 } |
| 121 | 121 |
| 122 const char kTraceCategoriesForAsyncEvents[] = "benchmark,latencyInfo"; | 122 const char kTraceCategoriesForAsyncEvents[] = "benchmark,latencyInfo,rail"; |
| 123 | 123 |
| 124 struct LatencyInfoEnabledInitializer { | 124 struct LatencyInfoEnabledInitializer { |
| 125 LatencyInfoEnabledInitializer() : | 125 LatencyInfoEnabledInitializer() : |
| 126 latency_info_enabled(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( | 126 latency_info_enabled(TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( |
| 127 kTraceCategoriesForAsyncEvents)) { | 127 kTraceCategoriesForAsyncEvents)) { |
| 128 } | 128 } |
| 129 | 129 |
| 130 const unsigned char* latency_info_enabled; | 130 const unsigned char* latency_info_enabled; |
| 131 }; | 131 }; |
| 132 | 132 |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 } | 367 } |
| 368 | 368 |
| 369 bool LatencyInfo::AddInputCoordinate(const gfx::PointF& input_coordinate) { | 369 bool LatencyInfo::AddInputCoordinate(const gfx::PointF& input_coordinate) { |
| 370 if (input_coordinates_size_ >= kMaxInputCoordinates) | 370 if (input_coordinates_size_ >= kMaxInputCoordinates) |
| 371 return false; | 371 return false; |
| 372 input_coordinates_[input_coordinates_size_++] = input_coordinate; | 372 input_coordinates_[input_coordinates_size_++] = input_coordinate; |
| 373 return true; | 373 return true; |
| 374 } | 374 } |
| 375 | 375 |
| 376 } // namespace ui | 376 } // namespace ui |
| OLD | NEW |