Changeset 148398 in webkit


Ignore:
Timestamp:
Apr 14, 2013 9:14:48 AM (11 years ago)
Author:
akling@apple.com
Message:

Move StylePropertySet::createImmutable() to ImmutableStylePropertySet.
<http://webkit.org/b/114584>

Reviewed by Anders Carlsson.

StylePropertySet::createImmutable() -> ImmutableStylePropertySet::create()
Also, immutableCopyIfNeeded() now returns a PassRefPtr<ImmutableStylePropertySet>.

  • css/CSSParser.cpp:

(WebCore::CSSParser::createStylePropertySet):

  • css/StylePropertySet.cpp:

(WebCore::ImmutableStylePropertySet::create):
(WebCore::StylePropertySet::immutableCopyIfNeeded):

  • css/StylePropertySet.h:

(StylePropertySet):
(ImmutableStylePropertySet):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r148397 r148398  
     12013-04-14  Andreas Kling  <akling@apple.com>
     2
     3        Move StylePropertySet::createImmutable() to ImmutableStylePropertySet.
     4        <http://webkit.org/b/114584>
     5
     6        Reviewed by Anders Carlsson.
     7
     8        StylePropertySet::createImmutable() -> ImmutableStylePropertySet::create()
     9        Also, immutableCopyIfNeeded() now returns a PassRefPtr<ImmutableStylePropertySet>.
     10
     11        * css/CSSParser.cpp:
     12        (WebCore::CSSParser::createStylePropertySet):
     13        * css/StylePropertySet.cpp:
     14        (WebCore::ImmutableStylePropertySet::create):
     15        (WebCore::StylePropertySet::immutableCopyIfNeeded):
     16        * css/StylePropertySet.h:
     17        (StylePropertySet):
     18        (ImmutableStylePropertySet):
     19
    1202013-04-14  Andreas Kling  <akling@apple.com>
    221
  • trunk/Source/WebCore/css/CSSParser.cpp

    r148395 r148398  
    15611561        results.remove(0, unusedEntries);
    15621562
    1563     return StylePropertySet::createImmutable(results.data(), results.size(), m_context.mode);
     1563    return ImmutableStylePropertySet::create(results.data(), results.size(), m_context.mode);
    15641564}
    15651565
  • trunk/Source/WebCore/css/StylePropertySet.cpp

    r148397 r148398  
    6969}
    7070
    71 PassRefPtr<StylePropertySet> StylePropertySet::createImmutable(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
     71PassRefPtr<ImmutableStylePropertySet> ImmutableStylePropertySet::create(const CSSProperty* properties, unsigned count, CSSParserMode cssParserMode)
    7272{
    7373    void* slot = WTF::fastMalloc(sizeForImmutableStylePropertySetWithPropertyCount(count));
     
    7575}
    7676
    77 PassRefPtr<StylePropertySet> StylePropertySet::immutableCopyIfNeeded() const
     77PassRefPtr<ImmutableStylePropertySet> StylePropertySet::immutableCopyIfNeeded() const
    7878{
    7979    if (!isMutable())
    80         return const_cast<StylePropertySet*>(this);
    81     return createImmutable(mutablePropertyVector().data(), mutablePropertyVector().size(), cssParserMode());
     80        return static_cast<ImmutableStylePropertySet*>(const_cast<StylePropertySet*>(this));
     81    return ImmutableStylePropertySet::create(mutablePropertyVector().data(), mutablePropertyVector().size(), cssParserMode());
    8282}
    8383
  • trunk/Source/WebCore/css/StylePropertySet.h

    r148397 r148398  
    5151    void deref();
    5252
    53     static PassRefPtr<StylePropertySet> createImmutable(const CSSProperty* properties, unsigned count, CSSParserMode);
    54 
    5553    class PropertyReference {
    5654    public:
     
    134132
    135133    PassRefPtr<MutableStylePropertySet> mutableCopy() const;
    136     PassRefPtr<StylePropertySet> immutableCopyIfNeeded() const;
     134    PassRefPtr<ImmutableStylePropertySet> immutableCopyIfNeeded() const;
    137135
    138136    void removeEquivalentProperties(const StylePropertySet*);
     
    207205class ImmutableStylePropertySet : public StylePropertySet {
    208206public:
     207    ~ImmutableStylePropertySet();
     208    static PassRefPtr<ImmutableStylePropertySet> create(const CSSProperty* properties, unsigned count, CSSParserMode);
     209
     210    void* m_storage;
     211
     212private:
    209213    ImmutableStylePropertySet(const CSSProperty*, unsigned count, CSSParserMode);
    210     ~ImmutableStylePropertySet();
    211 
    212     void* m_storage;
    213214};
    214215
Note: See TracChangeset for help on using the changeset viewer.