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

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: Ownptrization and a null check 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..8021f90c5dba799bbb1ed72137be1d056976487e 100644
--- a/Source/core/rendering/style/CachedUAStyle.h
+++ b/Source/core/rendering/style/CachedUAStyle.h
@@ -32,12 +32,14 @@ namespace WebCore {
// applyMatchedProperties for later use during adjustRenderStyle.
class CachedUAStyle {
public:
- CachedUAStyle()
- : hasAppearance(false)
- , backgroundLayers(BackgroundFillLayer)
- , backgroundColor(StyleColor::currentColor())
- { }
+ static inline PassOwnPtr<CachedUAStyle> create(const RenderStyle*);
+
+ bool hasAppearance;
+ BorderData border;
+ FillLayer backgroundLayers;
+ StyleColor backgroundColor;
+private:
explicit CachedUAStyle(const RenderStyle* style)
: hasAppearance(true)
, backgroundLayers(BackgroundFillLayer)
@@ -48,13 +50,12 @@ public:
backgroundLayers = *style->backgroundLayers();
backgroundColor = style->backgroundColor();
}
-
- bool hasAppearance;
- BorderData border;
- FillLayer backgroundLayers;
- StyleColor backgroundColor;
};
+PassOwnPtr<CachedUAStyle> CachedUAStyle::create(const RenderStyle* style)
esprehn 2014/06/15 05:09:59 Just put this in the class above.
pdr. 2014/06/15 05:33:45 Done.
+{
+ return adoptPtr(new CachedUAStyle(style));
+}
} // namespace WebCore
« 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