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

Side by Side Diff: Source/WebCore/css/StylePropertySet.cpp

Issue 11293004: Revert 132288 - Shrink immutable ElementAttributeData and StylePropertySet by one pointer each. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1307/
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/WebCore/dom/ElementAttributeData.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved. 4 * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 typedef HashMap<const StylePropertySet*, OwnPtr<PropertySetCSSStyleDeclaration> > PropertySetCSSOMWrapperMap; 47 typedef HashMap<const StylePropertySet*, OwnPtr<PropertySetCSSStyleDeclaration> > PropertySetCSSOMWrapperMap;
48 static PropertySetCSSOMWrapperMap& propertySetCSSOMWrapperMap() 48 static PropertySetCSSOMWrapperMap& propertySetCSSOMWrapperMap()
49 { 49 {
50 DEFINE_STATIC_LOCAL(PropertySetCSSOMWrapperMap, propertySetCSSOMWrapperMapIn stance, ()); 50 DEFINE_STATIC_LOCAL(PropertySetCSSOMWrapperMap, propertySetCSSOMWrapperMapIn stance, ());
51 return propertySetCSSOMWrapperMapInstance; 51 return propertySetCSSOMWrapperMapInstance;
52 } 52 }
53 53
54 static size_t immutableStylePropertySetSize(unsigned count) 54 static size_t immutableStylePropertySetSize(unsigned count)
55 { 55 {
56 return sizeof(StylePropertySet) + sizeof(CSSProperty) * count; 56 return sizeof(ImmutableStylePropertySet) + sizeof(CSSProperty) * count;
57 } 57 }
58 58
59 PassRefPtr<StylePropertySet> StylePropertySet::createImmutable(const CSSProperty * properties, unsigned count, CSSParserMode cssParserMode) 59 PassRefPtr<StylePropertySet> StylePropertySet::createImmutable(const CSSProperty * properties, unsigned count, CSSParserMode cssParserMode)
60 { 60 {
61 void* slot = WTF::fastMalloc(immutableStylePropertySetSize(count)); 61 void* slot = WTF::fastMalloc(immutableStylePropertySetSize(count));
62 return adoptRef(new (slot) ImmutableStylePropertySet(properties, count, cssP arserMode)); 62 return adoptRef(new (slot) ImmutableStylePropertySet(properties, count, cssP arserMode));
63 } 63 }
64 64
65 PassRefPtr<StylePropertySet> StylePropertySet::immutableCopyIfNeeded() const 65 PassRefPtr<StylePropertySet> StylePropertySet::immutableCopyIfNeeded() const
66 { 66 {
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 { 1135 {
1136 return adoptRef(new MutableStylePropertySet(cssParserMode)); 1136 return adoptRef(new MutableStylePropertySet(cssParserMode));
1137 } 1137 }
1138 1138
1139 PassRefPtr<StylePropertySet> StylePropertySet::create(const CSSProperty* propert ies, unsigned count) 1139 PassRefPtr<StylePropertySet> StylePropertySet::create(const CSSProperty* propert ies, unsigned count)
1140 { 1140 {
1141 return adoptRef(new MutableStylePropertySet(properties, count)); 1141 return adoptRef(new MutableStylePropertySet(properties, count));
1142 } 1142 }
1143 1143
1144 } // namespace WebCore 1144 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/WebCore/dom/ElementAttributeData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698