OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef ChildFrameDisconnector_h | 5 #ifndef ChildFrameDisconnector_h |
6 #define ChildFrameDisconnector_h | 6 #define ChildFrameDisconnector_h |
7 | 7 |
8 #include "core/dom/Node.h" | |
9 #include "core/html/HTMLFrameOwnerElement.h" | |
10 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
11 | 9 |
12 namespace WebCore { | 10 namespace WebCore { |
13 | 11 |
| 12 class ElementShadow; |
| 13 class HTMLFrameOwnerElement; |
| 14 class Node; |
| 15 |
14 class ChildFrameDisconnector { | 16 class ChildFrameDisconnector { |
15 STACK_ALLOCATED(); | 17 STACK_ALLOCATED(); |
16 public: | 18 public: |
17 enum DisconnectPolicy { | 19 enum DisconnectPolicy { |
18 RootAndDescendants, | 20 RootAndDescendants, |
19 DescendantsOnly | 21 DescendantsOnly |
20 }; | 22 }; |
21 | 23 |
22 explicit ChildFrameDisconnector(Node& root) | 24 explicit ChildFrameDisconnector(Node& root) |
23 : m_root(root) | 25 : m_root(root) |
24 { | 26 { |
25 } | 27 } |
26 | 28 |
27 void disconnect(DisconnectPolicy = RootAndDescendants); | 29 void disconnect(DisconnectPolicy = RootAndDescendants); |
28 | 30 |
29 private: | 31 private: |
30 void collectFrameOwners(Node&); | 32 void collectFrameOwners(Node&); |
31 void collectFrameOwners(ElementShadow&); | 33 void collectFrameOwners(ElementShadow&); |
32 void disconnectCollectedFrameOwners(); | 34 void disconnectCollectedFrameOwners(); |
33 | 35 |
34 WillBeHeapVector<RefPtrWillBeMember<HTMLFrameOwnerElement>, 10> m_frameOwner
s; | 36 WillBeHeapVector<RefPtrWillBeMember<HTMLFrameOwnerElement>, 10> m_frameOwner
s; |
35 Node& m_root; | 37 Node& m_root; |
36 }; | 38 }; |
37 | 39 |
38 } // namespace WebCore | 40 } // namespace WebCore |
39 | 41 |
40 #endif // ChildFrameDisconnector_h | 42 #endif // ChildFrameDisconnector_h |
OLD | NEW |