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

Unified Diff: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp

Issue 1855203002: Revert of Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
index 95fdf87e18ca4635a9270568dc3bafafaba4238b..03cc78f1b6474592a0171232787852f5d1a675b4 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -41,8 +41,8 @@
typedef HeapHashMap<Member<Widget>, Member<FrameView>> WidgetToParentMap;
static WidgetToParentMap& widgetNewParentMap()
{
- DEFINE_STATIC_LOCAL(WidgetToParentMap, map, (new WidgetToParentMap));
- return map;
+ DEFINE_STATIC_LOCAL(Persistent<WidgetToParentMap>, map, (new WidgetToParentMap()));
+ return *map;
}
typedef HeapHashSet<Member<Widget>> WidgetSet;
@@ -50,14 +50,14 @@
{
// Widgets in this set will not leak because it will be cleared in
// HTMLFrameOwnerElement::UpdateSuspendScope::performDeferredWidgetTreeOperations.
- DEFINE_STATIC_LOCAL(WidgetSet, set, (new WidgetSet));
- return set;
+ DEFINE_STATIC_LOCAL(Persistent<WidgetSet>, set, (new WidgetSet()));
+ return *set;
}
HeapHashCountedSet<Member<Node>>& SubframeLoadingDisabler::disabledSubtreeRoots()
{
- DEFINE_STATIC_LOCAL(HeapHashCountedSet<Member<Node>>, nodes, (new HeapHashCountedSet<Member<Node>>));
- return nodes;
+ DEFINE_STATIC_LOCAL(Persistent<HeapHashCountedSet<Member<Node>>>, nodes, (new HeapHashCountedSet<Member<Node>>()));
+ return *nodes;
}
static unsigned s_updateSuspendCount = 0;
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLDetailsElement.cpp ('k') | third_party/WebKit/Source/core/html/HTMLLinkElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698