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

Unified Diff: cc/surfaces/display.cc

Issue 2966803002: Limit the size of latency info storage (Closed)
Patch Set: Separate the checks for clarity Created 3 years, 5 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 | « cc/surfaces/display.h ('k') | cc/surfaces/display_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/display.cc
diff --git a/cc/surfaces/display.cc b/cc/surfaces/display.cc
index a9c5358eab4a693ee0e2fa439e19856e968ef6a1..ead51b6cd0c3fc22f92994b328dd8c89213244a0 100644
--- a/cc/surfaces/display.cc
+++ b/cc/surfaces/display.cc
@@ -340,9 +340,15 @@ bool Display::DrawAndSwap() {
if (have_damage && !size_matches)
aggregator_->SetFullDamageForSurface(current_surface_id_);
TRACE_EVENT_INSTANT0("cc", "Swap skipped.", TRACE_EVENT_SCOPE_THREAD);
- stored_latency_info_.insert(stored_latency_info_.end(),
- frame.metadata.latency_info.begin(),
- frame.metadata.latency_info.end());
+
+ // Do not store more that the allowed size.
+ if (ui::LatencyInfo::Verify(frame.metadata.latency_info,
+ "Display::DrawAndSwap")) {
+ stored_latency_info_.insert(stored_latency_info_.end(),
+ frame.metadata.latency_info.begin(),
+ frame.metadata.latency_info.end());
+ }
+
if (scheduler_) {
scheduler_->DidSwapBuffers();
scheduler_->DidReceiveSwapBuffersAck();
« no previous file with comments | « cc/surfaces/display.h ('k') | cc/surfaces/display_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698