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); |
} |