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

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..8ab90eb7fd06a85379471586d1570b6ae1358ffe 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), 0U);
+ uint32 id = number_to_id_[number];
+ if (id < min_available_id_) {
sky 2013/09/16 23:49:27 Refactor 54-57 and 64-67 to a common method?
sadrul 2013/09/17 02:26:38 Done.
+ 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