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 #include <memory> |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 CSSPathValue* CSSPathValue::create(PassRefPtr<StylePath> stylePath) { | 13 CSSPathValue* CSSPathValue::create(PassRefPtr<StylePath> stylePath) { |
14 return new CSSPathValue(std::move(stylePath)); | 14 return new CSSPathValue(std::move(stylePath)); |
15 } | 15 } |
16 | 16 |
17 CSSPathValue* CSSPathValue::create( | 17 CSSPathValue* CSSPathValue::create( |
18 std::unique_ptr<SVGPathByteStream> pathByteStream) { | 18 std::unique_ptr<SVGPathByteStream> pathByteStream) { |
19 return CSSPathValue::create(StylePath::create(std::move(pathByteStream))); | 19 return CSSPathValue::create(StylePath::create(std::move(pathByteStream))); |
20 } | 20 } |
21 | 21 |
22 CSSPathValue::CSSPathValue(PassRefPtr<StylePath> stylePath) | 22 CSSPathValue::CSSPathValue(PassRefPtr<StylePath> stylePath) |
23 : CSSValue(PathClass), m_stylePath(stylePath) { | 23 : CSSValue(PathClass), m_stylePath(stylePath) { |
24 ASSERT(m_stylePath); | 24 DCHECK(m_stylePath); |
25 } | 25 } |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 CSSPathValue* createPathValue() { | 29 CSSPathValue* createPathValue() { |
30 std::unique_ptr<SVGPathByteStream> pathByteStream = | 30 std::unique_ptr<SVGPathByteStream> pathByteStream = |
31 SVGPathByteStream::create(); | 31 SVGPathByteStream::create(); |
32 // Need to be registered as LSan ignored, as it will be reachable and | 32 // Need to be registered as LSan ignored, as it will be reachable and |
33 // separately referred to by emptyPathValue() callers. | 33 // separately referred to by emptyPathValue() callers. |
34 LEAK_SANITIZER_IGNORE_OBJECT(pathByteStream.get()); | 34 LEAK_SANITIZER_IGNORE_OBJECT(pathByteStream.get()); |
(...skipping 13 matching lines...) Expand all Loading... |
48 | 48 |
49 bool CSSPathValue::equals(const CSSPathValue& other) const { | 49 bool CSSPathValue::equals(const CSSPathValue& other) const { |
50 return byteStream() == other.byteStream(); | 50 return byteStream() == other.byteStream(); |
51 } | 51 } |
52 | 52 |
53 DEFINE_TRACE_AFTER_DISPATCH(CSSPathValue) { | 53 DEFINE_TRACE_AFTER_DISPATCH(CSSPathValue) { |
54 CSSValue::traceAfterDispatch(visitor); | 54 CSSValue::traceAfterDispatch(visitor); |
55 } | 55 } |
56 | 56 |
57 } // namespace blink | 57 } // namespace blink |
OLD | NEW |