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

Side by Side Diff: Source/core/dom/QualifiedName.cpp

Issue 560613002: Shrink QualifiedNameImpl by 8 bytes on 64-bit platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add COMPILE_ASSERT Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « Source/core/dom/QualifiedName.h ('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) 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 16 matching lines...) Expand all
27 #include "core/XLinkNames.h" 27 #include "core/XLinkNames.h"
28 #include "core/XMLNSNames.h" 28 #include "core/XMLNSNames.h"
29 #include "core/XMLNames.h" 29 #include "core/XMLNames.h"
30 #include "wtf/Assertions.h" 30 #include "wtf/Assertions.h"
31 #include "wtf/HashSet.h" 31 #include "wtf/HashSet.h"
32 #include "wtf/MainThread.h" 32 #include "wtf/MainThread.h"
33 #include "wtf/StaticConstructors.h" 33 #include "wtf/StaticConstructors.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 struct SameSizeAsQualifiedNameImpl : public RefCounted<SameSizeAsQualifiedNameIm pl> {
38 unsigned bitfield;
39 void* pointers[4];
40 };
41
42 COMPILE_ASSERT(sizeof(QualifiedName::QualifiedNameImpl) == sizeof(SameSizeAsQual ifiedNameImpl), qualified_name_impl_should_stay_small);
43
37 static const int staticQualifiedNamesCount = HTMLNames::HTMLTagsCount + HTMLName s::HTMLAttrsCount 44 static const int staticQualifiedNamesCount = HTMLNames::HTMLTagsCount + HTMLName s::HTMLAttrsCount
38 + MathMLNames::MathMLTagsCount + MathMLNames::MathMLAttrsCount 45 + MathMLNames::MathMLTagsCount + MathMLNames::MathMLAttrsCount
39 + SVGNames::SVGTagsCount + SVGNames::SVGAttrsCount 46 + SVGNames::SVGTagsCount + SVGNames::SVGAttrsCount
40 + XLinkNames::XLinkAttrsCount 47 + XLinkNames::XLinkAttrsCount
41 + XMLNSNames::XMLNSAttrsCount 48 + XMLNSNames::XMLNSAttrsCount
42 + XMLNames::XMLAttrsCount; 49 + XMLNames::XMLAttrsCount;
43 50
44 struct QualifiedNameHashTraits : public HashTraits<QualifiedName::QualifiedNameI mpl*> { 51 struct QualifiedNameHashTraits : public HashTraits<QualifiedName::QualifiedNameI mpl*> {
45 static const unsigned minimumTableSize = WTF::HashTableCapacityForSize<stati cQualifiedNamesCount>::value; 52 static const unsigned minimumTableSize = WTF::HashTableCapacityForSize<stati cQualifiedNamesCount>::value;
46 }; 53 };
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 { 143 {
137 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nameNamespac e, true); 144 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nameNamespac e, true);
138 } 145 }
139 146
140 void QualifiedName::createStatic(void* targetAddress, StringImpl* name) 147 void QualifiedName::createStatic(void* targetAddress, StringImpl* name)
141 { 148 {
142 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nullAtom, tr ue); 149 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nullAtom, tr ue);
143 } 150 }
144 151
145 } 152 }
OLDNEW
« no previous file with comments | « Source/core/dom/QualifiedName.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698