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

Side by Side Diff: third_party/WebKit/Source/core/dom/SubframeTracker.h

Issue 1770523002: Track connected subframes per-Document instead of per-Node. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix various crashes but still doesn't refcount tracked nodes (and needs to) Created 4 years, 9 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SubframeTracker_h
6 #define SubframeTracker_h
7
8 #include "platform/heap/Handle.h"
9 #include "wtf/Allocator.h"
10 #include "wtf/Noncopyable.h"
11
12 namespace blink {
13
14 class HTMLFrameOwnerElement;
15 class Node;
16
17 class SubframeTracker final {
18 WTF_MAKE_NONCOPYABLE(SubframeTracker);
19 DISALLOW_NEW();
20 public:
21 enum DisconnectPolicy { RootAndDescendants, DescendantsOnly };
22
23 SubframeTracker();
24
25 bool hasConnectedSubframes(Node&) const;
26 void disconnectSubframesAt(Node&, DisconnectPolicy = RootAndDescendants);
27
28 DECLARE_TRACE();
29
30 private:
31 friend class HTMLFrameOwnerElement;
32
33 void connectSubframe(HTMLFrameOwnerElement&);
34 void disconnectSubframe(HTMLFrameOwnerElement&);
35
36 // Set of nodes in a Document that have a descendant connected subframe. The
37 // ordering of this set is similar to a pre-order, depth-first traversal of
38 // the DOM tree, though relative traversal of sibling nodes is not
39 // necessarily maintained.
40 using SubframeNodeSet = WillBeHeapListHashSet<RawPtrWillBeMember<Node>>;
41 SubframeNodeSet m_connectedSubframeNodes;
42 };
43
44 } // namespace blink
45
46 #endif // SubframeTracker_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeRareData.cpp ('k') | third_party/WebKit/Source/core/dom/SubframeTracker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698