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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 23 matching lines...) Expand all
34 #include "core/loader/FrameLoader.h" 34 #include "core/loader/FrameLoader.h"
35 #include "core/loader/FrameLoaderClient.h" 35 #include "core/loader/FrameLoaderClient.h"
36 #include "core/plugins/PluginView.h" 36 #include "core/plugins/PluginView.h"
37 #include "platform/weborigin/SecurityOrigin.h" 37 #include "platform/weborigin/SecurityOrigin.h"
38 38
39 namespace blink { 39 namespace blink {
40 40
41 typedef HeapHashMap<Member<Widget>, Member<FrameView>> WidgetToParentMap; 41 typedef HeapHashMap<Member<Widget>, Member<FrameView>> WidgetToParentMap;
42 static WidgetToParentMap& widgetNewParentMap() 42 static WidgetToParentMap& widgetNewParentMap()
43 { 43 {
44 DEFINE_STATIC_LOCAL(Persistent<WidgetToParentMap>, map, (new WidgetToParentM ap())); 44 DEFINE_STATIC_LOCAL(WidgetToParentMap, map, (new WidgetToParentMap));
45 return *map; 45 return map;
46 } 46 }
47 47
48 typedef HeapHashSet<Member<Widget>> WidgetSet; 48 typedef HeapHashSet<Member<Widget>> WidgetSet;
49 static WidgetSet& widgetsPendingTemporaryRemovalFromParent() 49 static WidgetSet& widgetsPendingTemporaryRemovalFromParent()
50 { 50 {
51 // Widgets in this set will not leak because it will be cleared in 51 // Widgets in this set will not leak because it will be cleared in
52 // HTMLFrameOwnerElement::UpdateSuspendScope::performDeferredWidgetTreeOpera tions. 52 // HTMLFrameOwnerElement::UpdateSuspendScope::performDeferredWidgetTreeOpera tions.
53 DEFINE_STATIC_LOCAL(Persistent<WidgetSet>, set, (new WidgetSet())); 53 DEFINE_STATIC_LOCAL(WidgetSet, set, (new WidgetSet));
54 return *set; 54 return set;
55 } 55 }
56 56
57 HeapHashCountedSet<Member<Node>>& SubframeLoadingDisabler::disabledSubtreeRoots( ) 57 HeapHashCountedSet<Member<Node>>& SubframeLoadingDisabler::disabledSubtreeRoots( )
58 { 58 {
59 DEFINE_STATIC_LOCAL(Persistent<HeapHashCountedSet<Member<Node>>>, nodes, (ne w HeapHashCountedSet<Member<Node>>())); 59 DEFINE_STATIC_LOCAL(HeapHashCountedSet<Member<Node>>, nodes, (new HeapHashCo untedSet<Member<Node>>));
60 return *nodes; 60 return nodes;
61 } 61 }
62 62
63 static unsigned s_updateSuspendCount = 0; 63 static unsigned s_updateSuspendCount = 0;
64 64
65 HTMLFrameOwnerElement::UpdateSuspendScope::UpdateSuspendScope() 65 HTMLFrameOwnerElement::UpdateSuspendScope::UpdateSuspendScope()
66 { 66 {
67 ++s_updateSuspendCount; 67 ++s_updateSuspendCount;
68 } 68 }
69 69
70 void HTMLFrameOwnerElement::UpdateSuspendScope::performDeferredWidgetTreeOperati ons() 70 void HTMLFrameOwnerElement::UpdateSuspendScope::performDeferredWidgetTreeOperati ons()
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 DEFINE_TRACE(HTMLFrameOwnerElement) 307 DEFINE_TRACE(HTMLFrameOwnerElement)
308 { 308 {
309 visitor->trace(m_contentFrame); 309 visitor->trace(m_contentFrame);
310 visitor->trace(m_widget); 310 visitor->trace(m_widget);
311 HTMLElement::trace(visitor); 311 HTMLElement::trace(visitor);
312 FrameOwner::trace(visitor); 312 FrameOwner::trace(visitor);
313 } 313 }
314 314
315 315
316 } // namespace blink 316 } // namespace blink
OLDNEW
« 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