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

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: Rebase Created 6 years, 9 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/aura/window_event_dispatcher_unittest.cc ('k') | ui/events/latency_info.cc » ('j') | 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 a99476407b1311dac37a04819a1dbef37fcbb772..7220187272575e7e78cbdae5908486449bf8fc1f 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"
@@ -80,10 +80,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();
« no previous file with comments | « ui/aura/window_event_dispatcher_unittest.cc ('k') | ui/events/latency_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698