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 "base/debug/trace_event.h" | 5 #include "base/debug/trace_event.h" |
6 #include "base/json/json_writer.h" | 6 #include "base/json/json_writer.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "ui/events/latency_info.h" | 9 #include "ui/events/latency_info.h" |
10 | 10 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 type == ui::INPUT_EVENT_LATENCY_BEGIN_PLUGIN_COMPONENT || | 69 type == ui::INPUT_EVENT_LATENCY_BEGIN_PLUGIN_COMPONENT || |
70 type == ui::INPUT_EVENT_LATENCY_BEGIN_SCROLL_UPDATE_MAIN_COMPONENT); | 70 type == ui::INPUT_EVENT_LATENCY_BEGIN_SCROLL_UPDATE_MAIN_COMPONENT); |
71 } | 71 } |
72 | 72 |
73 // This class is for converting latency info to trace buffer friendly format. | 73 // This class is for converting latency info to trace buffer friendly format. |
74 class LatencyInfoTracedValue : public base::debug::ConvertableToTraceFormat { | 74 class LatencyInfoTracedValue : public base::debug::ConvertableToTraceFormat { |
75 public: | 75 public: |
76 static scoped_refptr<ConvertableToTraceFormat> FromValue( | 76 static scoped_refptr<ConvertableToTraceFormat> FromValue( |
77 scoped_ptr<base::Value> value); | 77 scoped_ptr<base::Value> value); |
78 | 78 |
79 virtual void AppendAsTraceFormat(std::string* out) const override; | 79 void AppendAsTraceFormat(std::string* out) const override; |
80 | 80 |
81 private: | 81 private: |
82 explicit LatencyInfoTracedValue(base::Value* value); | 82 explicit LatencyInfoTracedValue(base::Value* value); |
83 virtual ~LatencyInfoTracedValue(); | 83 ~LatencyInfoTracedValue() override; |
84 | 84 |
85 scoped_ptr<base::Value> value_; | 85 scoped_ptr<base::Value> value_; |
86 | 86 |
87 DISALLOW_COPY_AND_ASSIGN(LatencyInfoTracedValue); | 87 DISALLOW_COPY_AND_ASSIGN(LatencyInfoTracedValue); |
88 }; | 88 }; |
89 | 89 |
90 scoped_refptr<base::debug::ConvertableToTraceFormat> | 90 scoped_refptr<base::debug::ConvertableToTraceFormat> |
91 LatencyInfoTracedValue::FromValue(scoped_ptr<base::Value> value) { | 91 LatencyInfoTracedValue::FromValue(scoped_ptr<base::Value> value) { |
92 return scoped_refptr<base::debug::ConvertableToTraceFormat>( | 92 return scoped_refptr<base::debug::ConvertableToTraceFormat>( |
93 new LatencyInfoTracedValue(value.release())); | 93 new LatencyInfoTracedValue(value.release())); |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 } | 322 } |
323 | 323 |
324 void LatencyInfo::TraceEventType(const char* event_type) { | 324 void LatencyInfo::TraceEventType(const char* event_type) { |
325 TRACE_EVENT_ASYNC_STEP_INTO0("benchmark", | 325 TRACE_EVENT_ASYNC_STEP_INTO0("benchmark", |
326 "InputLatency", | 326 "InputLatency", |
327 TRACE_ID_DONT_MANGLE(trace_id), | 327 TRACE_ID_DONT_MANGLE(trace_id), |
328 event_type); | 328 event_type); |
329 } | 329 } |
330 | 330 |
331 } // namespace ui | 331 } // namespace ui |
OLD | NEW |