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