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

Unified Diff: chrome/common/string_ordinal.h

Issue 8198003: Convert app_launch_index and page_index from int to StringOrdinal. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressing review comments Created 9 years, 1 month 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: chrome/common/string_ordinal.h
diff --git a/chrome/common/string_ordinal.h b/chrome/common/string_ordinal.h
index abe0fe42da124d0408ace5ba171f51d568798a84..f6c956208741e280eee3034b41a241f0fc9d35db 100644
--- a/chrome/common/string_ordinal.h
+++ b/chrome/common/string_ordinal.h
@@ -29,6 +29,11 @@ class StringOrdinal {
// Creates an invalid StringOrdinal.
StringOrdinal();
+ // Creates a valid initial StringOrdinal, this is called to create the first
+ // element of StringOrdinal list (i.e. before we have any other values we can
+ // generate from).
+ static StringOrdinal CreateInitialOrdinal();
+
bool IsValid() const;
// All remaining functions can only be called if IsValid() holds.
@@ -69,4 +74,10 @@ class StringOrdinal {
bool is_valid_;
};
+// A helper class that can be used by STL containers that require sorting.
+class StringOrdinalLessThan {
+ public:
+ bool operator() (const StringOrdinal& lhs, const StringOrdinal& rhs) const;
+};
+
#endif // CHROME_COMMON_STRING_ORDINAL_H_

Powered by Google App Engine
This is Rietveld 408576698