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

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

Issue 1858753003: Remove RawPtr from core/css (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 DEFINE_STATIC_LOCAL(MediaQueryEvaluator, staticScreenEval, (new MediaQueryEv aluator("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(MediaQueryEvaluator, staticPrintEval, (new MediaQueryEva luator("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 StyleSheetContents* parseUASheet(const String& str)
65 { 65 {
66 RawPtr<StyleSheetContents> sheet = StyleSheetContents::create(CSSParserConte xt(UASheetMode, 0)); 66 StyleSheetContents* sheet = StyleSheetContents::create(CSSParserContext(UASh eetMode, 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);
71 return sheet.release(); 71 return sheet;
72 } 72 }
73 73
74 CSSDefaultStyleSheets::CSSDefaultStyleSheets() 74 CSSDefaultStyleSheets::CSSDefaultStyleSheets()
75 : m_defaultStyle(nullptr) 75 : m_defaultStyle(nullptr)
76 , m_defaultMobileViewportStyle(nullptr) 76 , m_defaultMobileViewportStyle(nullptr)
77 , m_defaultQuirksStyle(nullptr) 77 , m_defaultQuirksStyle(nullptr)
78 , m_defaultPrintStyle(nullptr) 78 , m_defaultPrintStyle(nullptr)
79 , m_defaultViewSourceStyle(nullptr) 79 , m_defaultViewSourceStyle(nullptr)
80 , m_defaultXHTMLMobileProfileStyle(nullptr) 80 , m_defaultXHTMLMobileProfileStyle(nullptr)
81 , m_defaultStyleSheet(nullptr) 81 , m_defaultStyleSheet(nullptr)
(...skipping 18 matching lines...) Expand all
100 String quirksRules = loadResourceAsASCIIString("quirks.css") + LayoutTheme:: theme().extraQuirksStyleSheet(); 100 String quirksRules = loadResourceAsASCIIString("quirks.css") + LayoutTheme:: theme().extraQuirksStyleSheet();
101 m_quirksStyleSheet = parseUASheet(quirksRules); 101 m_quirksStyleSheet = parseUASheet(quirksRules);
102 m_defaultQuirksStyle->addRulesFromSheet(quirksStyleSheet(), screenEval()); 102 m_defaultQuirksStyle->addRulesFromSheet(quirksStyleSheet(), screenEval());
103 } 103 }
104 104
105 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle() 105 RuleSet* CSSDefaultStyleSheets::defaultViewSourceStyle()
106 { 106 {
107 if (!m_defaultViewSourceStyle) { 107 if (!m_defaultViewSourceStyle) {
108 m_defaultViewSourceStyle = RuleSet::create(); 108 m_defaultViewSourceStyle = RuleSet::create();
109 // Loaded stylesheet is leaked on purpose. 109 // Loaded stylesheet is leaked on purpose.
110 RawPtr<StyleSheetContents> stylesheet = parseUASheet(loadResourceAsASCII String("view-source.css")); 110 StyleSheetContents* stylesheet = parseUASheet(loadResourceAsASCIIString( "view-source.css"));
111 m_defaultViewSourceStyle->addRulesFromSheet(stylesheet.release().leakRef (), screenEval()); 111 m_defaultViewSourceStyle->addRulesFromSheet(stylesheet, screenEval());
112 } 112 }
113 return m_defaultViewSourceStyle.get(); 113 return m_defaultViewSourceStyle.get();
114 } 114 }
115 115
116 RuleSet* CSSDefaultStyleSheets::defaultXHTMLMobileProfileStyle() 116 RuleSet* CSSDefaultStyleSheets::defaultXHTMLMobileProfileStyle()
117 { 117 {
118 if (!m_defaultXHTMLMobileProfileStyle) { 118 if (!m_defaultXHTMLMobileProfileStyle) {
119 m_defaultXHTMLMobileProfileStyle = RuleSet::create(); 119 m_defaultXHTMLMobileProfileStyle = RuleSet::create();
120 // Loaded stylesheet is leaked on purpose. 120 // Loaded stylesheet is leaked on purpose.
121 RawPtr<StyleSheetContents> stylesheet = parseUASheet(loadResourceAsASCII String("xhtmlmp.css")); 121 StyleSheetContents* stylesheet = parseUASheet(loadResourceAsASCIIString( "xhtmlmp.css"));
122 m_defaultXHTMLMobileProfileStyle->addRulesFromSheet(stylesheet.release() .leakRef(), screenEval()); 122 m_defaultXHTMLMobileProfileStyle->addRulesFromSheet(stylesheet, screenEv al());
123 } 123 }
124 return m_defaultXHTMLMobileProfileStyle.get(); 124 return m_defaultXHTMLMobileProfileStyle.get();
125 } 125 }
126 126
127 RuleSet* CSSDefaultStyleSheets::defaultMobileViewportStyle() 127 RuleSet* CSSDefaultStyleSheets::defaultMobileViewportStyle()
128 { 128 {
129 if (!m_defaultMobileViewportStyle) { 129 if (!m_defaultMobileViewportStyle) {
130 m_defaultMobileViewportStyle = RuleSet::create(); 130 m_defaultMobileViewportStyle = RuleSet::create();
131 m_mobileViewportStyleSheet = parseUASheet(loadResourceAsASCIIString("vie wportAndroid.css")); 131 m_mobileViewportStyleSheet = parseUASheet(loadResourceAsASCIIString("vie wportAndroid.css"));
132 m_defaultMobileViewportStyle->addRulesFromSheet(m_mobileViewportStyleShe et.get(), screenEval()); 132 m_defaultMobileViewportStyle->addRulesFromSheet(m_mobileViewportStyleShe et.get(), screenEval());
(...skipping 58 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 | « third_party/WebKit/Source/core/css/CSSCustomPropertyDeclaration.h ('k') | third_party/WebKit/Source/core/css/CSSFontFace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698