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

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

Issue 2514033002: Introducing SurfaceReferenceFactory (Closed)
Patch Set: up Created 4 years 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 2016 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_SURFACE_REFERENCE_FACTORY_H_
6 #define CC_SURFACES_SURFACE_REFERENCE_FACTORY_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "cc/surfaces/surface_id.h"
10 #include "cc/surfaces/surface_reference_base.h"
11 #include "cc/surfaces/surface_reference_owner.h"
12
13 namespace cc {
14
15 class SurfaceReferenceBase;
16 class CompositorFrameMetadata;
17
18 // Creates surface references. Returns an object of type
19 // SurfaceReferenceBase which holds on to its corresponding
20 // surface reference until destruction. The referenced surface
21 // will be kept alive as long as there is a reference to it.
22 class SurfaceReferenceFactory
23 : public base::RefCounted<SurfaceReferenceFactory> {
Fady Samuel 2016/12/13 22:55:05 RefCountedThreadSafe
Saman Sami 2016/12/14 17:50:02 Done.
24 public:
25 virtual std::unique_ptr<SurfaceReferenceBase> CreateReference(
26 SurfaceReferenceOwner* owner,
27 const SurfaceId& surface_id) const = 0;
28
29 SurfaceReferenceFactory() = default;
30
31 protected:
32 virtual ~SurfaceReferenceFactory() = default;
33
34 private:
35 friend class base::RefCounted<SurfaceReferenceFactory>;
36 virtual void DestroyReference(SurfaceReferenceBase* surface_ref) const = 0;
37 virtual void DestroyReference(SurfaceReferenceBase* surface_ref,
38 CompositorFrameMetadata* metadata) const = 0;
39 friend class SurfaceReferenceBase;
Fady Samuel 2016/12/13 22:55:05 Move friend statements above.
Saman Sami 2016/12/14 17:50:02 Done.
40
41 DISALLOW_COPY_AND_ASSIGN(SurfaceReferenceFactory);
42 };
43
44 } // namespace cc
45
46 #endif // CC_SURFACES_SURFACE_REFERENCE_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698