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

Side by Side Diff: cc/surfaces/frame_sink_id_allocator.h

Issue 2691363002: Centralize FrameSinkId allocation in one place (Closed)
Patch Set: fix nits Created 3 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 unified diff | Download patch
« no previous file with comments | « cc/surfaces/BUILD.gn ('k') | content/browser/compositor/gpu_process_transport_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CC_SURFACES_FRAME_SINK_ID_ALLOCATOR_H_
6 #define CC_SURFACES_FRAME_SINK_ID_ALLOCATOR_H_
7
8 #include "cc/surfaces/frame_sink_id.h"
9
10 namespace cc {
11
12 // This class generates FrameSinkId with a fixed client_id and an
13 // incrementally-increasing sink_id.
14 class FrameSinkIdAllocator {
15 public:
16 constexpr FrameSinkIdAllocator(uint32_t client_id)
Fady Samuel 2017/02/17 16:00:30 Another nit, just noticed. This needs explicit.
danakj 2017/02/21 22:56:56 Presubmit should warn about this I thought? Does t
xlai (Olivia) 2017/02/22 16:24:07 Done, added explicit. I don't think constexpr and
17 : client_id_(client_id), next_sink_id_(1u) {}
18
19 FrameSinkId NextFrameSinkId() {
20 return FrameSinkId(client_id_, next_sink_id_++);
21 }
22
23 private:
24 const uint32_t client_id_;
25 uint32_t next_sink_id_;
26
27 DISALLOW_COPY_AND_ASSIGN(FrameSinkIdAllocator);
28 };
29
30 } // namespace cc
31
32 #endif // CC_SURFACES_FRAME_SINK_ID_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « cc/surfaces/BUILD.gn ('k') | content/browser/compositor/gpu_process_transport_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698