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

Unified Diff: cc/surfaces/surface_id_allocator.cc

Issue 1496103002: Reusing base::IdType<...> to implement SurfaceId. Base URL: https://chromium.googlesource.com/chromium/src.git@type-safe-id-base
Patch Set: Rebasing + dusting off... 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
« no previous file with comments | « cc/surfaces/surface_id.h ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface_id_allocator.cc
diff --git a/cc/surfaces/surface_id_allocator.cc b/cc/surfaces/surface_id_allocator.cc
index d71467562e1ca21fbae3ac651fe2aaf1f847177d..3cef14db0e3f9081bd429196b37490c47049b605 100644
--- a/cc/surfaces/surface_id_allocator.cc
+++ b/cc/surfaces/surface_id_allocator.cc
@@ -26,14 +26,15 @@ SurfaceIdAllocator::~SurfaceIdAllocator() {
}
SurfaceId SurfaceIdAllocator::GenerateId() {
- SurfaceId id(static_cast<uint64_t>(id_namespace_) << 32 | next_id_);
+ SurfaceId id = SurfaceId::FromUnsafeValue(
+ static_cast<uint64_t>(id_namespace_) << 32 | next_id_);
next_id_++;
return id;
}
// static
uint32_t SurfaceIdAllocator::NamespaceForId(SurfaceId id) {
- return id.id >> 32;
+ return id.GetUnsafeValue() >> 32;
}
} // namespace cc
« no previous file with comments | « cc/surfaces/surface_id.h ('k') | cc/surfaces/surface_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698