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

Unified Diff: Source/core/css/StylePropertySet.cpp

Issue 16021003: Move StylePropertySet::createImmutable() to ImmutableStylePropertySet. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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/css/StylePropertySet.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StylePropertySet.cpp
diff --git a/Source/core/css/StylePropertySet.cpp b/Source/core/css/StylePropertySet.cpp
index 8eee64cd8fbb53b76dfe3d6b0f41d1a0f8ff8756..ddc9e23600df5bbf64e303713517ec0e2544bf14 100644
--- a/Source/core/css/StylePropertySet.cpp
+++ b/Source/core/css/StylePropertySet.cpp
@@ -56,17 +56,17 @@ static size_t sizeForImmutableStylePropertySetWithPropertyCount(unsigned count)
return sizeof(ImmutableStylePropertySet) - sizeof(void*) + sizeof(CSSValue*) * count + sizeof(StylePropertyMetadata) * count;
}
-PassRefPtr<StylePropertySet> StylePropertySet::createImmutable(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
+PassRefPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::create(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
{
void* slot = WTF::fastMalloc(sizeForImmutableStylePropertySetWithPropertyCount(count));
return adoptRef(new (slot) ImmutableStylePropertySet(properties, count, cssParserMode));
}
-PassRefPtr<StylePropertySet> StylePropertySet::immutableCopyIfNeeded() const
+PassRefPtr<ImmutableStylePropertySet> StylePropertySet::immutableCopyIfNeeded() const
{
if (!isMutable())
- return const_cast<StylePropertySet*>(this);
- return createImmutable(mutablePropertyVector().data(), mutablePropertyVector().size(), cssParserMode());
+ return static_cast<ImmutableStylePropertySet*>(const_cast<StylePropertySet*>(this));
+ return ImmutableStylePropertySet::create(mutablePropertyVector().data(), mutablePropertyVector().size(), cssParserMode());
}
MutableStylePropertySet::MutableStylePropertySet(const CSSProperty* properties, unsigned length)
« no previous file with comments | « Source/core/css/StylePropertySet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698