OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ipc/latency_info_param_traits_macros.h" | |
6 | |
7 #include "ui/gfx/ipc/geometry/gfx_param_traits.h" | 5 #include "ui/gfx/ipc/geometry/gfx_param_traits.h" |
| 6 #include "ui/latency/ipc/latency_info_param_traits_macros.h" |
8 | 7 |
9 // Generate param traits size methods. | 8 // Generate param traits size methods. |
10 #include "ipc/param_traits_size_macros.h" | 9 #include "ipc/param_traits_size_macros.h" |
11 namespace IPC { | 10 namespace IPC { |
12 #undef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ | 11 #undef UI_LATENCY_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ |
13 #include "ui/events/ipc/latency_info_param_traits_macros.h" | 12 #include "ui/latency/ipc/latency_info_param_traits_macros.h" |
14 } | 13 } |
15 | 14 |
16 // Generate param traits write methods. | 15 // Generate param traits write methods. |
17 #include "ipc/param_traits_write_macros.h" | 16 #include "ipc/param_traits_write_macros.h" |
18 namespace IPC { | 17 namespace IPC { |
19 #undef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ | 18 #undef UI_LATENCY_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ |
20 #include "ui/events/ipc/latency_info_param_traits_macros.h" | 19 #include "ui/latency/ipc/latency_info_param_traits_macros.h" |
21 } // namespace IPC | 20 } // namespace IPC |
22 | 21 |
23 // Generate param traits read methods. | 22 // Generate param traits read methods. |
24 #include "ipc/param_traits_read_macros.h" | 23 #include "ipc/param_traits_read_macros.h" |
25 namespace IPC { | 24 namespace IPC { |
26 #undef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ | 25 #undef UI_LATENCY_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ |
27 #include "ui/events/ipc/latency_info_param_traits_macros.h" | 26 #include "ui/latency/ipc/latency_info_param_traits_macros.h" |
28 } // namespace IPC | 27 } // namespace IPC |
29 | 28 |
30 // Generate param traits log methods. | 29 // Generate param traits log methods. |
31 #include "ipc/param_traits_log_macros.h" | 30 #include "ipc/param_traits_log_macros.h" |
32 namespace IPC { | 31 namespace IPC { |
33 #undef UI_EVENTS_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ | 32 #undef UI_LATENCY_IPC_LATENCY_INFO_PARAM_TRAITS_MACROS_H_ |
34 #include "ui/events/ipc/latency_info_param_traits_macros.h" | 33 #include "ui/latency/ipc/latency_info_param_traits_macros.h" |
35 } // namespace IPC | 34 } // namespace IPC |
36 | 35 |
37 // Implemetation for ParamTraits<ui::LatencyInfo>. | 36 // Implemetation for ParamTraits<ui::LatencyInfo>. |
38 #include "ui/events/ipc/latency_info_param_traits.h" | 37 #include "ui/latency/ipc/latency_info_param_traits.h" |
39 | 38 |
40 namespace IPC { | 39 namespace IPC { |
41 | 40 |
42 void ParamTraits<ui::LatencyInfo>::GetSize(base::PickleSizer* s, | 41 void ParamTraits<ui::LatencyInfo>::GetSize(base::PickleSizer* s, |
43 const param_type& p) { | 42 const param_type& p) { |
44 GetParamSize(s, p.trace_name_); | 43 GetParamSize(s, p.trace_name_); |
45 GetParamSize(s, p.latency_components_); | 44 GetParamSize(s, p.latency_components_); |
46 GetParamSize(s, p.input_coordinates_size_); | 45 GetParamSize(s, p.input_coordinates_size_); |
47 for (size_t i = 0; i < p.input_coordinates_size_; i++) { | 46 for (size_t i = 0; i < p.input_coordinates_size_; i++) { |
48 GetParamSize(s, p.input_coordinates_[i]); | 47 GetParamSize(s, p.input_coordinates_[i]); |
(...skipping 22 matching lines...) Expand all Loading... |
71 return false; | 70 return false; |
72 if (!ReadParam(m, iter, &p->latency_components_)) | 71 if (!ReadParam(m, iter, &p->latency_components_)) |
73 return false; | 72 return false; |
74 | 73 |
75 gfx::PointF input_coordinates; | 74 gfx::PointF input_coordinates; |
76 uint32_t input_coordinates_size; | 75 uint32_t input_coordinates_size; |
77 if (!ReadParam(m, iter, &input_coordinates_size)) | 76 if (!ReadParam(m, iter, &input_coordinates_size)) |
78 return false; | 77 return false; |
79 for (size_t i = 0; i < input_coordinates_size; i++) { | 78 for (size_t i = 0; i < input_coordinates_size; i++) { |
80 if (!ReadParam(m, iter, &input_coordinates)) | 79 if (!ReadParam(m, iter, &input_coordinates)) |
81 return false; | 80 return false; |
82 if (!p->AddInputCoordinate(input_coordinates)) | 81 if (!p->AddInputCoordinate(input_coordinates)) |
83 return false; | 82 return false; |
84 } | 83 } |
85 | 84 |
86 if (!ReadParam(m, iter, &p->trace_id_)) | 85 if (!ReadParam(m, iter, &p->trace_id_)) |
87 return false; | 86 return false; |
88 if (!ReadParam(m, iter, &p->terminated_)) | 87 if (!ReadParam(m, iter, &p->terminated_)) |
89 return false; | 88 return false; |
90 if (!ReadParam(m, iter, &p->source_event_type_)) | 89 if (!ReadParam(m, iter, &p->source_event_type_)) |
91 return false; | 90 return false; |
92 | 91 |
93 return true; | 92 return true; |
94 } | 93 } |
95 | 94 |
96 void ParamTraits<ui::LatencyInfo>::Log(const param_type& p, | 95 void ParamTraits<ui::LatencyInfo>::Log(const param_type& p, std::string* l) { |
97 std::string* l) { | |
98 LogParam(p.trace_name_, l); | 96 LogParam(p.trace_name_, l); |
99 l->append(" "); | 97 l->append(" "); |
100 LogParam(p.latency_components_, l); | 98 LogParam(p.latency_components_, l); |
101 l->append(" "); | 99 l->append(" "); |
102 LogParam(p.input_coordinates_size_, l); | 100 LogParam(p.input_coordinates_size_, l); |
103 l->append(" "); | 101 l->append(" "); |
104 for (size_t i = 0; i < p.input_coordinates_size_; i++) { | 102 for (size_t i = 0; i < p.input_coordinates_size_; i++) { |
105 LogParam(p.input_coordinates_[i], l); | 103 LogParam(p.input_coordinates_[i], l); |
106 l->append(" "); | 104 l->append(" "); |
107 } | 105 } |
108 LogParam(p.trace_id_, l); | 106 LogParam(p.trace_id_, l); |
109 l->append(" "); | 107 l->append(" "); |
110 LogParam(p.terminated_, l); | 108 LogParam(p.terminated_, l); |
111 l->append(" "); | 109 l->append(" "); |
112 LogParam(p.source_event_type_, l); | 110 LogParam(p.source_event_type_, l); |
113 } | 111 } |
114 | 112 |
115 } // namespace IPC | 113 } // namespace IPC |
OLD | NEW |