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

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

Issue 288153004: SyncPointManager never returns 0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to ToT Created 6 years, 7 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
« no previous file with comments | « content/common/gpu/sync_point_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/sync_point_manager.cc
diff --git a/content/common/gpu/sync_point_manager.cc b/content/common/gpu/sync_point_manager.cc
index 9383574faf9eb1039d8111f0b8ff46389425335f..5aa4b7e8e8c51f07bee35cb715c046c1bf59f579 100644
--- a/content/common/gpu/sync_point_manager.cc
+++ b/content/common/gpu/sync_point_manager.cc
@@ -26,6 +26,9 @@ SyncPointManager::~SyncPointManager() {
uint32 SyncPointManager::GenerateSyncPoint() {
base::AutoLock lock(lock_);
uint32 sync_point = next_sync_point_++;
+ // When an integer overflow occurs, don't return 0.
+ if (!sync_point)
+ sync_point = next_sync_point_++;
// Note: wrapping would take days for a buggy/compromized renderer that would
// insert sync points in a loop, but if that were to happen, better explicitly
« no previous file with comments | « content/common/gpu/sync_point_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698