OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef DisplayItem_h | 5 #ifndef DisplayItem_h |
6 #define DisplayItem_h | 6 #define DisplayItem_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/graphics/ContiguousContainer.h" | 9 #include "platform/graphics/ContiguousContainer.h" |
10 #include "platform/graphics/paint/DisplayItemClient.h" | 10 #include "platform/graphics/paint/DisplayItemClient.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 // derivedSize must fit in m_derivedSize. | 208 // derivedSize must fit in m_derivedSize. |
209 // If it doesn't, enlarge m_derivedSize and fix this assert. | 209 // If it doesn't, enlarge m_derivedSize and fix this assert. |
210 ASSERT_WITH_SECURITY_IMPLICATION(derivedSize < (1 << 8)); | 210 ASSERT_WITH_SECURITY_IMPLICATION(derivedSize < (1 << 8)); |
211 ASSERT_WITH_SECURITY_IMPLICATION(derivedSize >= sizeof(*this)); | 211 ASSERT_WITH_SECURITY_IMPLICATION(derivedSize >= sizeof(*this)); |
212 } | 212 } |
213 | 213 |
214 virtual ~DisplayItem() { } | 214 virtual ~DisplayItem() { } |
215 | 215 |
216 // Ids are for matching new DisplayItems with existing DisplayItems. | 216 // Ids are for matching new DisplayItems with existing DisplayItems. |
217 struct Id { | 217 struct Id { |
218 STACK_ALLOCATED(); | 218 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
219 Id(const DisplayItemClient& client, const Type type) | 219 Id(const DisplayItemClient& client, const Type type) |
220 : client(client) | 220 : client(client) |
221 , type(type) { } | 221 , type(type) { } |
222 | 222 |
223 const DisplayItemClient& client; | 223 const DisplayItemClient& client; |
224 const Type type; | 224 const Type type; |
225 }; | 225 }; |
226 | 226 |
227 Id getId() const { return Id(*m_client, m_type); } | 227 Id getId() const { return Id(*m_client, m_type); } |
228 | 228 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; | 379 bool isEndAndPairedWith(DisplayItem::Type otherType) const override = 0; |
380 #endif | 380 #endif |
381 | 381 |
382 private: | 382 private: |
383 bool isEnd() const final { return true; } | 383 bool isEnd() const final { return true; } |
384 }; | 384 }; |
385 | 385 |
386 } // namespace blink | 386 } // namespace blink |
387 | 387 |
388 #endif // DisplayItem_h | 388 #endif // DisplayItem_h |
OLD | NEW |