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

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

Issue 2007363002: Enable CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS temporarily for debugging crbug.com/609218 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 7 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
8 #include "wtf/HashMap.h" 8 #include "wtf/HashMap.h"
9 #include "wtf/HashSet.h" 9 #include "wtf/HashSet.h"
10 #endif 10 #endif
(...skipping 26 matching lines...) Expand all
37 bool DisplayItemClient::isAlive() const 37 bool DisplayItemClient::isAlive() const
38 { 38 {
39 return liveDisplayItemClients && liveDisplayItemClients->contains(this); 39 return liveDisplayItemClients && liveDisplayItemClients->contains(this);
40 } 40 }
41 41
42 void DisplayItemClient::beginShouldKeepAlive() const 42 void DisplayItemClient::beginShouldKeepAlive() const
43 { 43 {
44 CHECK(isAlive()); 44 CHECK(isAlive());
45 if (!displayItemClientsShouldKeepAlive) 45 if (!displayItemClientsShouldKeepAlive)
46 displayItemClientsShouldKeepAlive = new HashMap<const DisplayItemClient* , String>(); 46 displayItemClientsShouldKeepAlive = new HashMap<const DisplayItemClient* , String>();
47 #ifdef NDEBUG
48 displayItemClientsShouldKeepAlive->add(this, "");
49 #else
47 auto addResult = displayItemClientsShouldKeepAlive->add(this, ""); 50 auto addResult = displayItemClientsShouldKeepAlive->add(this, "");
48 #ifndef NDEBUG
49 if (addResult.isNewEntry) 51 if (addResult.isNewEntry)
50 addResult.storedValue->value = debugName(); 52 addResult.storedValue->value = debugName();
51 #endif 53 #endif
52 } 54 }
53 55
54 void DisplayItemClient::endShouldKeepAlive() const 56 void DisplayItemClient::endShouldKeepAlive() const
55 { 57 {
56 CHECK(isAlive()); 58 CHECK(isAlive());
57 displayItemClientsShouldKeepAlive->remove(this); 59 displayItemClientsShouldKeepAlive->remove(this);
58 } 60 }
59 61
60 #endif // CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 62 #endif // CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
61 63
62 } // namespace blink 64 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/DisplayItemClient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698