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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 123563002: Remove gpu side LatencyInfo merging (Closed) Base URL: http://git.chromium.org/chromium/src.git@gpu-per-event-latency-6-small
Patch Set: adding check at more places for GpuHostMsg_AcceleratedSurfaceBuffersSwapped/PostBuffer Created 6 years, 11 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: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 44eaf90cc85fb3634f118576f716f868d6d02ccf..3a134822b7e5f9b2bc3482b470a31f915193c34e 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -100,6 +100,7 @@ const int64 kHandleMoreWorkPeriodBusyMs = 1;
// Prevents idle work from being starved.
const int64 kMaxTimeSinceIdleMs = 10;
+const unsigned int kMaxLatencyInfoNumber = 100;
} // namespace
GpuCommandBufferStub::GpuCommandBufferStub(
@@ -567,7 +568,12 @@ void GpuCommandBufferStub::OnInitialize(
}
void GpuCommandBufferStub::OnSetLatencyInfo(
- const ui::LatencyInfo& latency_info) {
+ const std::vector<ui::LatencyInfo>& latency_info) {
+ if (latency_info.size() > kMaxLatencyInfoNumber) {
+ LOG(ERROR) << "GpuCommandBufferStub::OnSetLatencyInfo LatencyInfo"
+ << " size " << latency_info.size() << " is too big.";
+ return;
+ }
if (!latency_info_callback_.is_null())
latency_info_callback_.Run(latency_info);
}

Powered by Google App Engine
This is Rietveld 408576698