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

Unified Diff: content/browser/gpu/gpu_process_host_ui_shim.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/browser/gpu/gpu_process_host_ui_shim.cc
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
index b17bc59faae752ffa98445671ceac7261a81bcdb..55253a654ce43ff6df904e8f11cfc0b44fbddc7f 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -36,6 +36,8 @@ namespace {
#undef DestroyAll
#endif
+const unsigned int kMaxLatencyInfoNumber = 100;
+
base::LazyInstance<IDMap<GpuProcessHostUIShim> > g_hosts_by_id =
LAZY_INSTANCE_INITIALIZER;
@@ -284,6 +286,11 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped(
const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) {
TRACE_EVENT0("renderer",
"GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped");
+ if (params.latency_info.size() > kMaxLatencyInfoNumber) {
+ LOG(ERROR) << "GpuHostMsg_AcceleratedSurfaceBuffersSwapped LatencyInfo"
+ << " size " << params.latency_info.size() << " is too big.";
+ return;
+ }
AcceleratedSurfaceMsg_BufferPresented_Params ack_params;
ack_params.mailbox_name = params.mailbox_name;
ack_params.sync_point = 0;
@@ -312,7 +319,13 @@ void GpuProcessHostUIShim::OnAcceleratedSurfaceBuffersSwapped(
view->DidReceiveRendererFrame();
}
-void GpuProcessHostUIShim::OnFrameDrawn(const ui::LatencyInfo& latency_info) {
+void GpuProcessHostUIShim::OnFrameDrawn(
+ const std::vector<ui::LatencyInfo>& latency_info) {
+ if (latency_info.size() > kMaxLatencyInfoNumber) {
+ LOG(ERROR) << "GpuProcessHostUIShim::OnFrameDrawn LatencyInfo"
+ << " size " << latency_info.size() << " is too big.";
+ return;
+ }
RenderWidgetHostImpl::CompositorFrameDrawn(latency_info);
}
@@ -320,7 +333,11 @@ void GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer(
const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params) {
TRACE_EVENT0("renderer",
"GpuProcessHostUIShim::OnAcceleratedSurfacePostSubBuffer");
-
+ if (params.latency_info.size() > kMaxLatencyInfoNumber) {
+ LOG(ERROR) << "GpuHostMsg_AcceleratedSurfacePostSubBuffer LatencyInfo"
+ << " size " << params.latency_info.size() << " is too big.";
+ return;
+ }
AcceleratedSurfaceMsg_BufferPresented_Params ack_params;
ack_params.mailbox_name = params.mailbox_name;
ack_params.sync_point = 0;

Powered by Google App Engine
This is Rietveld 408576698