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

Unified Diff: ui/base/sequential_id_generator.cc

Issue 23654045: ui: Fix removing a number from the SequentialIDGenerator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | ui/base/sequential_id_generator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/sequential_id_generator.cc
diff --git a/ui/base/sequential_id_generator.cc b/ui/base/sequential_id_generator.cc
index 492efe5af8219d83382a4f7e6793fb38d596e32a..d491c31f645a173519bf2117fdfdcc41b42cc58c 100644
--- a/ui/base/sequential_id_generator.cc
+++ b/ui/base/sequential_id_generator.cc
@@ -59,6 +59,12 @@ void SequentialIDGenerator::ReleaseGeneratedID(uint32 id) {
}
void SequentialIDGenerator::ReleaseNumber(uint32 number) {
+ DCHECK_GT(number_to_id_.count(number), 0);
+ uint32 id = number_to_id_[number];
sadrul 2013/09/16 22:07:21 Should I just call ReleaseGeneratedID(number_to_id
+ if (id < min_available_id_) {
+ min_available_id_ = id;
+ DCHECK_GE(min_available_id_, min_id_);
+ }
Remove(number, &number_to_id_, &id_to_number_);
}
« no previous file with comments | « no previous file | ui/base/sequential_id_generator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698