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

Unified Diff: ui/events/latency_info.h

Issue 157003005: Replace std::map with base::SmallMap in ui::LatencyInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move ParamTraits<SmallMap> to base/ Created 6 years, 10 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
« ipc/ipc_message_utils.h ('K') | « ipc/ipc_message_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/latency_info.h
diff --git a/ui/events/latency_info.h b/ui/events/latency_info.h
index 332b8ff9fc1dbe17267fcab1891ab211d357d748..5d760dd75dc2448df3081555c092f481e87ea5db 100644
--- a/ui/events/latency_info.h
+++ b/ui/events/latency_info.h
@@ -5,11 +5,11 @@
#ifndef UI_EVENTS_LATENCY_INFO_H_
#define UI_EVENTS_LATENCY_INFO_H_
-#include <map>
#include <utility>
#include <vector>
#include "base/basictypes.h"
+#include "base/containers/small_map.h"
#include "base/time/time.h"
#include "ui/events/events_base_export.h"
@@ -79,10 +79,14 @@ struct EVENTS_BASE_EXPORT LatencyInfo {
uint32 event_count;
};
+ // Empirically determined constant based on a typical scroll sequence.
+ enum { kTypicalMaxComponentsPerLatencyInfo = 6 };
+
// Map a Latency Component (with a component-specific int64 id) to a
// component info.
- typedef std::map<std::pair<LatencyComponentType, int64>, LatencyComponent>
- LatencyMap;
+ typedef base::SmallMap<
+ std::map<std::pair<LatencyComponentType, int64>, LatencyComponent>,
+ kTypicalMaxComponentsPerLatencyInfo> LatencyMap;
LatencyInfo();
« ipc/ipc_message_utils.h ('K') | « ipc/ipc_message_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698