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

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

Issue 2691363002: Centralize FrameSinkId allocation in one place (Closed)
Patch Set: fix based on comment 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
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 incrementally
13 // -increasing sink_id.
Fady Samuel 2017/02/17 14:01:52 nit: put the hyphen (the -) on the previous line o
xlai (Olivia) 2017/02/17 15:55:11 Done.
14 class FrameSinkIdAllocator {
15 public:
16 constexpr FrameSinkIdAllocator(uint32_t client_id)
17 : client_id_(client_id), next_sink_id_(1u) {}
Fady Samuel 2017/02/17 14:01:52 nit: New line after this.
xlai (Olivia) 2017/02/17 15:55:11 Done.
18 FrameSinkId NextFrameSinkId() {
19 return FrameSinkId(client_id_, next_sink_id_++);
20 }
21
22 private:
23 const uint32_t client_id_;
24 uint32_t next_sink_id_;
25
26 DISALLOW_COPY_AND_ASSIGN(FrameSinkIdAllocator);
27 };
28
29 } // namespace cc
30
31 #endif // CC_SURFACES_FRAME_SINK_ID_ALLOCATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698