Chromium Code Reviews| Index: Source/platform/graphics/paint/DisplayItem.h |
| diff --git a/Source/platform/graphics/paint/DisplayItem.h b/Source/platform/graphics/paint/DisplayItem.h |
| index 55f0db17720c57a732e940235ab47d5a6b2e1887..31f9691d2e240e31e1276c7a3dcca320e75c62ee 100644 |
| --- a/Source/platform/graphics/paint/DisplayItem.h |
| +++ b/Source/platform/graphics/paint/DisplayItem.h |
| @@ -184,7 +184,6 @@ public: |
| , m_type(type) |
| , m_derivedSize(derivedSize) |
| , m_skippedCache(false) |
| - , m_ignoredFromList(false) |
| #ifndef NDEBUG |
| , m_clientDebugString(client.debugName()) |
| #endif |
| @@ -195,6 +194,8 @@ public: |
| ASSERT_WITH_SECURITY_IMPLICATION(derivedSize >= sizeof(*this)); |
| } |
| + virtual ~DisplayItem() { } |
| + |
| // Ids are for matching new DisplayItems with existing DisplayItems. |
| struct Id { |
| Id(const DisplayItemClient client, const Type type, const unsigned scope) |
| @@ -233,8 +234,6 @@ public: |
| return Id(m_client, nonCachedType(), m_scope); |
| } |
| - virtual ~DisplayItem() { } |
| - |
| virtual void replay(GraphicsContext&) { } |
| DisplayItemClient client() const { return m_client; } |
| @@ -329,8 +328,13 @@ public: |
| virtual bool drawsContent() const { return false; } |
| - bool ignoreFromDisplayList() const { return m_ignoredFromList; } |
| - void setIgnoredFromDisplayList() { m_ignoredFromList = true; } |
| + bool isValid() const { return m_client; } |
| + // Re-construct this display item as a permanently invalid item with no client set. |
| + void invalidate() |
|
pdr.
2015/08/18 06:15:21
This looks correct now, but it's tricky. Because t
Xianzhu
2015/08/18 16:24:44
Acknowledged and Done.
|
| + { |
| + this->~DisplayItem(); |
| + new (this) DisplayItem; |
| + } |
| #ifndef NDEBUG |
| static WTF::String typeAsDebugString(DisplayItem::Type); |
| @@ -351,7 +355,6 @@ private: |
| , m_type(UninitializedType) |
| , m_derivedSize(sizeof(*this)) |
| , m_skippedCache(false) |
| - , m_ignoredFromList(true) |
| #ifndef NDEBUG |
| , m_clientDebugString("invalid") |
| #endif |
| @@ -363,7 +366,6 @@ private: |
| const Type m_type : 16; |
| unsigned m_derivedSize : 8; // size of the actual derived class |
| unsigned m_skippedCache : 1; |
| - unsigned m_ignoredFromList : 1; |
| #ifndef NDEBUG |
| WTF::String m_clientDebugString; |