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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.cpp

Issue 1508223005: Client side display item cache flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 4 years, 7 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
OLDNEW
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 6
7 #if ENABLE(ASSERT) 7 #if ENABLE(ASSERT)
8
9 #include "wtf/HashSet.h" 8 #include "wtf/HashSet.h"
9 #endif
10 10
11 namespace blink { 11 namespace blink {
12 12
13 DisplayItemCacheGeneration::Generation DisplayItemCacheGeneration::s_nextGenerat ion = 1;
14
15 #if ENABLE(ASSERT)
16
13 HashSet<const DisplayItemClient*>* liveDisplayItemClients = nullptr; 17 HashSet<const DisplayItemClient*>* liveDisplayItemClients = nullptr;
14 18
15 DisplayItemClient::DisplayItemClient() 19 DisplayItemClient::DisplayItemClient()
16 { 20 {
17 if (!liveDisplayItemClients) 21 if (!liveDisplayItemClients)
18 liveDisplayItemClients = new HashSet<const DisplayItemClient*>(); 22 liveDisplayItemClients = new HashSet<const DisplayItemClient*>();
19 liveDisplayItemClients->add(this); 23 liveDisplayItemClients->add(this);
20 } 24 }
21 25
22 DisplayItemClient::~DisplayItemClient() 26 DisplayItemClient::~DisplayItemClient()
23 { 27 {
24 liveDisplayItemClients->remove(this); 28 liveDisplayItemClients->remove(this);
25 } 29 }
26 30
27 bool DisplayItemClient::isAlive(const DisplayItemClient& client) 31 bool DisplayItemClient::isAlive(const DisplayItemClient& client)
28 { 32 {
29 return liveDisplayItemClients && liveDisplayItemClients->contains(&client); 33 return liveDisplayItemClients && liveDisplayItemClients->contains(&client);
30 } 34 }
31 35
36 #endif // ENABLE(ASSERT)
37
32 } // namespace blink 38 } // namespace blink
33
34 #endif // ENABLE(ASSERT)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698