| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 DisplayItemClient_h | 5 #ifndef DisplayItemClient_h |
| 6 #define DisplayItemClient_h | 6 #define DisplayItemClient_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/geometry/LayoutRect.h" | 9 #include "platform/geometry/LayoutRect.h" |
| 10 #include "platform/graphics/PaintInvalidationReason.h" | 10 #include "platform/graphics/PaintInvalidationReason.h" |
| 11 #include "wtf/Assertions.h" | 11 #include "wtf/Assertions.h" |
| 12 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
| 13 | 13 |
| 14 #define CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS DCHECK_IS_ON() | 14 #define CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS DCHECK_IS_ON() |
| 15 | 15 |
| 16 namespace blink { | 16 namespace blink { |
| 17 | 17 |
| 18 // The class for objects that can be associated with display items. A | 18 // The class for objects that can be associated with display items. A |
| 19 // DisplayItemClient object should live at least longer than the document cycle | 19 // DisplayItemClient object should live at least longer than the document cycle |
| 20 // in which its display items are created during painting. After the document | 20 // in which its display items are created during painting. After the document |
| 21 // cycle, a pointer/reference to DisplayItemClient should be no longer | 21 // cycle, a pointer/reference to DisplayItemClient should be no longer |
| 22 // dereferenced unless we can make sure the client is still valid. | 22 // dereferenced unless we can make sure the client is still valid. |
| 23 |
| 23 class PLATFORM_EXPORT DisplayItemClient { | 24 class PLATFORM_EXPORT DisplayItemClient { |
| 24 public: | 25 public: |
| 25 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 26 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS |
| 26 DisplayItemClient(); | 27 DisplayItemClient(); |
| 27 virtual ~DisplayItemClient(); | 28 virtual ~DisplayItemClient(); |
| 28 | 29 |
| 29 // Tests if this DisplayItemClient object has been created and has not been | 30 // Tests if this DisplayItemClient object has been created and has not been |
| 30 // deleted yet. | 31 // deleted yet. |
| 31 bool isAlive() const; | 32 bool isAlive() const; |
| 32 | 33 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 return &client1 == &client2; | 182 return &client1 == &client2; |
| 182 } | 183 } |
| 183 inline bool operator!=(const DisplayItemClient& client1, | 184 inline bool operator!=(const DisplayItemClient& client1, |
| 184 const DisplayItemClient& client2) { | 185 const DisplayItemClient& client2) { |
| 185 return &client1 != &client2; | 186 return &client1 != &client2; |
| 186 } | 187 } |
| 187 | 188 |
| 188 } // namespace blink | 189 } // namespace blink |
| 189 | 190 |
| 190 #endif // DisplayItemClient_h | 191 #endif // DisplayItemClient_h |
| OLD | NEW |