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

Unified Diff: Source/core/rendering/style/CachedUAStyle.h

Issue 338673002: Reduce the number of CachedUAStyles (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Return a create that somehow escaped Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderThemeChromiumMac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/CachedUAStyle.h
diff --git a/Source/core/rendering/style/CachedUAStyle.h b/Source/core/rendering/style/CachedUAStyle.h
index a3d7446128baca8992dc2d1fc2cd0fdd82991402..10bed857f5600ba0a8c327aaaa7540c735196fa6 100644
--- a/Source/core/rendering/style/CachedUAStyle.h
+++ b/Source/core/rendering/style/CachedUAStyle.h
@@ -32,12 +32,17 @@ namespace WebCore {
// applyMatchedProperties for later use during adjustRenderStyle.
class CachedUAStyle {
public:
- CachedUAStyle()
- : hasAppearance(false)
- , backgroundLayers(BackgroundFillLayer)
- , backgroundColor(StyleColor::currentColor())
- { }
+ static PassOwnPtr<CachedUAStyle> create(const RenderStyle* style)
+ {
+ return adoptPtr(new CachedUAStyle(style));
+ }
+ bool hasAppearance;
+ BorderData border;
+ FillLayer backgroundLayers;
+ StyleColor backgroundColor;
+
+private:
explicit CachedUAStyle(const RenderStyle* style)
: hasAppearance(true)
, backgroundLayers(BackgroundFillLayer)
@@ -48,14 +53,10 @@ public:
backgroundLayers = *style->backgroundLayers();
backgroundColor = style->backgroundColor();
}
-
- bool hasAppearance;
- BorderData border;
- FillLayer backgroundLayers;
- StyleColor backgroundColor;
};
+
} // namespace WebCore
#endif // CachedUAStyle_h
« no previous file with comments | « Source/core/rendering/RenderThemeChromiumMac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698