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

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: Try performance 2 Created 4 years, 8 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
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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698