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

Side by Side Diff: cc/surfaces/surface_reference_base.cc

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 #include "cc/surfaces/surface_reference_base.h"
6
7 #include "cc/surfaces/surface_reference_factory.h"
8
9 namespace cc {
10
11 void SurfaceReferenceBase::Destroy() {
12 if (!factory_)
13 return;
Fady Samuel 2016/12/13 22:55:05 Move this to the destructor: if (factory_) fact
Saman Sami 2016/12/14 17:50:01 Done.
14 factory_->DestroyReference(this);
15 factory_ = nullptr;
16 }
17
18 void SurfaceReferenceBase::Destroy(CompositorFrameMetadata* metadata) {
19 if (!factory_)
20 return;
21 factory_->DestroyReference(this, metadata);
22 factory_ = nullptr;
23 }
24
25 bool SurfaceReferenceBase::IsDestroyed() const {
26 return factory_ == nullptr;
27 }
28
29 SurfaceReferenceBase::~SurfaceReferenceBase() {
30 Destroy();
31 }
32
33 SurfaceReferenceBase::SurfaceReferenceBase(
34 scoped_refptr<const SurfaceReferenceFactory> factory)
35 : factory_(factory) {}
Fady Samuel 2016/12/13 22:55:05 factory_(std::move(factory))
Saman Sami 2016/12/14 17:50:01 Done.
36
37 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698