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

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

Issue 2045723002: mojo ArrayTraits<T>::Resize returns bool indicating success (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed pach 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
« no previous file with comments | « ui/events/mojo/latency_info_struct_traits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/mojo/latency_info_struct_traits.cc
diff --git a/ui/events/mojo/latency_info_struct_traits.cc b/ui/events/mojo/latency_info_struct_traits.cc
index b95d48028f7466bed01bf48108bf9aa0aaf8d2e8..e9b0409498995069045c41bce597cce2c1f76404 100644
--- a/ui/events/mojo/latency_info_struct_traits.cc
+++ b/ui/events/mojo/latency_info_struct_traits.cc
@@ -211,11 +211,12 @@ ArrayTraits<InputCoordinateArray>::GetAt(const InputCoordinateArray& b,
}
// static
-void ArrayTraits<InputCoordinateArray>::Resize(InputCoordinateArray& b,
+bool ArrayTraits<InputCoordinateArray>::Resize(InputCoordinateArray& b,
size_t size) {
- // TODO(fsamuel): We should update ArrayTraits<T>::Resize to return a bool.
- CHECK_LE(size, ui::LatencyInfo::kMaxInputCoordinates);
+ if (size > ui::LatencyInfo::kMaxInputCoordinates)
+ return false;
b.size = size;
+ return true;
}
// static
« no previous file with comments | « ui/events/mojo/latency_info_struct_traits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698