Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: ui/latency/mojo/latency_info_struct_traits.cc

Issue 2914023002: Remove LatencyInfo::sequence_number. (May break metrics).
Patch Set: Fix Windows. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/latency/mojo/latency_info_struct_traits.h" 5 #include "ui/latency/mojo/latency_info_struct_traits.h"
6 6
7 #include "ipc/ipc_message_utils.h" 7 #include "ipc/ipc_message_utils.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 10
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 case ui::mojom::SourceEventType::OTHER: 182 case ui::mojom::SourceEventType::OTHER:
183 return ui::OTHER; 183 return ui::OTHER;
184 } 184 }
185 NOTREACHED(); 185 NOTREACHED();
186 return ui::SourceEventType::UNKNOWN; 186 return ui::SourceEventType::UNKNOWN;
187 } 187 }
188 188
189 } // namespace 189 } // namespace
190 190
191 // static 191 // static
192 int64_t StructTraits<ui::mojom::LatencyComponentDataView,
193 ui::LatencyInfo::LatencyComponent>::
194 sequence_number(const ui::LatencyInfo::LatencyComponent& component) {
195 return component.sequence_number;
196 }
197
198 // static
199 base::TimeTicks StructTraits<ui::mojom::LatencyComponentDataView, 192 base::TimeTicks StructTraits<ui::mojom::LatencyComponentDataView,
200 ui::LatencyInfo::LatencyComponent>:: 193 ui::LatencyInfo::LatencyComponent>::
201 event_time(const ui::LatencyInfo::LatencyComponent& component) { 194 event_time(const ui::LatencyInfo::LatencyComponent& component) {
202 return component.event_time; 195 return component.event_time;
203 } 196 }
204 197
205 // static 198 // static
206 uint32_t StructTraits<ui::mojom::LatencyComponentDataView, 199 uint32_t StructTraits<ui::mojom::LatencyComponentDataView,
207 ui::LatencyInfo::LatencyComponent>:: 200 ui::LatencyInfo::LatencyComponent>::
208 event_count(const ui::LatencyInfo::LatencyComponent& component) { 201 event_count(const ui::LatencyInfo::LatencyComponent& component) {
(...skipping 18 matching lines...) Expand all
227 bool StructTraits<ui::mojom::LatencyComponentDataView, 220 bool StructTraits<ui::mojom::LatencyComponentDataView,
228 ui::LatencyInfo::LatencyComponent>:: 221 ui::LatencyInfo::LatencyComponent>::
229 Read(ui::mojom::LatencyComponentDataView data, 222 Read(ui::mojom::LatencyComponentDataView data,
230 ui::LatencyInfo::LatencyComponent* out) { 223 ui::LatencyInfo::LatencyComponent* out) {
231 if (!data.ReadEventTime(&out->event_time)) 224 if (!data.ReadEventTime(&out->event_time))
232 return false; 225 return false;
233 if (!data.ReadFirstEventTime(&out->first_event_time)) 226 if (!data.ReadFirstEventTime(&out->first_event_time))
234 return false; 227 return false;
235 if (!data.ReadLastEventTime(&out->last_event_time)) 228 if (!data.ReadLastEventTime(&out->last_event_time))
236 return false; 229 return false;
237 out->sequence_number = data.sequence_number();
238 out->event_count = data.event_count(); 230 out->event_count = data.event_count();
239 return true; 231 return true;
240 } 232 }
241 233
242 // static 234 // static
243 ui::mojom::LatencyComponentType 235 ui::mojom::LatencyComponentType
244 StructTraits<ui::mojom::LatencyComponentIdDataView, 236 StructTraits<ui::mojom::LatencyComponentIdDataView,
245 std::pair<ui::LatencyComponentType, int64_t>>:: 237 std::pair<ui::LatencyComponentType, int64_t>>::
246 type(const std::pair<ui::LatencyComponentType, int64_t>& id) { 238 type(const std::pair<ui::LatencyComponentType, int64_t>& id) {
247 return UILatencyComponentTypeToMojo(id.first); 239 return UILatencyComponentTypeToMojo(id.first);
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 316 }
325 317
326 out->trace_id_ = data.trace_id(); 318 out->trace_id_ = data.trace_id();
327 out->coalesced_ = data.coalesced(); 319 out->coalesced_ = data.coalesced();
328 out->terminated_ = data.terminated(); 320 out->terminated_ = data.terminated();
329 out->source_event_type_ = MojoSourceEventTypeToUI(data.source_event_type()); 321 out->source_event_type_ = MojoSourceEventTypeToUI(data.source_event_type());
330 return true; 322 return true;
331 } 323 }
332 324
333 } // namespace mojo 325 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698