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

Unified Diff: base/id_type.h

Issue 1548443002: Introducing gpu::CommandBufferId as a distinct, IdType<...>-based type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@type-safe-save-package-id-self-contained
Patch Set: Created 4 years, 10 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
Index: base/id_type.h
diff --git a/content/common/id_type.h b/base/id_type.h
similarity index 96%
rename from content/common/id_type.h
rename to base/id_type.h
index 5e1c45353acf3ea642b8ebba92c54509020d3511..5c556950266675a30312558815204be3dd5716e3 100644
--- a/content/common/id_type.h
+++ b/base/id_type.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_COMMON_ID_TYPE_H_
-#define CONTENT_COMMON_ID_TYPE_H_
+#ifndef BASE_ID_TYPE_H_
+#define BASE_ID_TYPE_H_
#include <stdint.h>
#include <cstddef>
@@ -28,7 +28,7 @@
// IdType32<T> / IdTypeU32<T>: Signed / unsigned 32-bit IDs
// IdType64<T> / IdTypeU64<T>: Signed / unsigned 64-bit IDs
// IdType<>: For when you need a different underlying type or
-// a default/invalid value other than zero.
+// a default/null value other than zero.
//
// IdType32<Foo> behaves just like an int32_t in the following aspects:
// - it can be used as a key in std::map and/or std::unordered_map;
@@ -42,7 +42,7 @@
// - it ensures initialization to zero and allows checking against
// default-initialized values via is_null method.
-namespace content {
+namespace base {
template <typename TypeMarker, typename WrappedType, WrappedType kInvalidValue>
class IdType {
@@ -102,6 +102,6 @@ std::ostream& operator<<(
return stream << id.GetUnsafeValue();
}
-} // namespace content
+} // namespace base
#endif // CONTENT_COMMON_ID_TYPE_H_
« no previous file with comments | « base/base.gypi ('k') | base/id_type_unittest.cc » ('j') | ipc/ipc_message_utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698