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 #include "platform/graphics/paint/DisplayItemClient.h" | 5 #include "platform/graphics/paint/DisplayItemClient.h" |
6 | |
7 #if ENABLE(ASSERT) | |
8 | |
9 #include "wtf/HashSet.h" | 6 #include "wtf/HashSet.h" |
10 | 7 |
11 namespace blink { | 8 namespace blink { |
12 | 9 |
| 10 bool DisplayItemClient::s_cacheStatus = false; |
| 11 |
| 12 #if ENABLE(ASSERT) |
| 13 |
13 HashSet<const DisplayItemClient*>* liveDisplayItemClients = nullptr; | 14 HashSet<const DisplayItemClient*>* liveDisplayItemClients = nullptr; |
14 | 15 |
15 DisplayItemClient::DisplayItemClient() | 16 DisplayItemClient::DisplayItemClient() |
16 { | 17 { |
17 if (!liveDisplayItemClients) | 18 if (!liveDisplayItemClients) |
18 liveDisplayItemClients = new HashSet<const DisplayItemClient*>(); | 19 liveDisplayItemClients = new HashSet<const DisplayItemClient*>(); |
19 liveDisplayItemClients->add(this); | 20 liveDisplayItemClients->add(this); |
20 } | 21 } |
21 | 22 |
22 DisplayItemClient::~DisplayItemClient() | 23 DisplayItemClient::~DisplayItemClient() |
23 { | 24 { |
24 liveDisplayItemClients->remove(this); | 25 liveDisplayItemClients->remove(this); |
25 } | 26 } |
26 | 27 |
27 bool DisplayItemClient::isAlive(const DisplayItemClient& client) | 28 bool DisplayItemClient::isAlive(const DisplayItemClient& client) |
28 { | 29 { |
29 return liveDisplayItemClients && liveDisplayItemClients->contains(&client); | 30 return liveDisplayItemClients && liveDisplayItemClients->contains(&client); |
30 } | 31 } |
31 | 32 |
| 33 #endif // ENABLE(ASSERT) |
| 34 |
32 } // namespace blink | 35 } // namespace blink |
33 | |
34 #endif // ENABLE(ASSERT) | |
OLD | NEW |