Chromium Code Reviews| 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..d64306cd3feb16266f821a5a667f0016c8239db0 100644 |
| --- a/cc/surfaces/surface_id_allocator.cc |
| +++ b/cc/surfaces/surface_id_allocator.cc |
| @@ -6,6 +6,7 @@ |
| #include <stdint.h> |
| +#include "base/rand_util.h" |
| #include "cc/surfaces/surface_manager.h" |
| namespace cc { |
| @@ -26,14 +27,10 @@ SurfaceIdAllocator::~SurfaceIdAllocator() { |
| } |
| SurfaceId SurfaceIdAllocator::GenerateId() { |
| - SurfaceId id(static_cast<uint64_t>(id_namespace_) << 32 | next_id_); |
| + uint64_t nonce = base::RandUint64(); |
|
Tom Sepez
2016/05/24 22:35:45
Can we use the random number generator in crypto?
Fady Samuel
2016/05/25 00:04:29
I'd prefer not to have cc/surfaces depend on all o
|
| + SurfaceId id(id_namespace_, nonce, next_id_); |
| next_id_++; |
| return id; |
| } |
| -// static |
| -uint32_t SurfaceIdAllocator::NamespaceForId(SurfaceId id) { |
| - return id.id >> 32; |
| -} |
| - |
| } // namespace cc |