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

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

Issue 2027333004: Handle uncommitted PaintController in DisplayItemClient aliveness tracking (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
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 28 matching lines...) Expand all
39 } 39 }
40 } 40 }
41 liveDisplayItemClients->remove(this); 41 liveDisplayItemClients->remove(this);
42 } 42 }
43 43
44 bool DisplayItemClient::isAlive() const 44 bool DisplayItemClient::isAlive() const
45 { 45 {
46 return liveDisplayItemClients && liveDisplayItemClients->contains(this); 46 return liveDisplayItemClients && liveDisplayItemClients->contains(this);
47 } 47 }
48 48
49 void DisplayItemClient::beginShouldKeepAlive(const void* owner) const 49 void DisplayItemClient::beginShouldKeepAlive(const void* paintController) const
50 { 50 {
51 CHECK(isAlive()); 51 CHECK(isAlive());
52 if (!displayItemClientsShouldKeepAlive) 52 if (!displayItemClientsShouldKeepAlive)
53 displayItemClientsShouldKeepAlive = new HashMap<const void*, HashMap<con st DisplayItemClient*, String>>(); 53 displayItemClientsShouldKeepAlive = new HashMap<const void*, HashMap<con st DisplayItemClient*, String>>();
54 auto addResult = displayItemClientsShouldKeepAlive->add(owner, HashMap<const DisplayItemClient*, String>()).storedValue->value.add(this, ""); 54 auto addResult = displayItemClientsShouldKeepAlive->add(paintController, Has hMap<const DisplayItemClient*, String>()).storedValue->value.add(this, "");
55 if (addResult.isNewEntry) 55 if (addResult.isNewEntry)
56 addResult.storedValue->value = debugName(); 56 addResult.storedValue->value = debugName();
57 } 57 }
58 58
59 void DisplayItemClient::endShouldKeepAliveAllClients(const void* owner) 59 void DisplayItemClient::endShouldKeepAliveAllClients(const void* paintController )
60 { 60 {
61 if (displayItemClientsShouldKeepAlive) 61 if (displayItemClientsShouldKeepAlive)
62 displayItemClientsShouldKeepAlive->remove(owner); 62 displayItemClientsShouldKeepAlive->remove(paintController);
63 }
64
65 void DisplayItemClient::endShouldKeepAliveAllClients()
66 {
67 delete displayItemClientsShouldKeepAlive;
68 displayItemClientsShouldKeepAlive = nullptr;
63 } 69 }
64 70
65 #endif // CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS 71 #endif // CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS
66 72
67 } // namespace blink 73 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698