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

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

Issue 2598963005: Include-what-you-use for WrapUnique/MakeUnique. (Closed)
Patch Set: restore order of includes in x11_topmost_window_finder_interactive_uitest.cc Created 3 years, 12 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/display_unittest.cc ('k') | cc/surfaces/surface_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 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/sequence_surface_reference_factory.h" 5 #include "cc/surfaces/sequence_surface_reference_factory.h"
6 6
7 #include "base/memory/ptr_util.h"
7 #include "cc/surfaces/sequence_surface_reference.h" 8 #include "cc/surfaces/sequence_surface_reference.h"
8 9
9 namespace cc { 10 namespace cc {
10 11
11 std::unique_ptr<SurfaceReferenceBase> 12 std::unique_ptr<SurfaceReferenceBase>
12 SequenceSurfaceReferenceFactory::CreateReference( 13 SequenceSurfaceReferenceFactory::CreateReference(
13 SurfaceReferenceOwner* owner, 14 SurfaceReferenceOwner* owner,
14 const SurfaceId& surface_id) const { 15 const SurfaceId& surface_id) const {
15 auto seq = owner->GetSurfaceSequenceGenerator()->CreateSurfaceSequence(); 16 auto seq = owner->GetSurfaceSequenceGenerator()->CreateSurfaceSequence();
16 RequireSequence(surface_id, seq); 17 RequireSequence(surface_id, seq);
17 return base::MakeUnique<SequenceSurfaceReference>(make_scoped_refptr(this), 18 return base::MakeUnique<SequenceSurfaceReference>(make_scoped_refptr(this),
18 seq); 19 seq);
19 } 20 }
20 21
21 void SequenceSurfaceReferenceFactory::DestroyReference( 22 void SequenceSurfaceReferenceFactory::DestroyReference(
22 SurfaceReferenceBase* surface_ref) const { 23 SurfaceReferenceBase* surface_ref) const {
23 // This method can only be called by a SurfaceReferenceBase because it's 24 // This method can only be called by a SurfaceReferenceBase because it's
24 // private and only SurfaceReferenceBase is a friend. The reference only 25 // private and only SurfaceReferenceBase is a friend. The reference only
25 // calls this method on the factory that created it. So it's safe to cast 26 // calls this method on the factory that created it. So it's safe to cast
26 // the passed reference to the type returned by CreateReference. 27 // the passed reference to the type returned by CreateReference.
27 auto ref = static_cast<SequenceSurfaceReference*>(surface_ref); 28 auto ref = static_cast<SequenceSurfaceReference*>(surface_ref);
28 SatisfySequence(ref->sequence()); 29 SatisfySequence(ref->sequence());
29 } 30 }
30 31
31 } // namespace cc 32 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/display_unittest.cc ('k') | cc/surfaces/surface_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698