OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "core/css/CSSPathValue.h" | 5 #include "core/css/CSSPathValue.h" |
6 | 6 |
7 #include "core/style/StylePath.h" | 7 #include "core/style/StylePath.h" |
8 #include "core/svg/SVGPathUtilities.h" | 8 #include "core/svg/SVGPathUtilities.h" |
| 9 #include <memory> |
9 | 10 |
10 namespace blink { | 11 namespace blink { |
11 | 12 |
12 CSSPathValue* CSSPathValue::create(PassRefPtr<StylePath> stylePath) | 13 CSSPathValue* CSSPathValue::create(PassRefPtr<StylePath> stylePath) |
13 { | 14 { |
14 return new CSSPathValue(stylePath); | 15 return new CSSPathValue(stylePath); |
15 } | 16 } |
16 | 17 |
17 CSSPathValue* CSSPathValue::create(PassOwnPtr<SVGPathByteStream> pathByteStream) | 18 CSSPathValue* CSSPathValue::create(std::unique_ptr<SVGPathByteStream> pathByteSt
ream) |
18 { | 19 { |
19 return CSSPathValue::create(StylePath::create(std::move(pathByteStream))); | 20 return CSSPathValue::create(StylePath::create(std::move(pathByteStream))); |
20 } | 21 } |
21 | 22 |
22 CSSPathValue::CSSPathValue(PassRefPtr<StylePath> stylePath) | 23 CSSPathValue::CSSPathValue(PassRefPtr<StylePath> stylePath) |
23 : CSSValue(PathClass) | 24 : CSSValue(PathClass) |
24 , m_stylePath(stylePath) | 25 , m_stylePath(stylePath) |
25 { | 26 { |
26 ASSERT(m_stylePath); | 27 ASSERT(m_stylePath); |
27 } | 28 } |
28 | 29 |
29 namespace { | 30 namespace { |
30 | 31 |
31 CSSPathValue* createPathValue() | 32 CSSPathValue* createPathValue() |
32 { | 33 { |
33 OwnPtr<SVGPathByteStream> pathByteStream = SVGPathByteStream::create(); | 34 std::unique_ptr<SVGPathByteStream> pathByteStream = SVGPathByteStream::creat
e(); |
34 // Need to be registered as LSan ignored, as it will be reachable and | 35 // Need to be registered as LSan ignored, as it will be reachable and |
35 // separately referred to by emptyPathValue() callers. | 36 // separately referred to by emptyPathValue() callers. |
36 LEAK_SANITIZER_IGNORE_OBJECT(pathByteStream.get()); | 37 LEAK_SANITIZER_IGNORE_OBJECT(pathByteStream.get()); |
37 return CSSPathValue::create(std::move(pathByteStream)); | 38 return CSSPathValue::create(std::move(pathByteStream)); |
38 } | 39 } |
39 | 40 |
40 } // namespace | 41 } // namespace |
41 | 42 |
42 CSSPathValue& CSSPathValue::emptyPathValue() | 43 CSSPathValue& CSSPathValue::emptyPathValue() |
43 { | 44 { |
(...skipping 10 matching lines...) Expand all Loading... |
54 { | 55 { |
55 return byteStream() == other.byteStream(); | 56 return byteStream() == other.byteStream(); |
56 } | 57 } |
57 | 58 |
58 DEFINE_TRACE_AFTER_DISPATCH(CSSPathValue) | 59 DEFINE_TRACE_AFTER_DISPATCH(CSSPathValue) |
59 { | 60 { |
60 CSSValue::traceAfterDispatch(visitor); | 61 CSSValue::traceAfterDispatch(visitor); |
61 } | 62 } |
62 | 63 |
63 } // namespace blink | 64 } // namespace blink |
OLD | NEW |