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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSPathValue.cpp

Issue 1566423002: Avoid LSan false positives from CSSPathValue::emptyValue(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and adjust to RefPtr<> Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 9
10 namespace blink { 10 namespace blink {
(...skipping 15 matching lines...) Expand all
26 , m_pathByteStream(pathByteStream) 26 , m_pathByteStream(pathByteStream)
27 , m_cachedPath(cachedPath) 27 , m_cachedPath(cachedPath)
28 { 28 {
29 ASSERT(m_pathByteStream); 29 ASSERT(m_pathByteStream);
30 } 30 }
31 31
32 CSSPathValue::~CSSPathValue() 32 CSSPathValue::~CSSPathValue()
33 { 33 {
34 } 34 }
35 35
36 namespace {
37
38 PassRefPtrWillBeRawPtr<CSSPathValue> createPathValue()
39 {
40 RefPtr<SVGPathByteStream> pathByteStream = SVGPathByteStream::create();
41 // Need to be registered as LSan ignored, as it will be reachable and
42 // separately referred to by emptyPathValue() callers.
43 LEAK_SANITIZER_IGNORE_OBJECT(pathByteStream.get());
44 return CSSPathValue::create(pathByteStream.release());
45 }
46
47 }
48
36 CSSPathValue* CSSPathValue::emptyPathValue() 49 CSSPathValue* CSSPathValue::emptyPathValue()
37 { 50 {
38 DEFINE_STATIC_LOCAL(RefPtrWillBePersistent<CSSPathValue>, empty, (CSSPathVal ue::create(SVGPathByteStream::create()))); 51 DEFINE_STATIC_LOCAL(RefPtrWillBePersistent<CSSPathValue>, empty, (createPath Value()));
39 return empty.get(); 52 return empty.get();
40 } 53 }
41 54
42 StylePath* CSSPathValue::cachedPath() 55 StylePath* CSSPathValue::cachedPath()
43 { 56 {
44 if (!m_cachedPath) 57 if (!m_cachedPath)
45 m_cachedPath = StylePath::create(m_pathByteStream); 58 m_cachedPath = StylePath::create(m_pathByteStream);
46 return m_cachedPath.get(); 59 return m_cachedPath.get();
47 } 60 }
48 61
(...skipping 11 matching lines...) Expand all
60 { 73 {
61 CSSValue::traceAfterDispatch(visitor); 74 CSSValue::traceAfterDispatch(visitor);
62 } 75 }
63 76
64 String CSSPathValue::pathString() const 77 String CSSPathValue::pathString() const
65 { 78 {
66 return buildStringFromByteStream(*m_pathByteStream); 79 return buildStringFromByteStream(*m_pathByteStream);
67 } 80 }
68 81
69 } // namespace blink 82 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698