Skip to content

Commit

Permalink
Avoid log flooding in GLSurfacePresentationHelper
Browse files Browse the repository at this point in the history
Bug: 879929
Change-Id: Ifb452736573e65791ed5e3f143778f576854a167
Reviewed-on: https://chromium-review.googlesource.com/c/1477918
Commit-Queue: Peng Huang <[email protected]>
Reviewed-by: Antoine Labour <[email protected]>
Cr-Commit-Position: refs/heads/master@{#633415}
  • Loading branch information
phuang authored and Commit Bot committed Feb 19, 2019
1 parent a38af69 commit 1fb4eda
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/gl/gl_surface_presentation_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,13 @@ void GLSurfacePresentationHelper::CheckPendingFrames() {
&vsync_interval_)) {
vsync_timebase_ = base::TimeTicks();
vsync_interval_ = base::TimeDelta();
LOG(ERROR) << "GetVSyncParametersIfAvailable() failed!";
static unsigned int count = 0;
++count;
// GetVSyncParametersIfAvailable() could be called and failed frequently,
// so we have to limit the LOG to avoid flooding the log.
LOG_IF(ERROR, count < 20 || !(count & 0xff))
<< "GetVSyncParametersIfAvailable() failed for " << count
<< " times!";
}
}

Expand Down

0 comments on commit 1fb4eda

Please sign in to comment.