Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/surfaces/surface_id_allocator.h" | 5 #include "cc/surfaces/surface_id_allocator.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
| 10 #include "base/unguessable_token.h" | 10 #include "base/unguessable_token.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 SurfaceIdAllocator::SurfaceIdAllocator() : next_id_(1u) {} | 14 SurfaceIdAllocator::SurfaceIdAllocator() : next_id_(1u) {} |
| 15 | 15 |
| 16 SurfaceIdAllocator::~SurfaceIdAllocator() { | 16 SurfaceIdAllocator::~SurfaceIdAllocator() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 LocalSurfaceId SurfaceIdAllocator::GenerateId() { | 19 const LocalSurfaceId& SurfaceIdAllocator::GenerateId() { |
|
vmpstr
2017/02/07 22:46:20
Why this change?
Fady Samuel
2017/02/08 00:52:50
It's not necessary for now. I've reverted it.
| |
| 20 LocalSurfaceId id(next_id_, base::UnguessableToken::Create()); | 20 current_local_surface_id_ = |
| 21 next_id_++; | 21 LocalSurfaceId(next_id_++, base::UnguessableToken::Create()); |
| 22 return id; | 22 return current_local_surface_id_; |
| 23 } | 23 } |
| 24 | 24 |
| 25 } // namespace cc | 25 } // namespace cc |
| OLD | NEW |