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

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

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure Created 4 years, 8 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 | third_party/WebKit/Source/core/css/CSSPathValue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 27 matching lines...) Expand all
38 #include "core/layout/LayoutTheme.h" 38 #include "core/layout/LayoutTheme.h"
39 #include "platform/PlatformResourceLoader.h" 39 #include "platform/PlatformResourceLoader.h"
40 #include "wtf/LeakAnnotations.h" 40 #include "wtf/LeakAnnotations.h"
41 41
42 namespace blink { 42 namespace blink {
43 43
44 using namespace HTMLNames; 44 using namespace HTMLNames;
45 45
46 CSSDefaultStyleSheets& CSSDefaultStyleSheets::instance() 46 CSSDefaultStyleSheets& CSSDefaultStyleSheets::instance()
47 { 47 {
48 DEFINE_STATIC_LOCAL(Persistent<CSSDefaultStyleSheets>, cssDefaultStyleSheets , (new CSSDefaultStyleSheets())); 48 DEFINE_STATIC_LOCAL(CSSDefaultStyleSheets, cssDefaultStyleSheets, (new CSSDe faultStyleSheets));
49 return *cssDefaultStyleSheets; 49 return cssDefaultStyleSheets;
50 } 50 }
51 51
52 static const MediaQueryEvaluator& screenEval() 52 static const MediaQueryEvaluator& screenEval()
53 { 53 {
54 DEFINE_STATIC_LOCAL(Persistent<MediaQueryEvaluator>, staticScreenEval, (new MediaQueryEvaluator("screen"))); 54 DEFINE_STATIC_LOCAL(MediaQueryEvaluator, staticScreenEval, (new MediaQueryEv aluator("screen")));
55 return *staticScreenEval; 55 return staticScreenEval;
56 } 56 }
57 57
58 static const MediaQueryEvaluator& printEval() 58 static const MediaQueryEvaluator& printEval()
59 { 59 {
60 DEFINE_STATIC_LOCAL(Persistent<MediaQueryEvaluator>, staticPrintEval, (new M ediaQueryEvaluator("print"))); 60 DEFINE_STATIC_LOCAL(MediaQueryEvaluator, staticPrintEval, (new MediaQueryEva luator("print")));
61 return *staticPrintEval; 61 return staticPrintEval;
62 } 62 }
63 63
64 static RawPtr<StyleSheetContents> parseUASheet(const String& str) 64 static RawPtr<StyleSheetContents> parseUASheet(const String& str)
65 { 65 {
66 RawPtr<StyleSheetContents> sheet = StyleSheetContents::create(CSSParserConte xt(UASheetMode, 0)); 66 RawPtr<StyleSheetContents> sheet = StyleSheetContents::create(CSSParserConte xt(UASheetMode, 0));
67 sheet->parseString(str); 67 sheet->parseString(str);
68 // User Agent stylesheets are parsed once for the lifetime of the renderer 68 // User Agent stylesheets are parsed once for the lifetime of the renderer
69 // process and are intentionally leaked. 69 // process and are intentionally leaked.
70 LEAK_SANITIZER_IGNORE_OBJECT(sheet.get()); 70 LEAK_SANITIZER_IGNORE_OBJECT(sheet.get());
71 return sheet.release(); 71 return sheet.release();
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 visitor->trace(m_defaultStyleSheet); 191 visitor->trace(m_defaultStyleSheet);
192 visitor->trace(m_mobileViewportStyleSheet); 192 visitor->trace(m_mobileViewportStyleSheet);
193 visitor->trace(m_quirksStyleSheet); 193 visitor->trace(m_quirksStyleSheet);
194 visitor->trace(m_svgStyleSheet); 194 visitor->trace(m_svgStyleSheet);
195 visitor->trace(m_mathmlStyleSheet); 195 visitor->trace(m_mathmlStyleSheet);
196 visitor->trace(m_mediaControlsStyleSheet); 196 visitor->trace(m_mediaControlsStyleSheet);
197 visitor->trace(m_fullscreenStyleSheet); 197 visitor->trace(m_fullscreenStyleSheet);
198 } 198 }
199 199
200 } // namespace blink 200 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSPathValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698