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

Unified Diff: Source/core/rendering/RenderObject.h

Issue 894393003: Constify and use reference for RenderStyle in LayoutTheme (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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
Index: Source/core/rendering/RenderObject.h
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index 2338e8266e8a72c059078893967acebacacb394d..7580e666fb24379c93f0011d362f98e6db0d18c1 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -799,7 +799,8 @@ public:
// m_style can only be nullptr before the first style is set, thus most
// callers will never see a nullptr style and should use styleRef().
// FIXME: It would be better if style() returned a const reference.
- const RenderStyle& styleRef() const { ASSERT(m_style); return *m_style; }
+ const RenderStyle& styleRef() const { return mutableStyleRef(); }
+ RenderStyle& mutableStyleRef() const { ASSERT(m_style); return *m_style; }
/* The following methods are inlined in RenderObjectInlines.h */
RenderStyle* firstLineStyle() const;
« Source/core/layout/LayoutThemeChromiumMac.mm ('K') | « Source/core/rendering/RenderMenuList.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698