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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/CompositorFactory.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from Kent; merge. Created 4 years, 6 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
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 "platform/graphics/CompositorFactory.h" 5 #include "platform/graphics/CompositorFactory.h"
6 6
7 #include "platform/animation/CompositorAnimation.h" 7 #include "platform/animation/CompositorAnimation.h"
8 #include "platform/animation/CompositorAnimationPlayer.h" 8 #include "platform/animation/CompositorAnimationPlayer.h"
9 #include "platform/animation/CompositorAnimationTimeline.h" 9 #include "platform/animation/CompositorAnimationTimeline.h"
10 #include "platform/animation/CompositorFilterAnimationCurve.h" 10 #include "platform/animation/CompositorFilterAnimationCurve.h"
11 #include "platform/animation/CompositorFloatAnimationCurve.h" 11 #include "platform/animation/CompositorFloatAnimationCurve.h"
12 #include "platform/animation/CompositorTransformAnimationCurve.h" 12 #include "platform/animation/CompositorTransformAnimationCurve.h"
13 #include "platform/animation/CompositorTransformOperations.h" 13 #include "platform/animation/CompositorTransformOperations.h"
14 #include "platform/graphics/CompositorFilterOperations.h" 14 #include "platform/graphics/CompositorFilterOperations.h"
15 #include <memory>
15 16
16 namespace blink { 17 namespace blink {
17 18
18 class CompositorFactoryImpl : public CompositorFactory { 19 class CompositorFactoryImpl : public CompositorFactory {
19 public: 20 public:
20 CompositorFilterAnimationCurve* createFilterAnimationCurve() override 21 CompositorFilterAnimationCurve* createFilterAnimationCurve() override
21 { 22 {
22 return new CompositorFilterAnimationCurve(); 23 return new CompositorFilterAnimationCurve();
23 } 24 }
24 25
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 }; 73 };
73 74
74 static CompositorFactory* s_factory = 0; 75 static CompositorFactory* s_factory = 0;
75 76
76 void CompositorFactory::initializeDefault() 77 void CompositorFactory::initializeDefault()
77 { 78 {
78 delete s_factory; 79 delete s_factory;
79 s_factory = new CompositorFactoryImpl(); 80 s_factory = new CompositorFactoryImpl();
80 } 81 }
81 82
82 void CompositorFactory::initializeForTesting(PassOwnPtr<CompositorFactory> facto ry) 83 void CompositorFactory::initializeForTesting(std::unique_ptr<CompositorFactory> factory)
83 { 84 {
84 delete s_factory; 85 delete s_factory;
85 s_factory = factory.leakPtr(); 86 s_factory = factory.release();
86 } 87 }
87 88
88 void CompositorFactory::shutdown() 89 void CompositorFactory::shutdown()
89 { 90 {
90 delete s_factory; 91 delete s_factory;
91 s_factory = nullptr; 92 s_factory = nullptr;
92 } 93 }
93 94
94 CompositorFactory& CompositorFactory::current() 95 CompositorFactory& CompositorFactory::current()
95 { 96 {
96 ASSERT(s_factory); 97 ASSERT(s_factory);
97 return *s_factory; 98 return *s_factory;
98 } 99 }
99 100
100 } // namespace blink 101 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698