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

Unified Diff: content/browser/gpu/gpu_process_host.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.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 9e5861e3e6fe446bd48f8d29612263c436683fec..e8e32c2d2a49ae5895b06bae9fe08b38f3ff289c 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -64,6 +64,8 @@ bool GpuProcessHost::hardware_gpu_enabled_ = true;
namespace {
+const unsigned int kMaxLatencyInfoNumber = 100;
+
enum GPUProcessLifetimeEvent {
LAUNCHED,
DIED_FIRST_TIME,
@@ -132,7 +134,7 @@ void AcceleratedSurfaceBuffersSwappedCompletedForRenderer(
int surface_id,
base::TimeTicks timebase,
base::TimeDelta interval,
- const ui::LatencyInfo& latency_info) {
+ const std::vector<ui::LatencyInfo>& latency_info) {
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(
BrowserThread::UI,
@@ -167,7 +169,7 @@ void AcceleratedSurfaceBuffersSwappedCompleted(
bool alive,
base::TimeTicks timebase,
base::TimeDelta interval,
- const ui::LatencyInfo& latency_info) {
+ const std::vector<ui::LatencyInfo>& latency_info) {
AcceleratedSurfaceBuffersSwappedCompletedForGPU(
host_id, route_id, alive, timebase, interval);
AcceleratedSurfaceBuffersSwappedCompletedForRenderer(
@@ -877,6 +879,12 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(
const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) {
TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped");
+ if (params.latency_info.size() > kMaxLatencyInfoNumber) {
+ LOG(ERROR) << "GpuHostMsg_AcceleratedSurfaceBuffersSwapped LatencyInfo"
+ << " size " << params.latency_info.size() << " is too big.";
Ken Russell (switch to Gerrit) 2014/01/15 06:41:29 Please refactor this duplicated code and constant
Yufeng Shen (Slow to review) 2014/01/15 19:44:31 Done.
+ return;
+ }
+
gfx::GLSurfaceHandle surface_handle =
GpuSurfaceTracker::Get()->GetSurfaceHandle(params.surface_id);
// Compositor window is always gfx::kNullPluginWindow.
@@ -929,10 +937,17 @@ void GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped(
const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params) {
TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfaceBuffersSwapped");
+ if (params.latency_info.size() > kMaxLatencyInfoNumber) {
+ LOG(ERROR) << "GpuHostMsg_AcceleratedSurfaceBuffersSwapped LatencyInfo"
+ << " size " << params.latency_info.size() << " is too big.";
+ return;
+ }
+
base::ScopedClosureRunner scoped_completion_runner(
base::Bind(&AcceleratedSurfaceBuffersSwappedCompleted,
host_id_, params.route_id, params.surface_id,
- true, base::TimeTicks(), base::TimeDelta(), ui::LatencyInfo()));
+ true, base::TimeTicks(), base::TimeDelta(),
+ std::vector<ui::LatencyInfo>()));
gfx::GLSurfaceHandle handle =
GpuSurfaceTracker::Get()->GetSurfaceHandle(params.surface_id);
@@ -999,6 +1014,12 @@ void GpuProcessHost::OnAcceleratedSurfacePostSubBuffer(
const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params) {
TRACE_EVENT0("gpu", "GpuProcessHost::OnAcceleratedSurfacePostSubBuffer");
+ if (params.latency_info.size() > kMaxLatencyInfoNumber) {
+ LOG(ERROR) << "GpuHostMsg_AcceleratedSurfacePostSubBuffer LatencyInfo"
+ << " size " << params.latency_info.size() << " is too big.";
+ return;
+ }
+
NOTIMPLEMENTED();
}
« no previous file with comments | « content/browser/aura/software_browser_compositor_output_surface.cc ('k') | content/browser/gpu/gpu_process_host_ui_shim.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698