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

Unified Diff: ui/events/mojo/latency_info_struct_traits.h

Issue 2046563005: Add ArrayTraits<CArray<T>> utility template (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed tsepez's comments Created 4 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 side-by-side diff with in-line comments
Download patch
Index: ui/events/mojo/latency_info_struct_traits.h
diff --git a/ui/events/mojo/latency_info_struct_traits.h b/ui/events/mojo/latency_info_struct_traits.h
index 14ba52a2e0517c281e3bf730a0a599535e775617..6d9d990c6f2c8f5f2a49bd37197aaf204dfb4563 100644
--- a/ui/events/mojo/latency_info_struct_traits.h
+++ b/ui/events/mojo/latency_info_struct_traits.h
@@ -11,24 +11,7 @@
namespace mojo {
-// A buffer used to read bytes directly from LatencyInfoDataView into
-// ui::LatencyInfo's input_coordinates_.
-struct InputCoordinateArray {
- size_t size;
- gfx::PointF* data;
-};
-
-// TODO(fsamuel): We should add a common ArrayTraits<CArray<T>> utility struct.
-template <>
-struct ArrayTraits<InputCoordinateArray> {
- using Element = gfx::PointF;
- static size_t GetSize(const InputCoordinateArray& b);
- static Element* GetData(InputCoordinateArray& b);
- static const Element* GetData(const InputCoordinateArray& b);
- static Element& GetAt(InputCoordinateArray& b, size_t i);
- static const Element& GetAt(const InputCoordinateArray& b, size_t i);
- static bool Resize(InputCoordinateArray& b, size_t size);
-};
+using InputCoordinateArray = CArray<gfx::PointF>;
template <>
struct StructTraits<ui::mojom::LatencyComponent,
« no previous file with comments | « skia/public/interfaces/bitmap_skbitmap_struct_traits.cc ('k') | ui/events/mojo/latency_info_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698