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

Side by Side Diff: Source/WebCore/dom/ElementAttributeData.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 | « Source/WebCore/css/StylePropertySet.cpp ('k') | no next file » | 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 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2012 Apple Inc. All rights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010, 2012 Apple Inc. All rights reserved.
7 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). 7 * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 19 matching lines...) Expand all
30 #include "CSSParser.h" 30 #include "CSSParser.h"
31 #include "CSSStyleSheet.h" 31 #include "CSSStyleSheet.h"
32 #include "StyledElement.h" 32 #include "StyledElement.h"
33 #include "WebCoreMemoryInstrumentation.h" 33 #include "WebCoreMemoryInstrumentation.h"
34 #include <wtf/MemoryInstrumentationVector.h> 34 #include <wtf/MemoryInstrumentationVector.h>
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 static size_t immutableElementAttributeDataSize(unsigned count) 38 static size_t immutableElementAttributeDataSize(unsigned count)
39 { 39 {
40 return sizeof(ElementAttributeData) + sizeof(Attribute) * count; 40 return sizeof(ImmutableElementAttributeData) + sizeof(Attribute) * count;
41 } 41 }
42 42
43 PassRefPtr<ElementAttributeData> ElementAttributeData::createImmutable(const Vec tor<Attribute>& attributes) 43 PassRefPtr<ElementAttributeData> ElementAttributeData::createImmutable(const Vec tor<Attribute>& attributes)
44 { 44 {
45 void* slot = WTF::fastMalloc(immutableElementAttributeDataSize(attributes.si ze())); 45 void* slot = WTF::fastMalloc(immutableElementAttributeDataSize(attributes.si ze()));
46 return adoptRef(new (slot) ImmutableElementAttributeData(attributes)); 46 return adoptRef(new (slot) ImmutableElementAttributeData(attributes));
47 } 47 }
48 48
49 PassRefPtr<ElementAttributeData> ElementAttributeData::create() 49 PassRefPtr<ElementAttributeData> ElementAttributeData::create()
50 { 50 {
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 PassRefPtr<Attr> ElementAttributeData::getAttributeNode(const QualifiedName& nam e, Element* element) const 370 PassRefPtr<Attr> ElementAttributeData::getAttributeNode(const QualifiedName& nam e, Element* element) const
371 { 371 {
372 ASSERT(element); 372 ASSERT(element);
373 const Attribute* attribute = getAttributeItem(name); 373 const Attribute* attribute = getAttributeItem(name);
374 if (!attribute) 374 if (!attribute)
375 return 0; 375 return 0;
376 return ensureAttr(element, attribute->name()); 376 return ensureAttr(element, attribute->name());
377 } 377 }
378 378
379 } 379 }
OLDNEW
« no previous file with comments | « Source/WebCore/css/StylePropertySet.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698