| Index: third_party/WebKit/Source/core/dom/SubframeTracker.h
|
| diff --git a/third_party/WebKit/Source/core/dom/SubframeTracker.h b/third_party/WebKit/Source/core/dom/SubframeTracker.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2cd7a9134811f914c56cd4c6fff0f01b343d1030
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/dom/SubframeTracker.h
|
| @@ -0,0 +1,46 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef SubframeTracker_h
|
| +#define SubframeTracker_h
|
| +
|
| +#include "platform/heap/Handle.h"
|
| +#include "wtf/Allocator.h"
|
| +#include "wtf/Noncopyable.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class HTMLFrameOwnerElement;
|
| +class Node;
|
| +
|
| +class SubframeTracker final {
|
| + WTF_MAKE_NONCOPYABLE(SubframeTracker);
|
| + DISALLOW_NEW();
|
| +public:
|
| + enum DisconnectPolicy { RootAndDescendants, DescendantsOnly };
|
| +
|
| + SubframeTracker();
|
| +
|
| + bool hasConnectedSubframes(Node&) const;
|
| + void disconnectSubframesAt(Node&, DisconnectPolicy = RootAndDescendants);
|
| +
|
| + DECLARE_TRACE();
|
| +
|
| +private:
|
| + friend class HTMLFrameOwnerElement;
|
| +
|
| + void connectSubframe(HTMLFrameOwnerElement&);
|
| + void disconnectSubframe(HTMLFrameOwnerElement&);
|
| +
|
| + // Set of nodes in a Document that have a descendant connected subframe. The
|
| + // ordering of this set is similar to a pre-order, depth-first traversal of
|
| + // the DOM tree, though relative traversal of sibling nodes is not
|
| + // necessarily maintained.
|
| + using SubframeNodeSet = WillBeHeapListHashSet<RawPtrWillBeMember<Node>>;
|
| + SubframeNodeSet m_connectedSubframeNodes;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // SubframeTracker_h
|
|
|