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

Side by Side Diff: Source/core/layout/FloatingObjects.h

Issue 1318713003: Make classes and structures in core/layout fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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/layout/ClipRect.h ('k') | Source/core/layout/GapRects.h » ('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 * 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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 unsigned m_type : 2; // Type (left or right aligned) 106 unsigned m_type : 2; // Type (left or right aligned)
107 unsigned m_ownership : 2; // Ownership 107 unsigned m_ownership : 2; // Ownership
108 unsigned m_isPlaced : 1; 108 unsigned m_isPlaced : 1;
109 unsigned m_isLowestNonOverhangingFloatInChild : 1; 109 unsigned m_isLowestNonOverhangingFloatInChild : 1;
110 #if ENABLE(ASSERT) 110 #if ENABLE(ASSERT)
111 unsigned m_isInPlacedTree : 1; 111 unsigned m_isInPlacedTree : 1;
112 #endif 112 #endif
113 }; 113 };
114 114
115 struct FloatingObjectHashFunctions { 115 struct FloatingObjectHashFunctions {
116 STATIC_ONLY(FloatingObjectHashFunctions);
116 static unsigned hash(FloatingObject* key) { return DefaultHash<LayoutBox*>:: Hash::hash(key->layoutObject()); } 117 static unsigned hash(FloatingObject* key) { return DefaultHash<LayoutBox*>:: Hash::hash(key->layoutObject()); }
117 static unsigned hash(const OwnPtr<FloatingObject>& key) { return hash(key.ge t()); } 118 static unsigned hash(const OwnPtr<FloatingObject>& key) { return hash(key.ge t()); }
118 static unsigned hash(const PassOwnPtr<FloatingObject>& key) { return hash(ke y.get()); } 119 static unsigned hash(const PassOwnPtr<FloatingObject>& key) { return hash(ke y.get()); }
119 static bool equal(OwnPtr<FloatingObject>& a, FloatingObject* b) { return a-> layoutObject() == b->layoutObject(); } 120 static bool equal(OwnPtr<FloatingObject>& a, FloatingObject* b) { return a-> layoutObject() == b->layoutObject(); }
120 static bool equal(OwnPtr<FloatingObject>& a, const OwnPtr<FloatingObject>& b ) { return equal(a, b.get()); } 121 static bool equal(OwnPtr<FloatingObject>& a, const OwnPtr<FloatingObject>& b ) { return equal(a, b.get()); }
121 static bool equal(OwnPtr<FloatingObject>& a, const PassOwnPtr<FloatingObject >& b) { return equal(a, b.get()); } 122 static bool equal(OwnPtr<FloatingObject>& a, const PassOwnPtr<FloatingObject >& b) { return equal(a, b.get()); }
122 123
123 static const bool safeToCompareToEmptyOrDeleted = true; 124 static const bool safeToCompareToEmptyOrDeleted = true;
124 }; 125 };
125 struct FloatingObjectHashTranslator { 126 struct FloatingObjectHashTranslator {
127 STATIC_ONLY(FloatingObjectHashTranslator);
126 static unsigned hash(LayoutBox* key) { return DefaultHash<LayoutBox*>::Hash: :hash(key); } 128 static unsigned hash(LayoutBox* key) { return DefaultHash<LayoutBox*>::Hash: :hash(key); }
127 static bool equal(FloatingObject* a, LayoutBox* b) { return a->layoutObject( ) == b; } 129 static bool equal(FloatingObject* a, LayoutBox* b) { return a->layoutObject( ) == b; }
128 static bool equal(const OwnPtr<FloatingObject>& a, LayoutBox* b) { return a- >layoutObject() == b; } 130 static bool equal(const OwnPtr<FloatingObject>& a, LayoutBox* b) { return a- >layoutObject() == b; }
129 }; 131 };
130 typedef ListHashSet<OwnPtr<FloatingObject>, 4, FloatingObjectHashFunctions> Floa tingObjectSet; 132 typedef ListHashSet<OwnPtr<FloatingObject>, 4, FloatingObjectHashFunctions> Floa tingObjectSet;
131 typedef FloatingObjectSet::const_iterator FloatingObjectSetIterator; 133 typedef FloatingObjectSet::const_iterator FloatingObjectSetIterator;
132 typedef PODInterval<int, FloatingObject*> FloatingObjectInterval; 134 typedef PODInterval<int, FloatingObject*> FloatingObjectInterval;
133 typedef PODIntervalTree<int, FloatingObject*> FloatingObjectTree; 135 typedef PODIntervalTree<int, FloatingObject*> FloatingObjectTree;
134 typedef PODFreeListArena<PODRedBlackTree<FloatingObjectInterval>::Node> Interval Arena; 136 typedef PODFreeListArena<PODRedBlackTree<FloatingObjectInterval>::Node> Interval Arena;
135 typedef HashMap<LayoutBox*, OwnPtr<FloatingObject>> LayoutBoxToFloatInfoMap; 137 typedef HashMap<LayoutBox*, OwnPtr<FloatingObject>> LayoutBoxToFloatInfoMap;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 static String string(const int value); 203 static String string(const int value);
202 }; 204 };
203 template<> struct ValueToString<FloatingObject*> { 205 template<> struct ValueToString<FloatingObject*> {
204 static String string(const FloatingObject*); 206 static String string(const FloatingObject*);
205 }; 207 };
206 #endif 208 #endif
207 209
208 } // namespace blink 210 } // namespace blink
209 211
210 #endif // FloatingObjects_h 212 #endif // FloatingObjects_h
OLDNEW
« no previous file with comments | « Source/core/layout/ClipRect.h ('k') | Source/core/layout/GapRects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698